/* ============================================================
   SCHOLAR WAGER — style.css
   Thames International College · Match Betting
   Design system: ledger-grade sportsbook. Money is data, not decoration.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* Surfaces */
    --bg: #0b0e14;
    --bg-elevated: #0f131b;
    --surface: #131822;
    --surface-2: #182030;
    --surface-3: #1e2740;
    --border: #232c3d;
    --border-soft: #1a2230;

    /* Text */
    --text: #edeff3;
    --text-dim: #8a94a6;
    --text-faint: #4d5568;

    /* Brand / accent */
    --accent: #00d9a3;
    --accent-dim: #00a67d;
    --accent-glow: rgba(0, 217, 163, 0.18);
    --accent-ink: #04140f;

    /* Status */
    --amber: #ffb020;
    --amber-glow: rgba(255, 176, 32, 0.16);
    --red: #ff4d6a;
    --red-glow: rgba(255, 77, 106, 0.16);
    --blue: #4d9fff;
    --blue-glow: rgba(77, 159, 255, 0.14);

    /* Type */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Geometry */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --fast: 140ms;
    --med: 260ms;
    --slow: 600ms;

    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);

    color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }

.hidden { display: none !important; }

::selection { background: var(--accent-glow); color: var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* Focus visibility — accessibility floor */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.choice-card:focus-visible,
.nav-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   SHARED PRIMITIVES — inputs, buttons, labels
   ============================================================ */

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 16px 0 6px;
}

.field-label:first-of-type { margin-top: 0; }

.field-required {
    color: var(--amber);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
    appearance: none;
    -webkit-appearance: none;
}

.input::placeholder { color: var(--text-faint); }

.input:hover { border-color: var(--border); background: var(--surface-3); }

.input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A94A6' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
    cursor: pointer;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-col { min-width: 0; }

.phone-row {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 10px;
}

.input--code {
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 14px;
}

.input--phone { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--fast) var(--ease), background var(--fast) var(--ease),
    border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), opacity var(--fast) var(--ease);
    white-space: nowrap;
    user-select: none;
}

.btn:active { transform: scale(0.98); }

.btn--block { width: 100%; }

.btn--sm { padding: 8px 14px; font-size: 13px; }

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--primary:hover { background: #12e6b3; box-shadow: 0 6px 26px var(--accent-glow); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn--ghost {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-3); border-color: var(--text-faint); }

.btn--danger {
    background: var(--red);
    color: #2a0510;
}
.btn--danger:hover { background: #ff6680; }

.btn--danger-ghost {
    background: transparent;
    color: var(--red);
    border-color: rgba(255, 77, 106, 0.35);
}
.btn--danger-ghost:hover { background: var(--red-glow); border-color: var(--red); }

.btn--success {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn--success:hover { background: #12e6b3; }

/* File upload (styled label wrapping hidden input) */
.file-input-hidden {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
}

.file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.file-upload::before {
    content: "↑";
    font-size: 16px;
    color: var(--accent);
}

.file-upload:hover { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }

.file-upload.file-upload--filled {
    border-style: solid;
    border-color: var(--accent-dim);
    color: var(--accent);
    background: var(--accent-glow);
}

.file-upload.file-upload--filled::before { content: "✓"; }

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: -80px;
    transform: translateX(-50%);
    min-width: 220px;
    max-width: min(92vw, 420px);
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: bottom var(--med) var(--ease), opacity var(--med) var(--ease);
    text-align: center;
}

.toast--visible { bottom: 24px; opacity: 1; }
.toast--success { border-color: var(--accent-dim); background: linear-gradient(0deg, var(--accent-glow), var(--accent-glow)), var(--surface-3); }
.toast--error { border-color: rgba(255, 77, 106, 0.4); background: linear-gradient(0deg, var(--red-glow), var(--red-glow)), var(--surface-3); }

/* ============================================================
   AUTH SCREEN
   ============================================================ */

.auth-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 40px;
    overflow: hidden;
}

.auth-screen__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
            radial-gradient(ellipse 700px 500px at 15% -5%, var(--accent-glow) 0%, transparent 60%),
            radial-gradient(ellipse 600px 500px at 100% 100%, rgba(77, 159, 255, 0.1) 0%, transparent 55%),
            linear-gradient(180deg, var(--bg) 0%, #0a0d13 100%);
}

.auth-screen__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
            linear-gradient(var(--border-soft) 1px, transparent 1px),
            linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 0%, transparent 70%);
    opacity: 0.5;
}

.auth-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand__mark {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--accent), var(--accent-dim));
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 30px var(--accent-glow);
}

.auth-brand__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
}

.auth-brand__title span { color: var(--accent); }

.auth-brand__tag {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* Flip card */
.flip-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    perspective: 1600px;
}

.flip-card__inner {
    position: relative;
    width: 100%;
    min-height: 420px;
    transform-style: preserve-3d;
    transition: transform 700ms var(--ease);
}

.flip-card.is-flipped .flip-card__inner {
    transform: rotateY(180deg);
}

.flip-card__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
}

.flip-card__face--back {
    transform: rotateY(180deg);
    overflow-y: auto;
    max-height: 82vh;
}

.auth-form__title {
    font-size: 20px;
    margin-bottom: 4px;
}

.auth-form__sub {
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.auth-form__switch {
    margin-top: 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-dim);
}

.auth-form__switch a { font-weight: 600; }
.auth-form__switch a:hover { text-decoration: underline; }

.auth-form--signup .btn { margin-top: 22px; }
.auth-form .btn { margin-top: 22px; }

/* Field-level inline validation message */
.field-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 6px;
    display: none;
}

.field-error.field-error--visible { display: block; }

.input.input--error { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }

/* ============================================================
   APP SCREEN
   ============================================================ */

.app-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.app-header__brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.03em;
}

.app-header__brand span { color: var(--accent); }

.app-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header__balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.app-header__balance-label {
    font-size: 9.5px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-header__balance-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
}

.app-header__user {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-dim);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: var(--radius-full);
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 100px;
}

.view-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.view-header h2 {
    font-size: 17px;
}

.view-header--spaced { margin-top: 32px; }

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(0, 217, 163, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(0, 217, 163, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 217, 163, 0); }
}

.empty-note {
    color: var(--text-faint);
    font-size: 13.5px;
    text-align: center;
    padding: 32px 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

/* ---------- Events grid & cards ---------- */
.events-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 4px;
}

.event-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease);
    overflow: hidden;
}

.event-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--fast) var(--ease);
}

.event-card:hover {
    border-color: var(--text-faint);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.event-card:hover::before { opacity: 1; }

.event-card--soon {
    cursor: default;
    opacity: 0.75;
}

.event-card--soon:hover {
    transform: none;
    border-color: var(--border);
    background: var(--surface);
}

.event-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.event-card__sport {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    background: var(--surface-3);
    padding: 3px 9px;
    border-radius: var(--radius-full);
}

.event-badge {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 9px;
    border-radius: var(--radius-full);
}

.event-badge--live {
    color: var(--accent);
    background: var(--accent-glow);
}

.event-badge--soon {
    color: var(--amber);
    background: var(--amber-glow);
}

.event-card__title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.event-card__matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.event-card__team {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.event-card__team--b { text-align: right; }

.event-card__vs {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

.event-card__odds {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
}

.event-card__odds-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.event-card__odds-val--b { color: var(--blue); }

/* ---------- My Bets list ---------- */
.bets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bet-row__main { min-width: 0; }

.bet-row__event {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bet-row__meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 3px;
    font-family: var(--font-mono);
}

.bet-row__side {
    text-align: right;
    flex-shrink: 0;
}

.bet-row__amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14.5px;
}

.status-pill {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    margin-top: 4px;
    white-space: nowrap;
}

.status--pending { color: var(--amber); background: var(--amber-glow); }
.status--approved { color: var(--blue); background: var(--blue-glow); }
.status--rejected { color: var(--red); background: var(--red-glow); }
.status--won { color: var(--accent); background: var(--accent-glow); }
.status--lost { color: var(--text-dim); background: var(--surface-3); }

/* ---------- Profile ---------- */
.profile-card {
    text-align: center;
    padding: 28px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.profile-card__avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), var(--accent-dim));
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
}

.profile-card__name {
    font-size: 18px;
    margin-bottom: 4px;
}

.profile-card__username {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 13px;
}

.profile-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 16px;
    margin-bottom: 20px;
}

.profile-info__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}

.profile-info__row:last-child { border-bottom: none; }
.profile-info__row span { color: var(--text-dim); }
.profile-info__row strong { font-family: var(--font-mono); font-weight: 600; }

.profile-qr-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin-bottom: 20px;
}

.profile-qr-img {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 4px auto 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-soft);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-faint);
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--fast) var(--ease);
}

.nav-tab__icon { font-size: 19px; filter: grayscale(1); opacity: 0.6; transition: filter var(--fast), opacity var(--fast); }
.nav-tab__label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }

.nav-tab--active { color: var(--accent); }
.nav-tab--active .nav-tab__icon { filter: grayscale(0); opacity: 1; }

/* ============================================================
   BET MODAL
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 11, 0.72);
    backdrop-filter: blur(3px);
    animation: fade-in var(--med) var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-up var(--med) var(--ease);
    box-shadow: var(--shadow-lg);
}

@keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal__card--sm { max-width: 400px; }

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal__head h3 {
    font-size: 17px;
}

.modal__close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.modal__close:hover { background: var(--surface-3); color: var(--text); }

.modal__body .btn { margin-top: 16px; }
.modal__body .btn:first-of-type { margin-top: 20px; }

/* Choice row (Team A vs Team B) */
.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.choice-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.choice-card:hover { border-color: var(--text-faint); transform: translateY(-1px); }

.choice-card--selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.choice-card__name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.choice-card__odds {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
}

.choice-card--selected .choice-card__odds { color: var(--accent); }

.potential-win {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--text-dim);
}

.potential-win strong {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent);
}

/* Confirm summary (step 2) */
.confirm-summary {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 16px;
    margin-bottom: 16px;
}

.confirm-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}

.confirm-summary__row:last-child { border-bottom: none; }
.confirm-summary__row span { color: var(--text-dim); }
.confirm-summary__row strong { font-family: var(--font-mono); }

.payment-box {
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
}

.payment-box__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.payment-box__qr {
    width: 190px;
    height: 190px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px;
    margin: 0 auto 14px;
    border: 1px solid var(--border);
}

.payment-box__note {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.payment-box__note strong {
    font-family: var(--font-mono);
    color: var(--accent);
}

.payment-box__warning {
    font-size: 12.5px;
    color: var(--amber);
    background: var(--amber-glow);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 14px;
    line-height: 1.5;
}

.payment-box__warning strong { color: var(--amber); }

/* ============================================================
   ADMIN — shared shell
   ============================================================ */

.admin-body {
    background: var(--bg);
}

.admin-gate {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
            radial-gradient(ellipse 700px 500px at 20% 0%, var(--accent-glow) 0%, transparent 60%),
            var(--bg);
}

.admin-gate__card {
    width: 100%;
    max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.admin-gate__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.admin-gate__logo span { color: var(--accent); }

.admin-gate__tag {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 22px;
}

.admin-gate .input { margin-bottom: 14px; text-align: center; letter-spacing: 0.08em; }

.admin-gate__error {
    color: var(--red);
    font-size: 12.5px;
    margin-top: 12px;
}

/* Shell layout */
.admin-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.admin-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.admin-sidebar__logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.03em;
    padding: 8px 10px 26px;
}

.admin-sidebar__logo span { color: var(--accent); }

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.admin-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 500;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.admin-nav__item:hover { background: var(--surface); color: var(--text); }

.admin-nav__item--active {
    background: var(--accent-glow);
    color: var(--accent);
}

.admin-nav__icon { font-size: 15px; }

.admin-nav__badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.admin-sidebar__logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    padding: 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.admin-sidebar__logout:hover { border-color: var(--red); color: var(--red); }

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 32px 36px 60px;
    max-width: 1200px;
}

.admin-panel__head { margin-bottom: 24px; }

.admin-panel__head h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.admin-panel__sub {
    color: var(--text-dim);
    font-size: 13.5px;
    margin-bottom: 16px;
}

.admin-empty {
    color: var(--text-faint);
    font-size: 14px;
    text-align: center;
    padding: 48px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.admin-filterbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-filterbar .input { max-width: 320px; }
.admin-filterbar select.input { max-width: 180px; }

/* Card grid used by approvals / events / resolve */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.approval-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color var(--fast) var(--ease);
}

.approval-card:hover { border-color: var(--text-faint); }

.approval-card__info { display: flex; flex-direction: column; gap: 4px; }

.approval-card__user {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
    font-size: 13.5px;
}

.approval-card__event {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15.5px;
}

.approval-card__pick {
    font-size: 12.5px;
    color: var(--text-dim);
}

.approval-card__pick strong { color: var(--text); }

.approval-card__amount {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.approval-card__arrow { color: var(--text-faint); margin: 0 4px; }

.approval-card__date {
    font-size: 11.5px;
    color: var(--text-faint);
}

.approval-card__qrlink {
    font-size: 12.5px;
    font-weight: 600;
    width: fit-content;
}

.approval-card__actions {
    display: flex;
    gap: 10px;
}

.approval-card__actions .btn { flex: 1; }

/* Admin event card */
.admin-event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-event-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-event-card__sport {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.admin-event-card h4 {
    font-size: 15.5px;
}

.admin-event-card__teams {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-dim);
}

/* Toggle group (event status) */
.toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.toggle-btn {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.toggle-btn:hover { border-color: var(--text-faint); }

.toggle-btn--active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    justify-content: flex-end;
}

.modal__actions--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Resolve summary */
.resolve-summary {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 16px;
}

.resolve-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}

.resolve-summary__row:last-child { border-bottom: none; }
.resolve-summary__row span { color: var(--text-dim); }
.resolve-summary__row strong { font-family: var(--font-mono); }

/* Admin tables */
.admin-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    white-space: nowrap;
}

.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
}

.admin-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-2); }

.admin-table td a { font-weight: 600; font-size: 12.5px; }

/* User detail modal */
.user-detail-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    margin-bottom: 4px;
}

.user-detail-qr img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.user-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.user-detail-row:last-child { border-bottom: none; }

.user-detail-row span {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
}

.user-detail-row strong {
    font-size: 13.5px;
    font-family: var(--font-mono);
}

/* ============================================================
   RESPONSIVE — tablet / laptop
   ============================================================ */

@media (min-width: 560px) {
    .events-grid { grid-template-columns: 1fr 1fr; }
    .app-main { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 720px) {
    .app-header { padding-left: 32px; padding-right: 32px; }
    .app-main { max-width: 760px; }
    .events-grid { grid-template-columns: repeat(3, 1fr); }
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-soft);
        bottom: 16px;
        box-shadow: var(--shadow-lg);
    }
    .app-main { padding-bottom: 110px; }
}

@media (max-width: 860px) {
    .admin-sidebar {
        width: 76px;
        padding: 18px 10px;
    }
    .admin-sidebar__logo { display: none; }
    .admin-nav__item span:not(.admin-nav__badge) { display: none; }
    .admin-nav__item { justify-content: center; }
    .admin-nav__icon { font-size: 19px; }
    .admin-sidebar__logout { font-size: 0; padding: 11px; }
    .admin-sidebar__logout::before { content: "🔒"; font-size: 16px; }
    .admin-main { padding: 24px 16px 60px; }
    .user-detail-grid { grid-template-columns: 1fr; }
    .user-detail-qr img { max-width: 160px; margin: 0 auto; }
}

@media (max-width: 600px) {
    .admin-filterbar { flex-direction: column; }
    .admin-filterbar .input,
    .admin-filterbar select.input { max-width: none; }
    .field-row { grid-template-columns: 1fr; }
    .choice-row { gap: 8px; }
}

@media (min-width: 1000px) {
    .admin-main { padding: 40px 48px 60px; }
    .admin-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}