/* Fifty Seasons: loads after css/site.css. Black like the rest of the site; the colour is the tribes' own buffs. */

:root {
  --ink: #f2f4f8;
  --ink-soft: #a9b0c0;
  --ink-mute: #6b7282;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --bg-elev: #0b0c10;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --nav-h: 76px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gold: #ffd27a;
  --ember: #ff7a3d;
}
body.surv { overflow-x: hidden; }
body.surv .cursor, body.surv .cursor-ring { display: none !important; }
:where(body.surv) canvas { display: block; }
body.surv [hidden] { display: none !important; }

/* ---------- head ---------- */
.u-head { padding: calc(var(--nav-h) + 30px) var(--gutter) 18px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 48px; }
.u-title h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 760; line-height: .9; letter-spacing: -.05em; margin: 0 0 .7rem; }
.u-stats { font-size: 1rem; color: var(--ink-soft); max-width: 36em; }
.u-switch { display: grid; gap: .6rem; justify-items: end; max-width: 720px; }
.u-tabs { display: inline-flex; gap: 26px; }
.u-tabs button { position: relative; padding: 6px 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink-mute); white-space: nowrap; transition: color .2s var(--ease); }
.u-tabs button:hover, .u-tabs button[aria-selected="true"] { color: var(--ink); }
.u-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ink); }
.u-desc { font-size: .92rem; line-height: 1.45; color: var(--ink-soft); text-align: right; min-height: 1.5em; max-width: 34em; }
.u-stage { position: relative; }
.u-view { display: none; position: relative; }
.u-view.on { display: block; animation: uIn .6s var(--ease-out) both; }
@keyframes uIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- shared controls ---------- */
.chip-btn, .ctl {
  font-size: .86rem; font-weight: 500; line-height: 1.2;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: .42rem .75rem; color: var(--ink-soft); background: transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease); white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45rem;
}
.chip-btn:hover, .ctl:hover { color: var(--ink); border-color: rgba(255, 255, 255, .34); }
.chip-btn[aria-pressed="true"] { color: #000; background: var(--ink); border-color: var(--ink); }
.chip-btn i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ctl svg { width: 14px; height: 14px; }
.ctl[aria-pressed="true"] { color: var(--ink); border-color: rgba(255, 255, 255, .34); }
.lbl { font-size: .86rem; color: var(--ink-mute); }

/* ---------- The Season ---------- */
.s-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; padding: 6px var(--gutter) 4px; }
.s-read { min-height: 152px; display: flex; flex-direction: column; justify-content: flex-end; }
.s-kick { font-size: .86rem; font-weight: 600; color: var(--ink-mute); }
.s-name { margin: .2rem 0 0; font-size: clamp(2rem, 3.6vw, 3.1rem); font-weight: 760; line-height: .95; letter-spacing: -.045em; }
.s-exit { margin-top: .45rem; font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.s-line { margin-top: .45rem; max-width: 56em; font-size: .98rem; line-height: 1.5; color: var(--ink-soft); }
.s-line b { color: var(--ink); font-weight: 600; }
.s-also { margin-top: .4rem; font-size: .92rem; color: var(--ink-mute); }
.s-also a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.s-also a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.s-ctl { display: grid; justify-items: end; gap: .5rem; }
.s-ctl-row { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.s-play { color: #000; background: var(--ink); border-color: var(--ink); font-weight: 600; }
.s-play:hover { color: #000; background: #fff; border-color: #fff; }
.s-caption { min-height: 1.4em; max-width: 30em; font-size: .92rem; line-height: 1.45; color: #fff1c9; text-align: right; }
.s-chart { height: clamp(480px, 66svh, 760px); margin: 4px 0 0; }
.s-canvas { width: 100%; height: 100%; cursor: crosshair; }
.s-key { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .6rem var(--gutter) 0; font-size: .84rem; color: var(--ink-mute); }
.s-key span { display: inline-flex; align-items: center; gap: .5rem; }
.s-key i { display: inline-block; flex: none; }
.k-thread { width: 26px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #ffab40 0 30%, #ffab40 30%); clip-path: polygon(0 40%, 35% 30%, 60% 0, 100% 0, 100% 100%, 60% 100%, 35% 70%, 0 60%); }
.k-stitch { width: 16px; height: 10px; border-right: 1.5px solid #9cc4ff; border-bottom: 1.5px solid #9cc4ff; border-radius: 0 0 10px 0; transform: translateY(-3px); }
.k-ember { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); }
.k-idol { width: 7px; height: 7px; border: 1.3px solid var(--gold); transform: rotate(45deg); }
.k-idol.on { background: var(--gold); }
.k-jury { width: 24px; border-top: 1.5px dashed rgba(169, 176, 192, .8); }
.s-wall-h { margin: 2.6rem var(--gutter) .9rem; font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; }
.s-wall { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 12px; padding: 0 var(--gutter); }
@media (max-width: 1200px) { .s-wall { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.s-mini { display: grid; gap: 6px; padding: 8px 8px 7px; border: 1px solid var(--line); border-radius: 10px; text-align: left; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.s-mini:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .025); }
.s-mini.on { border-color: rgba(255, 255, 255, .6); }
.s-mini canvas { width: 100%; height: 62px; }
.s-mini span { font-size: .78rem; line-height: 1.25; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-mini b { color: var(--ink); font-weight: 650; margin-right: .2rem; }

/* ---------- Everyone ---------- */
.e-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; padding: 6px var(--gutter) 4px; }
.e-read { min-height: 148px; display: flex; flex-direction: column; justify-content: flex-end; }
.e-filters { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; max-width: 520px; }
.e-career { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin-top: .6rem; }
.e-career span { font-size: .9rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 7px; padding: .2rem .5rem; }
.e-career span.on { color: var(--ink); border-color: rgba(255, 255, 255, .45); }
.e-career b { color: var(--gold); font-weight: 650; }
.e-chart { height: clamp(620px, 88svh, 900px); }
.e-canvas { width: 100%; height: 100%; cursor: crosshair; }

/* ---------- The Edit ---------- */
.d-top { padding: 6px var(--gutter) 0; }
.d-head { margin: .3rem 0 0; max-width: 20em; font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 740; line-height: 1.05; letter-spacing: -.035em; }
.d-top .s-line { max-width: 52em; }
.d-ladder { height: clamp(330px, 44svh, 440px); margin-top: 1.2rem; }
.d-ladder canvas { width: 100%; height: 100%; }
.d-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 32px 48px; padding: 1.6rem var(--gutter) 0; align-items: start; }
.d-season-name, .d-game-h { margin: .2rem 0 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 740; letter-spacing: -.035em; line-height: 1; }
.d-season-h .s-line a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.d-heat { margin-top: .9rem; }
.d-heat canvas { width: 100%; }
.d-game { border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.25rem 1.1rem; }
.d-game-p { margin-top: .5rem; font-size: .95rem; line-height: 1.5; color: var(--ink-soft); }
.d-game-p b { color: var(--ink); font-weight: 650; }
.d-bars { display: grid; gap: 5px; margin-top: 1rem; }
.d-bar { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2.2em; align-items: center; gap: .6rem; padding: .28rem .45rem; border: 1px solid transparent; border-radius: 8px; text-align: left; font-size: .88rem; color: var(--ink-soft); transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.d-bar:not(:disabled):hover { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); color: var(--ink); }
.d-bar-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-bar-track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.d-bar-track i { display: block; width: var(--w); height: 100%; border-radius: 4px; background: var(--c); }
.d-bar-v { text-align: right; font-variant-numeric: tabular-nums; }
.d-bar.win { border-color: var(--gold); color: var(--gold); }
.d-bar.picked:not(.win) { border-color: rgba(255, 255, 255, .45); }
.d-bar:disabled { cursor: default; }
.d-game-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.d-verdict { font-size: .92rem; line-height: 1.45; color: var(--ink-soft); }
.d-score { margin-top: .7rem; font-size: .84rem; color: var(--ink-mute); }

/* ---------- tooltip ---------- */
.u-tip {
  position: fixed; left: 0; top: 0; z-index: 170; pointer-events: none; max-width: 320px;
  background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .75rem;
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.u-tip.show { opacity: 1; transform: none; }
.u-tip b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.u-tip small { display: block; margin-top: .1rem; font-size: .82rem; line-height: 1.4; color: var(--ink-soft); }
.u-tip em { display: block; margin-top: .2rem; font-style: normal; font-size: .78rem; color: var(--ink-mute); }

/* ---------- footer ---------- */
.u-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding: 1.6rem var(--gutter) 2rem; margin-top: 2.4rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-mute); }
.u-foot a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.u-foot a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .u-switch { justify-items: start; }
  .u-desc { text-align: left; }
  .s-top { grid-template-columns: minmax(0, 1fr); }
  .s-ctl { justify-items: start; }
  .s-ctl-row { justify-content: flex-start; }
  .s-caption { text-align: left; }
  .e-top { grid-template-columns: minmax(0, 1fr); }
  .e-filters { justify-content: flex-start; }
  .d-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) { :root { --nav-h: 64px; } }
@media (max-width: 640px) {
  .u-switch { width: 100%; }
  .u-tabs { width: 100%; justify-content: space-between; gap: 12px; }
  .s-chart { overflow-x: auto; }
  .s-chart canvas { min-width: 760px; }
  .s-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .u-view.on { animation: none; } }
