/* AutoRotationManager v2 — design language from docs/user-journey.drawio ("Mobile screens")
   Setup = light, list-based. Live = dark focus mode. Burgundy is the only accent. */

:root {
  --accent: #741E40;
  --accent-strong: #5A1730;
  --accent-soft: #F6E9EE;
  --ink: #111114;
  --muted: #8E8E93;
  --line: #ECECEF;
  --canvas: #F7F7F8;
  --surface: #FFFFFF;
  --surface-2: #F1F1F3;
  --in: #16A34A;
  --out: #DC2626;
  --win: #16A34A; --win-soft: #E8F6EE;
  --loss: #DC2626; --loss-soft: #FDECEC;
  --draw: #D97706; --draw-soft: #FEF3E2;
  --radius-card: 20px;
  --radius-tile: 16px;
  --gutter: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

body.live {
  --accent: #E0457B;
  --accent-strong: #741E40;
  --accent-soft: #3A1220;
  --ink: #FAFAFA;
  --muted: #8E8E93;
  --line: #26262B;
  --canvas: #0B0B0D;
  --surface: #18181B;
  --surface-2: #26262B;
  --in: #34D399;
  --out: #F87171;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 16px) var(--gutter) calc(env(safe-area-inset-bottom) + 96px);
  gap: 16px;
}
.screen.enter { animation: enter .22s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- nav + titles */
.nav { display: flex; align-items: center; min-height: 36px; gap: 8px; }
.nav .back { font-size: 32px; line-height: 1; color: var(--accent); width: 36px; height: 36px; margin-left: -8px; }
.nav .action { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.brand img { width: 26px; height: 26px; }
.large-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.subtitle { font-size: 13px; color: var(--muted); margin-top: -10px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; font-size: 16px; font-weight: 700; margin: 8px 0 -4px; }
.section-title button { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border-radius: var(--radius-card); padding: 16px; }
.hero {
  background: var(--accent); color: #fff; border-radius: 24px; padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.hero .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #E9C6D3; text-transform: uppercase; }
.hero .title { font-size: 22px; font-weight: 700; }
.hero .meta { font-size: 13px; color: #E9C6D3; }
.hero .btn-light { margin-top: 12px; align-self: flex-start; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent);
}
.pill.neutral { background: var(--surface-2); color: var(--muted); }
.pill.warn { background: var(--draw-soft); color: var(--draw); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; border-radius: 999px; padding: 0 24px; font-weight: 700; font-size: 16px;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-light { background: #fff; color: var(--accent); height: 40px; font-size: 14px; padding: 0 18px; }
.btn-ghost { background: var(--surface-2); color: var(--ink); width: 100%; }
.btn-white { background: #fff; color: var(--accent-strong); width: 100%; }
.footer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px; padding: 24px var(--gutter) calc(env(safe-area-inset-bottom) + 16px);
  background: linear-gradient(to bottom, transparent, var(--canvas) 40%);
  z-index: 5;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--surface); color: var(--ink); font-size: 14px; flex: none;
}

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border-radius: var(--radius-tile); padding: 10px 12px; min-height: 56px;
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .meta { font-size: 12px; color: var(--muted); }
.result-badge {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.result-badge.W { background: var(--win-soft); color: var(--win); }
.result-badge.L { background: var(--loss-soft); color: var(--loss); }
.result-badge.D { background: var(--draw-soft); color: var(--draw); }
.score { font-weight: 700; font-size: 15px; }

/* fixtures */
.fixture {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border-radius: 18px; padding: 12px 14px; border: 2px solid transparent;
}
.fixture[aria-pressed="true"] { border-color: var(--accent); }
.date-block {
  width: 50px; height: 50px; border-radius: 14px; background: var(--canvas); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.date-block b { font-size: 18px; }
.date-block span { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.fixture[aria-pressed="true"] .date-block { background: var(--accent-soft); color: var(--accent); }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.fixture[aria-pressed="true"] .radio { background: var(--accent); border-color: var(--accent); color: #fff; }

/* players grid */
.player-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-tile {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 56px;
  background: var(--surface); border-radius: var(--radius-tile); padding: 10px; border: 2px solid transparent;
}
.player-tile[aria-pressed="true"] { border-color: var(--accent); }
.player-tile .name { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-tile .num { font-size: 11px; color: var(--muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--canvas); color: var(--muted);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
}
.player-tile[aria-pressed="true"] .avatar { background: var(--accent); color: #fff; }
.player-tile.keeper .num { color: var(--accent); font-weight: 600; }
.icon { width: 18px; height: 18px; display: block; }
.avatar.small { width: 30px; height: 30px; }
.avatar.small .icon { width: 16px; height: 16px; }
.keeper-row {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border-radius: var(--radius-tile); padding: 10px 14px; font-size: 13px; line-height: 1.35;
}
.keeper-row .grow { flex: 1; min-width: 0; }
.keeper-row .link { color: var(--accent); font-weight: 600; white-space: nowrap; }
.check-list { display: flex; flex-direction: column; gap: 4px; max-height: 52dvh; overflow: auto; margin: 0 -4px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; text-align: left; font-size: 15px; font-weight: 500; }
.check-row .grow { flex: 1; }
.check-row[aria-pressed="true"] { background: var(--accent-soft); }
.check-row[aria-pressed="true"] .avatar { background: var(--accent); color: #fff; }
.check-row .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.check-row[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
body:not(.live) .bottom-sheet .grab { background: var(--line); }

/* calculating */
.calc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.ring { width: 140px; height: 140px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.steps { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 8px; }
.step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.step .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--accent); display: grid; place-items: center; font-size: 11px; color: #fff; }
.step.done { color: var(--ink); font-weight: 600; }
.step.done .dot { background: var(--accent); border: 0; }

/* plan */
.period-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.period-value { font-size: 46px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--canvas); border-radius: 999px; padding: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); font-weight: 700; font-size: 18px; }
.stepper button.plus { background: var(--accent); color: #fff; }
.stepper output { min-width: 46px; text-align: center; font-weight: 700; font-size: 14px; }
.queue-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 10px 12px; font-size: 13px; }
.time-pill { background: var(--canvas); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 12px; flex: none; }
.queue-row.first .time-pill { background: var(--accent-soft); color: var(--accent); }
.io-in { color: var(--in); font-weight: 700; }
.io-out { color: var(--out); font-weight: 700; }
.busy { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- live (dark) */
.live-top { display: flex; align-items: center; gap: 8px; }
.live-top .who { flex: 1; min-width: 0; }
.live-top .who .label { font-size: 11px; }
.live-top .who .opp { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pill { background: #3A1220; color: var(--out); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 5px 10px; }
.live-pill.paused { background: var(--surface-2); color: var(--muted); }

.focus { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.big-timer { text-align: center; margin-top: 4vh; }
.big-timer .t { font-size: clamp(76px, 25vw, 120px); font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-timer .of { color: var(--muted); font-size: 14px; margin-top: 6px; }
.next-rot { text-align: center; padding: 8px 0; border-radius: 20px; }
.next-rot:active { background: var(--surface); }
.next-rot .in { font-size: 38px; font-weight: 700; color: var(--accent); margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.next-rot .names { font-size: 16px; font-weight: 600; line-height: 1.6; }

.timeline { position: relative; height: 60px; margin: 0 6px; }
.timeline .track, .timeline .fill { position: absolute; top: 26px; height: 4px; border-radius: 2px; left: 0; }
.timeline .track { right: 0; background: var(--surface-2); }
.timeline .fill { background: var(--accent); }
.timeline .ev { position: absolute; top: 23px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--surface-2); }
.timeline .ev.done { background: var(--accent); }
.timeline .ev.next { top: 19px; width: 18px; height: 18px; margin-left: -9px; background: var(--canvas); border: 3px solid var(--accent); }
.timeline .ev.end { width: 12px; height: 12px; margin-left: -6px; top: 22px; background: var(--canvas); border: 2px solid var(--muted); }
.timeline .now { position: absolute; top: 12px; width: 2px; height: 32px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.timeline .now-label { position: absolute; top: -6px; transform: translateX(-50%); font-size: 11px; font-weight: 700; }
.timeline .tick-label { position: absolute; top: 42px; font-size: 10px; color: var(--muted); }
.timeline .next-label { position: absolute; top: 42px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.handle { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; color: var(--muted); font-weight: 600; font-size: 13px; width: 100%; }
.handle::before { content: ''; width: 40px; height: 5px; border-radius: 3px; background: #3A3A40; }

/* folded timer + sheet */
.folded { background: var(--surface); border-radius: 20px; padding: 12px 16px 10px; display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: center; }
.folded .t { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.folded .sub { font-size: 11px; color: var(--muted); }
.folded .nr { text-align: right; }
.folded .nr .v { color: var(--accent); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.folded .bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.folded .bar i { display: block; height: 100%; background: var(--accent); }

.segmented { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; }
.segmented button { flex: 1; height: 30px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.segmented.small button { height: 24px; font-size: 11px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

.sheet-body { display: flex; flex-direction: column; gap: 14px; }

/* stats: timeline chart */
.tl-chart { position: relative; display: grid; grid-template-columns: 72px 1fr; row-gap: 8px; column-gap: 6px; }
.tl-axis { grid-column: 2; position: relative; height: 14px; font-size: 9px; color: var(--muted); }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.tl-track { position: relative; height: 18px; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--surface-2); }
.tl-seg { position: absolute; top: 3px; height: 12px; border-radius: 4px; }
.tl-seg.played { background: var(--in); }
.tl-seg.planned { border: 1.5px dashed #4A4A52; }
.tl-mark { position: absolute; top: -1px; transform: translateX(-50%); font-size: 12px; line-height: 20px; }
.tl-mark.assist { width: 14px; height: 14px; top: 2px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--canvas); font-size: 8px; font-weight: 700; line-height: 11px; text-align: center; }
.tl-overlay { position: absolute; top: 0; bottom: 0; left: 78px; right: 0; pointer-events: none; }
.tl-now { position: absolute; top: 10px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--accent); }
.tl-now::after { content: 'now'; position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
.tl-conceded { position: absolute; top: 2px; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--out); }
.legend { font-size: 11px; color: var(--muted); text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 14px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

/* stats: play time */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--surface); border-radius: 16px; padding: 10px; text-align: center; }
.tile b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11px; color: var(--muted); }
.pt-list { position: relative; display: flex; flex-direction: column; gap: 10px; }
.pt-row { display: grid; grid-template-columns: 72px 1fr 44px 52px; align-items: center; gap: 8px; font-size: 12px; }
.pt-row .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-row .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 7px; border-radius: 4px; background: var(--surface-2); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.bar i.below { background: #6A6A72; }
.bar i.green { background: var(--in); }
.delta { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 2px 0; text-align: center; font-variant-numeric: tabular-nums; }
.delta.pos { background: #14321F; color: var(--in); }
.delta.neg { background: #3A1A1C; color: var(--out); }
.fair-line { position: absolute; top: -4px; bottom: -4px; border-left: 1.5px dashed var(--ink); opacity: .8; pointer-events: none; }
.fair-line span { position: absolute; bottom: -18px; transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap; }

/* stats: goals */
.scoreboard { background: var(--surface); border-radius: 20px; padding: 12px 16px; }
.scoreboard .teams { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; gap: 12px; }
.scoreboard .teams span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.scoreboard .big { text-align: center; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scoreboard .big i { font-style: normal; color: #55555c; margin: 0 6px; }
.ga-table { display: flex; flex-direction: column; gap: 8px; }
.ga-row { display: grid; grid-template-columns: 28px 1fr 32px 32px; align-items: center; gap: 8px; font-size: 13px; }
.ga-row .avatar { width: 26px; height: 26px; font-size: 9px; background: var(--surface-2); color: var(--ink); }
.ga-row b, .ga-row .h { text-align: center; }
.ga-row .h { font-size: 11px; color: var(--muted); font-weight: 700; }
.ga-row .zero { color: #55555c; }
.feed-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.feed-row .time-pill { background: var(--surface); color: var(--muted); }
.feed-row .x { margin-left: auto; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; }

/* queue (live) */
.vq { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 28px; }
.vq::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--surface-2); }
.vq-item { position: relative; padding: 8px 12px; border-radius: 16px; }
.vq-item::before { content: ''; position: absolute; left: -27px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--canvas); border: 2px solid #3A3A40; box-sizing: border-box; }
.vq-item.done { color: var(--muted); }
.vq-item.done::before { background: var(--muted); border: 0; }
.vq-item.next { background: var(--surface); outline: 1.5px solid var(--accent); }
.vq-item.next::before { border: 3px solid var(--accent); }
.vq-item .when { font-size: 11px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }
.vq-item.next .when { color: var(--accent); }
.vq-item .what { font-size: 13px; margin-top: 2px; }
.vq-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 2px -28px; }

/* field tab */
.field-group { display: flex; flex-direction: column; gap: 8px; }
.pchip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pchip { border-radius: 14px; padding: 10px 6px; text-align: center; font-weight: 700; font-size: 13px; background: var(--surface-2); }
.pchip small { display: block; font-weight: 500; font-size: 10px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pchip.on { background: #10B981; color: #fff; }
.pchip.on small { color: #D1FAE5; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; animation: fade .15s ease; }
.overlay::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.overlay.center { justify-content: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.overlay > * { position: relative; width: 100%; max-width: 480px; margin: 0 auto; }
.rotate-card { background: #741E40; border-radius: 28px; padding: 22px 20px; color: #fff; display: flex; flex-direction: column; gap: 12px; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.rotate-card .head { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: #F3CDDB; }
.rotate-card .clock { text-align: center; font-size: 15px; color: #F3CDDB; font-variant-numeric: tabular-nums; }
.pair { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; }
.pair > div { border-radius: 16px; padding: 10px; text-align: center; font-weight: 700; font-size: 17px; }
.pair small { display: block; font-size: 9px; letter-spacing: .08em; }
.pair .o { background: #5A1730; }
.pair .o small { color: #F87171; }
.pair .i { background: #fff; color: #111114; }
.pair .i small { color: #059669; }
.pair .arrow { text-align: center; color: #F3CDDB; }
.rotate-card .later { color: #F3CDDB; font-size: 13px; font-weight: 600; padding: 6px; }

.bottom-sheet { background: var(--surface); border-radius: 32px 32px 0 0; padding: 10px var(--gutter) calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease; max-height: 88dvh; overflow: auto; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.bottom-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #3A3A40; margin: 0 auto 4px; }
.bottom-sheet h2 { margin: 0; font-size: 20px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { height: 40px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }
.choice.outline[aria-pressed="true"] { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* halftime / fulltime */
.center-head { text-align: center; display: flex; flex-direction: column; gap: 4px; margin-top: 3vh; }
.center-head h1 { margin: 0; font-size: 32px; }
.center-head .badge { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 28px; margin: 0 auto 8px; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: grid; grid-template-columns: 70px 1fr 46px; align-items: center; gap: 8px; font-size: 12px; }
.mini-row .n { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .v { text-align: right; font-variant-numeric: tabular-nums; }
.mini-row .bar { height: 4px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%);
  background: #111114; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
  pointer-events: none;
}
/* live mode: keep the bottom handle and buttons free */
body.live .toast { background: #FAFAFA; color: #111114; bottom: auto; top: calc(env(safe-area-inset-top) + 64px); }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 18px; height: 74px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.inline-icon { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.inline-icon .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- accounts */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none;
}
.form input:focus { border-color: var(--accent); }
.form .hint { font-weight: 400; font-size: 12px; }
.form-error { background: var(--loss-soft); color: var(--loss); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.link-btn { color: var(--accent); font-weight: 600; text-decoration: underline; }
.choice-cards { display: flex; flex-direction: column; gap: 10px; }
.choice-card {
  display: flex; align-items: center; gap: 14px; text-align: left; font-size: 14px; line-height: 1.4;
  background: var(--surface); border-radius: 18px; padding: 14px; border: 2px solid transparent;
}
.choice-card[aria-pressed="true"] { border-color: var(--accent); }
.choice-card[aria-pressed="true"] .avatar { background: var(--accent); color: #fff; }
.player-tile:disabled { opacity: .45; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar.big { width: 56px; height: 56px; font-size: 18px; background: var(--accent); color: #fff; }
.member { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-tile); padding: 10px 12px; }
.member .grow { flex: 1; min-width: 0; }
.member .title { font-weight: 600; font-size: 14px; }
.member .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.pending { border: 2px solid var(--draw); }
body:not(.live) .icon-btn { background: var(--canvas); }
body:not(.live) .chip { border-color: var(--line); }
.chip.on, body:not(.live) .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.temp-pw { font-size: 22px; font-weight: 700; letter-spacing: .04em; margin: 4px 0; user-select: all; }
.live-hero .live-score { font-size: 54px; font-weight: 700; line-height: 1; margin: 6px 0; }
.live-hero .live-score i { font-style: normal; opacity: .5; margin: 0 8px; }
.header-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; margin-left: auto; }
.viewer-pill { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 5px 10px; }
.notice { background: var(--draw-soft); color: #92400e; border-radius: 14px; padding: 10px 14px; font-size: 13px; }
