/* World Cup 2026 — minimal, modern, single-file CSS */
:root {
    --bg: #0b1020;
    --panel: #131a30;
    --panel-2: #1a2240;
    --ink: #e9ecf8;
    --ink-dim: #aab0c8;
    --line: #2a3358;
    --accent: #28d17c;      /* WC26-ish green */
    --accent-2: #ff5252;
    --gold: #f5c542;
    --blue: #4f7cff;
    --radius: 10px;
    --shadow: 0 4px 18px rgba(0,0,0,.25);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.topbar {
    background: linear-gradient(180deg, #0e1530 0%, #0b1020 100%);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
    max-width: 1180px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { background: var(--accent); color: #0b1020; padding: 4px 8px; border-radius: 6px; font-size: 13px; letter-spacing: .5px; }
.brand-name { font-size: 16px; color: var(--ink-dim); }
.nav { display: flex; gap: 16px; margin-left: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink-dim); font-size: 14px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }
.hello { color: var(--ink-dim); }
.signout, .signin { color: var(--accent); }
.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---- Mobile layout (<= 720px): stack top bar into two compact rows ---- */
@media (max-width: 720px) {
    .topbar-inner {
        padding: 8px 12px; gap: 10px;
    }
    .brand { order: 1; flex: 0 0 auto; }
    .brand-name { display: none; }            /* keep the WC26 chip only */
    .account { order: 2; margin-left: auto; gap: 6px; }
    .hello { display: none; }                  /* avatar is enough */
    .nav {
        order: 3; flex: 1 0 100%;               /* full-width second row */
        gap: 8px; padding-top: 6px;
        border-top: 1px solid var(--line);
        overflow-x: auto;                      /* horizontal scroll if needed */
        scrollbar-width: none;                 /* hide scrollbar */
        white-space: nowrap;
        flex-wrap: nowrap;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav a {
        font-size: 13px;
        padding: 4px 10px;
        background: var(--panel-2);
        border-radius: 999px;
        flex: 0 0 auto;
    }
    .page { padding: 16px 12px 60px; }
}
@media (max-width: 380px) {
    .signout, .signin { font-size: 12px; }
}

h1, h2, h3 { margin: 0 0 12px; color: var(--ink); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { color: var(--ink-dim); }

/* Cards / panels */
.panel {
    background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
    padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}

/* Full-border colored variants — used selectively on the home page to break monotony. */
.panel-green   { border-color: var(--accent);    box-shadow: 0 4px 18px rgba(40,209,124,.10); }
.panel-blue    { border-color: var(--blue);      box-shadow: 0 4px 18px rgba(79,124,255,.10); }
.panel-gold    { border-color: var(--gold);      box-shadow: 0 4px 18px rgba(245,197,66,.10); }
.panel-violet  { border-color: #a26cff;          box-shadow: 0 4px 18px rgba(162,108,255,.10); }
.panel-teal    { border-color: #28c8d1;          box-shadow: 0 4px 18px rgba(40,200,209,.10); }
.panel-coral   { border-color: #ff8b6a;          box-shadow: 0 4px 18px rgba(255,139,106,.10); }

.panel-green   h1, .panel-green   h2 { color: var(--accent); }
.panel-blue    h1, .panel-blue    h2 { color: var(--blue); }
.panel-gold    h1, .panel-gold    h2 { color: var(--gold); }
.panel-violet  h1, .panel-violet  h2 { color: #c5a3ff; }
.panel-teal    h1, .panel-teal    h2 { color: #4ddfe6; }
.panel-coral   h1, .panel-coral   h2 { color: #ffa388; }

/* Inline badge bullets for the Rules page list */
.badge-list { list-style: none; padding-left: 0; margin: 6px 0 0; }
.badge-list li { padding: 6px 0; color: var(--ink-dim); font-size: 14px; line-height: 1.5; border-bottom: 1px dashed var(--line); }
.badge-list li:last-child { border-bottom: none; }
.badge-inline {
    display: inline-block;
    background: var(--panel-2); border: 1px solid var(--line);
    padding: 2px 8px; border-radius: 4px; color: var(--ink);
    margin-right: 4px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* Match card */
.match {
    display: grid; grid-template-columns: 1fr 220px 1fr; align-items: center; gap: 14px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
}
.match .center { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
@media (max-width: 640px) {
    .match { grid-template-columns: 1fr 140px 1fr; gap: 8px; padding: 10px 8px; }
    .match .venue { font-size: 10px; }
}
.match.locked { opacity: .85; }
.match .team { display: flex; align-items: center; gap: 10px; }
.match .team.t2 { flex-direction: row-reverse; text-align: right; }
.match .flag { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px #00000033; }
.match .name { font-weight: 600; }
.match .vs { color: var(--ink-dim); font-size: 12px; }
.match .meta { color: var(--ink-dim); font-size: 12px; margin-top: 6px; }
.match .score-inputs { display: flex; align-items: center; gap: 6px; }
.match .kickoff { font-size: 12px; color: var(--ink); font-weight: 600; margin-bottom: 6px; letter-spacing: .2px; }
.match.locked .kickoff { color: var(--ink-dim); }
.match .lock-hint { font-size: 11px; color: var(--accent); margin-top: 6px; font-weight: 600; }
.match .lock-hint.is-locked { color: var(--ink-dim); }
.match .venue { margin-top: 4px; max-width: 100%; line-height: 1.3; word-break: break-word; }
.match .locked-score { display: flex; flex-direction: column; align-items: center; }
.match input[type=number] {
    width: 48px; height: 38px; text-align: center; font-size: 18px; font-weight: 700;
    background: #0b1020; color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
.match .dash { color: var(--ink-dim); }
.match .actual { font-weight: 700; font-size: 20px; padding: 0 6px; }
.match .pts { color: var(--gold); font-weight: 700; }
.match .pts.zero { color: var(--ink-dim); }
.match .your-result {
    margin-top: 6px; font-size: 12px; color: var(--ink-dim);
    background: rgba(255,255,255,.03); border: 1px solid var(--line);
    padding: 4px 8px; border-radius: 4px; display: inline-flex; gap: 6px; align-items: center;
}
.match .your-result strong { color: var(--ink); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: #08111e; border: none; cursor: pointer;
    padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 14px;
}
.btn:hover { filter: brightness(1.05); }
.btn.btn-secondary { background: #2a3358; color: var(--ink); }
.btn.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.save-bar {
    position: sticky; bottom: 0; background: var(--panel);
    border-top: 1px solid var(--line); padding: 12px 18px;
    display: flex; justify-content: space-between; align-items: center;
    margin: 18px -20px 0; z-index: 10;
}

/* Login */
.login { display: flex; justify-content: center; padding-top: 60px; }
.login-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 30px; max-width: 380px; text-align: center; box-shadow: var(--shadow);
}
.login-logo { width: 90px; height: 90px; margin-bottom: 10px; }
.fine-print { color: var(--ink-dim); font-size: 12px; margin-top: 14px; }

/* Group table */
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.group {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px;
}
.group h3 { color: var(--accent); margin-bottom: 8px; }
.group table { width: 100%; border-collapse: collapse; font-size: 14px; }
.group td { padding: 5px 4px; border-bottom: 1px solid #1f2746; }
.group .flag-cell { width: 26px; }
.group .num { width: 30px; text-align: right; color: var(--ink-dim); }

/* Leaderboard */
.lb { width: 100%; border-collapse: collapse; }
.lb th, .lb td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.lb th { color: var(--ink-dim); font-weight: 500; font-size: 13px; }
.lb td.pts, .lb th.pts { text-align: right; }
.lb td.pts { font-weight: 700; color: var(--gold); }
.lb .rank-1 td { background: rgba(245,197,66,.06); }
.lb .rank-2 td { background: rgba(192,192,192,.04); }
.lb .rank-3 td { background: rgba(205,127,50,.05); }
.lb .move { font-size: 12px; margin-left: 4px; }
.lb .up { color: var(--accent); }
.lb .down { color: var(--accent-2); }
.lb .streak {
    color: #ff9b3a;
    font-weight: 700;
    font-size: 13px;
    background: rgba(255,155,58,.12);
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
}
/* Player cell layout: avatar + name + recognition chips on one flex row.
   On narrow screens chips drop to a second line cleanly instead of orphaning. */
.lb-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.lb-player-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    text-decoration: none;
    min-width: 0;
    flex: 0 1 auto;
}
.lb-player-link .avatar { width: 22px; height: 22px; }
.lb-player-emoji { font-size: 18px; }
.lb-player-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lb .reco-icon { font-size: 14px; }
@media (max-width: 520px) {
    /* Keep player + chips on one line; truncate long names with an ellipsis
       instead of wrapping the cell to a second row. */
    .lb-player { flex-wrap: nowrap; max-width: 100%; }
    .lb-player-link { flex: 1 1 auto; min-width: 0; overflow: hidden; }
    .lb-player-name {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 14px;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .lb .streak { font-size: 12px; padding: 1px 5px; flex: 0 0 auto; }
    .lb .reco-icon { flex: 0 0 auto; }
    .lb th, .lb td { padding: 8px 6px; }

    /* Standings page only: hide the Badges and Move columns on phones so
       the player name + streak + points have room. The full grid is still
       there on tablet/desktop. Home-page Top 10 keeps all its columns since
       it's a tighter table to begin with. */
    .lb-standings th:nth-child(3),
    .lb-standings td:nth-child(3),
    .lb-standings th:nth-child(4),
    .lb-standings td:nth-child(4) { display: none; }

    /* Home Top 10: long names ("Mahyar Sharif Vaghefi") were stretching the
       player column so wide that the 🔥 column wrapped onto two lines.
       Truncate the name with an ellipsis and keep "🔥 N" on one line. */
    .lb-top10 { table-layout: fixed; }
    .lb-top10 td:nth-child(2) {
        max-width: 0;          /* required for ellipsis inside a table cell */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .lb-top10 td:nth-child(3) { white-space: nowrap; }
}
.lb-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lb-badge {
    display: inline-block;
    background: var(--panel-2); border: 1px solid rgba(245,197,66,.3);
    padding: 1px 4px; border-radius: 4px;
    font-size: 14px; cursor: help;
}

/* ===== Live page ===== */
.panel.panel-red { background: linear-gradient(135deg, rgba(255,82,82,.07), rgba(255,82,82,.01));
                   border-color: rgba(255,82,82,.35); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.live-match { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
              padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.lm-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.lm-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lm-team.t2 { justify-content: flex-end; }
.lm-team .flag { width: 28px; height: 20px; }
.lm-team-name { font-weight: 600; }
.lm-score { font-size: 32px; font-weight: 800; color: var(--gold); display: inline-flex; align-items: baseline; gap: 8px; }
.lm-score-num { transition: color 0.4s, transform 0.2s; }
.lm-score-flash { color: #fff; transform: scale(1.15); }
.lm-dash { color: var(--ink-dim); }
.lm-meta { font-size: 12px; color: var(--ink-dim); text-align: center; }
.lm-section-h { font-size: 13px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .5px;
                margin: 6px 0 4px; font-weight: 600; }
.lm-predictions { display: flex; flex-direction: column; gap: 4px; }
.lm-pred { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px;
           padding: 6px 8px; background: rgba(255,255,255,.03); border-radius: 5px; font-size: 13px; }
.lm-pred-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden;
               text-overflow: ellipsis; white-space: nowrap; }
.lm-pred-who .avatar { width: 18px; height: 18px; }
.lm-pred-pick { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.lm-pred-tag { font-size: 11px; color: var(--ink-dim); }
.lm-pred-pts { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.lm-pred.lm-p-exact { background: rgba(40,209,124,.10); }
.lm-pred.lm-p-good { background: rgba(40,209,124,.06); }
.lm-pred.lm-p-ok { background: rgba(245,197,66,.05); }
.lm-pred.lm-p-miss .lm-pred-pts { color: var(--ink-dim); }
.lm-emoji { font-size: 16px; }
.lm-dist { display: flex; flex-direction: column; gap: 4px; }
.lm-dist-row { display: grid; grid-template-columns: 48px 1fr 36px; align-items: center; gap: 8px;
               padding: 3px 6px; border-radius: 4px; font-size: 13px; }
.lm-dist-row.lm-dist-current { background: rgba(245,197,66,.10); outline: 1px solid rgba(245,197,66,.4); }
.lm-dist-score { font-weight: 700; font-variant-numeric: tabular-nums; text-align: center;
                 padding: 2px 6px; border-radius: 4px; }
.lm-dist-score.lm-dist-t1 { background: rgba(40,209,124,.18); color: #6ce0a0; }
.lm-dist-score.lm-dist-t2 { background: rgba(255,82,82,.18); color: #ff8888; }
.lm-dist-score.lm-dist-dr { background: rgba(180,180,180,.18); color: var(--ink-dim); }
.lm-dist-fill { background: rgba(255,255,255,.04); height: 12px; border-radius: 3px; overflow: hidden; }
.lm-dist-fill-inner { display: block; height: 100%; border-radius: 3px; transition: width .25s ease; }
.lm-dist-fill-inner.lm-dist-t1 { background: rgba(40,209,124,.7); }
.lm-dist-fill-inner.lm-dist-t2 { background: rgba(255,82,82,.7); }
.lm-dist-fill-inner.lm-dist-dr { background: rgba(180,180,180,.5); }
.lm-dist-count { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.lm-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.lm-col-left, .lm-col-right { min-width: 0; }
.lm-top5 { display: flex; flex-direction: column; gap: 3px;
           padding: 8px; border-radius: 6px; }
/* Before = cool / muted indigo so it reads as the "snapshot from earlier". */
.lm-top5.lm-top5-before { background: rgba(122,140,255,.06); border-left: 3px solid rgba(122,140,255,.6); }
/* After = warm / gold so it reads as the current standings. */
.lm-top5.lm-top5-after  { background: rgba(245,197,66,.07); border-left: 3px solid rgba(245,197,66,.65); }
.lm-top5-row { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 6px;
               padding: 5px 8px; background: rgba(255,255,255,.04); border-radius: 4px; font-size: 13px; }
.lm-top5-pos { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.lm-top5-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden;
               text-overflow: ellipsis; white-space: nowrap; }
.lm-top5-who .avatar { width: 16px; height: 16px; }
.lm-top5-arrow { font-size: 11px; font-variant-numeric: tabular-nums; }
.lm-top5-arrow.up   { color: var(--accent); }
.lm-top5-arrow.down { color: var(--accent-2); }
.lm-top5-arrow.flat { color: var(--ink-dim); }
.lm-top5-pts { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.lm-top5-row.lm-top5-projected {
    background: rgba(162,108,255,.10);
    border-left: 2px solid rgba(162,108,255,.55);
    font-style: italic;
    color: var(--ink-dim);
}
.lm-top5-row.lm-top5-projected .lm-top5-who { color: #c5a3ff; }
.lm-top5-row.lm-top5-projected .lm-top5-pos { color: #c5a3ff; }
@media (max-width: 720px) {
    .lm-cols { grid-template-columns: 1fr; }
}

.lm-chat { display: flex; flex-direction: column; gap: 6px; }
.lm-chat-log { max-height: 260px; overflow-y: auto; background: #0b1020; border: 1px solid var(--line);
               border-radius: 5px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
               font-size: 13px; }
.lm-chat-msg { display: flex; gap: 6px; align-items: baseline; line-height: 1.4; }
.lm-chat-msg .avatar { width: 16px; height: 16px; }
.lm-chat-msg.lm-chat-ai { background: rgba(162,108,255,.06); padding: 4px 6px; border-radius: 4px; }
.lm-chat-who { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; color: var(--ink-dim); }
.lm-chat-body { color: var(--ink); word-break: break-word; }
.lm-chat-form { display: flex; gap: 6px; }
.lm-chat-form input { flex: 1; background: #0b1020; color: var(--ink); border: 1px solid var(--line);
                      border-radius: 5px; padding: 8px 10px; font-size: 14px; }
.lm-chat-form .btn { flex: 0 0 auto; }
@media (max-width: 520px) {
    .live-grid { grid-template-columns: 1fr; }
    .lm-score { font-size: 24px; }
    .lm-pred { grid-template-columns: 1fr auto auto; }
    .lm-pred-tag { display: none; }
}

/* League-pulse tier dashboard — 4 tiles above the leaderboard. */
.tier-pulse {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.tier-tile {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink-dim);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tier-tile .tier-label {
    font-size: 11px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}
.tier-tile .tier-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin: 2px 0;
}
.tier-tile .tier-sub {
    font-size: 11px;
    color: var(--ink-dim);
}
.tier-tile .tier-leader {
    font-size: 12px;
    margin-top: 6px;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tier-tile .tier-top {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    counter-reset: tier-rank;
}
.tier-tile .tier-top li {
    counter-increment: tier-rank;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    line-height: 1.25;
}
.tier-tile .tier-top li::before {
    content: counter(tier-rank) ".";
    color: var(--ink-dim);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.tier-tile .tier-top-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.tier-tile .tier-top-val {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 13px;
}
.tier-tile .tier-empty {
    font-size: 12px;
    color: var(--ink-dim);
    margin-top: 8px;
    font-style: italic;
}

/* Late-edit watch — two columns of saves / slips */
.late-edits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.late-col {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
}
.late-col-saves { border-left: 3px solid var(--accent); }
.late-col-slips { border-left: 3px solid var(--accent-2); }
.late-head {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    color: var(--ink-dim);
    margin-bottom: 6px;
}
.late-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.late-list li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
}
.late-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.late-delta { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.late-pos { color: var(--accent); }
.late-neg { color: var(--accent-2); }
.late-flips { font-size: 11px; color: var(--ink-dim); }
@media (max-width: 520px) {
    .late-edits { grid-template-columns: 1fr; }
}

/* Drama log — narrative tags + goal timeline per finished match */
.drama-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.drama-row {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 10px 12px;
}
.drama-score {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 14px; margin-bottom: 6px;
}
.drama-team { flex: 0 1 auto; }
.drama-num {
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,.06);
    border-radius: 4px; padding: 1px 6px;
}
.drama-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.drama-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.drama-late_winner     { background: rgba(255,170,80,.12);  border-color: rgba(255,170,80,.35); }
.drama-stoppage_winner { background: rgba(255,90,90,.14);   border-color: rgba(255,90,90,.4); }
.drama-comeback        { background: rgba(120,220,160,.14); border-color: rgba(120,220,160,.4); }
.drama-fight_back      { background: rgba(120,180,255,.12); border-color: rgba(120,180,255,.35); }
.drama-early_collapse  { background: rgba(220,120,180,.14); border-color: rgba(220,120,180,.4); }
.drama-goal_fest       { background: rgba(255,220,90,.14);  border-color: rgba(255,220,90,.4); }
.drama-timeline { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--ink-dim); }
.drama-goal {
    font-variant-numeric: tabular-nums;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.drama-side-1 { color: #cde6ff; }
.drama-side-2 { color: #ffd9c2; }

/* Rank-movement bumps chart */
.rank-chart-wrap {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 4px 4px;
    overflow-x: auto;
}
.rank-chart {
    display: block;
    width: 100%;
    height: auto;
    min-width: 600px;
}
/* Tier-specific accent colors for the left border + leader text */
.tier-tile.tier-hit    { border-left-color: var(--accent); }
.tier-tile.tier-hit    .tier-num { color: var(--accent); }
.tier-tile.tier-exact  { border-left-color: var(--gold); }
.tier-tile.tier-exact  .tier-num { color: var(--gold); }
.tier-tile.tier-exact  .tier-leader { color: var(--gold); }
.tier-tile.tier-shape  { border-left-color: var(--blue); }
.tier-tile.tier-shape  .tier-num { color: var(--blue); }
.tier-tile.tier-shape  .tier-leader { color: var(--blue); }
.tier-tile.tier-winner { border-left-color: #6ce0a0; }
.tier-tile.tier-winner .tier-num { color: #6ce0a0; }
.tier-tile.tier-winner .tier-leader { color: #6ce0a0; }

@media (max-width: 720px) {
    .tier-pulse { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .tier-tile .tier-num { font-size: 22px; }
}

.picks-archive { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.08); }
.picks-archive[open] summary { margin-bottom: 4px; }
.picks-archive summary::-webkit-details-marker { display: none; }
.picks-archive .picks-archive-day {
    margin: 18px 0 6px;
    font-size: 13px;
    color: var(--ink-dim);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
}
.picks-archive .picks-archive-day:first-child { margin-top: 6px; }

.mvp-strip {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, rgba(245,197,66,.10), rgba(245,197,66,.02));
    border: 1px solid rgba(245,197,66,.4);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}
.mvp-medal { font-size: 26px; }

.wa-strip {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(37,211,102,.10), rgba(37,211,102,.02));
    border: 1px solid rgba(37,211,102,.35);
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
}
.wa-icon { font-size: 24px; }
.wa-text { display: flex; flex-direction: column; flex: 1 1 auto; gap: 2px; line-height: 1.3; }
.wa-text strong { color: #25d366; font-size: 15px; }
.wa-strip .btn { background: #25d366; color: #0b1020; flex: 0 0 auto; }
@media (max-width: 640px) {
    .wa-strip { flex-direction: column; align-items: stretch; text-align: center; }
}

.news-panel {
    background:
        linear-gradient(135deg, rgba(79,124,255,.10), rgba(40,209,124,.04)),
        repeating-linear-gradient(0deg, transparent 0 28px, rgba(255,255,255,.015) 28px 29px);
    border-color: rgba(79,124,255,.5);
    padding: 22px 24px;
}
.news-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(79,124,255,.25);
}
.news-badge {
    background: var(--blue); color: #0b1020; padding: 4px 12px;
    border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: .8px;
    text-transform: uppercase;
}
.news-dateline {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; color: var(--ink-dim); font-size: 13px;
}
.news-layout {
    /* Image dominant on the left; body flows in a narrow column on the right.
       The body is clamped (see below) so it never extends below the image —
       overflow is replaced with an ellipsis and a "Read more →" link to /ai.php. */
    display: grid; grid-template-columns: 1fr 360px; gap: 22px;
    align-items: start;
}
.news-figure { margin: 0; }
.news-figure img {
    width: 100%; border-radius: 10px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.news-figure figcaption {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11px; color: var(--ink-dim); margin-top: 6px;
    text-align: center; font-style: italic;
    text-transform: uppercase; letter-spacing: 1px;
}
.news-body {
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px; line-height: 1.65;
    /* Clamp by height (not line-clamp) so the ::first-letter drop cap below
       still floats correctly — line-clamp uses display:-webkit-box which kills
       floats. A soft mask fade replaces the hard cut with a gradient. */
    max-height: 430px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 78%, transparent 100%);
            mask-image: linear-gradient(to bottom, black 78%, transparent 100%);
}
.news-body::first-letter {
    /* old-newspaper drop cap — now works again because we're not in -webkit-box */
    float: left; font-size: 56px; line-height: .9;
    padding: 6px 10px 0 0; color: var(--blue);
    font-weight: 700;
}
.news-more {
    display: inline-block;
    margin-top: 10px;
    grid-column: 2 / 3;   /* sits under the body column on desktop */
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    color: var(--blue);
    text-decoration: none;
    font-style: italic;
}
.news-more:hover { text-decoration: underline; }

@media (max-width: 800px) {
    .news-layout { grid-template-columns: 1fr; }
    .news-figure img { max-height: 240px; object-fit: cover; }
    .news-body {
        font-size: 15px;
        /* full body breathing room on mobile — image stacks above text */
        max-height: none; overflow: visible;
        -webkit-mask-image: none; mask-image: none;
    }
    .news-body::first-letter { font-size: 44px; padding: 4px 8px 0 0; }
    .news-more { grid-column: auto; }
}

/* Profile page */
.profile-hero { display: flex; gap: 18px; align-items: flex-start; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--accent); }
.profile-stats { display: flex; flex-wrap: wrap; gap: 16px 22px; margin-top: 6px; }
.profile-stats > div { display: flex; flex-direction: column; }
.profile-stats .lbl { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .4px; }
.profile-stats .val { font-size: 18px; font-weight: 700; color: var(--ink); }

/* Badges */
.badge-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px; margin-top: 8px;
}
.badge {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel-2); border: 1px solid var(--line);
    padding: 10px 12px; border-radius: 8px; position: relative;
    cursor: help;
}
.badge.earned { border-color: rgba(245,197,66,.5);
                background: linear-gradient(135deg, rgba(245,197,66,.10), rgba(245,197,66,.02)); }
.badge.locked { opacity: .5; filter: grayscale(.7); }
.badge-icon { font-size: 22px; line-height: 1; }
.badge-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.badge-progress {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: #0b1020; border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 6px; font-size: 10px; color: var(--ink-dim); font-weight: 700;
}
@media (max-width: 640px) {
    .profile-hero { flex-direction: column; }
    .profile-stats { gap: 10px 16px; }
    .profile-stats .val { font-size: 16px; }
}

/* Footer */
.footsy {
    text-align: center; padding: 30px 10px; color: var(--ink-dim);
    font-size: 12px; border-top: 1px solid var(--line); margin-top: 60px;
}
.footsy a { margin-left: 6px; }
.muted { color: var(--ink-dim); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.group { background: #1f2746; color: var(--accent); }
.tag.ko { background: #2a1f46; color: var(--gold); }
.tag.locked { background: #2a3358; color: var(--ink-dim); }
.notice { background: rgba(79,124,255,.08); border: 1px solid rgba(79,124,255,.25); color: var(--ink); padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: 14px; }

.champ-callout {
    margin-top: 24px;
    background: linear-gradient(135deg, rgba(245,197,66,.12), rgba(245,197,66,.04));
    border: 1px solid rgba(245,197,66,.4);
    border-radius: var(--radius);
    padding: 18px 22px;
}
.champ-callout h2 { color: var(--gold); font-size: 22px; margin-bottom: 8px; }
.champ-callout p { color: var(--ink); font-size: 15px; }
.champ-callout strong { color: var(--gold); }

/* Home-page scrolling picks ribbon */
.ribbon {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
    margin: 0 0 22px; overflow: hidden; position: relative;
    display: grid; grid-template-columns: 200px 1fr; align-items: stretch;
    isolation: isolate;   /* contain blend/z so it can't leak into siblings */
}
.ribbon-label {
    background: var(--panel); color: var(--accent); font-weight: 700; font-size: 12px;
    padding: 10px 14px; display: flex; align-items: center;
    border-right: 1px solid var(--line); white-space: nowrap;
    letter-spacing: .3px; text-transform: uppercase;
    box-shadow: 6px 0 12px rgba(0,0,0,.35);    /* visual separator over the track */
    position: relative; z-index: 2;
}
.ribbon-track {
    overflow: hidden; min-width: 0;            /* allow grid item to shrink */
    position: relative; z-index: 1;
    padding-left: 14px;                        /* breathing room after the label */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 60px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 60px), transparent 100%);
}
/* Ribbon — content track must shrink-wrap to its real content width,
   otherwise translateX(-50%) shifts by half the *container* (wrong) instead of
   half the *content* (right), producing visible jumps mid-card. */
.ribbon-inner {
    display: flex;            /* row of cards, takes content width */
    width: max-content;       /* shrink-wrap to combined card width */
    padding: 10px 0; white-space: nowrap;
    animation: ribbon-scroll 30s linear infinite;
    will-change: transform;
}
.ribbon:hover .ribbon-inner { animation-play-state: paused; }

/* One self-contained card per (player, match, prediction). */
.pick-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    padding: 8px 12px;
    margin-right: 14px;
    background: #0b1020;
    border: 1px solid var(--line);
    border-top: 3px solid var(--ink-dim);
    border-radius: 8px;
    min-width: 100px;
    line-height: 1.2;
}
.pick-card.pick-t1 { border-top-color: var(--accent); }
.pick-card.pick-t2 { border-top-color: var(--accent-2); }
.pick-card.pick-dr { border-top-color: var(--ink-dim); }
.pick-card .pick-name {
    font-size: 12px; font-weight: 700; color: var(--ink);
    margin-bottom: 5px;
    max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-card .pick-flags { display: inline-flex; align-items: center; gap: 4px; }
.pick-card .rflag {
    width: 22px; height: 16px; object-fit: cover; border-radius: 2px;
    border: 1px solid rgba(0,0,0,.4);
}
.pick-card .rflag-divider { color: var(--ink-dim); font-size: 10px; font-weight: 500; }
.pick-card .pick-score {
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
    font-weight: 700; font-size: 14px;
    padding: 1px 10px; border-radius: 4px;
}
.pick-card.pick-t1 .pick-score { background: rgba(40,209,124,.18);  color: var(--accent); }
.pick-card.pick-t2 .pick-score { background: rgba(255,82,82,.18);   color: var(--accent-2); }
.pick-card.pick-dr .pick-score { background: rgba(170,176,200,.10); color: var(--ink); }

@keyframes ribbon-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* content is duplicated → -50% loops seamlessly */
}
@media (prefers-reduced-motion: reduce) {
    .ribbon-inner { animation: none; }
}
@media (max-width: 640px) {
    .ribbon { grid-template-columns: 1fr; }      /* single column on phones */
    .ribbon-label { display: none; }             /* hide the wordy label */
    .ribbon-track {
        padding-left: 0;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
                mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    }
    .ribbon-inner { padding: 8px 0; }
}

/* Match stats bars (league + Kalshi) */
.match-stats { background: var(--panel-2); border: 1px solid var(--line); border-top: none;
               border-radius: 0 0 var(--radius) var(--radius); padding: 8px 14px 10px;
               margin: -10px 0 10px;
               display: flex; flex-direction: column; gap: 6px; }
.match-stats .stats-block { display: grid; grid-template-columns: 70px 1fr 220px;
                            align-items: center; gap: 10px; font-size: 11px; color: var(--ink-dim); }
.match-stats .stats-label { color: var(--ink); font-weight: 600; }
.match-stats .stats-text  { font-variant-numeric: tabular-nums; text-align: right; }
.match-stats .bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden;
                    background: #0b1020; border: 1px solid var(--line); }
.match-stats .bar.empty { background: #0b1020 repeating-linear-gradient(
                              45deg, transparent 0 6px, rgba(170,176,200,.08) 6px 12px); }
.match-stats .seg { height: 100%; }
.match-stats .seg.t1 { background: var(--accent); }
.match-stats .seg.t2 { background: var(--accent-2); }
.match-stats .seg.dr { background: var(--ink-dim); opacity: .6; }
/* "Last N H2H" — two rows with W/D/L icons, mimicking sports-app form badges.
   Sits inside .match-stats; no own background/border. */
.h2h-form {
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px dashed var(--line);
    display: flex; flex-direction: column; gap: 6px;
    cursor: help;
}
.h2h-empty .h2h-empty-text { font-size: 12px; color: var(--ink-dim); font-style: italic; }

/* AI Bench */
.ai-hero {
    display: flex; gap: 16px; align-items: center;
    padding-bottom: 14px; margin-bottom: 6px;
    border-bottom: 1px dashed var(--line);
}
.ai-emoji { font-size: 42px; line-height: 1; flex: 0 0 auto; }
.ai-portrait {
    width: 88px; height: 88px; border-radius: 50%;
    object-fit: cover; flex: 0 0 auto;
    border: 2px solid rgba(162,108,255,.6);
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.ai-tab-portrait {
    width: 22px; height: 22px; border-radius: 50%;
    object-fit: cover; flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.15);
}

/* AI predictors' picks for the next match, on the home page. */
.ai-next-picks {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.ai-next-picks-label {
    font-size: 11px; color: #c5a3ff; font-weight: 800;
    letter-spacing: .5px; text-transform: uppercase;
    margin-bottom: 8px;
}
.ai-next-picks-grid {
    display: grid; grid-template-columns: 1fr; gap: 8px;
}
.ai-next-pick {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px;
    background: rgba(255,255,255,.025);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink-dim);
    border-radius: 6px;
}
.ai-next-pick.ai-pk-el_profesor  { border-left-color: var(--accent); }
.ai-next-pick.ai-pk-el_romantico { border-left-color: var(--accent-2); }

.ai-next-portrait {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,.15);
}
.ai-next-emoji { font-size: 32px; line-height: 1; flex: 0 0 auto; width: 44px; text-align: center; }
.ai-next-body { flex: 1; min-width: 0; }
.ai-next-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.ai-next-score {
    font-size: 13px; color: var(--ink); margin: 4px 0; line-height: 1.2;
}
.ai-next-score strong {
    font-size: 16px; color: var(--gold);
    font-variant-numeric: tabular-nums;
    padding: 0 6px;
}
.ai-next-team { color: var(--ink-dim); font-size: 11px; }
.ai-next-why summary {
    list-style: none; cursor: pointer; font-size: 11px;
    color: var(--blue); margin-top: 4px;
}
.ai-next-why summary::-webkit-details-marker { display: none; }
.ai-next-why div {
    font-size: 12px; color: var(--ink-dim); line-height: 1.5;
    padding: 6px 0 0; max-width: 540px;
}
.ai-stats { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.ai-stats > div { display: flex; flex-direction: column; }
.ai-stats .lbl { font-size: 10px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .4px; }
.ai-stats .val { font-size: 16px; font-weight: 700; color: var(--ink); }
.ai-picks { display: flex; flex-direction: column; gap: 4px; }
.ai-pick {
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 6px; padding: 0; overflow: hidden;
}
.ai-pick summary {
    list-style: none;
    display: grid; grid-template-columns: 1fr auto auto auto;
    align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer;
    font-size: 13px;
}
.ai-pick summary::-webkit-details-marker { display: none; }
.ai-pick summary:hover { background: rgba(255,255,255,.02); }
.ai-pick-fixture { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.ai-pick-fixture .flag { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.ai-pick-score { font-weight: 700; color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-pick-actual { font-size: 11px; }
.ai-pick-pts { font-size: 12px; font-weight: 700; color: var(--gold); padding: 1px 8px; background: rgba(245,197,66,.15); border-radius: 4px; }
.ai-pick-pts.zero { color: var(--ink-dim); background: rgba(170,176,200,.10); }
.ai-reasoning {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--line);
    color: var(--ink); font-size: 13px; line-height: 1.55;
    background: rgba(255,255,255,.015);
}

/* AI persona tabs — sticky pill row */
.ai-tabs {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(162,108,255,.2);
}
.ai-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-dim); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: all .12s ease;
}
.ai-tab:hover { color: var(--ink); border-color: rgba(162,108,255,.4); text-decoration: none; }
.ai-tab.active {
    background: linear-gradient(135deg, rgba(162,108,255,.20), rgba(162,108,255,.06));
    border-color: #a26cff; color: var(--ink);
}
.ai-tab-emoji { font-size: 16px; line-height: 1; }

/* Newspaper-style post inside AI Bench (mirrors home news panel feel) */
.ai-post {
    padding: 16px 0;
    border-bottom: 1px dashed var(--line);
}
.ai-post:last-child { border-bottom: none; padding-bottom: 4px; }
.ai-post-meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.ai-post-badge {
    background: rgba(162,108,255,.18); color: #c5a3ff;
    padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 800;
    letter-spacing: .4px; text-transform: uppercase;
}
.ai-post-meta .muted {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; font-size: 13px;
}
.ai-post-figure {
    margin: 0 0 14px;
    text-align: center;       /* center moderately-sized image */
}
.ai-post-figure img {
    max-width: 100%;
    max-height: 320px;        /* cap so it never dominates the page */
    border-radius: 10px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.ai-post-headline {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px; line-height: 1.25;
    color: var(--ink); font-weight: 700;
    margin: 4px 0 14px;
}
.ai-post-body {
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px; line-height: 1.7;
}
.ai-post-body::first-letter {
    /* old-newspaper drop cap, smaller than the home page so it doesn't overpower */
    float: left; font-size: 44px; line-height: .9;
    padding: 4px 8px 0 0; color: #c5a3ff;
    font-weight: 700;
}
@media (max-width: 640px) {
    .ai-post-figure img { max-height: 220px; }
    .ai-post-body { font-size: 15px; }
    .ai-post-body::first-letter { font-size: 36px; padding: 3px 6px 0 0; }
}

/* Leaderboard shadow row */
.lb tr.lb-shadow td { background: rgba(162,108,255,.06); }
.lb tr.lb-shadow td:first-child { border-left: 3px solid #a26cff; }

@media (max-width: 640px) {
    .ai-hero { flex-direction: column; align-items: flex-start; }
    .ai-stats { width: 100%; }
    .ai-pick summary { grid-template-columns: 1fr auto; row-gap: 4px; }
    .ai-pick-actual, .ai-pick-pts { grid-column: 2; justify-self: end; }
}
.h2h-form-label {
    font-size: 10px; color: var(--gold); font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 2px;
}
.h2h-row {
    display: grid; grid-template-columns: 24px 1fr auto;
    align-items: center; gap: 10px;
}
.h2h-row .flag { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; border: 1px solid rgba(0,0,0,.4); }
.h2h-row .name { font-size: 13px; color: var(--ink); font-weight: 600; }
.h2h-row .form-icons { display: inline-flex; gap: 4px; }
.form-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 11px; font-weight: 800; line-height: 1;
    color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3);
}
.form-icon.win  { background: var(--accent); }
.form-icon.loss { background: var(--accent-2); }
.form-icon.draw { background: var(--ink-dim); color: #0b1020; }
@media (max-width: 640px) {
    .h2h-row { grid-template-columns: 20px 1fr auto; gap: 6px; }
    .h2h-row .name { font-size: 12px; }
    .form-icon { width: 18px; height: 18px; font-size: 10px; }
}
@media (max-width: 640px) {
    .match-stats .stats-block { grid-template-columns: 56px 1fr 130px; font-size: 10px; }
}

/* Score-distribution mini bar chart */
.dist-block {
    display: grid; grid-template-columns: 70px 1fr; gap: 10px;
    align-items: start; margin-top: 4px; padding-top: 8px;
    border-top: 1px dashed var(--line);
}
.dist-bars { display: flex; flex-direction: column; gap: 4px; }
.dist-row { display: grid; grid-template-columns: 38px 1fr 24px; align-items: center;
            gap: 8px; font-size: 11px; color: var(--ink-dim); }
.dist-score { font-variant-numeric: tabular-nums; font-weight: 600; }
.dist-score.dist-t1 { color: var(--accent); }
.dist-score.dist-t2 { color: var(--accent-2); }
.dist-score.dist-dr { color: var(--ink-dim); }
.dist-fill { display: block; height: 8px; background: #0b1020;
             border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.dist-fill-inner { display: block; height: 100%; min-width: 2px;
                   transition: width .3s ease-out; }
.dist-fill-inner.dist-t1 { background: var(--accent); }
.dist-fill-inner.dist-t2 { background: var(--accent-2); }
.dist-fill-inner.dist-dr { background: var(--ink-dim); opacity: .6; }
.dist-count { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
    .dist-block { grid-template-columns: 56px 1fr; }
}

.champ-dist {
    margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.champ-dist h3 { color: var(--ink); font-size: 14px; margin-bottom: 10px; font-weight: 600; }
.champ-dist-row { grid-template-columns: 160px 1fr 30px; font-size: 13px; }
.champ-dist .dist-team { color: var(--ink); display: inline-flex; align-items: center; }
@media (max-width: 640px) {
    .champ-dist-row { grid-template-columns: 120px 1fr 24px; font-size: 12px; }
}

/* =================== Cover popup (dismissible) =================== */
.pc-cover {
    position: fixed; inset: 0;
    z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pc-cover-backdrop {
    position: absolute; inset: 0;
    background: rgba(6,10,20,.72);
    backdrop-filter: blur(2px);
    cursor: pointer;
}
.pc-cover-card {
    position: relative; z-index: 1;
    max-width: 620px; width: 100%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
    padding: 12px 12px 14px;
    animation: pcCoverIn .28s ease-out;
}
@keyframes pcCoverIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.pc-cover-close {
    position: absolute; top: -12px; right: -12px;
    width: 34px; height: 34px; border-radius: 50%;
    background: #1a2340; color: #fff;
    border: 2px solid #fff;
    font-size: 16px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
}
.pc-cover-close:hover { background: #ff5252; }
.pc-cover-img {
    display: block;
    width: 100%; height: auto;
    border-radius: 8px;
    background: #f7f9fc;
}
.pc-cover-caption {
    margin-top: 10px;
    text-align: center;
    color: #1a2340;
    font-size: 13px; font-weight: 600;
    letter-spacing: .2px;
}
body.pc-cover-open { overflow: hidden; }
@media (max-width: 640px) {
    .pc-cover-card { max-width: 100%; }
    .pc-cover-close { top: -10px; right: -10px; width: 30px; height: 30px; font-size: 14px; }
}

/* Champion-pick flag sits immediately to the LEFT of the player name. */
.lb-champ-flag {
    width: 18px; height: 13px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: -2px;
    margin-right: 5px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

/* =================== Admin bracket editor =================== */
.bracket-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 820px) {
    .bracket-layout { grid-template-columns: 1fr; }
}

.bracket-palette {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    position: sticky; top: 10px;
    align-self: start;
    max-height: calc(100vh - 24px);
    display: flex; flex-direction: column;
}
@media (max-width: 820px) {
    .bracket-palette { position: static; max-height: 320px; }
}
.bracket-palette-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.bracket-palette-head input {
    width: 100%; padding: 6px 10px;
    background: rgba(255,255,255,.04);
    color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
    font-size: 13px;
}
.bracket-team-list {
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
    padding-right: 4px;
}
.bracket-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    font-size: 13px;
}
.bracket-chip:hover { background: rgba(255,255,255,.08); }
.bracket-chip:active { cursor: grabbing; }
.bracket-chip-flag { width: 18px; height: 14px; border-radius: 2px; flex: 0 0 auto; object-fit: cover; }
.bracket-chip-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-chip-group {
    font-size: 10px; color: var(--ink-dim);
    background: rgba(255,255,255,.05); padding: 1px 5px; border-radius: 3px;
    flex: 0 0 auto;
}
.bracket-chip-dragging { opacity: .4; }
.bracket-chip-picked {
    background: rgba(120,180,255,.15);
    border-color: rgba(120,180,255,.6);
    box-shadow: 0 0 0 1px rgba(120,180,255,.4);
}

.bracket-grid { display: flex; flex-direction: column; gap: 18px; }
.bracket-stage {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 14px 12px;
}
.bracket-stage-h { margin: 0 0 10px; font-size: 16px; color: var(--ink); }
.bracket-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.bracket-match {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}
.bracket-match-meta { font-size: 11px; color: var(--ink-dim); margin-bottom: 6px; }
.bracket-vs { text-align: center; font-size: 10px; color: var(--ink-dim); padding: 2px 0; }

.bracket-slot {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border: 1px dashed var(--line);
    border-radius: 5px;
    min-height: 30px;
    font-size: 13px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.bracket-slot-filled {
    border-style: solid;
    background: rgba(255,255,255,.03);
}
.bracket-slot-hover {
    background: rgba(120,180,255,.18);
    border-color: rgba(120,180,255,.7);
    border-style: solid;
}
.bracket-slot-saving  { opacity: .55; }
.bracket-slot-ok {
    background: rgba(120,220,160,.18);
    border-color: rgba(120,220,160,.6);
    border-style: solid;
}
.bracket-slot-err {
    background: rgba(255,90,90,.18);
    border-color: rgba(255,90,90,.6);
    border-style: solid;
}
.bracket-slot-flag { width: 18px; height: 14px; border-radius: 2px; flex: 0 0 auto; object-fit: cover; }
.bracket-slot-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bracket-slot-empty { color: var(--ink-dim); font-style: italic; flex: 1 1 auto; }
.bracket-slot-clear {
    border: none; background: transparent;
    color: var(--ink-dim); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px;
}
.bracket-slot-clear:hover { color: var(--accent-2); }
