/* Two fonts, cleanly: Oswald for titles + all display bits (scores, tickets,
   chips, stats, labels), League Spartan for body/everything-else text. */
@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700;800&family=Oswald:wght@400;500;600;700&display=swap');

/* ── Theme tokens ────────────────────────────────────────────────────────────
   Neutral near-black / off-white base with the brand green + gold used only as
   accents. Dark is the default; light applies on [data-theme="light"] or when
   the OS prefers light (unless the user has forced dark). */
:root {
  color-scheme: dark;
  --bg:            #0E100F;  /* page background (near-black, faint green cast) */
  --surface:       #191C1A;  /* cards / header / nav */
  --surface-2:     #101312;  /* inputs, wells, quiet fills */
  --surface-3:     #202422;  /* elevated cards: chips, tickets, rows */
  --border:        #2C302D;
  --border-strong: #454B47;
  --text:          #F1F3F0;
  --text-muted:    #A6ACA5;
  --text-faint:    #7B817B;
  --accent:        #FFD98A;  /* stadium gold — signature accent */
  --accent-hover:  #FFE8B4;
  --on-accent:     #20180A;  /* ink on gold fills */
  --green:         #4CB25C;  /* field-green accent */
  --green-ink:     #06210C;
  --red:           #F26B6B;
  --red-bg:        #2C1211;

  /* Back-compat aliases so existing var(--field-*) usages resolve to tokens */
  --field-deep:  var(--bg);
  --field:       var(--surface);
  --field-light: var(--surface);
  --field-input: var(--surface-2);
  --border-mine: var(--border-strong);
  --white:       var(--text);
  --black:       var(--border-strong);
}

/* Light palette */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:            #F4F5F2;
  --surface:       #FFFFFF;
  --surface-2:     #EEF0EC;
  --surface-3:     #FFFFFF;
  --border:        #E1E4DE;
  --border-strong: #C7CCC5;
  --text:          #161917;
  --text-muted:    #565C56;
  --text-faint:    #828981;
  --accent:        #C8890B;
  --accent-hover:  #B67C08;
  --on-accent:     #241A00;
  --green:         #2E8B40;
  --green-ink:     #FFFFFF;
  --red:           #D84A4A;
  --red-bg:        #FBE7E7;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:            #F4F5F2;
    --surface:       #FFFFFF;
    --surface-2:     #EEF0EC;
    --surface-3:     #FFFFFF;
    --border:        #E1E4DE;
    --border-strong: #C7CCC5;
    --text:          #161917;
    --text-muted:    #565C56;
    --text-faint:    #828981;
    --accent:        #C8890B;
    --accent-hover:  #B67C08;
    --on-accent:     #241A00;
    --green:         #2E8B40;
    --green-ink:     #FFFFFF;
    --red:           #D84A4A;
    --red-bg:        #FBE7E7;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--field-deep); }
body { color: var(--text); font-family: 'League Spartan', sans-serif; min-height: 100vh; }

.hidden { display: none !important; }

/* Header */
.header {
  background: var(--field);
  border-bottom: 1px solid var(--border);
  /* Bar spans full width; its contents align to the same centered column as .content */
  padding: 16px max(24px, calc((100% - 640px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow: hidden; /* contain the wordmark floodlight glow */
}
/* Wordmark centered in the header; actions (Share) stay pinned to the right. */
.logo { position: absolute; left: 50%; transform: translateX(-50%); font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700; color: var(--white); letter-spacing: 1.5px; text-transform: uppercase; }
.logo span { color: var(--accent); }
/* Warm floodlight glow behind the wordmark, like stadium lights */
.logo::before { content: ""; position: absolute; inset: -130% -45%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, rgba(255,233,168,0.28), transparent 68%); }
.who { font-size: 12px; color: var(--white); }

/* No side gutter — cards run the full width of the screen. */
.content { padding: 16px 0; max-width: 640px; margin: 0 auto; }

/* Cards */
.card { background: var(--field-light); border-radius: 12px; padding: 24px; margin-bottom: 18px; }
.card-title { font-family: 'Oswald', sans-serif; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--white); font-weight: 700; margin-bottom: 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.field input, .field select {
  background: var(--field-input); border: 1px solid var(--border); border-radius: 7px; color: var(--text);
  font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 10px 12px; outline: none; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--white); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Date input shouldn't stretch full width — keep it compact and centered */
input[type="date"] { max-width: 200px; align-self: center; text-align: center; }

/* "Enter manually" toggle under the status form */
.manual-link { text-align: center; margin-top: 12px; }
.manual-link a { color: var(--text-muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.manual-link a:hover { color: var(--green); }

/* Buttons */
.btn { padding: 10px 18px; border-radius: 7px; border: none; font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); width: 100%; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--white); color: var(--white); }
.btn-danger { background: var(--red); color: #FFFFFF; }
.btn-danger:hover { background: #DC2626; }
.btn-stop { background: none; border: 1px solid var(--red); color: var(--red); padding: 7px 14px; font-size: 12px; cursor: pointer; border-radius: 7px; font-weight: 700; }
.btn-stop:hover { background: var(--red-bg); }
.btn-row { display: flex; gap: 8px; }
.btn-watch { width: auto; flex: 0 0 auto; padding: 7px 12px; font-size: 12px; }
.game-group .btn-row .btn-ghost { flex: 1; }

/* Status banner */
.watching-banner { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--surface-2); border: 1px solid var(--green); border-radius: 8px; padding: 14px 16px; gap: 10px; }
.watching-banner .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.watching-banner .game { font-size: 15px; font-weight: 600; margin-top: 2px; color: var(--white); }
.watching-banner .rooting { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.watcher-rooting { font-size: 11px; color: var(--text-muted); }
.watcher-inperson { font-size: 11px; }

/* Checkbox row (e.g. "watching in person") */
.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--field-input); border: 1px solid var(--border); border-radius: 8px;
  padding: 13px 14px; margin: 4px 0 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.checkbox-row:hover { border-color: var(--text-muted); }
.checkbox-row:has(input:checked) { border-color: var(--green); background: var(--surface-2); }
.checkbox-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }

/* Game groups — "stadium scoreboard" cards: amber body, team-color edge bars,
   a header strip with the league + a live/upcoming tag, and a dark LED score
   panel in the middle. */
.game-group { position: relative; overflow: hidden; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px 16px; margin-bottom: 12px; }
.game-group.mine { border-color: var(--accent); }

/* ── Live tab: centered filter toggle + side-scrolling "who's watching" strip ── */
.board-toggle.board-toggle-center { display: flex; width: max-content; max-width: 100%; margin: 0 auto 12px; }
/* The Live tab's Friends/Everyone toggle: a pill track with a soft floating
   highlight instead of two bordered buttons glued together. */
#board-toggle.board-toggle-center {
  display: flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 0;
}
#board-toggle.board-toggle-center .seg {
  border: none; background: transparent; border-radius: 999px; cursor: pointer;
  padding: 6px 16px; font-size: 11px; font-weight: 700; color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
#board-toggle.board-toggle-center .seg + .seg { border-left: none; }
#board-toggle.board-toggle-center .seg.active { background: var(--accent); color: var(--on-accent); }
.wstrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.wstrip-empty { color: var(--text-faint); font-size: 13px; padding: 4px 2px 14px; }

/* Permanent fixture above the live board: a scrolling ticker of yesterday's
   final scores. */
.score-ticker { display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; margin-bottom: 12px; overflow: hidden; }
.score-ticker-label {
  flex: none; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10px; line-height: 1.3;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); text-align: center;
  padding-right: 10px; border-right: 1px solid var(--border);
}
.score-ticker-track { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.score-ticker-items { display: flex; width: max-content; animation: tickerScroll 32s linear infinite; }
.score-ticker:hover .score-ticker-items, .score-ticker.paused .score-ticker-items { animation-play-state: paused; }
.ticker-item { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-family: 'Oswald', sans-serif; white-space: nowrap; }
.ticker-team { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 3px 5px; border-radius: 6px; }
.ticker-team.win { color: var(--text); font-weight: 700; }
/* A favorite team gets a gold-tinted pill so it pops out of the scroll. */
.ticker-team.fav { background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.ticker-team.fav.win { color: var(--accent-hover); }
.ticker-logo { display: block; width: 18px; height: 18px; object-fit: contain; }
.ticker-score { line-height: 1; font-size: 12px; font-weight: 700; color: var(--text); }
.ticker-dash { line-height: 1; color: var(--text-faint); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .score-ticker-items { animation: none; }
  .score-ticker-track { overflow-x: auto; }
}

.wcard { flex: 0 0 auto; width: 112px; scroll-snap-align: start; background: var(--surface-3); color: var(--text); border-radius: 10px; padding: 6px 8px 7px; border: 1px solid var(--border); cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.wcard:hover { transform: translateY(-2px); }
.wcard.mine { border-color: var(--green); }
.wtop { display: flex; align-items: center; justify-content: space-between; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 8px; letter-spacing: 0.6px; text-transform: uppercase; }
.wleague { opacity: 0.85; }
.wtag { opacity: 0.55; }
.wlive { display: inline-flex; align-items: center; gap: 3px; color: var(--red); }
.wlive-time { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 9px; letter-spacing: 0.2px; color: var(--text); text-align: center; max-width: 100%; }
.wdot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); animation: livePulse 1.4s ease-in-out infinite; }
.wrow { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 3px; gap: 3px; }
.wrow.single { justify-content: center; }
.wteam { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 30px; min-width: 0; }
.wlogo-slot { display: inline-flex; align-items: center; justify-content: center; height: 18px; }
.wlogo { width: 18px; height: 18px; object-fit: contain; }
.wabbr { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 9px; letter-spacing: 0.2px; }
.wrecord { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 9px; color: var(--text); white-space: nowrap; }
.wsingle { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.wmid { display: flex; align-items: center; gap: 2px; }
/* Scores tab only: the live-status line stacks above the score in this slot
   (see renderScoreGame in app.js). The Live tab's currently-watching card
   uses the same .wmid class but never gained a status line, so it stays a
   plain row — scoping this to .score-chip keeps that card unaffected. */
.score-chip .wmid { flex-direction: column; justify-content: center; gap: 1px; min-width: 0; }
.wscore-line { display: flex; align-items: center; gap: 2px; }
.wscore { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 16px; line-height: 1; }
.wcolon { opacity: 0.35; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; }
.wat { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; opacity: 0.45; }
.wfoot { display: flex; align-items: center; gap: 4px; border-top: 1px dashed var(--border); padding-top: 5px; }
.wavs { display: flex; align-items: center; }
.wav { display: inline-flex; margin-left: -5px; }
.wav:first-child { margin-left: 0; }
.wstrip .avatar-sm { width: 16px; height: 16px; font-size: 8px; border: 1.5px solid var(--surface-3); }
.wav.me .avatar-sm { border-color: var(--green); }
.wchat { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10px; color: var(--text-muted); }
.wchat .ui-icon { width: 11px; height: 11px; }
.wchat .chat-dot { margin-left: 1px; }

/* ── Live tab: "The Sideline" memory feed ─────────────────────────────────── */
#memory-feed { margin-top: 20px; }
.post { background: var(--field-light); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; margin-bottom: 12px; cursor: pointer; transition: border-color 0.12s; }
.post:hover { border-color: var(--white); }
.post-head { display: flex; align-items: center; gap: 9px; }
.post-head .avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.post-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.post-name { color: var(--white); font-weight: 700; font-size: 14px; }
.post-sub { color: var(--text-faint); font-size: 11px; text-transform: capitalize; }
.post-time { margin-left: auto; color: var(--text-faint); font-size: 11px; white-space: nowrap; align-self: flex-start; }
/* Delete control for your own shared posts */
.post-del { align-self: flex-start; flex-shrink: 0; margin-left: 8px; padding: 3px; border: none; background: none; cursor: pointer; color: var(--text-faint); line-height: 0; border-radius: 6px; transition: color 0.13s, background 0.13s; }
.post-del:hover { color: var(--red); background: var(--red-bg); }
.post-del .ui-icon { width: 15px; height: 15px; }
/* The game line is the same ticket stub used on the profile, for consistency */
.post .stub { --stub-notch: var(--surface); margin: 11px 0; }
.post .stub .history-game,
.post .stub .history-game .hist-at,
.post .stub .history-sub,
.post .stub .hist-final { color: var(--text); }
.post .stub .history-game .team-won { color: var(--accent); font-weight: 800; }
.post-mem { color: var(--text); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; margin-top: 10px; }
/* Two-emoji reactions on a Sideline post */
.post-reacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; line-height: 1; color: var(--text-muted);
  transition: border-color 0.13s, background 0.13s, transform 0.08s;
}
.react-btn:hover { border-color: var(--border-strong); }
.react-btn:active { transform: scale(0.94); }
.react-btn.on { border-color: var(--accent); background: var(--surface-3); color: var(--text); }
.react-emoji { font-size: 15px; }
.react-count { font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 700; }
.react-count:empty { display: none; }
/* Comment button (same pill as reactions) */
.post-comment-btn {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; margin-left: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; line-height: 1; color: var(--text-muted);
  transition: border-color 0.13s, background 0.13s, transform 0.08s;
}
.post-comment-btn:hover { border-color: var(--border-strong); color: var(--text); }
.post-comment-btn:active { transform: scale(0.94); }
.post-comment-btn .ui-icon { width: 15px; height: 15px; }
.pc-count { font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 700; }
.pc-count:empty { display: none; }

/* Comments modal */
.comments-modal { display: flex; flex-direction: column; max-height: 82vh; }
.comments-list { flex: 1; overflow-y: auto; margin: 14px 0; display: flex; flex-direction: column; gap: 14px; min-height: 110px; max-height: 52vh; }
.comment { display: flex; gap: 9px; }
.comment-av { flex-shrink: 0; }
.comment-av .avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-time { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.comment-del { margin-left: auto; flex-shrink: 0; padding: 2px; border: none; background: none; cursor: pointer; color: var(--text-faint); line-height: 0; border-radius: 5px; transition: color 0.13s, background 0.13s; }
.comment-del:hover { color: var(--red); background: var(--red-bg); }
.comment-del .ui-icon { width: 13px; height: 13px; }
.comment-text { font-size: 14px; color: var(--text); line-height: 1.45; margin-top: 2px; overflow-wrap: anywhere; }
.comments-input-row { display: flex; gap: 8px; }
.comments-input-row input {
  flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 10px 12px; outline: none;
}
.comments-input-row input:focus { border-color: var(--accent); }
.comments-input-row .btn { width: auto; flex-shrink: 0; padding: 10px 14px; display: inline-flex; align-items: center; }
.comments-input-row .btn .ui-icon { width: 16px; height: 16px; }
.post-photo { display: block; width: 100%; border-radius: 10px; margin-top: 10px; border: 1px solid var(--border); }
/* Team-color edge bars down each side (filled in JS from team colors) */
.gg-edge { position: absolute; top: 0; bottom: 0; width: 6px; pointer-events: none; }
.gg-edge.home { left: 0; }
.gg-edge.away { right: 0; }
.gg-edge:not([style*="background"]) { display: none; }
/* Header strip: league pill on the left, live/upcoming tag on the right */
.gg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.gg-league { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); padding: 3px 11px; border-radius: 20px; }
.gg-tag { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.gg-live { display: inline-flex; align-items: center; gap: 6px; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--red); }
.gg-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: livePulse 1.4s ease-in-out infinite; }
/* Matchup body: home | LED panel | away */
.gg-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.gg-body.single { grid-template-columns: 1fr auto; }
.gg-side { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-align: center; }
.gg-logo-slot { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 40px; }
.gg-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.gg-name { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text); line-height: 1.05; overflow-wrap: anywhere; }
.gg-single { text-align: center; font-size: 15px; font-weight: 700; color: var(--text); }
/* Center stack: the LED panel with a small status line underneath */
.gg-center { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.gg-panel { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 16px; }
/* Seven-segment digits, with a monospace fallback while the font loads */
.gg-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 26px; line-height: 1; color: var(--text); }
.gg-num.lose { color: var(--text-faint); }
.gg-colon { font-family: 'Oswald', sans-serif; color: var(--text-faint); font-size: 22px; line-height: 1; }
/* Start time keeps the readable condensed face (seven-segment can't render "PM") */
.gg-start { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; color: var(--text); letter-spacing: 0.3px; white-space: nowrap; }
.gg-clock { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); text-align: center; }
.gg-clock.live { color: var(--red); opacity: 1; }
.gg-sub { display: flex; justify-content: center; }
/* Buttons need dark-on-amber contrast, matching the score cards */
.game-group .btn-primary { background: var(--accent); color: var(--on-accent); }
.game-group .btn-primary:hover { background: var(--accent-hover); }
.game-group .btn-ghost { border: 1px solid var(--border); color: var(--text); }
.game-group .btn-ghost:hover { border-color: var(--text-muted); background: var(--surface-2); }
.game-group-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.game-title { font-size: 15px; font-weight: 700; color: var(--white); }
.game-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.game-score { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12px; color: var(--text-muted); }
.game-score .gs-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; color: var(--white); }
.game-score .gs-status { color: var(--text-muted); }
.game-score.live .gs-status { color: var(--accent); font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #EF4444; flex-shrink: 0; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.chat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; margin-left: 7px; vertical-align: middle; }

/* Quick "Start Watching" popup */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--field-light); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 100%; max-width: 360px; }
.modal-title { font-family: 'Oswald', sans-serif; font-size: 17px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--white); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-sub { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
/* Cleaner, roomier fields + a warmer focus state inside modals */
.modal .field { margin-bottom: 15px; }
.modal .field label { letter-spacing: 0.8px; }
.modal .field input, .modal .field select { padding: 12px 13px; border-radius: 9px; transition: border-color 0.14s, box-shadow 0.14s; }
.modal .field input:hover, .modal .field select:hover { border-color: var(--text-muted); }
.modal .field input:focus, .modal .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 233, 168, 0.13); }
/* Give the primary action a little lift */
.modal .btn-primary { padding-top: 12px; padding-bottom: 12px; box-shadow: 0 4px 14px rgba(255, 233, 168, 0.18); }
.modal .btn-primary:hover { box-shadow: 0 6px 18px rgba(255, 233, 168, 0.26); }
/* Log a Game modal: a gold badge on the title (echoing the + FAB) and a
   hairline that separates the header from the form. */
#log-modal .modal-title .ui-icon { width: 26px; height: 26px; padding: 5px; box-sizing: border-box; background: var(--accent); color: var(--on-accent); border-radius: 50%; }
#log-modal .modal-sub { padding-bottom: 15px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.modal-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin: 18px 0 8px; }
.modal-optional { text-transform: none; letter-spacing: 0; color: var(--text-faint); font-weight: 400; }
.rooting-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.root-opt {
  cursor: pointer; background: var(--field-input); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-muted); font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 600; padding: 8px 14px;
}
.root-opt.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.modal .checkbox-row { margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.sport-chip { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 4px; background: var(--surface-2); color: var(--text-muted); text-transform: uppercase; white-space: nowrap; }

.watcher-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; margin-bottom: 12px; }
/* Who's-watching as a small admission-ticket stub sitting on the amber card:
   a torn tab with the head count, a dashed perforation with punched notches
   (colored like the card so they read as cut-outs), then a row of avatars. */
.watch-ticket {
  position: relative; overflow: hidden; display: flex; align-items: stretch;
  color: var(--text); border-radius: 8px; margin-top: 12px; --notch: 6px;
  filter:
    drop-shadow(1px 0 0 var(--border-strong)) drop-shadow(-1px 0 0 var(--border-strong))
    drop-shadow(0 1px 0 var(--border-strong)) drop-shadow(0 -1px 0 var(--border-strong))
    drop-shadow(0 2px 4px rgba(0,0,0,0.30));
}
.watch-ticket::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--surface-3); border-radius: 8px;
  -webkit-mask:
    radial-gradient(circle var(--notch) at 44px 0,    #0000 var(--notch), #000 calc(var(--notch) + 0.5px)),
    radial-gradient(circle var(--notch) at 44px 100%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px));
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.watch-ticket-tab { position: relative; flex: 0 0 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.watch-ticket-tab::after { content: ""; position: absolute; top: 8px; bottom: 8px; right: -1px; border-right: 2px dashed var(--border); }
.wt-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px; line-height: 1; color: var(--text); }
.wt-cap { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.watch-ticket-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.wt-avs { display: flex; align-items: center; flex-shrink: 0; }
.watch-ticket-label { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Overlapping avatars inside the ticket (name on tap → profile) */
.watcher-av { position: relative; display: inline-flex; margin-left: -8px; cursor: pointer; transition: transform 0.12s; }
.watcher-av:first-child { margin-left: 0; }
.watcher-av:hover { transform: translateY(-2px); z-index: 2; }
.watch-ticket .avatar-sm { width: 30px; height: 30px; font-size: 12px; border: 2px solid var(--surface-3); }
.watch-ticket .watcher-av.me .avatar-sm { border-color: var(--green); }
.watcher-av-pin { position: absolute; right: -3px; bottom: -3px; background: var(--field-deep); border-radius: 50%; padding: 2px; display: inline-flex; }
.watcher-av-pin .ui-icon { width: 10px; height: 10px; color: var(--text); }

.empty-state { text-align: center; padding: 46px 24px; color: var(--text-faint); }
.empty-state h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto; line-height: 1.5; }
/* Gold line illustration above the copy on empty screens */
.empty-art { width: 84px; height: 84px; color: var(--accent); opacity: 0.62; margin: 0 auto 16px; display: block; }
/* Retryable error state — shown when a fetch failed rather than came back empty */
.load-error .load-retry { margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; }
.load-error .load-retry svg { width: 15px; height: 15px; }

.name-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; text-align: center; background: var(--field-deep); }
.name-prompt .card { max-width: 360px; width: 100%; text-align: left; }
.name-prompt p { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }

/* Chat */
.chat-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  color: var(--white); font-size: 13px; font-weight: 700;
  background: var(--field-light); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.back-btn:hover { background: var(--field-input); border-color: var(--white); }
.chat-title { font-size: 15px; font-weight: 700; color: var(--white); }
.chat-window { background: var(--field-light); border-radius: 12px; padding: 16px; height: 420px; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.4; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
.msg.theirs { align-self: flex-start; background: var(--field-input); color: var(--white); }
.msg-author { font-size: 10px; opacity: 0.7; margin-bottom: 3px; font-weight: 600; }
.msg-empty { color: var(--text-faint); font-size: 13px; text-align: center; margin: auto; }
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-row input { flex: 1; background: var(--field-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 10px 14px; outline: none; }
.chat-input-row input:focus { border-color: var(--white); }
.chat-input-row button { background: var(--accent); color: var(--on-accent); border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; }

.refresh-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.last-updated { font-size: 11px; color: var(--text-faint); font-family: 'Oswald', sans-serif; }

/* Live tab header — center the "Live Now" heading so the top of the board
   reads centered, like the profile header. (The Friends/Everyone toggle's
   own centering lives with its other rules, above.) */
#board-view .refresh-row { flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0 16px; }

/* Textarea (shares field styling) */
.field textarea {
  background: var(--field-input); border: 1px solid var(--border); border-radius: 7px; color: var(--text);
  font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 10px 12px; outline: none; width: 100%; resize: vertical;
}
.field textarea:focus { border-color: var(--white); }

/* Sign-in */
.g-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--field-deep); color: var(--white);
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; margin-right: 8px; vertical-align: middle;
}
/* Apple logo on the Sign in with Apple button */
.apple-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 8px; vertical-align: middle; color: var(--text); }
.apple-icon svg { width: 100%; height: 100%; display: block; margin-top: -1px; }
#apple-signin-btn { display: inline-flex; align-items: center; justify-content: center; }
#signin-screen .btn { width: 100%; margin-top: 8px; }
.signin-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.signin-divider::before, .signin-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.link-btn { display: block; width: 100%; background: none; border: none; cursor: pointer; margin-top: 12px; color: var(--text-muted); font-family: 'League Spartan', sans-serif; font-size: 12px; text-decoration: underline; text-align: center; }
.link-btn:hover { color: var(--green); }
.signin-error { margin-top: 14px; color: var(--red); font-size: 12px; }
.signin-error.ok { color: var(--white); }

/* Header profile button */
.who { display: flex; align-items: center; gap: 4px; }
.who-invite {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 700; font-family: 'League Spartan', sans-serif; line-height: 1;
  padding: 8px 14px; border-radius: 7px;
}
.who-invite:hover { background: var(--surface); border-color: var(--border-strong); }
.who-profile {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--field-light); border: 1px solid var(--border);
  color: var(--white); font-size: 13px; font-weight: 500; font-family: 'League Spartan', sans-serif;
  padding: 7px 12px; border-radius: 7px;
}
.who-profile:hover { border-color: var(--white); background: var(--field-input); }

/* Header icon buttons: theme toggle + messages */
.theme-toggle, .who-msg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: color 0.13s, border-color 0.13s, background 0.13s;
}
.theme-toggle:hover, .who-msg:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .ui-icon, .who-msg .ui-icon { width: 17px; height: 17px; }
/* Unseen-conversation count on the messages button */
.who-msg { position: relative; overflow: visible; }
.hdr-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 9px; border: 2px solid var(--surface);
}

/* Messages inbox */
.msg-inbox { padding: 6px; }
.msg-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 11px 12px; border-radius: 10px;
  border-bottom: 1px solid var(--border); position: relative;
}
.msg-row:last-child { border-bottom: none; }
.msg-row:hover { background: var(--surface-2); }
.msg-row-av { flex-shrink: 0; }
.msg-row-av .avatar-sm { width: 40px; height: 40px; font-size: 15px; }
.msg-group-av { background: var(--surface-3); color: var(--accent); border: 1px solid var(--border); }
.msg-group-av .ui-icon { width: 18px; height: 18px; }
.msg-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg-row-top { display: flex; align-items: baseline; gap: 8px; }
.msg-row-name { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row-time { margin-left: auto; flex-shrink: 0; font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.msg-row-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row.unseen .msg-row-name, .msg-row.unseen .msg-row-preview { color: var(--text); font-weight: 700; }
.msg-row-dot { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* Activity: who's reacted to or commented on your posts */
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.activity-row.activity-clickable { cursor: pointer; border-radius: 10px; padding: 11px 8px; margin: 0 -8px; transition: background 0.12s; }
.activity-row.activity-clickable:hover { background: var(--surface-2); }
.activity-info { flex: 1; min-width: 0; }
.activity-line { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-line strong { font-weight: 700; }
.activity-post { color: var(--text-muted); }
.activity-comment { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 3px; }
.activity-time { font-size: 11px; flex-shrink: 0; white-space: nowrap; margin-top: 1px; }

/* Avatars */
/* Avatars: a real photo when uploaded, otherwise the person's initials on a
   circle. Photo <img> covers the initials, which stay as a fallback. */
.avatar-sm {
  position: relative; overflow: hidden; flex-shrink: 0; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--field-input);
  color: var(--accent); font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10px; letter-spacing: 0.3px;
}
.avatar-lg {
  position: relative; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 14px; background: var(--field-input);
  color: var(--accent); font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: 0.5px;
}
.avatar-md {
  position: relative; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--field-input);
  color: var(--accent); font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 0.3px;
}
.avatar-sm img, .avatar-lg img, .avatar-md img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Profile-photo editor */
.photo-edit { display: flex; align-items: center; gap: 14px; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.field-hint-inline { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); opacity: 0.6; font-size: 11px; }

/* Profile page */
.profile-top { display: flex; flex-direction: row; align-items: center; gap: 14px; }
.profile-id { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; text-align: left; }
.profile-nameline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-name { font-size: 20px; font-weight: 700; color: var(--white); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
/* The header keeps the same left-aligned row whether or not there's a bio, so a
   bio-less profile (avatar left, name + games stacked, actions right) stays
   balanced instead of bunching everything into the middle. */
.fact { font-size: 12px; color: var(--text-muted); background: var(--field-input); border-radius: 20px; padding: 4px 10px; }
.profile-bio { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin: 2px 0 0; text-align: left; }
.profile-games { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
.profile-games strong { font-size: 15px; font-weight: 700; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 18px; }
.stat { background: var(--field-input); border-radius: 10px; padding: 14px 10px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--white); font-family: 'Oswald', sans-serif; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* Compact the main profile identity card (avatar, name, favorites, stats) */
#profile-body > .card:first-child { padding: 14px; margin-bottom: 12px; }
#profile-body > .card:first-child .avatar-lg { width: 46px; height: 46px; font-size: 19px; border-radius: 11px; }
#profile-body > .card:first-child .profile-name { font-size: 18px; }
#profile-body > .card:first-child .profile-top { gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
#profile-body > .card:first-child .card-subtitle { margin-top: 10px !important; }
#profile-body > .card:first-child .fav-team-grid { margin-top: 4px; }
#profile-body > .card:first-child .stats-row { margin-top: 8px; }
#profile-body > .card:first-child .stat { padding: 4px 8px; }
#profile-body > .card:first-child .stat-num { font-size: 19px; }
/* Small Edit/Message action, right-aligned on the name line next to the sport */
.profile-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.profile-actions .btn { width: auto; padding: 6px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.profile-actions .btn .ui-icon { width: 16px; height: 16px; }

/* Call-to-action row that sits between the identity box and the favorite teams:
   Invite (or Add-Friend / friends indicator) plus a link to the full friends
   list. The two buttons split the width evenly. */
.profile-cta { display: flex; gap: 8px; margin-top: 12px; }
.profile-cta .btn { flex: 1; width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; font-size: 13px; }
.profile-cta .btn .ui-icon { width: 16px; height: 16px; }

/* ── Profile: full amber cards ─────────────────────────────────────────── */
#profile-body .card { background: var(--surface); color: var(--text); }
/* Text sitting directly on the amber card is solid black */
#profile-body .profile-name,
#profile-body .profile-bio,
#profile-body .profile-games,
#profile-body .profile-games strong,
#profile-body .card-title,
#profile-body .card-subtitle,
#profile-body .card-sub,
#profile-body .stat-line,
#profile-body .stat-line strong,
#profile-body .stat-line .muted,
#profile-body .stat-num,
#profile-body .stat-label,
#profile-body .fact,
#profile-body .ftb-name,
#profile-body .ftb-star,
#profile-body .sport-bar-label,
#profile-body .sport-bar-num,
#profile-body .rooting-inperson,
#profile-body .history-game,
#profile-body .history-game .hist-at,
#profile-body .history-sub,
#profile-body .hist-final,
#profile-body .hist-inperson,
#profile-body .hist-rooting,
#profile-body .hist-del,
#profile-body .friend-id,
#profile-body .field label,
#profile-body .msg-empty { color: var(--text); }
#profile-body .hist-first-visit { color: var(--accent); }
#profile-body .stat-line,
#profile-body .friend-row { border-bottom-color: var(--border); }
/* Flat amber — no wells behind inner content */
#profile-body .stat,
#profile-body .fav-team-box,
#profile-body .fact,
#profile-body .sport-bar { background: transparent; }
#profile-body .sport-bar-fill,
#profile-body .sport-bar-fill.rooting { background: var(--accent); }
#profile-body .sport-bar-row.rooting-clickable:hover { background: transparent; }
/* History rows separated by a hairline instead of a tile */
#profile-body .history-game .team-won { color: var(--accent); font-weight: 800; }

/* ── Watch history as ticket stubs ─────────────────────────────────────── */
.stub {
  position: relative; overflow: hidden;
  display: flex; align-items: stretch; justify-content: flex-start; gap: 0;
  color: var(--text); padding: 0; border-radius: 9px;
  --notch: 7px;
  /* A 4-way 1px drop-shadow traces the notched silhouette below, so the outline
     is the shape of the ticket rather than a plain box. */
  filter:
    drop-shadow(1px 0 0 var(--border-strong)) drop-shadow(-1px 0 0 var(--border-strong))
    drop-shadow(0 1px 0 var(--border-strong)) drop-shadow(0 -1px 0 var(--border-strong));
}
/* The ticket surface, with real notches punched out of the perforation line
   (tab is 46px wide) so the background shows through and the outline dips in. */
.stub::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--surface-3); border-radius: 9px;
  -webkit-mask:
    radial-gradient(circle var(--notch) at 46px 0,    #0000 var(--notch), #000 calc(var(--notch) + 0.5px)),
    radial-gradient(circle var(--notch) at 46px 100%, #0000 var(--notch), #000 calc(var(--notch) + 0.5px));
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* Tear-off tab: away logo, vertical sport label, home logo — stacked */
.stub-tab {
  position: relative;
  flex: 0 0 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 0;
}
/* Perforation dashes run between the notches (not to the edges), so they don't
   poke through the punch-outs or get traced by the ticket outline. */
.stub-tab::after {
  content: ""; position: absolute; top: 9px; bottom: 9px; right: -1px;
  border-right: 2px dashed var(--border);
}
.stub-sport {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase;
  writing-mode: vertical-rl; transform: rotate(180deg);
}
.stub-tab .hist-logo-slot:empty { display: none; }
.stub-body { position: relative; flex: 1; min-width: 0; padding: 10px 12px; }
/* Reserve room for the top-right controls (pin + delete) so a long game line
   never runs under them. Only on tickets that actually have the controls. */
.stub:has(.stub-controls) .stub-body { padding-right: 56px; }
.hist-logo { width: 20px; height: 20px; object-fit: contain; display: block; }
/* Owner controls (pin + remove) cluster in the ticket's top-right corner */
.stub-controls { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; gap: 1px; }
.stub .hist-del, .stub .hist-pin { position: static; transform: none; background: none; border: none; cursor: pointer; padding: 3px; border-radius: 6px; line-height: 1; }
.stub .hist-pin { color: var(--text-faint); }
.stub .hist-pin.pinned { color: var(--accent); }
.stub .hist-pin.pinned .ui-icon { fill: currentColor; }
.stub .hist-pin:hover { background: var(--surface-2); color: var(--text); }
.stub .hist-pin .ui-icon, .stub .hist-del .ui-icon { width: 15px; height: 15px; display: block; }

/* "Pinned favorites" — square white ticket stubs sitting on the green page.
   No card behind them; each has a perforated tab and a torn bottom edge. */
.pinned-strip { margin: 0 0 18px; padding: 0 4px; }
.pinned-label { display: flex; align-items: center; justify-content: center; gap: 5px; font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--white); margin-bottom: 3px; }
.pinned-label .ui-icon { width: 14px; height: 14px; fill: currentColor; }
.pinned-sub { font-size: 12px; font-style: italic; color: var(--white); opacity: 0.85; margin-bottom: 10px; text-align: center; }
/* Four across in one row (they shrink to fit); capped so they don't get huge. */
.pinned-tickets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 460px; }
.pin-ticket {
  min-width: 0; position: relative; background: var(--surface-3); color: var(--text); aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden;
  border: 1px solid var(--border-strong); border-bottom: none;
  /* Torn bottom edge: scalloped bites cut out of the bottom strip. */
  --tear: 5px;
  -webkit-mask:
    radial-gradient(var(--tear) at 50% 100%, #0000 97%, #000) 50% 100% / calc(var(--tear)*2) var(--tear) repeat-x,
    linear-gradient(#000 0 0) 0 0 / 100% calc(100% - var(--tear)) no-repeat;
  mask:
    radial-gradient(var(--tear) at 50% 100%, #0000 97%, #000) 50% 100% / calc(var(--tear)*2) var(--tear) repeat-x,
    linear-gradient(#000 0 0) 0 0 / 100% calc(100% - var(--tear)) no-repeat;
}
/* Perforated tab across the top: sport + date, dashed tear line, punch notches. */
.pin-tab {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 6px; border-bottom: 2px dashed var(--border);
}
.pin-tab::before, .pin-tab::after {
  content: ""; position: absolute; bottom: -5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--field-deep);
}
.pin-tab::before { left: -5px; }
.pin-tab::after { right: -5px; }
.pin-date { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 9px; letter-spacing: 0.3px; color: var(--text-muted); white-space: nowrap; }
.pin-main { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 5px 7px 8px; min-height: 0; }
/* "ATTENDED" ink stamp for in-person games, matching the full ticket stubs. */
.pin-ticket.attended .pin-main::after {
  content: "ATTENDED"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-11deg); pointer-events: none;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1.5px;
  color: rgba(239,68,68,0.42); border: 2px solid rgba(239,68,68,0.42); border-radius: 3px; padding: 1px 5px; white-space: nowrap;
}
.pin-team { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pin-team .hist-logo { width: 16px; height: 16px; }
/* Slot keeps its width even when empty so the two team rows stay aligned. */
.pin-team .hist-logo-slot { display: inline-flex; align-items: center; flex: 0 0 16px; justify-content: center; }
.pin-abbr { font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; color: var(--text); }
.pin-team-score { margin-left: auto; font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.pin-team.won .pin-abbr, .pin-team.won .pin-team-score { color: var(--accent); }
.pin-remove {
  position: absolute; top: 2px; right: 2px; z-index: 1; background: var(--surface-2);
  border: none; cursor: pointer; padding: 1px; line-height: 1; color: var(--text-faint); border-radius: 4px;
}
.pin-remove:hover { color: var(--red); background: var(--surface); }
.pin-remove .ui-icon { width: 11px; height: 11px; display: block; }

/* Tickets are tappable to open a game memory. */
#profile-body .stub, .pin-ticket { cursor: pointer; }
.hist-memory { margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-memory .ui-icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 2px; }
/* Venue / broadcast detail lines on a ticket */
.hist-meta { margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta .ui-icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; opacity: 0.7; }
.hist-memory-add { opacity: 0.55; font-style: italic; }
/* Game memory modal */
.modal-title .ui-icon { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.memory-meta { color: var(--text-faint); font-size: 12px; margin-top: 4px; font-weight: 400; }
.memory-text {
  width: 100%; margin-top: 16px; background: var(--field-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px;
  line-height: 1.5; padding: 10px 12px; resize: vertical; outline: none;
}
.memory-text:focus { border-color: var(--white); }
.memory-read { margin-top: 16px; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.memory-vis { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); font-weight: 700; opacity: 0.75; }
.memory-vis .ui-icon { width: 13px; height: 13px; }
.memory-vis + .memory-read { margin-top: 6px; }
/* Memory photo — shown full-width (aspect kept) in the read view */
.memory-photo { display: block; width: 100%; margin-top: 16px; border-radius: 10px; border: 1px solid var(--border); }
.memory-photo + .memory-read { margin-top: 12px; }
/* Memory photo picker (editor): a small preview beside Add/Change + Remove */
.memory-photo-edit { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.memory-photo-preview {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--field-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.memory-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.mem-photo-empty { color: var(--text-faint); opacity: 0.5; }
.mem-photo-empty .ui-icon { width: 26px; height: 26px; }
.memory-photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.memory-photo-actions .btn { width: auto; padding: 7px 12px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.memory-photo-actions .btn .ui-icon { width: 15px; height: 15px; }
/* "Where'd you watch?" — editor field + read-only line */
.memory-where { margin-top: 14px; }
.memory-where label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.memory-where label .ui-icon { width: 14px; height: 14px; }
.memory-where input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
  color: var(--text); background: var(--field-input);
  border: 1px solid var(--border); border-radius: 10px;
}
.memory-where input::placeholder { color: var(--text-faint); opacity: 0.7; }
.memory-where-read { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--text-faint); font-size: 13px; font-weight: 600; }
.memory-where-read .ui-icon { width: 15px; height: 15px; flex-shrink: 0; }
/* A freshly-logged stub "prints in" like a ticket sliding out of the machine */
@keyframes stubPrint {
  0%   { opacity: 0; transform: translateY(26px) scale(0.98); }
  70%  { opacity: 1; transform: translateY(-2px) scale(1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.stub.printing { animation: stubPrint 380ms cubic-bezier(0.22, 1, 0.36, 1) both; }
/* In-person stamp thuds on a beat after the ticket lands */
@keyframes stampIn {
  0%, 45% { opacity: 0; transform: translateY(0) rotate(-9deg) scale(1.6); }
  70%     { opacity: 0.28; transform: translateY(0) rotate(-9deg) scale(0.92); }
  100%    { opacity: 0.22; transform: translateY(0) rotate(-9deg) scale(1); }
}
.stub.printing.attended .stub-body::after { animation: stampIn 620ms ease both; }

/* "ATTENDED" ink stamp for in-person games */
.stub.attended .stub-body::after {
  content: "ATTENDED"; position: absolute; right: 10px; bottom: 8px;
  transform: rotate(-9deg); pointer-events: none;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 3px;
  color: rgba(239,68,68,0.4); border: 2.5px solid rgba(239,68,68,0.4); border-radius: 4px; padding: 2px 8px;
}
#profile-body .hist-del:hover { color: var(--red); background: var(--surface-2); }
/* Buttons on amber cards go dark for contrast (sign-out stays outside cards) */
#profile-body .card .btn-primary { background: var(--accent); color: var(--on-accent); }
#profile-body .card .btn-ghost { border-color: var(--border); color: var(--text); }
/* Add Friend / Accept Request is a social action — green, not the gold CTA. */
#profile-body .card #friend-btn.btn-primary { background: var(--green); color: var(--green-ink); }
#friend-btn.btn-primary { background: var(--green); color: var(--green-ink); }

/* Compact the profile Stats card */
.stats-card { padding: 14px; }
.stats-card .card-title { margin-bottom: 10px; }
.stats-card .stat-line { padding: 6px 0; }
.stats-card .card-subtitle { margin: 12px 0 6px; }
.stats-card .sport-bar-item { margin: 8px 0; }
.stats-card .sport-bar-row { margin: 4px 0; }
.stats-card .sport-bar-row.rooting-clickable { margin: 2px -6px; }

/* Record hero card — the headline of the profile */
.record-card { text-align: center; padding: 12px; margin-bottom: 12px; }
.record-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--text-muted); }
/* In person · full record · Remotely, all on one row */
.record-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin-top: 6px; }
.record-center { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.record-hero { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 52px; line-height: 1; color: var(--accent); }
.record-sep { opacity: 0.4; margin: 0 4px; }
.record-caption { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.record-split { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.record-split-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.record-split-val { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px; color: var(--text); }
/* Win/loss/tie strength bar under the record hero */
.rec-strength { display: flex; height: 9px; border-radius: 6px; overflow: hidden; margin-top: 12px; border: 1px solid var(--border); }
.rec-strength i { display: block; height: 100%; }
.rs-w { background: var(--green); }
.rs-t { background: var(--border-strong); }
.rs-l { background: var(--red); }
.rec-strength-key { display: flex; justify-content: center; gap: 14px; margin-top: 7px; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
.rec-strength-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* Profile stat lines + by-sport breakdown */
.card-subtitle { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin: 18px 0 10px; }
.card-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); margin: -4px 0 14px; }

/* Live board Friends/Everyone segmented toggle */
.board-toggle { display: inline-flex; gap: 0; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.board-toggle .seg {
  cursor: pointer; background: var(--field-light); border: none;
  color: var(--text-muted); font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700;
  padding: 8px 16px; transition: background 0.12s, color 0.12s;
}
.board-toggle .seg + .seg { border-left: 1px solid var(--border); }
.board-toggle .seg.active { background: var(--accent); color: var(--on-accent); }

/* "Log Game" collapsible (What Are You Watching) */
.logwatch { padding: 14px; }
.logwatch-summary { list-style: none; cursor: pointer; }
.logwatch-summary::-webkit-details-marker { display: none; }
.logwatch-btn {
  display: block; width: 100%; text-align: center;
  background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 700; padding: 12px; border-radius: 8px;
}
.logwatch-btn:hover { background: var(--accent-hover); }
.logwatch[open] { padding: 24px; }
.logwatch[open] .logwatch-summary { margin-bottom: 16px; }

/* News page tabs (Team News / Trade Central) */
.news-tabs { margin: 4px 0 16px; }

/* Structured draft/transaction lists */
.struct-note { font-size: 12px; color: var(--white); font-weight: 700; margin-bottom: 12px; }
.struct-list { display: flex; flex-direction: column; gap: 8px; }
/* Transaction / draft-pick rows use the amber-on-black scheme too. */
.struct-row { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.pick-row { display: flex; align-items: center; gap: 12px; }
.pick-num { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--accent); width: 42px; flex-shrink: 0; text-align: center; }
.pick-player { font-size: 14px; font-weight: 700; color: var(--text); }
.pick-team { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.txn-date { font-size: 11px; color: var(--text-muted); font-family: 'Oswald', sans-serif; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.txn-desc { font-size: 13px; color: var(--text); line-height: 1.45; }

/* Add-to-home-screen guide blocks */
.install-block { padding: 0 24px 8px; }
.install-os { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin: 8px 0 4px; }
#install.os-ios .install-block[data-os="android"],
#install.os-android .install-block[data-os="ios"] { display: none; }

/* How-to-use collapsible guide */
.howto { padding: 0; }
.howto-summary {
  list-style: none; cursor: pointer; padding: 18px 24px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--white); font-weight: 700; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.howto-summary::-webkit-details-marker { display: none; }
.howto-summary::after { content: "▸"; color: var(--text-muted); font-size: 14px; transition: transform 0.15s ease; }
.howto[open] .howto-summary::after { transform: rotate(90deg); }
.howto-list { margin: 0; padding: 0 24px 22px 44px; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.howto-list li { margin-bottom: 10px; }
.howto-list li:last-child { margin-bottom: 0; }
.howto-list strong { color: var(--white); }
.howto-list em { color: var(--white); font-style: normal; font-family: 'Oswald', sans-serif; font-size: 12px; }
.howto-note {
  margin: 0 24px 22px; padding: 12px 14px; border-radius: 8px;
  background: var(--field-input);
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
}
.howto-note strong { color: var(--white); }
.btn-signout { width: 100%; }
.load-more-history { width: 100%; margin-top: 8px; }
.stat-lines { display: flex; flex-direction: column; }
.stat-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.stat-line:last-child { border-bottom: none; }
.stat-line strong { color: var(--white); font-weight: 700; text-align: right; }
.stat-line .muted { color: var(--text-muted); font-weight: 400; }
.league-stats-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 18px 0 10px; }
.league-stats-box .card-subtitle { margin-top: 0; }
.league-stats-picker select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; font-weight: 700; padding: 9px 12px; outline: none;
}
.league-stats-picker select:focus { border-color: var(--accent); }
.league-stats-lines { margin-top: 10px; }
.league-stats-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* MVP spotlight cards on the profile, and the ranked-leaderboard modal they open. */
.mvp-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mvp-card {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; font: inherit; color: inherit;
}
.mvp-card:hover { border-color: var(--border-strong); }
.mvp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mvp-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvp-line { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvp-league {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted); background: var(--surface-3);
  padding: 3px 9px; border-radius: 20px; flex-shrink: 0;
}
.mvp-dig-deeper { width: 100%; margin-top: 10px; border-color: var(--green); color: var(--green); }
.mvp-dig-deeper:hover { border-color: var(--green); color: var(--green); opacity: 0.85; }
.mvp-modal { max-width: 380px; }
.mvp-modal .mvp-list { max-height: 50vh; overflow-y: auto; margin-top: 12px; padding-right: 2px; }
#players-body .mvp-list { margin-top: 14px; }
.mvp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mvp-filters input, .mvp-filters select {
  flex: 1 1 90px; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 9px 12px; outline: none;
}
.mvp-filters input { flex-basis: 100%; }
.mvp-filters input::placeholder { color: var(--text-faint); }
.mvp-filters input:focus, .mvp-filters select:focus { border-color: var(--accent); }
.mvp-row { display: flex; align-items: center; gap: 10px; padding: 6px; margin: 0 -6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; transition: background 0.12s; }
.mvp-row:hover { background: var(--field-input); }
.mvp-row:last-child { border-bottom: none; }
.player-games-modal .history-list { max-height: 55vh; overflow-y: auto; margin-top: 12px; padding-right: 2px; }
.mvp-rank { width: 18px; flex-shrink: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; color: var(--text-faint); text-align: center; }
.mvp-group + .mvp-group { margin-top: 16px; }
.mvp-group-title {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}
.sport-bar-item { margin: 10px 0; }
.sport-bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.sport-bar-label { font-size: 12px; color: var(--white); width: 96px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sport-bar { flex: 1; height: 8px; background: var(--field-input); border-radius: 5px; overflow: hidden; }
.sport-bar-fill { display: block; height: 100%; background: var(--red); border-radius: 5px; }
.sport-bar-fill.rooting { background: var(--accent); }
.sport-bar-sub { font-size: 11px; color: var(--text); font-weight: 700; margin: 0 0 0 106px; }
.sport-bar-sub.complete { color: var(--accent); }
/* Favorite team facts (with logo) on the profile */
.fact-team { display: inline-flex; align-items: center; gap: 6px; }
.fact-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }

/* Favorite-team picker rows in Edit Profile */
.fav-row { display: flex; gap: 8px; margin-bottom: 8px; }
.fav-row select {
  flex: 1; min-width: 0; background: var(--field-input); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 10px 12px; outline: none;
}
.fav-row select:focus { border-color: var(--white); }
.fav-row select:disabled { opacity: 0.5; }

/* Favorite teams on the profile view — four boxes in one row, logo on top */
.fav-team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.fav-team-box {
  background: var(--field-input); border-radius: 9px;
  padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
  box-shadow: inset 0 -3px 0 var(--tc, transparent);
}
.ftb-logo { width: 50px; height: 50px; object-fit: contain; }
.ftb-star { color: var(--accent); display: inline-flex; }
.ftb-star .ui-icon { width: 44px; height: 44px; }
.ftb-name {
  font-size: 10.5px; font-weight: 600; color: var(--white); line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* News team chips (multi-select) — same box design: logo on top, name under */
.news-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.news-chips:empty { display: none; }
.news-chips-hint { font-size: 12px; color: var(--text-muted); }
.news-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; min-width: 0;
  background: var(--field-input); border: 1px solid transparent; border-radius: 9px;
  color: var(--text-muted); font-family: 'League Spartan', sans-serif; font-size: 10.5px; font-weight: 600;
  padding: 10px 4px 9px; opacity: 0.55; transition: opacity 0.12s, border-color 0.12s; text-align: center;
  box-shadow: inset 0 -3px 0 var(--tc, transparent);
}
.news-chip span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.news-chip img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.news-chip.on { opacity: 1; border-color: var(--accent); color: var(--accent); }

/* News tab — center the top controls AND compact them so the article list
   gets as much room as possible. */
#news-view > .card { padding: 14px 16px; margin-bottom: 12px; }
#news-view .refresh-row { justify-content: center; gap: 12px; margin-bottom: 8px; }
#news-view .card-sub { text-align: center; margin: 0 0 10px; }
#news-view .news-tabs { margin: 0 auto 10px; }
#news-view .news-chips { margin-bottom: 10px; }
#news-view .grid2 { gap: 10px; }
#news-view .field { margin-bottom: 0; gap: 4px; }
.news-tabs { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }

/* Scores tab — compact + center the top card (heading, refresh, sport picker). */
#scores-view > .card { padding: 14px 16px; margin-bottom: 12px; }
#scores-view .refresh-row { justify-content: center; gap: 12px; margin-bottom: 8px; }
#scores-view .field { margin-bottom: 0; gap: 4px; }
.scores-controls { display: flex; gap: 10px; align-items: flex-end; }
.scores-controls .field { flex: 1; min-width: 0; }
.scores-controls input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.sport-bar-row.rooting-clickable { cursor: pointer; border-radius: 6px; padding: 4px 6px; margin: 3px -6px; transition: background 0.12s; }
.sport-bar-row.rooting-clickable:hover { background: var(--field-input); }
.sport-bar-num { font-size: 12px; color: var(--text-muted); font-family: 'Oswald', sans-serif; width: 24px; text-align: right; }
.rooting-inperson { font-size: 11px; color: var(--white); font-family: 'Oswald', sans-serif; margin-left: 6px; white-space: nowrap; }

/* Nav tabs */
.nav-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.nav-tab {
  flex: 1; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  background: var(--field-input); border: 1px solid var(--border); color: var(--text-muted);
  font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700;
}
.nav-tab:hover { border-color: var(--text-muted); color: var(--white); }
.nav-tab.active { background: var(--surface); border-color: var(--accent); color: var(--text); }

/* Scores */
.btn-refresh {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
  padding: 9px 16px; font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
}
.btn-refresh:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-refresh:active { transform: scale(0.97); }
.btn-refresh.is-pinned { background: var(--accent); color: var(--on-accent); }
.btn-refresh.is-pinned:hover { background: var(--accent-hover); }
.btn-refresh.btn-icon-only { padding: 9px 11px; }
.refresh-row-actions { display: flex; align-items: center; gap: 8px; }
.league-toggle-list { max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.league-toggle-list .checkbox-row { margin: 0 0 8px; }

.score-group { margin-bottom: 22px; }
.score-league { text-align: center; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--white); font-weight: 700; margin-bottom: 10px; }
/* Games render as the same compact "score chip" used by the Live tab's
   watch strip, wrapped into a responsive grid (two-plus across on a phone). */
.score-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: start; }
/* Chip on the score page: let the grid size it (the Live strip pins width). */
.score-chip { width: auto; flex: none; scroll-snap-align: none; padding: 8px 10px 9px; }
.score-chip.skel-card { min-height: 92px; }
/* Centered, solid-black start time for upcoming games (sits where the score
   goes once the game is underway). */
.wtime { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 13px; line-height: 1; letter-spacing: 0.2px; color: var(--text); text-align: center; white-space: nowrap; }
/* Footer: a spacer, the centered favored badge, then the pin on the right — a
   3-column grid so the badge stays centered regardless of the pin's width. */
.score-chip .wfoot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.wfoot-mid { min-width: 0; display: flex; justify-content: center; }
.wfav { min-width: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 9px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--accent); background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfav.even { font-style: italic; }
.wpin-wrap { display: inline-flex; align-items: center; }
.score-chip .wpin-wrap { justify-self: end; }
/* Pin/star sits inline in the footer (scoped to beat the absolute default). */
.score-chip .wpin { position: static; top: auto; right: auto; display: inline-flex; align-items: center; padding: 0; }
.score-chip .wpin .ui-icon { width: 12px; height: 12px; }
.wevent-detail { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.2px; color: var(--text-muted); text-align: center; margin: 1px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pin-btn { position: absolute; top: 8px; right: 8px; background: none; border: none; padding: 2px; cursor: pointer; font-size: 14px; line-height: 1; color: var(--text); opacity: 0.4; }
.pin-btn.pinned { opacity: 1; }
.pin-btn.pinned .ui-icon { fill: currentColor; }
.pin-btn:hover { opacity: 0.7; }
.fav-star { padding: 2px; font-size: 14px; line-height: 1; cursor: default; color: var(--accent); }
.fav-star .ui-icon { fill: currentColor; }
.event-name { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; line-height: 1.3; }
.event-detail { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* News list */
#news-list { display: flex; flex-direction: column; gap: 12px; }
/* News cards use the same amber-on-black scheme as the score rows. */
.news-item {
  display: flex; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; transition: border-color 0.15s;
}
.news-item:hover { border-color: var(--border-strong); }
.news-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-2); }
.news-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-headline { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.news-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { font-size: 11px; color: var(--text-faint); font-family: 'Oswald', sans-serif; margin-top: 2px; }
.news-source { color: var(--text-muted); font-weight: 700; }
/* "Share to The Sideline" button pinned in the news card's top-right corner */
.news-item-wrap { position: relative; }
.news-item-wrap .news-item { padding-right: 46px; }
.news-share {
  position: absolute; top: 9px; right: 9px; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
  transition: color 0.13s, border-color 0.13s, background 0.13s;
}
.news-share:hover { color: var(--accent); border-color: var(--accent); }
.news-share .ui-icon { width: 15px; height: 15px; }

/* Share-to-Sideline modal: a small article preview above the comment box */
.share-preview { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.share-preview-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.share-preview-text { min-width: 0; }
.share-preview-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-preview-source { font-size: 11px; color: var(--text-muted); font-family: 'Oswald', sans-serif; margin-top: 3px; }
.share-preview + .memory-text { margin-top: 10px; }

/* A shared news article inside a Sideline feed post */
.post-article { display: flex; gap: 10px; align-items: center; text-decoration: none; margin-top: 11px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.13s; }
.post-article:hover { border-color: var(--border-strong); }
.post-article-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.post-article-text { min-width: 0; }
.post-article-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-article-source { font-size: 11px; color: var(--text-muted); font-family: 'Oswald', sans-serif; margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }
.post-article-source .ui-icon { width: 12px; height: 12px; }

/* Profile "Shared Stories" list */
.shared-list { display: flex; flex-direction: column; gap: 14px; }
.shared-item { position: relative; }
.shared-item .post-article { margin-top: 0; }
.shared-item.owned .post-article { padding-right: 38px; }
.shared-comment { color: var(--text); font-size: 13px; line-height: 1.5; margin-top: 8px; overflow-wrap: anywhere; }
.shared-del { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 4px; border: none; background: none; cursor: pointer; color: var(--text-faint); line-height: 0; border-radius: 6px; transition: color 0.13s, background 0.13s; }
.shared-del:hover { color: var(--red); background: var(--red-bg); }
.shared-del .ui-icon { width: 15px; height: 15px; }

/* ── Safety: report / block / delete ──────────────────────────────────────── */
/* Report control on posts (shares the delete-button look) + comments */
.post-report, .comment-report { background: none; border: none; cursor: pointer; padding: 3px; border-radius: 6px; color: var(--text-faint); line-height: 0; transition: color 0.13s, background 0.13s; }
.post-report { align-self: flex-start; flex-shrink: 0; margin-left: 8px; }
.comment-report { margin-left: auto; flex-shrink: 0; }
.post-report:hover, .comment-report:hover { color: var(--red); background: var(--red-bg); }
.post-report .ui-icon { width: 15px; height: 15px; }
.comment-report .ui-icon { width: 13px; height: 13px; }
/* Report modal reason list */
.report-reasons { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 4px; }
.report-reason { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--text); border: 1px solid transparent; }
.report-reason:hover { background: var(--surface-2); }
.report-reason input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.report-reason:has(input:checked) { border-color: var(--border-strong); background: var(--surface-2); }
/* Profile safety menu (Report / Block) */
.safety-modal .modal-title { margin-bottom: 14px; }
.safety-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; font-weight: 600; padding: 13px 14px; margin-bottom: 8px;
}
.safety-opt:hover { border-color: var(--border-strong); }
.safety-opt.danger { color: var(--red); }
.safety-opt .ui-icon { width: 17px; height: 17px; }
/* Edit Profile danger zone */
.danger-zone { border: 1px solid var(--red); }
.danger-zone .card-title { color: var(--red); }
.danger-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
/* Sign-in terms line + inline text buttons */
.signin-terms { margin-top: 16px; font-size: 11px; line-height: 1.5; color: var(--text-faint); text-align: center; }
.link-inline { background: none; border: none; padding: 0; cursor: pointer; color: var(--accent); font: inherit; text-decoration: underline; }
.link-inline:hover { color: var(--accent-hover); }

/* Friends */
.friend-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; margin-left: 2px; }
.friend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.friend-row:last-child { border-bottom: none; }
.friend-id { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--white); cursor: pointer; min-width: 0; }
.friend-id .avatar-sm { flex-shrink: 0; }
.friend-logos { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 8px; }
.friend-logo { width: 20px; height: 20px; object-fit: contain; }

/* Watch history list */
/* Watch-history filters (search + league + place + date), white controls on
   the amber card. Search takes its own row; the rest wrap below it. */
.history-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.history-filters input, .history-filters select {
  flex: 1 1 90px; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 14px; padding: 9px 12px; outline: none;
}
.history-filters .history-search { flex-basis: 100%; }
.history-filters input::placeholder { color: var(--text-faint); }
.history-filters input:focus, .history-filters select:focus { border-color: var(--accent); }
.history-filters input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* Clear sits on its own full-width row, centered. */
.history-clear-row { flex-basis: 100%; display: flex; justify-content: center; }
.history-clear {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700; padding: 9px 18px; cursor: pointer;
}
.history-clear:hover { background: var(--surface-2); }
.history-list { display: flex; flex-direction: column; gap: 10px; }
/* Games revealed by "Load more" live in this wrapper — give it the same column
   gap so the extra tickets don't collapse together. (.hidden still wins.) */
#history-more { display: flex; flex-direction: column; gap: 10px; }
/* (.history-item's old row background/padding was legacy — every history item is
   now a .stub ticket, which owns its own layout and white background.) */
.history-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hist-del { background: none; border: none; color: var(--text-faint); font-size: 15px; line-height: 1; cursor: pointer; padding: 4px 7px; border-radius: 6px; }
.hist-del:hover { color: var(--red); background: var(--red-bg); }
.history-game { font-size: 14px; font-weight: 700; color: var(--white); }
.history-game .team-won { color: var(--accent); }
.history-game .hist-at { color: var(--text-faint); font-weight: 400; margin: 0 2px; }
.history-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.hist-final { color: var(--text-muted); font-weight: 700; }
.hist-inperson { color: var(--green); font-weight: 700; }
.hist-rooting { color: var(--white); margin-top: 3px; }
.hist-first-visit { color: var(--accent); font-weight: 700; margin-top: 3px; }
.hist-first-visit .ui-icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }

/* Site footer (links to the public About page; visible on every screen) */
.site-footer {
  text-align: center;
  padding: 28px 24px 36px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
/* "Buy me a hot dog" support button — gold so it reads as the friendly ask it is */
.hotdog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 11px 22px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.hotdog-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent); }
.hotdog-btn:active { transform: translateY(0); }
.hotdog-emoji { font-size: 18px; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .hotdog-btn { transition: none; } }
.site-footer-link {
  color: var(--text-muted);
  font-family: 'League Spartan', sans-serif;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 18px;
  display: inline-block;
  font-weight: 600;
  background: none;
  cursor: pointer;
}
.site-footer-link:hover { color: var(--green); border-color: var(--green); }

/* Daily Pick 'Ems (top of Scores page) */
.pickems-card { border: 1px solid var(--border); }
.pickems-games { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.pickem { background: var(--field-input); border-radius: 10px; padding: 10px 12px; }
.pickem-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-faint); margin-bottom: 8px; }
.pickem-opts { display: flex; align-items: center; gap: 8px; }
.pickem-vs { font-size: 11px; color: var(--text-faint); font-family: 'Oswald', sans-serif; flex: 0 0 auto; }
.pickem-opt {
  flex: 1; min-width: 0; padding: 7px 8px; border-radius: 8px;
  background: var(--field-light); border: 1px solid var(--border); color: var(--text);
  font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.pickem-teamrow { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; max-width: 100%; }
.pickem-logo { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.pickem-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.pickem-record { font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.pickem-opt:hover:not(:disabled) { border-color: var(--white); }
.pickem-opt.picked { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pickem-opt.correct { background: #14532D; color: #DCFCE7; border-color: #22C55E; }
.pickem-opt.wrong { background: var(--red-bg); color: #FECACA; border-color: var(--red); }
.pickem-opt:disabled { cursor: default; opacity: 0.9; }
.pickems-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pickems-result { font-size: 13px; color: var(--text-muted); }

/* Pick 'Ems collapsible header */
.pickems-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; user-select: none; }
/* Title centered; the date / collapse chevron sits pinned to the right. */
.pickems-head .pickems-toggle-label { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.pickems-card:not(.is-collapsed) .pickems-head { margin-bottom: 12px; }
.pickems-card.is-collapsed { padding-top: 16px; padding-bottom: 16px; }
.pickems-toggle-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--text-muted); font-family: 'Oswald', sans-serif; }
.pickems-chevron { font-size: 11px; color: var(--text-faint); }
.pickems-head:hover .pickems-chevron { color: var(--white); }

/* Pick 'Ems share actions + last-played recap */
.pickems-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pickems-last { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); font-family: 'Oswald', sans-serif; }
.pickems-last strong { color: var(--white); }

/* Inline UI icons + drop-in logo image */
.ui-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.nav-tab .ui-icon { width: 1.05em; height: 1.05em; }
.logo-img { height: 30px; width: auto; max-width: 190px; vertical-align: middle; }

/* Bottom tab bar */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  /* Bar spans full width; tabs align to the same centered column as .content */
  padding-left: max(0px, calc((100% - 640px) / 2));
  padding-right: max(0px, calc((100% - 640px) / 2));
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 4px 14px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-family: 'Oswald', sans-serif;
  font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
}
.bnav-tab .ui-icon { width: 30px; height: 30px; }
.bnav-tab.active { color: var(--green); }
.bnav-tab:active { opacity: 0.6; }
/* Center "Log Game" action: a raised gold circle (inverse of the other tabs) */
.bnav-log { flex: 1; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; }
.bnav-log .fab {
  width: 52px; height: 52px; border-radius: 50%; margin-top: -24px;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--field); box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  transition: transform 0.12s, background 0.12s;
}
.bnav-log .fab .ui-icon { width: 28px; height: 28px; stroke-width: 2.6; }
.bnav-log:hover .fab { background: var(--accent-hover); }
.bnav-log:active .fab { transform: scale(0.92); }
/* Text label is desktop-only — see the sidebar override below. */
.bnav-log-label { display: none; }
/* Keep page content clear of the fixed bottom bar */
body { padding-bottom: 104px; }
.site-footer { margin-bottom: 8px; }

/* How-to popup */
.howto-modal { max-width: 440px; max-height: 82vh; overflow-y: auto; text-align: left; }
.howto-modal .howto-list { margin: 12px 0 4px 18px; }
.howto-modal .howto-note { margin-top: 10px; }

/* Profile moved to the bottom tab — hide the old top-right profile button,
   and surface pending friend requests as a dot on the Profile tab instead. */
.who-profile { display: none; }
.bnav-tab { position: relative; }
.bnav-tab.has-alert::after {
  content: ""; position: absolute; top: 9px; right: 27%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--field);
}

/* Skeleton loaders */
.skel { position: relative; overflow: hidden; background: var(--field-input); border-radius: 6px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  animation: skelShimmer 1.3s ease-in-out infinite;
}
@keyframes skelShimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; border-radius: 6px; }
.skel-circle { border-radius: 50%; flex-shrink: 0; }
.skel-card { pointer-events: none; }
.skel-newsitem { border-radius: 10px; padding: 14px; margin-bottom: 10px; }

/* "New version available" banner (service worker update) */
.update-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(98px + env(safe-area-inset-bottom)); z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--field-light); border: 1px solid var(--accent); border-radius: 10px;
  padding: 12px 16px; box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  color: var(--white); font-size: 14px; font-weight: 600;
  max-width: 420px; margin: 0 auto;
}
.update-banner button {
  background: var(--accent); color: var(--on-accent); border: none; border-radius: 7px;
  padding: 8px 16px; font-family: 'League Spartan', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer;
  flex-shrink: 0;
}

/* ── Motion & texture polish ─────────────────────────────────────────────── */

/* Subtle view transition when switching tabs/screens */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content > div { animation: viewIn 0.26s ease both; }

/* Tactile press feedback on interactive elements */
.btn, .btn-refresh, .seg, .root-opt, .pickem-opt, .news-chip, .site-footer-link, .bnav-tab, .hist-del, .pin-btn {
  transition: transform 0.08s ease, background-color 0.13s ease, color 0.13s ease, border-color 0.13s ease, opacity 0.13s ease;
}
.btn:active, .btn-refresh:active, .seg:active, .root-opt:active,
.pickem-opt:not(:disabled):active, .news-chip:active, .site-footer-link:active,
.hist-del:active, .pin-btn:active { transform: scale(0.96); }
.bnav-tab:active { transform: scale(0.94); }

/* Depth: soft shadows so surfaces layer instead of reading flat */
.card { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22); }
.bottom-nav { box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.30); }
.modal { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }

/* Faint mowing-stripe texture behind the sticky header */
.header {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.020) 0 24px, transparent 24px 48px),
    var(--surface);
}

/* Popups ease in rather than snapping */
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-overlay { animation: overlayIn 0.16s ease both; }
.modal-overlay .modal { animation: modalIn 0.2s ease both; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .content > div, .modal-overlay, .modal-overlay .modal { animation: none; }
  .stub.printing, .stub.printing.attended .stub-body::after { animation: none; }
  .btn, .btn-refresh, .seg, .root-opt, .pickem-opt, .news-chip, .site-footer-link, .bnav-tab, .hist-del, .pin-btn { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP LAYOUT — left nav rail, wide main area.
   Everything below only applies at ≥1000px; the mobile layout is untouched.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1000px) {
  body { padding-bottom: 0; }

  /* Header spans the full top; wordmark stays centered, Share on the right */
  .header { padding: 14px 28px; }

  /* Bottom tab bar becomes a fixed left sidebar */
  .bottom-nav {
    top: 60px; bottom: 0; left: 0; right: auto; width: 212px;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 18px 12px;
    border-top: none; border-right: 1px solid var(--border);
    box-shadow: none;
  }
  .bnav-tab {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 13px 14px; border-radius: 10px; font-size: 17px; letter-spacing: 0.4px;
  }
  .bnav-tab .ui-icon { width: 24px; height: 24px; }
  .bnav-tab.active { background: rgba(255,255,255,0.07); color: var(--green); }
  .bnav-tab:not(.active):hover { background: rgba(255,255,255,0.04); color: var(--white); }

  /* "Log a game" drops the mobile raised-circle treatment (which relied on
     sitting mid-row in a horizontal bar) for a normal sidebar row, gold-tinted
     to stand out as the primary action. Without this it stayed flex:1 in the
     new vertical bar and swelled to fill the sidebar, shoving News/Profile
     down to the very bottom. */
  .bnav-log {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 10px 14px; border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
  }
  .bnav-log:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
  .bnav-log .fab {
    width: 32px; height: 32px; margin-top: 0; border: none; box-shadow: none; flex-shrink: 0;
  }
  .bnav-log .fab .ui-icon { width: 20px; height: 20px; }
  .bnav-log-label {
    display: inline; font-family: 'Oswald', sans-serif; font-size: 15px; font-weight: 700;
    letter-spacing: 0.4px; text-transform: uppercase; color: var(--accent);
  }

  /* Content sits to the right of the sidebar; each view centers in a wide column */
  .content { margin-left: 212px; max-width: none; padding: 28px 36px; }
  .content > div { max-width: 1180px; margin: 0 auto; }
  .site-footer { margin-left: 212px; }

  /* Reading-width views stay narrow and centered so lines of text and single-
     column cards don't stretch uncomfortably wide. */
  #profile-view, #chat-view, #edit-profile-view, #rooting-view,
  #board-view, #scores-view { max-width: 760px; }

  /* News keeps its two-up article grid */
  #news-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
}

/* ── Delight: reactions, scores, confetti, toast ─────────────────────────── */
.react-btn { transition: transform .12s ease; }
.react-btn.pop { transform: scale(1.35); }
.float-emoji {
  position: fixed; z-index: 9999; pointer-events: none;
  font-size: 22px; transform: translate(-50%, -50%);
  animation: floatUp .9s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -40%) scale(.6); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1.3); }
}
/* A watched game's chip flashes when its score changes */
.wcard.scored { animation: chipFlash 1.4s ease-out; }
@keyframes chipFlash {
  0%   { box-shadow: 0 0 0 0 var(--green); }
  15%  { box-shadow: 0 0 0 3px var(--green); background: color-mix(in srgb, var(--green) 14%, var(--surface-3)); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.confetti-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.confetti-bit {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: confettiFall 1.6s linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-12px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(102vh) rotate(540deg); opacity: .9; }
}
.app-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 11px 16px; font-size: 13.5px; max-width: 88vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); z-index: 10001; opacity: 0;
  transition: opacity .25s ease, transform .25s ease; display: flex; align-items: center; gap: 8px;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast .toast-ic svg, .app-toast svg { width: 18px; height: 18px; color: var(--accent); vertical-align: middle; }
.app-toast strong { color: var(--accent); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 8px;
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text);
  font-size: 12px; font-weight: 600;
}
.badge .badge-ic svg { width: 15px; height: 15px; color: var(--accent); }
.badge.locked { background: var(--surface-2); border-color: var(--border); color: var(--text-faint); opacity: .7; }
.badge.locked .badge-ic svg { color: var(--text-faint); }

/* ── Friends leaderboard ─────────────────────────────────────────────────── */
.lb-seg { display: flex; gap: 6px; margin: 4px 0 12px; }
.lb-seg-btn {
  flex: 1; padding: 8px 6px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.lb-seg-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lb-body { display: flex; flex-direction: column; gap: 2px; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 9px; cursor: pointer;
}
.lb-row:hover { background: var(--surface-2); }
.lb-row.me { background: color-mix(in srgb, var(--green) 13%, transparent); }
.lb-rank { width: 24px; text-align: center; font-size: 16px; }
.lb-rank .lb-num { font-size: 13px; color: var(--text-faint); font-weight: 700; }
.lb-name { flex: 1; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-weight: 700; color: var(--accent); font-size: 14px; }

/* ── Post-game "how was it?" prompt ──────────────────────────────────────── */
.postgame-prompt {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(24px);
  width: min(440px, 92vw); background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 14px 44px 14px 14px; z-index: 10001;
  box-shadow: 0 14px 36px rgba(0,0,0,.3); opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "flag text" "add add"; gap: 6px 12px; align-items: center;
}
.postgame-prompt.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.postgame-prompt .pg-flag { grid-area: flag; font-size: 26px; }
.postgame-prompt .pg-text { grid-area: text; font-size: 13.5px; line-height: 1.35; color: var(--text); }
.postgame-prompt .pg-add { grid-area: add; margin-top: 4px; }
.postgame-prompt .pg-close {
  position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--text-faint);
  cursor: pointer; padding: 4px; line-height: 0;
}
.postgame-prompt .pg-close svg { width: 16px; height: 16px; }

/* Preferences toggle row */
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 14px; }
.pref-row .pref-note { display: block; font-weight: 400; font-size: 12px; color: var(--text-faint); }
.pref-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.push-subprefs { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.pref-row.pref-sub { font-weight: 500; font-size: 13px; color: var(--text-muted); }
.pref-row.pref-sub input[type="checkbox"] { width: 17px; height: 17px; }

/* Badge explanation modal */
.badge-modal { text-align: center; max-width: 340px; }
.badge-hero {
  width: 68px; height: 68px; margin: 4px auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.badge-hero svg { width: 34px; height: 34px; color: var(--accent); }
.badge-hero.locked { background: var(--surface-2); border-color: var(--border); }
.badge-hero.locked svg { color: var(--text-faint); }
.badge-status {
  display: inline-flex; align-items: center; gap: 6px; margin: 12px auto 2px;
  font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.badge-status svg { width: 15px; height: 15px; }
.badge-status.earned { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.badge-status.locked { color: var(--text-faint); background: var(--surface-2); }
.badge { cursor: pointer; }

/* ── Frictionless friends: invite / QR / suggestions / onboarding ─────────── */
.invite-modal, .onboard-modal { max-width: 360px; }
.qr-tile {
  width: 200px; height: 200px; margin: 16px auto 4px; background: #fff; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box;
}
.qr-tile img, .qr-tile canvas { display: block; width: 176px !important; height: 176px !important; }
.qr-load { color: #888; font-size: 13px; }
.invite-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.invite-actions .btn { width: auto; padding: 9px 16px; }

/* Invite call-to-action row on the Friends screen */
.invite-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invite-cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.invite-cta-text strong { font-size: 14px; }
.invite-cta-text span { font-size: 12px; color: var(--text-faint); }

/* Suggestion rows (reason under the name) */
.sugg-id { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.sugg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-reason { font-size: 11.5px; color: var(--accent); }

/* Onboarding wizard */
.onboard-step { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 6px; }
.onboard-modal .fav-rows { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.onboard-suggest { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 8px; }
