/*
 * SPDX-License-Identifier: BUSL-1.1
 * Copyright (c) 2026 Interchained LLC. All rights reserved.
 * CHALK / Sports-Rater — https://sports-rater.com — Licensor: Interchained LLC
 */
:root {
  --bg: #07090d;
  --bg-2: #0f141b;
  --bg-3: #161d26;
  --line: #222b37;
  --fg: #f4f6f8;
  --fg-2: #a9b4c0;
  --fg-3: #687481;
  --accent: #c8ff3d;         /* overridden per team */
  --accent-2: #9fd41c;
  --accent-ink: #07090d;
  --red: #ff4d5e;
  --amber: #ffb54d;
  --blue: #5ab0ff;
  --radius: 20px;
  --display: "Barlow Condensed", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { padding-bottom: calc(88px + var(--safe-b)); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.glow { position: fixed; inset: -40% -20% auto -20%; height: 70vh; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; z-index: 0; transition: background .6s; }

.top { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(180deg, rgba(7,9,13,.98), rgba(7,9,13,.82)); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.mark { font-family: var(--display); font-weight: 900; font-size: 24px; letter-spacing: .02em; color: var(--fg); }
.mark b { color: var(--accent); font-weight: 900; }
.sub { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.ctx { display: flex; gap: 6px; }
.pill { appearance: none; background: var(--bg-3); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.pill.mode[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

main { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 14px 14px 0; }

/* ---------------- hero ---------------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 10px 6px 18px; }
.hero-abbr { font-family: var(--display); font-weight: 900; font-size: clamp(64px, 18vw, 112px); line-height: .9; letter-spacing: -.02em; color: var(--fg); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.hero-name { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); margin-top: 2px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge-pill { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .1em; padding: 5px 9px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); cursor: pointer; }
.badge-pill.bad { background: rgba(255,77,94,.14); color: var(--red); border-color: rgba(255,77,94,.4); }
.hero-rating { display: grid; grid-template-columns: 148px 1fr; gap: 14px; align-items: center; background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 300px; }
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #1c2531; stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1), stroke .3s; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 50%, transparent)); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 54px; letter-spacing: -.03em; }
.ring-num small { font-size: 14px; color: var(--fg-3); margin-left: 2px; font-weight: 600; }
.hero-rating-meta { display: grid; gap: 5px; min-width: 0; }
.rc-label { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--fg-3); font-size: 12px; }
.rc-rank { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--fg-2); }
.rc-rank b { color: var(--accent); font-size: 28px; }
.rc-def { font-size: 12px; color: var(--fg-3); font-family: var(--mono); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------------- rating card ---------------- */
.ratings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.rt { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, transform .1s; }
.rt:hover { border-color: var(--accent-2); }
.rt:active { transform: scale(.98); }
.rt .k { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--fg-3); }
.rt .v { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1; letter-spacing: -.03em; margin-top: 4px; }
.rt .v small { font-size: 13px; color: var(--fg-3); font-weight: 600; letter-spacing: 0; }
.rt .r { font-size: 12px; color: var(--fg-2); font-family: var(--mono); margin-top: 4px; }
.rt .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #1c2531; }
.rt .bar i { display: block; height: 100%; background: var(--accent); }
.rt.prov .v { color: var(--fg-2); }
.tile.scout { grid-column: 1 / -1; }
.scout-body { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.scout-abbr { font-family: var(--display); font-weight: 900; font-size: 56px; line-height: .9; }
.scout-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.scout-stats div { background: var(--bg-3); border-radius: 10px; padding: 8px 10px; }
.scout-stats .k { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: var(--fg-3); }
.scout-stats .v { font-family: var(--display); font-weight: 800; font-size: 20px; }
.scout-lines { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; color: var(--fg-2); }
.scout-lines div::before { content: "› "; color: var(--accent); }

/* ---------------- fans ---------------- */
.pill.who { display: inline-flex; align-items: center; gap: 6px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.who img { width: 18px; height: 18px; border-radius: 4px; }
.tile.fanfeed { grid-column: 1 / -1; }
.take { display: flex; gap: 8px; margin-bottom: 10px; }
.take input { flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--line); color: var(--fg); border-radius: 12px; padding: 10px 12px; font: inherit; }
.feed-body { display: grid; gap: 8px; }
.fi { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start; padding: 10px; background: var(--bg-3); border-radius: 12px; }
.fi img { width: 32px; height: 32px; border-radius: 8px; }
.fi .h { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: .04em; text-transform: none; font-size: 14px; color: var(--fg); }
.fi .h small { color: var(--fg-3); font-family: var(--mono); font-weight: 400; font-size: 11px; margin-left: 6px; }
.fi .t { font-size: 14px; color: var(--fg-2); margin-top: 2px; line-height: 1.35; }
.fi .rx { display: flex; gap: 4px; margin-top: 6px; }
.fi .rx button { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--bg-2); color: var(--fg-3); border: 1px solid var(--line); }
.fi .rx button:hover { color: var(--fg); border-color: var(--accent-2); }
.fi .sc { font-family: var(--display); font-weight: 800; font-size: 22px; text-align: right; }
.fi .sc small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); font-weight: 600; }
.rt .fan { position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 10px; color: var(--fg-3); }
.rt .fan b { color: var(--fg-2); }
.rater { display: grid; gap: 8px; }
.rater input[type=range] { width: 100%; accent-color: var(--accent); }
.rater .big { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: 1; }
.who-form { display: grid; gap: 8px; }
.who-form input { background: var(--bg-3); border: 1px solid var(--line); color: var(--fg); border-radius: 10px; padding: 10px 12px; font: inherit; }

/* ---------------- games ---------------- */
.tile.games { grid-column: 1 / -1; }
.games-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.gm { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; padding: 8px 10px; background: var(--bg-3); border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.gm:hover { border-color: var(--accent-2); }
.gm .wl { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-family: var(--display); font-weight: 800; background: var(--accent); color: var(--accent-ink); }
.gm .wl.L { background: var(--red); color: #fff; }
.gm .wl.S { background: var(--bg-2); color: var(--fg-3); border: 1px solid var(--line); }
.gm .o { font-family: var(--display); font-weight: 700; font-size: 16px; }
.gm .m { font-size: 11px; color: var(--fg-3); font-family: var(--mono); }
#trend-chips .chip { padding: 4px 9px; font-size: 12px; }

/* ---------------- grid tiles ---------------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 120px; position: relative; overflow: hidden; }
.tile-h { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--fg-3); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.tile-f { font-size: 13px; color: var(--fg-2); margin-top: 8px; line-height: 1.35; }
.tile.trend { grid-column: 1 / -1; }
#trend-svg { width: 100%; height: 96px; display: block; }
#trend-svg .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
#trend-svg .area { fill: url(#g); opacity: .9; }
#trend-svg .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
#trend-svg .dot.prov { stroke: var(--fg-3); }
#trend-svg .lbl { font-family: var(--mono); font-size: 9px; fill: var(--fg-3); }
#trend-svg .val { font-family: var(--display); font-weight: 700; font-size: 12px; fill: var(--fg); }
.form-body { display: grid; gap: 6px; }
.form-row { display: flex; justify-content: space-between; font-size: 14px; }
.form-row .k { color: var(--fg-3); }
.form-row .v { font-family: var(--mono); }
.delta.up { color: var(--accent); } .delta.down { color: var(--red); }
.score-line { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.01em; }
.score-line .wl { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-size: 16px; margin-right: 8px; vertical-align: 6px; background: var(--accent); color: var(--accent-ink); }
.score-line .wl.L { background: var(--red); color: #fff; }
.dev { margin-top: 8px; font-family: var(--display); font-weight: 700; letter-spacing: .08em; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); }
.dev.HIGH { border-color: rgba(255,77,94,.5); color: var(--red); }
.dev.MODERATE { border-color: rgba(255,181,77,.5); color: var(--amber); }
.dev.LOW { color: var(--fg-2); }
.tile .sub-line { font-size: 13px; color: var(--fg-2); margin-top: 6px; line-height: 1.35; }
.opp { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opp .abbr { font-family: var(--display); font-weight: 900; font-size: 42px; line-height: 1; }
.opp .kick { font-size: 13px; color: var(--fg-3); }
.opp .oscore { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--fg-2); text-align: right; }
.opp .oscore small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); font-weight: 600; }
.weak-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.weak-row:first-of-type { border-top: 0; }
.weak-row .n { color: var(--fg-3); font-size: 12px; }
.weak-row .epa { font-family: var(--mono); color: var(--red); font-size: 13px; }
.weak-row .epa.good { color: var(--accent); }
.rc-components { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.comp { background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.comp .k { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: var(--fg-3); }
.comp .v { font-family: var(--display); font-weight: 800; font-size: 22px; margin-top: 2px; }
.comp .p { font-size: 11px; color: var(--fg-2); font-family: var(--mono); }
.comp .bar { height: 4px; background: #1c2531; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.comp .bar i { display: block; height: 100%; background: var(--accent); }
.tile.comps { grid-column: 1 / -1; }
.empty { color: var(--fg-3); font-size: 13px; }

/* ---------------- suggestions + feed ---------------- */
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--fg-2); transition: border-color .15s, color .15s, transform .1s; }
.chip:hover { border-color: var(--accent-2); color: var(--fg); }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.feed { display: grid; gap: 12px; padding-top: 10px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card-head .q { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; letter-spacing: -.01em; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 6px; background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.lime { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.red { color: var(--red); border-color: rgba(255,77,94,.35); }
.badge.amber { color: var(--amber); border-color: rgba(255,181,77,.35); }
.statements { display: grid; gap: 6px; margin-top: 12px; }
.statement { display: flex; gap: 10px; font-size: 15px; color: var(--fg); line-height: 1.35; }
.statement::before { content: ""; flex: 0 0 3px; border-radius: 2px; background: var(--accent); margin-top: 3px; }
.prose { margin-top: 12px; font-size: 16px; line-height: 1.55; color: var(--fg-2); white-space: pre-wrap; }
.prose:empty { display: none; }
.prose.streaming::after { content: "▍"; color: var(--accent); animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.card-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.drawer { margin-top: 12px; display: grid; gap: 10px; }
.drawer:empty { display: none; }
/* Coach view lives INSIDE an answer card. Scoped to .card: the bare `.coach` selector
   used to match <body class="coach"> in coach mode and hid the entire page. */
.card .coach { display: none; margin-top: 12px; }
.card.coach-on .coach { display: block; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.kv div { background: var(--bg-3); border-radius: 10px; padding: 8px 10px; }
.kv .k { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--fg-3); }
.kv .v { font-family: var(--mono); font-size: 15px; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--mono); }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--fg-3); font-weight: 600; }
td.num, th.num { text-align: right; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.play { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg-3); border-radius: 10px; font-size: 14px; }
.play .dd { font-family: var(--display); font-weight: 700; font-size: 16px; }
.play .yd { font-family: var(--mono); font-size: 13px; text-align: right; }
.play .yd.good { color: var(--accent); }
.play .yd.bad { color: var(--red); }
.play .meta { color: var(--fg-3); font-size: 12px; }
.play.tap { cursor: pointer; }
.play.tap:hover { outline: 1px solid var(--accent-2); }
pre.code { background: #04060a; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 12px; overflow-x: auto; color: var(--fg-2); max-height: 380px; }
.muted { color: var(--fg-3); font-size: 13px; }
.h { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--fg-3); margin: 6px 0 4px; }
.prov { display: grid; gap: 4px; font-family: var(--mono); font-size: 12px; }
.prov div { padding: 4px 8px; background: var(--bg-3); border-radius: 8px; display: flex; gap: 8px; }
.prov .c { color: var(--accent); }
.prov .hsh { color: var(--fg-3); margin-left: auto; }
.err { color: var(--red); font-family: var(--mono); font-size: 13px; }

.ask { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 8px; padding: 12px 14px calc(12px + var(--safe-b)); background: linear-gradient(0deg, rgba(7,9,13,1) 70%, rgba(7,9,13,0)); }
.ask input { flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 14px 18px; font-size: 16px; outline: none; }
.ask input:focus { border-color: var(--accent); }
.ask button { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 22px; font-weight: 700; box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent); }

form.rd { display: grid; gap: 8px; }
form.rd .row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; }
form.rd input, form.rd select { background: var(--bg-3); border: 1px solid var(--line); color: var(--fg); border-radius: 10px; padding: 8px 10px; font: inherit; }
form.rd .go { justify-self: start; }

@media (min-width: 720px) {
  .ask { left: 50%; transform: translateX(-50%); width: 820px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .tile.trend { grid-column: span 2; }
  .tile.next { grid-column: span 2; }
  .tile.comps { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-rating { min-width: 0; }
}
@media (max-width: 420px) {
  .ratings { grid-template-columns: repeat(2, 1fr); }
  .rt .v { font-size: 34px; }
  .hero-rating { grid-template-columns: 116px 1fr; }
  .ring { width: 116px; height: 116px; }
  .ring-num { font-size: 40px; }
  .rc-components { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .comp .v { font-size: 18px; }
}

/* ---------------- loading indicators ---------------- */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { height: 14px; border-radius: 6px; margin: 8px 0; background: linear-gradient(90deg, var(--bg-3) 25%, #1f2935 50%, var(--bg-3) 75%); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }
.home.loading .tile::after, .home.loading .rt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,.035) 50%, transparent 75%); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; pointer-events: none; }
.home.loading .tile-h::after { content: " · loading"; color: var(--fg-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
@keyframes ringpulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.ring.loading .ring-bg { animation: ringpulse 1.2s ease-in-out infinite; stroke: color-mix(in srgb, var(--accent) 45%, #1c2531); }
.badge.working::after { content: "…"; animation: blink .8s infinite; }
.progress { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------------- team logos ---------------- */
.hero-logo-slot:empty { display: none; }
.hero-logo { width: clamp(72px, 16vw, 112px); height: auto; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 40%, transparent)); }
.hero.has-logo .hero-abbr { font-size: clamp(36px, 9vw, 56px); margin-top: 4px; }
.opp { display: flex; align-items: center; gap: 10px; }
.opp-logo { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.site-foot { margin: 28px 4px 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; color: var(--fg-3); display: grid; gap: 6px; }

/* ---------------- the record ---------------- */
.record { margin: 4px 0 10px; }
.record .tile-h { padding: 0 4px 8px; }
.record-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 4px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.record-strip:empty::after { content: ""; display: block; height: 4px; }
.rec { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 6px; transition: border-color .15s, transform .1s; }
.rec:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.rec-q { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.15; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-s { font-size: 12.5px; color: var(--fg-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rec-m { display: flex; gap: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); }

/* identity badges: outlined, so the always-awarded pair reads differently from earned tiers */
.badge-pill.signature { background: transparent; border-style: dashed; }
.badge-pill.heel { background: transparent; border-style: dashed; color: var(--fg-2); border-color: var(--line); }

/* history cards */
.card.skel { animation: none; }
.card.recorded { border-color: color-mix(in srgb, var(--line) 70%, var(--accent) 30%); }
.card.flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .2s; }

/* ---------------- views: Dashboard | Feed ---------------- */
/* Tabs live IN the header bar (brand | tabs | controls) — never in open space above the hero. */
.views { display: flex; gap: 6px; justify-content: center; align-items: center; min-width: 0; }
.view-tab { font-family: var(--display); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); background: var(--bg-2); display: inline-flex; gap: 8px; align-items: center; transition: background .15s, color .15s, border-color .15s; }
.view-tab:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.view-tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.view-count { font-family: var(--mono); font-size: 11px; letter-spacing: 0; text-transform: none; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.18); }
.view-tab:not(.on) .view-count { background: var(--bg-3); color: var(--fg-3); }
.view-count:empty { display: none; }
main.view-home #feedview { display: none; }
main.view-feed #home { display: none; }
.feedview .feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 0; }
.feedview .feed { padding-top: 6px; }

/* ---------------- holo shimmer (replaces the flat gray) ---------------- */
@keyframes holo { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.skeleton, .home.loading .tile::after, .home.loading .rt::after {
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--accent) 10%, var(--bg-3)) 0%,
    color-mix(in srgb, var(--blue) 22%, var(--bg-3)) 25%,
    color-mix(in srgb, var(--accent) 28%, var(--bg-3)) 45%,
    color-mix(in srgb, #ff7ad9 18%, var(--bg-3)) 65%,
    color-mix(in srgb, var(--accent) 10%, var(--bg-3)) 100%);
  background-size: 200% 100%;
  animation: holo 1.6s linear infinite;
}
.home.loading .tile::after, .home.loading .rt::after { opacity: .35; mix-blend-mode: screen; }
.card.skel .skeleton { box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }

/* ---------------- pro scrollbars (coach tables, record strip, code, suggest) ---------------- */
.tbl, .record-strip, pre.code { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--bg-3)) transparent; }
.tbl::-webkit-scrollbar, .record-strip::-webkit-scrollbar, pre.code::-webkit-scrollbar { height: 8px; }
.tbl::-webkit-scrollbar-track, .record-strip::-webkit-scrollbar-track, pre.code::-webkit-scrollbar-track { background: transparent; }
.tbl::-webkit-scrollbar-thumb, .record-strip::-webkit-scrollbar-thumb, pre.code::-webkit-scrollbar-thumb { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), color-mix(in srgb, var(--accent) 35%, transparent)); border-radius: 999px; border: 2px solid var(--bg-2); }
.tbl::-webkit-scrollbar-thumb:hover, .record-strip::-webkit-scrollbar-thumb:hover, pre.code::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.tbl { position: relative; }
.tbl::after { content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 28px; background: linear-gradient(90deg, transparent, var(--bg-2)); pointer-events: none; border-radius: 0 12px 12px 0; }
.tbl table { min-width: 100%; white-space: nowrap; }

/* ---------------- team hero (full-bleed, half-screen, bevelled, cut by the dashboard) ---------------- */
.team-hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: 50vh; min-height: 260px; max-height: 560px; margin-top: -14px; margin-bottom: calc(-25vh + 10px); z-index: 0; pointer-events: none; }
.team-hero-frame { position: absolute; inset: 0 0 0 0; overflow: hidden;
  /* gradient stroke: accent -> transparent -> accent, drawn by the frame's padding */
  padding: 2px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 85%, white 10%), color-mix(in srgb, var(--accent) 25%, transparent) 40%, color-mix(in srgb, var(--accent) 25%, transparent) 60%, color-mix(in srgb, var(--accent) 85%, white 10%));
  /* bevel / emboss: light top-left lip, dark bottom-right lip, soft drop */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.65), 0 18px 48px rgba(0,0,0,.55);
  border-radius: 0 0 28px 28px; }
.team-hero-img { position: absolute; inset: 2px; border-radius: 0 0 26px 26px; background-size: cover; background-position: center 35%; opacity: 0; transition: opacity .9s ease; filter: saturate(1.05) contrast(1.02); transform: scale(1.02); }
.team-hero-img.on { opacity: 1; }
.team-hero-vignette { position: absolute; inset: 2px; border-radius: 0 0 26px 26px;
  background:
    linear-gradient(180deg, rgba(7,9,13,.55) 0%, rgba(7,9,13,0) 22%, rgba(7,9,13,0) 45%, rgba(7,9,13,.92) 100%),
    radial-gradient(120% 80% at 50% 30%, transparent 55%, rgba(7,9,13,.5) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(255,255,255,.04); }
/* gradient fallback when no image has loaded */
.team-hero:not(.has-img) .team-hero-frame::after { content: ""; position: absolute; inset: 2px; border-radius: 0 0 26px 26px; background: radial-gradient(80% 90% at 50% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), linear-gradient(180deg, var(--bg-3), var(--bg)); }
/* the dashboard rises over the hero's lower half */
#home { position: relative; z-index: 1; }
#home .hero { padding-top: 18px; }
#home .hero-rating, #home .rt, #home .tile { box-shadow: 0 10px 30px rgba(0,0,0,.35); }
main.view-feed .team-hero { display: none; }
.mode-coach .team-hero { height: 36vh; margin-bottom: calc(-18vh + 10px); }
@media (max-width: 640px) { .team-hero { height: 40vh; margin-bottom: calc(-20vh + 10px); } }

/* header on small screens: brand + controls on row one, tabs on row two, still inside the bar */
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; row-gap: 8px; }
  .views { grid-column: 1 / -1; justify-content: flex-start; }
  .team-hero { margin-top: -14px; }
}

.site-foot .legal { color: var(--fg-2); }
.site-foot .legal b { color: var(--fg); letter-spacing: .04em; }

.brand-mark { width: 28px; height: 28px; border-radius: 7px; align-self: center; margin-right: 2px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.brand { align-items: center; }

/* ---------------- coach mode: a different room ---------------- */
.coach-deck { margin: 6px 0 12px; }
.coach-deck .tile-h { padding: 0 4px 8px; }
.coach-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* min-width: 0 — a grid item defaults to min-width:auto and grows to its table's intrinsic width, so two
   wide panels overlapped each other and the deck edge (v0.9.3). With it, .tbl's overflow-x: auto does its job. */
.coach-panels .cpanel { min-height: 0; min-width: 0; padding: 12px; display: grid; gap: 8px; align-content: start; }
.coach-panels .cpanel .tbl { max-width: 100%; }
.coach-panels .cpanel .tbl table { font-size: 12px; }
.coach-panels .cpanel .tbl th, .coach-panels .cpanel .tbl td { padding: 6px 8px; }
.coach-panels .cpanel .ph { display: grid; gap: 2px; }
.coach-panels .cpanel .ph .t { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; color: var(--fg); }
.coach-panels .cpanel .ph .t b { color: var(--accent); font-family: var(--mono); font-weight: 600; letter-spacing: 0; }
.coach-panels .cpanel .ph .s { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0; text-transform: none; white-space: normal; }
.coach-panels .cpanel.pending { opacity: .85; }
.coach-panels .cpanel.pending .skeleton { height: 12px; margin: 4px 0; }
@media (max-width: 760px) { .coach-panels { grid-template-columns: 1fr; } }
.mode-coach #tile-feed, .mode-coach #take, .mode-coach #fav { display: none !important; }
/* Rate differently builds formulas — an analyst's tool, coach mode only. Fans get knobs that are not facts (v0.11.0). */
body:not(.mode-coach) #rate-differently { display: none !important; }
.mode-coach .rt .v { font-family: var(--mono); font-size: 30px; }
.mode-coach .statement { font-family: var(--mono); font-size: 13.5px; }
.mode-coach .prose { font-size: 14px; color: var(--fg-2); }
.mode-coach .team-hero { height: 30vh; margin-bottom: calc(-15vh + 10px); }
.mode-coach .hero-abbr { font-size: clamp(36px, 8vw, 48px); }

/* Headline rating picker (v0.10.0): the hero ring is switchable by subject. Chips sit above the label;
   the active one carries the accent. Tiles below also switch it (click the tile body). */
.headline-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.headline-pick .hp { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg-3); cursor: pointer; }
.headline-pick .hp:hover { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.headline-pick .hp.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rt { cursor: pointer; }
.rt.headline { outline: 1px solid var(--accent); outline-offset: -1px; }
.rt.headline .k::after { content: " · headline"; color: var(--accent); letter-spacing: 0; text-transform: none; font-weight: 500; }

/* Fan knobs that are not facts (v0.11.0): allegiance, picks, hype. */
.fav.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pick { margin-top: 12px; display: grid; gap: 8px; }
.pick .ph { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--fg-3); display: flex; justify-content: space-between; gap: 8px; }
.pick .ph .rec { font-family: var(--mono); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.pick .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pick .side { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-3); color: var(--fg); cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .04em; }
.pick .side img { width: 26px; height: 26px; object-fit: contain; }
.pick .side:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.pick .side.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick .side[disabled] { opacity: .55; cursor: not-allowed; }
.pick .split { height: 8px; border-radius: 4px; background: var(--bg-3); overflow: hidden; display: flex; }
.pick .split i { display: block; height: 100%; background: var(--accent); }
.pick .split i.b { background: color-mix(in srgb, var(--fg-3) 60%, transparent); }
.pick .note, .hype .note { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.hype { margin-top: 10px; display: grid; gap: 6px; }
.hype .scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.hype .scale button { padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-3); color: var(--fg-2); font-family: var(--display); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.hype .scale button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hype .scale button.crowd { box-shadow: inset 0 -3px 0 var(--accent); }
.lb { display: grid; gap: 4px; margin-bottom: 10px; }
.lb .row { display: grid; grid-template-columns: 22px 24px 1fr auto; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; padding: 4px 6px; border-radius: 8px; background: var(--bg-3); }
.lb .row img { width: 20px; height: 20px; border-radius: 6px; }
.lb .row .h { font-family: var(--body, inherit); font-weight: 600; }
.lb .row .r { color: var(--fg-2); }
.lb .row.me { outline: 1px solid var(--accent); outline-offset: -1px; }
.lb .lbh { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--fg-3); }
.fi .t .pk { font-family: var(--display); font-weight: 800; color: var(--accent); }

/* Headline sharecard (v0.12.0): a 1200×630 canvas drawn from the hero, the logo and the numbers. */
.card.share canvas { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-3); }
.card.share .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.card.share .soc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card.share .soc a { text-decoration: none; }
.card.share .cap { margin-top: 10px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; color: var(--fg-2); }
.card.share .out { font-family: var(--mono); font-size: 11px; color: var(--fg-3); min-height: 14px; }
.chip.share { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }

/* Side stack (v0.12.3): Last game over What's hurting them in one column; Next up spans two at 3-col. */
.tile-stack { display: grid; gap: 10px; align-content: start; min-width: 0; }
.tile-stack .tile { min-width: 0; }
.tile.next { min-width: 0; }
.pick .side { min-width: 0; overflow: hidden; }
.pick .side span { white-space: nowrap; }
