/* ── Tokens ──────────────────────────────────────────────── */
:root {
    --bg:          #0b0b12;
    --surface:     #161622;
    --surface-2:   #1e1e2d;
    --border:      rgba(255,255,255,0.07);
    --border-mid:  rgba(255,255,255,0.12);
    --accent:      #ff2d55;
    --accent-dim:  rgba(255, 45, 85, 0.14);
    --violet:      #6d28d9;
    --discord:     #5865f2;
    --success:     #22d3a5;
    --warning:     #fbbf24;
    --text:        #eeeef8;
    --text-muted:  #6b6b8e;
    --text-faint:  #3b3b58;
    --glow:        rgba(255, 45, 85, 0.18);
    --font-display:'Bebas Neue', sans-serif;
    --font-body:   'DM Sans', system-ui, sans-serif;
    --font-mono:   'DM Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg:         #f0eff8;
        --surface:    #ffffff;
        --surface-2:  #f4f3fc;
        --border:     rgba(0,0,0,0.08);
        --border-mid: rgba(0,0,0,0.14);
        --text:       #0e0e1a;
        --text-muted: #5a5a78;
        --text-faint: #c0bfd8;
        --glow:       rgba(255,45,85,0.1);
        --accent-dim: rgba(255,45,85,0.08);
    }
}

:root[data-theme="dark"] {
    --bg:          #0b0b12;
    --surface:     #161622;
    --surface-2:   #1e1e2d;
    --border:      rgba(255,255,255,0.07);
    --border-mid:  rgba(255,255,255,0.12);
    --text:        #eeeef8;
    --text-muted:  #6b6b8e;
    --text-faint:  #3b3b58;
    --glow:        rgba(255,45,85,0.18);
    --accent-dim:  rgba(255,45,85,0.14);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* ── Ambient orbs ────────────────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}
.orb-1 {
    width: 560px; height: 560px;
    top: -180px; left: -140px;
    background: radial-gradient(circle, rgba(255,45,85,0.12) 0%, transparent 70%);
}
.orb-2 {
    width: 480px; height: 480px;
    bottom: -160px; right: -120px;
    background: radial-gradient(circle, rgba(109,40,217,0.12) 0%, transparent 70%);
}

/* ── Container / panel ───────────────────────────────────── */
.container {
    position: relative;
    z-index: 10;
    width: min(92vw, 520px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px 4px 12px 12px;
    padding: 0 2.25rem 2.5rem;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 32px 80px rgba(0,0,0,0.55),
        0 0 60px var(--glow);
}

/* Crimson top accent bar */
.panel-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--violet) 100%);
    margin: 0 -2.25rem 2rem;
    position: relative;
}
.panel-bar::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0; right: 0;
    height: 8px;
    background: linear-gradient(to bottom, var(--glow), transparent);
}

/* Logo */
.site-logo {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    margin: 0 auto 2rem;
    border: 1px solid var(--border-mid);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ── Screens ─────────────────────────────────────────────── */
.screen        { display: none; opacity: 0; }
.screen.hidden { display: none !important; }

.screen.active {
    display: block;
    animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#landing-screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ──────────────────────────────────────────── */
.screen-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.display-heading {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    text-wrap: balance;
    margin-bottom: 1rem;
}

.success-heading {
    background: linear-gradient(135deg, var(--success) 0%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.body-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 38ch;
    margin-bottom: 2rem;
}
.body-text strong { color: var(--text); font-weight: 600; }

/* ── Live badge ──────────────────────────────────────────── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1.2rem;
    background: var(--surface-2);
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 2s infinite;
}
.live-count { color: var(--text); font-weight: 500; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.95rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 24px rgba(255,45,85,0.32);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(255,45,85,0.46);
}
.btn-primary:active { transform: translateY(0); }

.btn-discord {
    background: var(--discord);
    color: #fff;
    box-shadow: 0 6px 24px rgba(88,101,242,0.32);
    margin-top: 0.5rem;
}
.btn-discord:hover {
    transform: translateY(-2px);
    background: #4752c4;
    box-shadow: 0 10px 32px rgba(88,101,242,0.45);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.75rem;
    margin-top: 0.75rem;
}
.btn-ghost:hover {
    border-color: var(--success);
    color: var(--success);
    background: rgba(34,211,165,0.06);
}

/* ── DOB form ────────────────────────────────────────────── */
.dob-form { display: flex; flex-direction: column; gap: 1rem; }

.dob-inputs { display: flex; gap: 0.6rem; }
.dob-select-year { font-size: 1rem; }

.dob-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dob-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dob-select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--text);
    padding: 0.75rem 0.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dob-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,45,85,0.12);
}
.dob-select option { background: #1e1e2d; }

.error-msg {
    font-size: 0.83rem;
    color: var(--accent);
    background: rgba(255,45,85,0.08);
    border: 1px solid rgba(255,45,85,0.22);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* ── Step progress track ─────────────────────────────────── */
.step-track {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.4rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.step-pip {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-mid);
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s ease;
}

.step-item.done .step-pip {
    border-color: var(--success);
    background: var(--success);
    color: #051a12;
    box-shadow: 0 0 16px rgba(34,211,165,0.35);
}
.step-item.done .step-pip::before { content: '✓'; font-size: 0.85rem; }
.step-item.done .step-pip > span  { display: none; }

.step-label {
    font-family: var(--font-mono);
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    transition: color 0.3s;
}
.step-item.done .step-label { color: var(--success); }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.4rem;
    position: relative;
    overflow: hidden;
}
.step-line::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--success);
    transition: left 0.5s ease;
}
.step-line.filled::after { left: 0; }

/* ── Check status ────────────────────────────────────────── */
.check-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.pulse-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulseScale 1.6s infinite;
}
.check-status.status-progress .pulse-dot { background: var(--warning); }
.check-status.status-done    .pulse-dot  { background: var(--success); animation: none; }

@keyframes pulseScale {
    0%,100% { transform: scale(1); opacity: 1; }
    50%     { transform: scale(0.6); opacity: 0.4; }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.check-status.status-progress .status-text { color: var(--warning); }
.check-status.status-done    .status-text  { color: var(--success); }

/* ── Offer list ──────────────────────────────────────────── */
.offers-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}
.offers-list::-webkit-scrollbar { width: 3px; }
.offers-list::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

.offer-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1.1rem;
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: background 0.18s ease;
}
.offer-card:last-child { border-bottom: none; }

/* Left accent strip */
.offer-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center;
}
.offer-card:hover::before { transform: scaleY(1); }
.offer-card:hover { background: var(--surface-2); }

.offer-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.offer-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.offer-conversion {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.offer-cta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    flex-shrink: 0;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.offers-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.88rem;
    font-family: var(--font-mono);
}

.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--border-mid);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.offers-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 2rem;
    text-align: center;
}

/* ── Success screen ──────────────────────────────────────── */
.success-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(34,211,165,0.12);
    border: 2px solid rgba(34,211,165,0.35);
    color: var(--success);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
}

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.4rem;
    right: 1.4rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 290px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--discord);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.toast.toast-in {
    transform: translateX(0);
    opacity: 1;
}
.toast.toast-out {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
}

.toast-flag { font-size: 1.55rem; line-height: 1; flex-shrink: 0; }

.toast-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.toast-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast-action {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.toast-check {
    margin-left: auto;
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(34,211,165,0.15);
    color: var(--success);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .toast-container { right: 0.75rem; left: 0.75rem; max-width: unset; }
    .container { padding: 0 1.4rem 2rem; }
    .panel-bar { margin: 0 -1.4rem 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
