@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --lake: #1b3a3e;
    --lake-deep: #12282b;
    --fog: #ede8dd;
    --fog-dim: #ddd6c5;
    --stone: #5c7a89;
    --roof: #b5654a;
    --lantern: #d4a857;
    --ink: #22282a;
    --radius: 6px;
}

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

body {
    background: var(--fog);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 48px;
    background: var(--lake);
    color: var(--fog);
}

.nav .brand {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav .brand .mark {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav .links {
    display: flex;
    gap: 32px;
    font-size: 0.92rem;
}

.nav .links a {
    opacity: 0.78;
    transition: opacity 0.2s ease;
}

.nav .links a:hover,
.nav .links a.active {
    opacity: 1;
}

.hero {
    position: relative;
    background: linear-gradient(180deg, var(--lake) 0%, var(--lake) 58%, var(--lake-deep) 100%);
    color: var(--fog);
    padding: 64px 48px 0;
    overflow: hidden;
}

.hero-mountains {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 260px;
    z-index: 1;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 260' preserveAspectRatio='none'><path d='M0 260 L180 90 L320 170 L480 40 L620 150 L760 60 L920 180 L1080 70 L1240 160 L1400 50 L1600 190 L1600 260 Z' fill='%23142F33'/></svg>"),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 260' preserveAspectRatio='none'><path d='M0 260 L220 130 L400 200 L560 100 L740 190 L900 110 L1080 210 L1260 120 L1440 200 L1600 140 L1600 260 Z' fill='%23193A3F'/></svg>");
    background-repeat: no-repeat, no-repeat;
    background-position: bottom, bottom;
    background-size: 100% 65%, 100% 100%;
    opacity: 0.8;
}

.hero-mountains::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(18,40,43,0) 0%, var(--lake-deep) 96%);
}

.hero-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero .eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lantern);
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 3.1rem;
    line-height: 1.08;
    margin-bottom: 18px;
}

.hero p.sub {
    font-size: 1.05rem;
    opacity: 0.75;
    max-width: 520px;
    margin: 0 auto 44px;
}

.fogline {
    position: relative;
    height: 64px;
    margin-top: 30px;
}

.fogline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(237,232,221,0.35), transparent);
}

.fogline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(237,232,221,0.08) 0%, transparent 70%);
}

.draw-card {
    position: relative;
    z-index: 2;
    background: var(--fog);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 40px 44px;
    max-width: 640px;
    margin: -50px auto 0;
    box-shadow: 0 30px 60px -20px rgba(18, 40, 43, 0.45);
}

.draw-card.empty {
    text-align: center;
    color: var(--stone);
}

.draw-card .label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 6px;
}

.draw-card .date {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    margin-bottom: 26px;
}

.tier-block {
    margin-bottom: 22px;
}

.tier-block:last-child {
    margin-bottom: 0;
}

.tier-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 10px;
}

.chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--fog);
    background: linear-gradient(180deg, var(--stone) 0%, var(--stone) 50%, var(--lake) 50%, var(--lake-deep) 100%);
    overflow: hidden;
}

.chip::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(237,232,221,0.4);
}

.section {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 48px;
}

.section h2 {
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.section .section-sub {
    color: var(--stone);
    font-size: 0.95rem;
    margin-bottom: 36px;
}

.countdown-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.countdown-box, .search-box {
    flex: 1;
    min-width: 260px;
    background: #fff;
    border: 1px solid var(--fog-dim);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
}

.countdown-box .eyebrow, .search-box .eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 10px;
}

.countdown-timer {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 2rem;
    color: var(--lake);
}

.countdown-note {
    font-size: 0.8rem;
    color: var(--stone);
    margin-top: 8px;
}

.search-box .filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.filters input {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 10px 14px;
    border: 1px solid var(--fog-dim);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
}

.filters button {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--lake);
    color: var(--fog);
    cursor: pointer;
}

.filters button:hover {
    background: var(--lake-deep);
}

.clear-link {
    font-size: 0.8rem;
    color: var(--lake);
    font-weight: 500;
}

.history-row {
    padding: 28px 0;
    border-bottom: 1px solid var(--fog-dim);
}

.history-row:last-child {
    border-bottom: none;
}

.history-row .date {
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.history-row .tier-list .tier-block {
    margin-bottom: 16px;
}

.history-row .chip {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
}

.howto-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.howto-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.howto-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--lake);
    color: var(--fog);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.howto-item h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.howto-item p {
    color: var(--stone);
    font-size: 0.92rem;
}

.tier-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tier-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--fog-dim);
    border-radius: 20px;
    padding: 8px 16px 8px 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--stone);
}

.tier-chip .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.terms-body h3 {
    font-size: 1.1rem;
    margin: 32px 0 10px;
}

.terms-body p, .terms-body li {
    color: #3d4547;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.terms-body ul {
    padding-left: 20px;
}

.helpline {
    margin-top: 40px;
    padding: 24px;
    background: #fff;
    border-left: 3px solid var(--roof);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

footer {
    background: var(--lake-deep);
    color: rgba(237,232,221,0.6);
    text-align: center;
    padding: 32px;
    font-size: 0.82rem;
}

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 40px 24px;
}

.login-box {
    background: var(--lake);
    color: var(--fog);
    padding: 44px;
    border-radius: 8px;
    width: 320px;
    text-align: center;
}

.login-box h1, .login-box h2 {
    font-size: 1.2rem;
    margin-bottom: 24px;
    font-weight: 600;
    color: var(--fog);
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.login-box button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: var(--lantern);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
}

.dash-table td {
    white-space: nowrap;
}

.dash-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dash-topbar h1 {
    font-size: 1.4rem;
}

.dash-topbar a {
    color: var(--stone);
    font-size: 0.88rem;
}

.dash-card {
    background: #fff;
    border-radius: 6px;
    padding: 28px;
    margin-bottom: 28px;
}

.dash-card h3 {
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.dash-field-label {
    display: block;
    font-size: 0.72rem;
    color: var(--stone);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--fog-dim);
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--ink);
}

.dash-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: var(--lake);
    color: var(--fog);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.dash-btn-ghost {
    background: var(--fog);
    color: var(--lake);
}

.dash-btn-danger {
    background: var(--roof);
    color: #fff;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dash-table th, .dash-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--fog-dim);
    vertical-align: top;
}

.dash-table th {
    color: var(--stone);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pill {
    display: inline-block;
    background: var(--fog);
    border: 1px solid var(--fog-dim);
    border-radius: 5px;
    padding: 2px 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    margin: 2px 4px 2px 0;
}

.error-text { color: var(--roof); font-size: 0.85rem; margin: 10px 0; }
.success-text { color: #4F9E46; font-size: 0.85rem; margin: 10px 0; }

@media (max-width: 640px) {
    .nav { padding: 20px 24px; flex-direction: column; gap: 14px; }
    .nav .brand .mark { width: 44px; height: 44px; }
    .hero { padding: 60px 24px 0; }
    .hero h1 { font-size: 2.1rem; }
    .draw-card { padding: 28px 24px; margin: -34px 16px 0; }
    .section { padding: 56px 24px; }
    .chip { width: 42px; height: 42px; font-size: 0.85rem; }
    .countdown-row { flex-direction: column; }
}