@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo+Black&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Rack Your Stack: black, electric lime, white. Confident, competitive. */
    --bg: #000000;
    --bg-card: #0d0d0d;
    --bg-elevated: #161616;
    --border: #2a2a2a;
    --border-soft: #1a1a1a;

    --lime: #c6ff00;
    --lime-bright: #e4ff4d;
    --lime-dim: rgba(198, 255, 0, 0.15);

    /* keep --gold aliases pointing at lime so nothing that still
       references the old variable names silently breaks */
    --gold: var(--lime);
    --gold-bright: var(--lime-bright);
    --gold-dim: var(--lime-dim);

    --text: #ffffff;
    --text-muted: #8a8a8a;

    --money: var(--lime);
    --money-dim: rgba(198, 255, 0, 0.14);
    --debt: #ff4d4d;
    --debt-dim: rgba(255, 77, 77, 0.14);

    --venmo: #3d95ce;
    --cashapp: #00d632;

    --font-display: "Anton", "Archivo Black", Impact, sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

a { color: inherit; }

/* --- Header / wordmark --- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-card);
    border-bottom: 2px solid var(--lime);
    position: relative;
}

.key-strip { display: none; } /* Egyptian-era decorative strip, retired */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.brand-seal {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.brand-word {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.3rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-transform: uppercase;
}
.brand-word .accent { color: var(--lime); }

.nav-links {
    display: flex;
    align-items: center;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 22px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--lime); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--lime);
    margin: 0 auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.container { max-width: 880px; margin: 0 auto; padding: 28px 16px 60px; }

/* --- Cards --- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 14px;
    position: relative;
}

.card h2, .card h3 {
    font-family: var(--font-display);
    font-weight: 400;
    margin-top: 0;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* --- Status badges --- */

.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}
.badge-open { background: var(--money-dim); color: var(--money); border-color: rgba(198,255,0,0.3); }
.badge-locked { background: var(--lime-dim); color: var(--lime-bright); border-color: rgba(198,255,0,0.3); }
.badge-settled { background: rgba(138,138,138,0.1); color: var(--text-muted); border-color: var(--border); }
.badge-cash { background: rgba(138,138,138,0.12); color: var(--text-muted); border-color: var(--border); margin-left: 6px; }
.badge-cancelled { background: rgba(255,77,77,0.1); color: var(--debt); border-color: rgba(255,77,77,0.25); }

.positive { color: var(--money); }
.negative { color: var(--debt); }

/* --- Ledger numerals: oversized, bold, tabular --- */

.ledger {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* --- Buttons --- */

button, .btn {
    background: var(--lime);
    color: #000000;
    border: none;
    padding: 12px 20px;
    min-height: 44px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
}
button:hover, .btn:hover { background: var(--lime-bright); }
button:active, .btn:active { transform: translateY(1px); }

.btn-venmo { background: var(--venmo); color: white; }
.btn-cashapp { background: var(--cashapp); color: #000000; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
}
.btn-outline:hover { background: var(--bg-elevated); border-color: var(--lime); }

/* --- Forms --- */

input, textarea, select {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    min-height: 44px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
}
textarea { min-height: 80px; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--lime);
}
input[type="number"] { font-family: var(--font-mono); }

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.checkbox-row { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 400;
    cursor: pointer;
    min-height: 44px;
}
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--lime);
    cursor: pointer;
    flex-shrink: 0;
}

/* radio buttons (event type toggle, etc.) get the same lime accent */
input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--lime);
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Flash messages --- */

.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.9rem; border: 1px solid transparent; font-weight: 600; }
.flash-error { background: var(--debt-dim); color: #ff8080; border-color: rgba(255,77,77,0.3); }
.flash-success { background: var(--money-dim); color: var(--lime-bright); border-color: rgba(198,255,0,0.3); }

/* --- Section titles: bold, oversized-adjacent --- */

.section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lime);
    font-weight: 400;
    margin: 30px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-soft);
}

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--text-muted); font-size: 0.85rem; }

/* --- Hero (landing page) --- */

.hero {
    text-align: center;
    padding: 48px 20px;
    margin-top: 12px;
}
.hero-seal { width: 64px; height: 64px; margin-bottom: 18px; }
.hero-lockup { max-width: 460px; width: 100%; height: auto; margin-bottom: 8px; }
.hero h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 400;
    margin: 0 0 10px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    line-height: 1.05;
}
.hero h1 .accent { color: var(--lime); }
.hero p { color: var(--text-muted); font-size: 1rem; max-width: 420px; margin: 0 auto; }
.hero-actions { margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- Balance display: the "how much did you rack" number --- */

.balance-figure {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* --- Leaderboard --- */

.rank {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.card-leader {
    border-color: var(--lime);
    border-width: 2px;
    background: linear-gradient(180deg, rgba(198,255,0,0.08), var(--bg-card) 60%);
}
.card-leader .rank {
    color: var(--lime-bright);
}

/* --- Fight card bulk creation --- */

.fight-row {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg-elevated);
}
.fight-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.fight-row-top .fight-input { flex: 1; min-width: 110px; margin-bottom: 0; }
.fight-row-bottom {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 8px;
}
.fight-row-bottom input { margin-bottom: 0; }
.vs-label { color: var(--text-muted); font-size: 0.8rem; flex-shrink: 0; }
.remove-fight { padding: 8px 12px; min-height: 40px; line-height: 1; flex-shrink: 0; }

/* --- Draft participant picker --- */

#participant-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    min-height: 44px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background 0.12s ease;
}
.participant-row:last-child { border-bottom: none; }
.participant-row:hover { background: var(--bg-elevated); }
.participant-row.participant-selected { background: rgba(198,255,0,0.08); }

.participant-rank {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lime-bright);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.participant-row.participant-selected .participant-rank {
    border-color: var(--lime);
    background: var(--lime);
    color: #000000;
}

/* --- Dashboard logo --- */
.dashboard-logo { max-width: 280px; width: 100%; height: auto; }

/* ============================================================
   Mobile: primary layout, not an afterthought breakpoint.
   ============================================================ */

@media (max-width: 768px) {
    .navbar { padding: 14px 16px; }
    .brand-seal { width: 44px; height: 44px; }
    .brand-word { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-card);
        border-bottom: 2px solid var(--lime);
        box-shadow: 0 12px 24px rgba(0,0,0,0.5);
        z-index: 50;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        margin-left: 0;
        padding: 16px 20px;
        font-size: 0.95rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-top: 1px solid var(--border-soft);
    }

    .container { padding: 20px 14px 48px; }

    .hero { padding: 32px 16px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.92rem; }
    .hero-lockup { max-width: 300px; }

    .balance-figure { font-size: 1.7rem; }

    .card { padding: 16px; }

    .row { flex-wrap: wrap; }

    .fight-row-bottom { grid-template-columns: 1fr; }

    .dashboard-logo { max-width: 200px; }
}
