@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Mulish:wght@400;500;700&display=swap');

:root {
    --burgundy: #5C1A2B;
    --burgundy-deep: #3E0F1D;
    --gold: #C9A24B;
    --gold-light: #E4CD8C;
    --charcoal: #221D1A;
    --cream: #F4ECDD;
    --ivory: #FBF7EE;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
}

body {
    font-family: 'Mulish', sans-serif;
    background: var(--ivory);
    color: var(--charcoal);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-main {
    flex: 1 0 auto;
}

h1, h2, h3, .brand, .medallion-number {
    font-family: 'Cormorant Garamond', serif;
}

/* ── Top bar ── */
.topbar {
    background: var(--burgundy-deep);
    color: var(--gold-light);
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    padding: 6px;
    text-transform: uppercase;
}

/* ── Navbar ── */
nav.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: var(--ivory);
    border-bottom: 2px solid var(--gold);
}
nav.main-nav .brand {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--burgundy);
    letter-spacing: 0.02em;
}
nav.main-nav .brand span { color: var(--gold); }
nav.main-nav ul {
    list-style: none;
    display: flex;
    gap: 34px;
}
nav.main-nav a {
    text-decoration: none;
    color: var(--charcoal);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
}
nav.main-nav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 2px;
    background: var(--gold);
    transition: width .25s ease;
}
nav.main-nav a:hover::after,
nav.main-nav a.active::after { width: 100%; }

/* ── Ornamental hero ── */
.hero {
    position: relative;
    background: var(--burgundy);
    color: var(--ivory);
    padding: 70px 40px 90px;
    text-align: center;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 60px;
    background-image: repeating-linear-gradient(45deg, var(--gold) 0 2px, transparent 2px 14px);
    opacity: 0.35;
}
.hero::before { left: 0; }
.hero::after { right: 0; }
.hero .eyebrow {
    letter-spacing: 0.35em;
    font-size: 0.75rem;
    color: var(--gold-light);
    text-transform: uppercase;
    margin-bottom: 14px;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.hero p.tagline {
    color: var(--gold-light);
    font-size: 1.05rem;
    font-style: italic;
}
.countdown {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 30px;
}
.countdown .unit {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 12px 18px;
    min-width: 70px;
}
.countdown .unit .num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-light);
    display: block;
    line-height: 1;
}
.countdown .unit .label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ivory);
    opacity: 0.75;
}
.countdown-caption {
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-light);
    opacity: 0.85;
}

/* ── Medallion draw display ── */
.draw-panel {
    max-width: 920px;
    margin: -55px auto 60px;
    background: var(--ivory);
    border: 1px solid var(--gold);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(60, 20, 20, 0.18);
    padding: 40px;
    position: relative;
}
.draw-panel .draw-date {
    text-align: center;
    color: var(--burgundy);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 28px;
}
.tier-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 6px;
    border-bottom: 1px solid rgba(92, 26, 43, 0.15);
}
.tier-row:last-child { border-bottom: none; }
.tier-label {
    font-weight: 700;
    color: var(--burgundy);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 160px;
}
.medallions { display: flex; gap: 10px; flex-wrap: wrap; }
.medallion {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #8a2c40 0%, var(--burgundy) 45%, var(--burgundy-deep) 100%);
    box-shadow:
        inset -4px -4px 8px rgba(0,0,0,0.35),
        inset 3px 3px 5px rgba(255,255,255,0.25),
        0 3px 4px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--gold-light);
    position: relative;
}
.medallion::after {
    content: '';
    position: absolute;
    top: 6px; left: 10px;
    width: 11px; height: 7px;
    background: rgba(255,255,255,0.55);
    border-radius: 50%;
    filter: blur(1.5px);
}
.medallion-number { font-size: 1.1rem; }

/* ── Section wrapper ── */
.section {
    max-width: 960px;
    margin: 0 auto;
    padding: 50px 40px;
}
.section h2 {
    color: var(--burgundy);
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    padding-bottom: 6px;
}

/* ── History table ── */
.filter-bar {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar button {
    padding: 10px 14px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    font-family: 'Mulish', sans-serif;
}
.filter-bar button {
    background: var(--burgundy);
    color: var(--ivory);
    cursor: pointer;
    font-weight: 700;
}
.history-card {
    border: 1px solid rgba(92,26,43,0.2);
    border-left: 4px solid var(--gold);
    border-radius: 4px;
    padding: 18px 22px;
    margin-bottom: 16px;
    background: var(--ivory);
}
.history-card .date { font-weight: 700; color: var(--burgundy); margin-bottom: 14px; font-size: 1.1rem; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}
.pagination .page-link {
    padding: 10px 20px;
    background: var(--burgundy);
    color: var(--ivory);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}
.pagination .page-link:hover { background: var(--burgundy-deep); }
.pagination .page-status {
    color: var(--burgundy);
    font-weight: 700;
    font-size: 0.9rem;
}
.history-tier-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.history-tier-row:last-child { margin-bottom: 0; }
.history-tier-label {
    font-weight: 700;
    color: var(--burgundy);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 130px;
    flex-shrink: 0;
}
.num-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.num-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #8a2c40 0%, var(--burgundy) 45%, var(--burgundy-deep) 100%);
    box-shadow:
        inset -3px -3px 6px rgba(0,0,0,0.35),
        inset 2px 2px 4px rgba(255,255,255,0.25),
        0 2px 3px rgba(0,0,0,0.25);
    color: var(--gold-light);
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    position: relative;
}
.num-chip::after {
    content: '';
    position: absolute;
    top: 4px; left: 7px;
    width: 8px; height: 5px;
    background: rgba(255,255,255,0.55);
    border-radius: 50%;
    filter: blur(1px);
}

/* ── Contact ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}
.contact-card {
    background: var(--ivory);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 24px;
}
.contact-card h3 { color: var(--burgundy); margin-bottom: 10px; }
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(92,26,43,0.3);
    border-radius: 4px;
    font-family: 'Mulish', sans-serif;
}
.contact-form button {
    background: var(--burgundy);
    color: var(--ivory);
    border: none;
    padding: 12px 26px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

/* ── Footer ── */
footer {
    background: var(--charcoal);
    color: var(--gold-light);
    text-align: center;
    padding: 30px;
    font-size: 0.85rem;
    margin-top: 60px;
    flex-shrink: 0;
}
footer a { color: var(--gold-light); }

/* ── Admin ── */
.admin-wrap { max-width: 1000px; margin: 40px auto; padding: 0 20px; font-family: 'Mulish', sans-serif; }
.admin-wrap table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-wrap th, .admin-wrap td { padding: 10px; border-bottom: 1px solid #ddd; text-align: left; font-size: 0.9rem; }
.admin-wrap input[type=text], .admin-wrap input[type=date], .admin-wrap input[type=password] {
    padding: 8px; border: 1px solid #bbb; border-radius: 4px; margin-bottom: 8px; width: 100%;
}
.admin-wrap button { padding: 8px 16px; border-radius: 4px; border: none; cursor: pointer; background: var(--burgundy); color: #fff; }
.admin-wrap .danger { background: #a33; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Mulish', sans-serif;
}
.modal-box input[type=text], .modal-box input[type=date] {
    padding: 8px; border: 1px solid #bbb; border-radius: 4px; margin-bottom: 8px; width: 100%;
}
.modal-box label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.modal-box button { padding: 8px 16px; border-radius: 4px; border: none; cursor: pointer; background: var(--burgundy); color: #fff; margin-right: 8px; margin-top: 6px; }

@media (max-width: 700px) {
    nav.main-nav { flex-direction: column; gap: 14px; }
    .hero h1 { font-size: 2.1rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .tier-label { width: auto; margin-bottom: 8px; }
    .tier-row { flex-direction: column; align-items: flex-start; }
    .history-tier-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .history-tier-label { width: auto; }
}