:root {
  --red: #E11D2E;
  --red-2: #B5121F;
  --red-soft: rgba(225, 29, 46, .14);
  --bg: #0B0B0E;
  --card: #15151A;
  --card-2: #1D1D24;
  --card-3: #262630;
  --line: rgba(255, 255, 255, .08);
  --text: #F5F5F7;
  --muted: #9B9BA8;
  --green: #22C55E;
  --amber: #F5A524;
  --blue: #3B82F6;
  --gold: #D4A23A;
  --viewer-bg: #E8E6E2;
  --viewer-ink: #18181B;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viewer-bg: #1A1A1F; --viewer-ink: #EDEDF0; }
}
:root[data-theme="dark"] { --viewer-bg: #1A1A1F; --viewer-ink: #EDEDF0; }

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { background: var(--viewer-bg); color: var(--viewer-ink); font-family: var(--sans); }
body { min-height: 100vh; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
button:disabled { cursor: not-allowed; }
input { font: inherit; }
.ic { flex: none; }

/* ---------- viewer shell ---------- */
.viewer-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; }
.viewer-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.viewer-brand strong { display: block; font-family: var(--cond); font-size: 22px; letter-spacing: .02em; text-transform: uppercase; }
.viewer-brand small { color: color-mix(in srgb, var(--viewer-ink) 60%, transparent); font-size: 12.5px; }
.viewer-logo { height: 26px; width: auto; display: block; }
.viewer-brand { gap: 14px; }
.rcr-lion { display: block; height: 100%; aspect-ratio: 104 / 94; background: url(../brand/rcr-horizontal.png) no-repeat 0 50% / auto 100%; }
.seg { display: flex; background: color-mix(in srgb, var(--viewer-ink) 8%, transparent); border-radius: 999px; padding: 4px; }
.seg button { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: color-mix(in srgb, var(--viewer-ink) 70%, transparent); }
.seg button.on { background: var(--red); color: #fff; }
.ghost-btn { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--viewer-ink) 20%, transparent); }
.stage-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 8px 16px 16px; overflow: hidden; }
.stage { display: flex; gap: 56px; align-items: flex-start; transform-origin: top center; width: max-content; }
.device-label { font-size: 13px; font-weight: 600; margin: 0 0 12px 6px; color: color-mix(in srgb, var(--viewer-ink) 65%, transparent); }

.phone-frame { width: 414px; height: 868px; padding: 12px; border-radius: 60px; background: #09090B;
  box-shadow: 0 0 0 2px #2a2a30, 0 30px 70px rgba(0, 0, 0, .35); }
.phone-screen { position: relative; width: 390px; height: 844px; border-radius: 48px; overflow: hidden; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; font-size: 15px; }
.ipad-frame { width: 1230px; height: 870px; padding: 18px; border-radius: 40px; background: #09090B;
  box-shadow: 0 0 0 2px #2a2a30, 0 30px 70px rgba(0, 0, 0, .35); }
.ipad-screen { width: 1194px; height: 834px; border-radius: 24px; overflow: hidden; background: #08080A; color: var(--text); position: relative; }

/* ---------- phone basics ---------- */
.statusbar { height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 30px 0 36px; font-weight: 600; font-size: 15px; position: relative; z-index: 3; }
.notch { position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; background: #000; border-radius: 20px; }
.sb-icons { font-size: 10px; letter-spacing: 1px; }
.ph-view { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.ph-view::-webkit-scrollbar { display: none; }
.pad { padding: 4px 16px 24px; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.center { text-align: center; }
.pad-y { padding: 18px 0; }
.red { color: var(--red); }

.ph-head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 12px; }
.ph-head-title { flex: 1; min-width: 0; }
.ph-head-title small { color: var(--muted); font-size: 12px; font-weight: 500; display: block; }
.ph-head h1 { font-family: var(--cond); font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); position: relative; flex: none; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; font-style: normal; }

.home-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 14px; }
.home-logo { height: 40px; flex: none; }
.home-head h1 { font-family: var(--cond); font-size: 28px; font-weight: 700; text-transform: uppercase; line-height: 1; }
.role-bar { display: flex; align-items: center; gap: 10px; }
.role-bar select { font: inherit; font-size: 14px; font-weight: 700; padding: 7px 34px 7px 12px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--red); background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff; appearance: none; -webkit-appearance: none; }
.role-bar select option { color: #111; background: #fff; }
.empty { text-align: center; padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .tile-ic { margin: 0; }
.announce { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.announce input, .announce textarea { background: var(--card-2); border: 0; border-radius: 14px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 14.5px; outline: none; resize: none; }
.announce .btn-primary { margin: 0; }
.tag-court { background: rgba(46, 111, 158, .2); color: #6FB2E6; }
.role-chip { font-size: 11.5px; font-weight: 600; padding: 7px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }

.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.sec-title h2 { font-family: var(--cond); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.link { color: var(--red); font-weight: 600; font-size: 13.5px; }
.group-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 4px 8px; }

.card { background: var(--card); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.card.flush { padding: 4px 0; overflow: hidden; }
.list { background: var(--card); border-radius: 18px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
button.row:active { background: var(--card-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-badge { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 15px; flex: none; }
.row-badge.home { background: var(--red-soft); color: var(--red); }
.row-badge.away { background: var(--card-3); color: var(--muted); }
.score-mini { font-family: var(--cond); font-weight: 700; font-size: 18px; white-space: nowrap; }
.score-mini.win { color: var(--green); }
.score-mini.loss { color: var(--muted); }
.score-mini.live { color: var(--red); }
.time-mini { color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.live-txt { color: var(--red); font-style: normal; font-weight: 700; }

/* live card */
.live-card { display: block; width: 100%; border-radius: 22px; padding: 14px 16px 12px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #C8172A 0%, #7E0C17 55%, #2A0509 100%); box-shadow: 0 10px 30px rgba(225, 29, 46, .25); }
.live-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.live-top .sm { margin-left: auto; opacity: .8; }
.live-card .muted { color: rgba(255, 255, 255, .8); }
/* Live card colour follows the clock: running = green, stopped = red, break/timeout = black */
.live-card.ph-run { background: linear-gradient(165deg, #22A04B 0%, #0E4A24 42%, #050505 100%); box-shadow: 0 10px 30px rgba(34, 197, 94, .22); }
.live-card.ph-stopped { background: linear-gradient(165deg, #E11D2E 0%, #6A0B15 42%, #050505 100%); }
.live-card.ph-break, .live-card.ph-timeout { background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.brk-label { text-align: center; font-family: var(--cond); font-weight: 800; font-size: 26px; letter-spacing: .16em; margin: 2px 0 10px; color: #fff; }
.brk-label small { display: block; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .1em; opacity: .65; text-transform: uppercase; }
.live-foot.tops { display: flex; justify-content: space-between; gap: 12px; white-space: normal; }
.tops span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tops span.r { text-align: right; align-items: flex-end; }
.tops b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.tops em { font-style: normal; font-size: 11px; opacity: .75; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 9px; border-radius: 999px; }
.pill-live { background: #fff; color: var(--red); }
.pill-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
.pill-final { background: rgba(255, 255, 255, .18); color: #fff; }
@keyframes blink { 50% { opacity: .2; } }
.live-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; column-gap: 12px; margin: 12px 0 10px; }
.lt { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; min-width: 0; text-align: center; }
.lt b { font-family: var(--cond); font-size: 16px; line-height: 1.1; text-transform: uppercase; letter-spacing: .03em; overflow-wrap: anywhere; }
.lt-score { align-self: center; font-family: var(--cond); font-weight: 800; font-size: 48px; line-height: 1; display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.lt-score em { font-style: normal; opacity: .5; font-size: 34px; }
.live-foot { font-size: 12.5px; opacity: .85; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crest { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
  font-family: var(--cond); font-weight: 800; font-size: 14px; color: #fff; letter-spacing: .02em; }
.crest svg { width: 100%; height: 100%; display: block; }
.crest { position: relative; }
.crest:not(.logo) { background: var(--c-bg); color: var(--c-ink); box-shadow: inset 0 0 0 2px var(--c-ring); }
.crest.logo { background: none; border: 0; overflow: visible; }
.crest.logo > span { display: none; }
.crest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.crest.xs { width: 30px; height: 30px; font-size: 10px; }
.crest-pair { display: flex; flex: none; }
.crest-pair { gap: 2px; }
.lad-team { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lad-team .crest.xs { width: 24px; height: 24px; font-size: 8px; }
.final-board .crest { margin: 0 4px; }
.crest.opp { border: 2px solid rgba(255, 255, 255, .25); }
.crest.lg { width: 56px; height: 56px; font-size: 17px; }
.crest.md { width: 40px; height: 40px; font-size: 13px; }
.crest.sm { width: 30px; height: 30px; font-size: 10px; }

/* next game */
.next-card { background: var(--card); border-radius: 18px; overflow: hidden; }
.next-main { display: flex; align-items: center; gap: 14px; padding: 14px; width: 100%; }
.next-date { width: 54px; height: 58px; border-radius: 14px; background: var(--red); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.next-date b { font-family: var(--cond); font-size: 28px; line-height: 1; }
.next-date small { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.next-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.next-info b { font-size: 16px; }
.next-info small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.rsvp { display: flex; align-items: center; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rsvp span { margin-right: auto; }
.rsvp.wide { background: var(--card); border-radius: 16px; margin-top: 12px; border: 0; padding: 12px 14px; }
.rsvp-btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 999px; background: var(--card-2); font-weight: 600; font-size: 13px; color: var(--text); }
.rsvp-btn.on.yes { background: var(--green); color: #04210f; }
.rsvp-btn.on.no { background: var(--card-3); color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--card); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 3px; min-height: 108px; }
.tile-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--card-2); display: grid; place-items: center; margin-bottom: 8px; color: var(--red); }
.tile b { font-size: 14.5px; }
.tile small { color: var(--muted); font-size: 12px; }
.tile.hot { box-shadow: inset 0 0 0 1.5px var(--red); }
.tile.hot small { color: var(--red); font-weight: 600; }
.news-thumb { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #2b2b33, #17171c); display: grid; place-items: center; color: var(--red); flex: none; }

/* segmented + chips */
.segctl { display: flex; background: var(--card); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.segctl button { flex: 1; text-align: center; padding: 8px 0; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.segctl button.on { background: var(--card-3); color: var(--text); }
.chips { display: flex; gap: 8px; margin-bottom: 4px; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); }

/* ladder */
.ladder { padding: 0; overflow: hidden; }
.ladder-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 14px 6px; }
.ladder-head small { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 6px; text-align: center; }
td { padding: 9px 6px; text-align: center; font-size: 13.5px; border-top: 1px solid var(--line); }
th.l, td.l { text-align: left; padding-left: 14px; }
tr.me td { background: var(--red-soft); font-weight: 700; }
tr.me td.l { color: #fff; box-shadow: inset 3px 0 0 var(--red); }

/* game detail */
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-list > div { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.info-list .ic { color: var(--muted); }
.warn { color: var(--amber); font-style: normal; font-weight: 600; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 16px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 15px; margin: 12px 0; text-decoration: none; }
.btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 16px;
  background: var(--card-2); font-weight: 600; margin-top: 12px; }
.jersey { width: 34px; height: 34px; border-radius: 10px; background: var(--card-3); display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 17px; flex: none; }
.you { font-size: 10.5px; background: var(--red); color: #fff; padding: 1px 6px; border-radius: 6px; font-weight: 700; vertical-align: 2px; }
.st { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.st-in { background: rgba(34, 197, 94, .15); color: var(--green); }
.st-maybe { background: rgba(245, 165, 36, .15); color: var(--amber); }
.st-out { background: var(--card-3); color: var(--muted); }
.final-board { border-radius: 20px; padding: 18px; text-align: center; margin-bottom: 12px; background: var(--card); }
.final-board.win { background: linear-gradient(160deg, #0f3a22, var(--card) 70%); }
.final-board small { font-weight: 800; letter-spacing: .14em; font-size: 12px; color: var(--muted); }
.final-board.win small { color: var(--green); }
.final-board div { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0; }
.final-board b { font-family: var(--cond); font-size: 56px; line-height: 1; }
.final-board em { font-style: normal; color: var(--muted); font-size: 30px; }
.final-board span { font-family: var(--cond); text-transform: uppercase; font-size: 18px; color: var(--muted); width: 80px; }
.final-board p { color: var(--muted); font-size: 13px; }

.board.ph-run { background: linear-gradient(165deg, #1D8A41 0%, #0B2F18 45%, #050505 100%); }
.board.ph-stopped { background: linear-gradient(165deg, #C81A2A 0%, #4A0810 45%, #050505 100%); }
.board.ph-break, .board.ph-timeout { background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.board { background: radial-gradient(120% 120% at 50% 0%, #2a0a0f, var(--card) 60%); border-radius: 22px; padding: 14px 12px 6px; margin-bottom: 12px; text-align: center; }
.board-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 10px; }
.bt { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bt b { font-size: 12.5px; font-weight: 600; }
.board-score { font-family: var(--cond); font-weight: 800; font-size: 56px; line-height: 1; display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
.board-score em { font-style: normal; color: var(--muted); font-size: 32px; }
.board-clock { margin: 10px 0 4px; font-weight: 700; color: var(--red); font-size: 14px; font-variant-numeric: tabular-nums; }
.qtable td, .qtable th { border: 0; padding: 5px 4px; }
.qtable td.cur { color: var(--red); font-weight: 700; }
.box td { font-size: 13px; padding: 8px 6px; }
.box td.l { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.box .jn { display: inline-block; width: 22px; color: var(--muted); font-family: var(--cond); font-weight: 700; font-size: 14px; }
.box tr.oncourt td.l { box-shadow: inset 3px 0 0 var(--home-tone, var(--red)); }
.box td.warn { color: var(--amber); font-weight: 700; }
.pbp { display: flex; gap: 10px; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.pbp:last-child { border: 0; }
.pbp-t { color: var(--muted); font-variant-numeric: tabular-nums; width: 62px; flex: none; font-size: 12px; padding-top: 1px; }
.pbp.home { box-shadow: inset 3px 0 0 var(--home-tone, var(--red)); }
.pbp.away { box-shadow: inset 3px 0 0 var(--away-tone, var(--blue)); }
.pbp.neutral { color: var(--muted); font-weight: 600; }

/* chat */
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; flex: none; }
.thread { display: flex; flex-direction: column; height: 100%; }
.msgs { flex: 1; overflow-y: auto; padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.msg { max-width: 80%; display: flex; flex-direction: column; gap: 3px; align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .from { color: var(--muted); font-size: 11.5px; font-weight: 600; padding-left: 4px; }
.bubble { background: var(--card-2); padding: 10px 13px; border-radius: 18px 18px 18px 6px; font-size: 14.5px; line-height: 1.35; }
.msg.me .bubble { background: var(--red); border-radius: 18px 18px 6px 18px; }
.msg .t { color: var(--muted); font-size: 10.5px; padding: 0 4px; }
.composer { display: flex; gap: 8px; padding: 10px 12px 30px; border-top: 1px solid var(--line); background: var(--bg); }
.composer input { flex: 1; background: var(--card-2); border: 0; border-radius: 999px; padding: 11px 16px; color: var(--text); outline: none; font-size: 14.5px; }
.composer button { width: 42px; height: 42px; border-radius: 50%; background: var(--red); display: grid; place-items: center; color: #fff; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head .icon-btn { background: var(--card-2); width: 34px; height: 34px; }
.cal-head b { font-family: var(--cond); font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid.wk span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-d { height: 44px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 14px; font-weight: 500; text-align: center; }
.cal-d.today { color: var(--red); font-weight: 800; }
.cal-d.sel { background: var(--red); color: #fff; }
.dots { display: flex; gap: 3px; height: 5px; }
.dots i, .legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.cal-d.sel .dots i { background: #fff !important; }
.k-game { background: var(--red); }
.k-train { background: var(--blue); }
.k-club { background: var(--gold); }
.k-loved { background: #EC4899; }
.heart { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); flex: none; }
.heart.on { color: #EC4899; }
.heart.on svg { fill: currentColor; }
.heart.big { background: var(--card); width: 40px; height: 40px; }
.row-link { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.row .heart { margin: -6px -6px -6px 0; }
.row.is-live { box-shadow: inset 3px 0 0 var(--green); }
.pill.mini { font-size: 9px; padding: 2px 6px; vertical-align: 1px; }
.love-empty { display: flex; align-items: center; gap: 12px; width: 100%; color: #EC4899; }
.love-empty span { display: flex; flex-direction: column; color: var(--text); }
.love-empty small { color: var(--muted); font-size: 12.5px; }
.love-label { display: flex; align-items: center; gap: 6px; color: #EC4899; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.legend i { margin-right: 5px; width: 7px; height: 7px; vertical-align: 1px; }
.ev-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }

/* inbox */
.inbox-row { align-items: flex-start; }
.inbox-row.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 7px; vertical-align: 2px; }
.tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 7px; flex: none; display: inline-block; margin-top: 1px; }
.tag-payment { background: var(--red-soft); color: var(--red); }
.tag-referee { background: rgba(212, 162, 58, .15); color: var(--gold); }
.tag-club { background: rgba(59, 130, 246, .15); color: var(--blue); }
.tag-team { background: rgba(34, 197, 94, .13); color: var(--green); }
.msg-subject { font-size: 22px; margin: 12px 0 4px; line-height: 1.2; }
.msg-body { background: var(--card); border-radius: 18px; padding: 16px; margin: 16px 0 4px; line-height: 1.55; font-size: 14.5px; }

/* referee availability */
.avail-day { padding: 12px 14px 14px; }
.avail-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.avail-head small { color: var(--muted); font-size: 12px; margin-right: auto; }
.slots { display: flex; flex-wrap: wrap; gap: 7px; }
.slot { padding: 8px 11px; border-radius: 10px; background: var(--card-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.slot.yes { background: var(--green); color: #04210f; }
.slot.no { background: var(--card-3); color: var(--red); text-decoration: line-through; }
b.ok { color: var(--green); }
b.no { color: var(--red); }

/* tab bar, sheet, toast */
.tabbar { flex: none; display: flex; padding: 8px 6px 26px; background: rgba(11, 11, 14, .96); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: #6E6E7A; position: relative; }
.tabbar button.on { color: var(--red); }
.tabbar .badge { top: -3px; right: 18px; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 0 14px; margin-bottom: 10px; color: var(--muted); }
.search-box input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 15px; padding: 13px 0; }
.search-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--red); }
.player-card, .club-card, .profile-card { display: flex; align-items: center; gap: 14px; }
.player-card > div, .club-card > div, .profile-card > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.player-card b, .club-card b, .profile-card b { font-size: 18px; }
.player-card small, .club-card small, .profile-card small { color: var(--muted); font-size: 12.5px; }
.club-card { box-shadow: inset 0 3px 0 var(--tone); }
.jersey.xl { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; background: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat-grid div { background: var(--card); border-radius: 16px; padding: 12px; text-align: center; }
.stat-grid b { display: block; font-family: var(--cond); font-size: 28px; line-height: 1.1; }
.stat-grid small { color: var(--muted); font-size: 11.5px; }
.avatar.big { width: 58px; height: 58px; font-size: 20px; }
.tile-ic.sm { width: 34px; height: 34px; margin: 0; border-radius: 10px; }
.badge.static { position: static; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--card-3); position: relative; flex: none; transition: .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--green); }
.switch.on i { left: 21px; }
.ph-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.ph-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.ph-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #121216; border-radius: 26px 26px 0 0; padding: 10px 16px 34px; z-index: 11;
  transform: translateY(105%); transition: transform .25s ease; max-height: 80%; overflow-y: auto; }
.ph-sheet.open { transform: none; }
.ph-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--card-3); margin: 0 auto 14px; }
.ph-sheet h3 { font-family: var(--cond); font-size: 24px; text-transform: uppercase; margin-bottom: 6px; }
.ph-sheet .list { background: var(--card); margin: 14px 0 0; }
.ph-toast { position: absolute; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: #fff; color: #111; font-size: 13.5px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; white-space: nowrap; }
.ph-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- iPad scorebench ---------- */
.bn { height: 100%; display: flex; flex-direction: column; font-family: var(--sans); position: relative;
  background: radial-gradient(90% 60% at 50% 0%, #1b0a0d 0%, #08080A 70%); }
.bn-topbar { display: flex; align-items: center; gap: 22px; padding: 12px 20px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.bn-brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.bn-brand img { height: 18px; width: auto; display: block; }
.bn-brand b { font-family: var(--cond); font-size: 15px; letter-spacing: .14em; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.bn-settings { margin-left: auto; }
.bn-homebtn { font-size: 13px; padding: 7px 12px; }
.bn-homebtn.on { background: var(--red); color: #fff; }

/* scorebench home: tonight on this court */
.bn-home { flex: 1; min-height: 0; padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.bh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.bh-head small { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.bh-head h2 { font-family: var(--cond); font-size: 44px; text-transform: uppercase; line-height: 1; margin: 4px 0 6px; }
.bh-head p { color: var(--muted); font-size: 14px; }
.bh-stats { display: flex; gap: 10px; }
.bh-stats div { background: var(--card); border-radius: 14px; padding: 10px 18px; text-align: center; min-width: 92px; }
.bh-stats b { display: block; font-family: var(--cond); font-size: 32px; line-height: 1; }
.bh-stats small { letter-spacing: .06em; }
.bh-list { display: flex; flex-direction: column; gap: 12px; }
.bh-game { display: grid; grid-template-columns: 96px 1fr 230px; align-items: center; gap: 18px; background: var(--card); border-radius: 20px; padding: 18px 20px; }
.bh-game.live { box-shadow: inset 0 0 0 2px var(--green); background: linear-gradient(90deg, rgba(34, 197, 94, .08), var(--card) 40%); }
.bh-game.final { opacity: .8; }
.bh-time { text-align: center; border-right: 1px solid var(--line); padding-right: 14px; }
.bh-time b { display: block; font-family: var(--cond); font-size: 38px; line-height: 1; }
.bh-time small { font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.bh-mid { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bh-grade { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bh-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.bh-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bh-team b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-team.r { justify-content: flex-end; text-align: right; }
.bh-score { display: flex; align-items: center; gap: 8px; font-family: var(--cond); }
.bh-score b { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bh-score em { font-style: normal; color: var(--muted); font-size: 22px; }
.bh-refs { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.bh-right { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.bh-pill { align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; padding: 5px 10px; border-radius: 999px; }
.bh-pill.live { background: rgba(34, 197, 94, .15); color: var(--green); }
.bh-pill.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.2s infinite; }
.bh-pill.final { background: var(--card-3); color: var(--muted); }
.bh-pill.next { background: rgba(245, 165, 36, .15); color: var(--amber); }
.bh-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: 13px; background: var(--card-3); font-weight: 800; font-size: 15px; }
.bh-btn.go { background: var(--green); color: #04210f; }
.bh-btn:disabled { opacity: .35; }
.bh-done { align-self: flex-end; display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; font-size: 13px; }
.bh-wait { color: var(--muted); font-size: 11.5px; text-align: center; }
.bn-sync { display: flex; align-items: center; gap: 7px; color: var(--green); font-weight: 600; }
.bn-sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1.6s infinite; }
.bn-sync.done { color: var(--muted); }
.bn-sync.done i { animation: none; background: var(--muted); }

.bn-board { display: grid; grid-template-columns: 1fr 330px 1fr; gap: 14px; padding: 12px 16px 8px; }
.bn-team { background: var(--card); border-radius: 20px; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 10px; }
.bn-team.home { box-shadow: inset 0 3px 0 var(--home-tone); }
.bn-team.away { box-shadow: inset 0 3px 0 var(--away-tone); }
.bn-team-name { display: flex; align-items: center; gap: 10px; grid-column: 1; }
.bn-team-name b { font-family: var(--cond); font-size: 22px; text-transform: uppercase; letter-spacing: .03em; }
.poss-dot { color: var(--amber); font-size: 12px; }
.bn-score-wrap { grid-column: 2; grid-row: 1 / 3; align-self: center; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bn-score { font-family: var(--cond); font-weight: 800; font-size: 104px; line-height: .9; font-variant-numeric: tabular-nums; align-self: center; min-width: 120px; text-align: right; }
.bn-team-stats { grid-column: 1; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; padding-top: 10px; }
.bn-team-stats > div { display: flex; align-items: center; gap: 10px; }
.bn-team-stats small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); width: 86px; }
.foul-boxes, .to-dots { display: flex; gap: 5px; }
.foul-boxes i { width: 18px; height: 18px; border-radius: 4px; background: var(--card-3); }
.foul-boxes i.on { background: var(--red); }
.to-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.to-dots i.on { background: var(--text); border-color: var(--text); }
.penalty { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .08em; background: var(--amber); color: #2a1a00; padding: 3px 7px; border-radius: 6px; }
.fc { font-style: normal; color: var(--muted); font-weight: 700; }
.bn-small { padding: 7px 12px; border-radius: 10px; background: var(--card-3); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.bn-small:disabled { opacity: .35; }
.bn-small.lg { padding: 14px 22px; font-size: 15px; }

.bn-centre { background: #000; border-radius: 20px; padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "q shot" "clock shot" "btn poss"; align-items: center; column-gap: 12px; row-gap: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.bn-q { display: flex; align-items: center; justify-content: space-between; }
.clk-edit { padding: 3px 10px; font-family: var(--sans); font-size: 11.5px; letter-spacing: 0; color: var(--text); }
.bn-q { grid-area: q; font-family: var(--cond); font-weight: 700; font-size: 18px; color: var(--amber); letter-spacing: .1em; }
.bn-clock { grid-area: clock; font-family: var(--cond); font-weight: 800; font-size: 64px; line-height: .95; font-variant-numeric: tabular-nums; color: #fff; }
.bn-clock.run { color: var(--red); text-shadow: 0 0 22px rgba(225, 29, 46, .45); }
.bn-startstop { grid-area: btn; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 12px; font-weight: 800; letter-spacing: .08em; font-size: 15px; }
.bn-startstop.go { background: var(--green); color: #04210f; }
.bn-startstop.stop { background: var(--red); color: #fff; }
.bn-startstop:disabled { opacity: .3; }
.bn-shot { grid-area: shot; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shot-num { width: 76px; height: 64px; border-radius: 12px; background: #120406; display: grid; place-items: center; font-family: var(--cond); font-weight: 800; font-size: 46px; color: var(--amber); font-variant-numeric: tabular-nums; }
.shot-num.low { color: var(--red); }
.shot-btns { display: flex; gap: 4px; }
.shot-btns .bn-small { padding: 5px 9px; }
.bn-poss { grid-area: poss; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--card-2); border-radius: 12px; padding: 9px 8px; font-size: 18px; color: var(--card-3); }
.bn-poss small { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.bn-poss span.on { color: var(--amber); }

.bn-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px 1fr; gap: 14px; padding: 6px 16px; }
.bn-roster { background: var(--card); border-radius: 20px; padding: 8px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.bn-roster-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 8px 4px; }
.bn-roster-head b { font-family: var(--cond); letter-spacing: .12em; font-size: 14px; }
.bn-roster.home .bn-roster-head b { color: var(--home-tone); }
.bn-roster.away .bn-roster-head b { color: var(--away-tone); }
.bn-roster-head small { color: var(--muted); font-size: 11.5px; font-weight: 600; margin-left: auto; margin-right: 8px; }
.bn-roster-head { align-items: center; }
.bn-roster-head .bn-small { padding: 4px 10px; font-size: 11.5px; }
.bn-roster-head .bn-small.on { background: var(--green); color: #04210f; }
.bn-roster.subbing { box-shadow: inset 0 0 0 2px var(--green); }
.bn-roster.subbing .bn-roster-head small { color: var(--green); }
.bn-divider { display: flex; align-items: center; gap: 8px; margin: 2px 8px; flex: none; }
.bn-divider::before, .bn-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.bn-divider span { font-size: 9.5px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.bn-player { flex: 1; min-height: 0; display: grid; grid-template-columns: 40px 1fr auto 44px; align-items: center; gap: 10px; padding: 0 10px; border-radius: 11px; background: transparent; font-size: 14px; }
.bn-player.on { background: var(--card-2); }
.bn-player.on .bn-no { background: var(--text); color: var(--bg); }
.bn-roster.home .bn-player.sel { background: var(--home-tone); }
.bn-roster.away .bn-player.sel { background: var(--away-tone); }
.bn-player.sel .bn-no { background: #fff; color: #000; }
.bn-player.sel .bn-pf i { background: rgba(255, 255, 255, .35); }
.bn-player.sel .bn-pf i.on { background: #fff; }
.bn-player.out { opacity: .4; }
.bn-player em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--red); background: var(--red-soft); padding: 2px 5px; border-radius: 4px; }
.bn-no { width: 36px; height: 30px; border-radius: 8px; background: var(--card-3); display: grid; place-items: center; font-family: var(--cond); font-weight: 800; font-size: 18px; }
.bn-pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bn-pf { display: flex; gap: 3px; }
.bn-pf i { width: 7px; height: 14px; border-radius: 2px; background: var(--card-3); }
.bn-pf i.on { background: var(--red); }
.bn-pts { font-family: var(--cond); font-weight: 800; font-size: 24px; text-align: right; font-variant-numeric: tabular-nums; }

.bn-pad { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.bn-sel { background: var(--card); border-radius: 16px; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 58px; }
.bn-sel .crest { grid-row: 1 / 3; }
.bn-sel b { font-size: 15.5px; }
.bn-sel small { color: var(--muted); font-size: 12px; grid-column: 2; }
.bn-sel b.muted, .bn-sel b.muted + small { grid-column: 1 / 3; text-align: center; }
.bn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bn-pad .bn-grid { flex: 1; min-height: 0; }
.bn-pad .bn-grid .bb { height: auto; }
.bn-grid.pts3 { flex: 1.25; }
.bn-grid.two { grid-template-columns: 1fr 1fr; }
.bb { border-radius: 14px; background: var(--card-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 62px; text-align: center;
  transition: transform .08s, background .15s; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); }
.bb:active:not(:disabled) { transform: scale(.96); }
.bb b { font-family: var(--cond); font-weight: 800; font-size: 22px; letter-spacing: .03em; }
.bb small { font-size: 11px; color: var(--muted); font-weight: 600; }
.bb.pts { background: linear-gradient(180deg, #22C55E, #15803D); }
.bb.pts b { font-size: 46px; line-height: 1; }
.bb.pts small { color: rgba(255, 255, 255, .8); }
.bb.foul { background: linear-gradient(180deg, #E11D2E, #A5101C); }
.bb.foul small { color: rgba(255, 255, 255, .8); }
.bb.tech { background: #000; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22), inset 0 -3px 0 rgba(255, 255, 255, .08); }
.bb.tech b, .bb.tech small { color: #fff; }
.bb.foul b, .bb.tech b { font-size: 24px; }
.bb.sub { flex-direction: row; gap: 8px; height: 46px; font-weight: 700; font-size: 14px; }
.bb:disabled { opacity: .3; }

.bn-foot { display: grid; grid-template-columns: 1fr 330px 200px; gap: 14px; padding: 8px 16px 14px; height: 168px; }
.bn-log { background: var(--card); border-radius: 18px; padding: 10px 12px; overflow: hidden; }
.bn-log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.bn-log-head b { font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.bn-log-row { font-size: 13px; padding: 4px 8px; border-radius: 6px; display: flex; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-log-row span { color: var(--muted); width: 66px; flex: none; font-variant-numeric: tabular-nums; }
.bn-log-row.home { box-shadow: inset 3px 0 0 var(--home-tone); }
.bn-log-row.away { box-shadow: inset 3px 0 0 var(--away-tone); }
.bn-log-row:first-of-type { background: var(--card-2); }
.bn-qt { background: var(--card); border-radius: 18px; overflow: hidden; align-self: stretch; }
.bn-qt th, .bn-qt td { padding: 10px 6px; font-size: 15px; }
.bn-qt td:first-child { font-family: var(--cond); font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.bn-end { display: flex; }
.bb.endq { flex: 1; height: auto; background: var(--card-3); font-family: var(--cond); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border: 2px dashed rgba(255, 255, 255, .15); }
.bn-final { flex: 1; border-radius: 18px; background: rgba(34, 197, 94, .12); color: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-weight: 800; font-size: 18px; gap: 4px; }
.bn-final small { color: var(--muted); font-weight: 500; font-size: 12px; }

.bn-flash { position: absolute; top: 210px; left: 50%; transform: translateX(-50%); background: #fff; color: #111; font-weight: 800; font-size: 20px; padding: 12px 22px; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: pop .25s ease; z-index: 5; white-space: nowrap; font-family: var(--cond); letter-spacing: .04em; }
.bn-flash.home { background: var(--home-tone); color: #fff; }
.bn-flash.away { background: var(--away-tone); color: #fff; }
.bn-flash.warn { background: var(--amber); color: #2a1a00; }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }
.bn-modal-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 10; }
.bn-modal { background: #17171C; border-radius: 22px; padding: 26px; width: 440px; }
.bn-modal h3 { font-family: var(--cond); font-size: 30px; text-transform: uppercase; margin-bottom: 8px; }
.bn-modal p { color: var(--muted); line-height: 1.5; }
.bn-shot.off { justify-content: center; text-align: center; width: 76px; }
.bn-shot.off small { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--muted); line-height: 1.4; }
.bn-modal.settings { width: 680px; max-height: 790px; overflow-y: auto; padding: 22px 26px; }
.bn-modal.settings .set-row { padding: 10px 0; }
.mode-box { background: var(--card-2); border-radius: 16px; padding: 14px; margin: 10px 0 8px; }
.mode-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mode-top b { font-size: 16px; }
.mode-now { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mode-now.set { color: var(--green); }
.mode-now.custom { color: var(--amber); }
.off-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.off-grid.two { grid-template-columns: 1fr 1fr; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.off-grid label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.off-grid small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.off-grid select { appearance: none; -webkit-appearance: none; background: var(--card-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1.5px solid transparent; border-radius: 10px; padding: 10px 24px 10px 10px; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; width: 100%; }
.add-ref { border: 1.5px dashed rgba(255, 255, 255, .22); border-radius: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; align-self: end; height: 42px; text-align: center; }
.add-ref:hover { color: var(--text); border-color: var(--red); }
.off-grid small { display: flex; justify-content: space-between; align-items: center; }
.rm-ref { color: var(--muted); font-size: 11px; padding: 0 2px; line-height: 1; }
.rm-ref:hover { color: var(--red); }
.off-grid select:focus { border-color: var(--red); outline: none; }
.off-grid select option { background: #1D1D24; }
.ref-inputs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.ref-inputs label { display: flex; flex-direction: column; gap: 5px; }
.ref-inputs small { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ref-inputs input { background: var(--card-3); border: 1.5px solid transparent; border-radius: 11px; padding: 11px 12px; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; outline: none; }
.ref-inputs input:focus { border-color: var(--red); }
.ref-inputs .bh-btn { padding: 11px 18px; }
.mode-pick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mode-pick .seg-opts { background: var(--card-3); }
.mode-pick .seg-opts button { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.mode-pick .seg-opts button small { font-size: 10px; font-weight: 600; opacity: .75; }
.mode-table th, .mode-table td { padding: 6px 4px; font-size: 12.5px; border-top: 1px solid var(--line); }
.mode-table thead th { border-top: 0; }
.mode-table td.l { padding-left: 6px; font-weight: 600; }
.mode-table tr.cur td { background: rgba(255, 255, 255, .04); }
.mode-table td.pick { box-shadow: inset 0 0 0 2px var(--red); border-radius: 6px; }
.sc { color: var(--muted); font-size: 11.5px; }
.sc.on { color: var(--green); font-weight: 700; }
.bn-mode { font-weight: 700; color: var(--text); background: var(--card-2); padding: 3px 9px; border-radius: 7px; }
.set-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.set-head h3 { margin: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row b { display: block; font-size: 15px; }
.set-row small { color: var(--muted); font-size: 12.5px; }
.seg-opts { display: flex; background: var(--card-2); border-radius: 11px; padding: 3px; flex: none; }
.seg-opts button { padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.seg-opts button.on { background: var(--red); color: #fff; }
.set-note { font-size: 12px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.bn-modal-btns { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
.bn-modal .bb.endq { flex: none; padding: 0 22px; height: 50px; background: var(--red); border: 0; font-size: 18px; }

@media (max-width: 640px) {
  .viewer-bar { padding: 12px 16px; }
  .seg button { padding: 7px 11px; font-size: 12.5px; }
}

/* LIVE badge matches the clock: green while running, red when stopped */
.ph-run .pill-live { color: #15803D; }
.ph-run .pill-live i { background: #16A34A; }

/* Game officials above "Tap a player": refs on top, supervisor + court controller below */
.bn-refs { background: var(--card); border-radius: 12px; padding: 7px 8px; flex: none; display: flex; flex-direction: column; gap: 5px; }
.off-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.off-row.two { grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 5px; }
.off { text-align: center; min-width: 0; }
.off small { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.off b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.off b.na { color: var(--muted); font-weight: 600; }
/* …and black at quarter time / during a timeout */
.ph-break .pill-live, .ph-timeout .pill-live { color: #000; }
.ph-break .pill-live i, .ph-timeout .pill-live i { background: #000; }

/* ---------- tonight's draw (mirrors the printed draw: purple 6:10, magenta 7:10, gold 8:10) ---------- */
.draw-link { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border-radius: 18px; padding: 13px 14px; margin-top: 12px; }
.draw-link > .ic:first-child { color: var(--red); }
.draw-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.draw-link b { font-size: 15px; }
.draw-link small { color: var(--muted); font-size: 12.5px; }
.slot-dots { display: flex; gap: 3px; }
.slot-dots i { width: 8px; height: 8px; border-radius: 2px; }
.draw { display: grid; gap: 4px; }
.draw-head, .draw-row { display: grid; grid-template-columns: 54px repeat(3, 1fr); gap: 4px; }
.draw-head span { text-align: center; font-family: var(--cond); font-weight: 800; font-size: 14px; letter-spacing: .04em; padding: 6px 0; border-radius: 8px;
  background: color-mix(in srgb, var(--slot) 30%, transparent); color: #fff; }
.draw-venue { font-family: var(--cond); font-weight: 800; font-style: italic; font-size: 15px; letter-spacing: .06em; padding: 8px 4px 2px; color: var(--muted); }
.draw-court { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11.5px; background: var(--card); border-radius: 8px; text-align: center; }
.draw-cell { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 8px; text-align: center;
  background: color-mix(in srgb, var(--slot) 20%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--slot) 45%, transparent); }
.draw-cell.empty { opacity: .4; }
.draw-cell small { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: rgba(255, 255, 255, .7); }
.draw-cell small em { font-style: normal; color: var(--green); }
.draw-cell .dt { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.draw-cell b { font-size: 10.5px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.draw-cell .sc { font-style: normal; font-family: var(--cond); font-weight: 800; font-size: 14px; margin-left: auto; }
.draw-cell.live { box-shadow: inset 0 0 0 1.5px var(--green); }
.draw-cell.done { opacity: .75; }
.draw-cell.mine { box-shadow: inset 0 0 0 2px var(--red); }
.draw-cell.loved { box-shadow: inset 0 0 0 2px #EC4899; }
.draw-row.closed .draw-none { grid-column: 2 / 5; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 8px; color: var(--muted); font-size: 11.5px; font-weight: 700; min-height: 40px; }
.key-mine { color: var(--red); }
.key-loved { color: #EC4899; }
.final-board.live-other { background: linear-gradient(165deg, #1D8A41 0%, #0B2F18 45%, var(--card) 100%); }
.final-board.live-other small { display: inline-flex; gap: 6px; align-items: center; color: #fff; }

/* iPad draw: same grid, roomier */
.draw.bench .draw-head, .draw.bench .draw-row { grid-template-columns: 110px repeat(3, 1fr); gap: 8px; }
.draw.bench .draw-head span { font-size: 20px; padding: 8px 0; }
.draw.bench .draw-venue { font-size: 22px; padding: 6px 4px 0; }
.draw.bench .draw-court { font-size: 15px; border-radius: 12px; }
.draw.bench .draw-cell { padding: 10px 12px; border-radius: 12px; gap: 5px; align-items: stretch; text-align: left; }
.draw.bench .draw-cell small { font-size: 11px; }
.draw.bench .draw-cell .dt { justify-content: flex-start; gap: 8px; }
.draw.bench .draw-cell b { font-size: 15px; -webkit-line-clamp: 1; }
.draw.bench .draw-cell .sc { font-size: 22px; }
.draw.bench .draw-cell.here { box-shadow: inset 0 0 0 3px #fff; }
.draw.bench .draw-row.closed .draw-none { min-height: 46px; font-size: 14px; }
.bh-head .draw-btn { align-self: center; margin-left: auto; padding: 12px 18px; }

/* ---------- finalise night ---------- */
.fin-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 18px; border-radius: 18px; flex: none;
  background: var(--red); color: #fff; font-family: var(--cond); font-size: 24px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.fin-btn .ic { display: none; }
.fin-btn small { font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .85; }
.fin-done { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 18px; background: rgba(34, 197, 94, .12); color: var(--green); flex: none; }
.fin-done b { display: block; font-family: var(--cond); font-size: 22px; letter-spacing: .05em; text-transform: uppercase; }
.fin-done small { color: var(--text); font-size: 13px; }
.bn-modal.fin-modal { width: 720px; max-height: 790px; overflow-y: auto; }
.fin-modal > p { margin-bottom: 12px; }
.fin-list { display: flex; flex-direction: column; gap: 10px; }
.fin-game { background: var(--card-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 3px 0 0 var(--card-3); }
.fin-game.good { box-shadow: inset 3px 0 0 var(--green); }
.fin-game.bad { box-shadow: inset 3px 0 0 var(--red); }
.fin-top { display: flex; align-items: center; gap: 10px; }
.fin-time { font-family: var(--cond); font-size: 22px; width: 48px; }
.fin-teams { flex: 1; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; min-width: 0; }
.fin-teams em { font-style: normal; color: var(--muted); }
.fin-game select { appearance: none; -webkit-appearance: none; background: var(--card-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1.5px solid transparent; border-radius: 10px; padding: 9px 28px 9px 12px; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.fin-game.good select { border-color: var(--green); }
.fin-game.bad select { border-color: var(--red); }
.fin-game select option { background: #1D1D24; }
.fin-game textarea { background: var(--card); border: 1.5px solid transparent; border-radius: 10px; padding: 9px 12px; color: var(--text); font: inherit; font-size: 13.5px; resize: none; outline: none; }
.fin-game textarea:focus { border-color: var(--red); }
.bb.fin-go { width: 100%; height: 54px; margin-top: 14px; background: var(--red); font-family: var(--cond); font-size: 20px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.bb.fin-go:disabled { background: var(--card-3); opacity: 1; color: var(--muted); }
.pin-modal { width: 340px; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 22px 0 6px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: #fff; border-color: #fff; }
.pin-err { color: var(--red) !important; font-weight: 700; font-size: 13px; min-height: 20px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.pin-key { height: 62px; border-radius: 16px; background: var(--card-2); font-family: var(--cond); font-size: 28px; font-weight: 800; text-align: center; }
.pin-key:active { background: var(--card-3); }
.pin-key.alt { font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--muted); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.fin-btn:disabled { background: var(--card-2); color: var(--muted); cursor: not-allowed; }

/* Full-screen mode (#ipad-full / #phone-full): only the device screen, no frame or toolbar */
body.full { background: #000; overflow: hidden; }
body.full .viewer-bar, body.full .device-label { display: none; }
body.full .stage-wrap { padding: 0; overflow: hidden; }
body.full .ipad-frame, body.full .phone-frame { padding: 0; width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; }
body.full .ipad-screen, body.full .phone-screen { border-radius: 0; }

/* ---------- full play-by-play (Open) ---------- */
.log-btns { display: flex; gap: 6px; }
.bn-modal.pbp-modal { width: 720px; max-height: 790px; display: flex; flex-direction: column; }
.pbp-modal > p { margin-bottom: 12px; font-size: 13.5px; }
.pl-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; padding-right: 4px; }
.pl-row { display: flex; align-items: center; gap: 12px; background: var(--card-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.pl-row.home { box-shadow: inset 3px 0 0 var(--home-tone); }
.pl-row.away { box-shadow: inset 3px 0 0 var(--away-tone); }
.pl-row.end { background: transparent; color: var(--muted); font-weight: 700; justify-content: center; }
.pl-row.end .pl-t { display: none; }
.pl-t { color: var(--muted); font-size: 12px; width: 64px; flex: none; font-variant-numeric: tabular-nums; }
.pl-text { flex: 1; }
.pl-text em { font-style: normal; font-size: 11px; color: var(--amber); margin-left: 6px; }
.pl-row.editing { align-items: flex-start; background: var(--card-3); }
.pl-edit { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; align-items: end; }
.pl-edit label { display: flex; flex-direction: column; gap: 5px; }
.pl-edit small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pl-edit select { appearance: none; -webkit-appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1.5px solid transparent; border-radius: 10px; padding: 9px 28px 9px 12px; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; }
.pl-edit select option { background: #1D1D24; }
.pl-edit .seg-opts { align-self: flex-start; }
.pl-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.bn-small.save { background: var(--green); color: #04210f; }
.bn-small.del { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }

/* ---------- edit game clock ---------- */
.clk-modal { width: 470px; text-align: center; }
.clk-set { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 14px; }
.clk-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.clk-col b { font-family: var(--cond); font-weight: 800; font-size: 72px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 96px; }
.clk-col small { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.clk-col .pin-key { width: 88px; height: 48px; font-size: 22px; }
.clk-col.fine { margin-left: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.clk-col.fine .pin-key { width: 64px; }
.clk-colon { font-family: var(--cond); font-size: 64px; color: var(--muted); margin-bottom: 26px; }
.clk-quick { display: flex; justify-content: center; gap: 8px; }
.clk-modal .bn-modal-btns { justify-content: center; }

/* ---------- team rundown (tap a team on the scoreboard) ---------- */
.bn-team.tappable { cursor: pointer; transition: background .15s; }
.bn-team.tappable:active { background: var(--card-2); }
.bn-modal.team-modal { width: 780px; max-height: 800px; overflow-y: auto; box-shadow: inset 0 4px 0 var(--tone); }
.tr-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.tr-head > div { flex: 1; }
.tr-head small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tr-head h3 { margin: 2px 0 0; }
.tr-score { font-family: var(--cond); font-size: 60px; font-weight: 800; line-height: 1; margin-right: 8px; }
.tr-sec { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.tr-tile { background: var(--card-2); border-radius: 12px; padding: 10px; text-align: center; }
.tr-tile b { display: block; font-family: var(--cond); font-size: 30px; font-weight: 800; line-height: 1.05; }
.tr-tile small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tr-tile.big { background: color-mix(in srgb, var(--tone) 22%, var(--card-2)); }
.tr-tile.warn b, .tr-tile.warn small { color: var(--amber); }
.tr-tile.bad b { color: var(--red); }
.tr-q { margin-top: 10px; background: var(--card-2); border-radius: 12px; overflow: hidden; }
.tr-q td, .tr-q th { padding: 8px 6px; }
.tr-q td.pen { color: var(--amber); font-weight: 800; }
.tr-players { background: var(--card-2); border-radius: 12px; overflow: hidden; }
.tr-players td, .tr-players th { padding: 7px 8px; font-size: 13.5px; }
.tr-players tr.out td { opacity: .5; }
.tr-players td.warn { color: var(--amber); font-weight: 800; }
.tr-players .st { font-size: 11px; }
.tr-note { font-size: 11.5px !important; margin-top: 6px; }
/* iPad home: officials sit under the score / "vs" */
.bh-centre { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 210px; }
.bh-off { color: var(--muted); font-size: 11.5px; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.bh-off.refs { color: var(--text); font-weight: 600; margin-top: 4px; }

/* iPad draw: this iPad's court row stands out */
.draw.bench .draw-row.here-row { background: rgba(255, 255, 255, .06); border-radius: 14px; box-shadow: 0 0 0 2px #fff; padding: 4px; margin: 2px 0; }
.draw.bench .draw-row.here-row .draw-court { background: #fff; color: #000; flex-direction: column; gap: 2px; }
.draw-court em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.draw.bench .draw-cell.here { box-shadow: inset 0 0 0 2px #fff; }
.draw.bench .draw-cell.here.live { box-shadow: inset 0 0 0 3px var(--green), 0 0 0 1px #fff; }

/* ---------- iPad: See details for a game that isn't being scored ---------- */
.bh-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--card-3); color: var(--text); padding: 9px; font-size: 13.5px; }
.bh-btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.bn-modal.gd-modal { width: 780px; max-height: 800px; overflow-y: auto; }
.gd-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.gd-modal .set-head h3 { margin-top: 2px; }
.gd-info { display: flex; align-items: center; gap: 18px; margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.gd-info span { display: inline-flex; align-items: center; gap: 6px; }
.gd-info .bh-pill { align-self: center; }
.gd-officials { display: flex; gap: 8px; margin-bottom: 14px; }
.gd-officials div { flex: 1; background: var(--card-2); border-radius: 10px; padding: 8px 10px; text-align: center; }
.gd-officials small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gd-officials b { font-size: 14px; }
.gd-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.gd-vs { font-family: var(--cond); font-size: 26px; color: var(--muted); align-self: center; }
.gd-team { background: var(--card-2); border-radius: 14px; padding: 12px; box-shadow: inset 0 3px 0 var(--tone); }
.gd-team-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gd-team-head b { display: block; font-size: 17px; }
.gd-team-head small { color: var(--muted); font-size: 12px; }
.gd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.gd-stats div { background: var(--card); border-radius: 10px; padding: 7px; text-align: center; }
.gd-stats b { display: block; font-family: var(--cond); font-size: 22px; }
.gd-stats small { color: var(--muted); font-size: 10.5px; }
.gd-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 12.5px; }
.gd-sheet b { display: inline-block; width: 20px; color: var(--muted); }
.gd-sheet em { grid-column: 1 / -1; color: var(--muted); font-style: normal; text-align: center; padding: 10px 0; }
.gd-last { text-align: center; margin-top: 12px; font-size: 13px; }
.bh-details { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: var(--card-3); font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.bh-details:hover { background: var(--red); }

/* ---------- iPad top bar: left (home + brand) · centred game · right (settings + status) ---------- */
.bn-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 18px; min-height: 58px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.tb-mid b { display: flex; align-items: center; gap: 8px; font-family: var(--cond); font-size: 19px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.tb-mid b em { font-style: normal; color: var(--muted); font-size: 14px; }
.tb-mid b .crest.xs { width: 22px; height: 22px; }
.tb-mid small { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.bn-settings { margin-left: 0; padding: 8px 13px; }
.bn-homebtn { padding: 8px 13px; }
.bn-brand img { height: 17px; }
.bn-sync { padding: 7px 12px; border-radius: 999px; background: rgba(34, 197, 94, .12); font-size: 12.5px; white-space: nowrap; }
.bn-sync.done { background: var(--card-2); }

/* ---------- end of quarter / finish game confirmation ---------- */
.bn-modal.end-modal { width: 600px; text-align: center; }
.em-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.end-modal h3 { margin: 4px 0 14px; font-size: 34px; }
.end-modal.is-final h3 { color: #fff; }
.em-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 14px; }
.em-team { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 16px; background: var(--card-2); }
.em-team b { font-size: 15px; }
.em-team em { font-style: normal; font-family: var(--cond); font-size: 58px; font-weight: 800; line-height: 1; }
.em-team.win { background: color-mix(in srgb, var(--tone) 22%, var(--card-2)); box-shadow: inset 0 0 0 2px var(--tone); }
.em-team.lose { opacity: .6; }
.em-tag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; background: var(--tone); color: #000; padding: 3px 7px; border-radius: 6px; }
.em-dash { font-family: var(--cond); font-size: 40px; color: var(--muted); }
.em-q { background: var(--card-2); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.em-q td, .em-q th { padding: 8px 6px; font-size: 14px; }
.em-q td.l { display: flex; align-items: center; gap: 8px; font-weight: 700; padding-left: 12px; }
.em-q .crest.xs { width: 22px; height: 22px; }
.em-note { font-size: 13.5px; }
.end-modal .bn-modal-btns { justify-content: center; }
.end-modal .bb.endq { min-width: 190px; }
.end-modal.is-final .bb.endq { background: var(--green); color: #04210f; }

/* ---------- full-time screen ---------- */
.final-screen { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 22px 14px; display: flex; flex-direction: column; gap: 12px; }
.fs-hero { border-radius: 22px; padding: 16px 20px 14px; text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--win) 35%, #000) 0%, #0b0b0e 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.fs-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; color: rgba(255, 255, 255, .7); }
.fs-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 8px 0 6px; }
.fs-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fs-team b { font-family: var(--cond); font-size: 24px; letter-spacing: .04em; text-transform: uppercase; }
.fs-team.lose { opacity: .55; }
.fs-team .crest.lg { width: 64px; height: 64px; }
.fs-nums { display: flex; align-items: center; gap: 14px; font-family: var(--cond); font-weight: 800; font-size: 96px; line-height: 1; font-variant-numeric: tabular-nums; }
.fs-nums span { color: rgba(255, 255, 255, .55); }
.fs-nums span.w { color: #fff; text-shadow: 0 0 30px color-mix(in srgb, var(--win) 60%, transparent); }
.fs-nums em { font-style: normal; font-size: 50px; color: var(--muted); }
.fs-result { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: var(--win); color: #000; font-weight: 800; font-size: 14px; }
.final-screen .em-q { margin: 0; }
.fs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fs-col { background: var(--card); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: inset 0 3px 0 var(--tone); }
.fs-col-head { display: flex; align-items: center; gap: 10px; }
.fs-col-head b { font-family: var(--cond); font-size: 19px; text-transform: uppercase; letter-spacing: .04em; }
.fs-sub { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.fs-player { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.fs-rank { width: 20px; height: 20px; border-radius: 50%; background: var(--tone); color: #000; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.fs-no { color: var(--muted); font-weight: 700; width: 30px; }
.fs-name { flex: 1; font-weight: 600; }
.fs-player b { font-family: var(--cond); font-size: 20px; }
.fs-player b small { font-family: var(--sans); font-size: 11px; color: var(--muted); }
.fs-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 2px; }
.fs-mini div { background: var(--card-2); border-radius: 10px; padding: 6px; text-align: center; }
.fs-mini b { display: block; font-family: var(--cond); font-size: 22px; }
.fs-mini small { color: var(--muted); font-size: 10px; }
.fs-col .bh-btn.ghost { margin-top: 2px; }
.fs-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fs-off { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.fs-btns { display: flex; gap: 8px; }
.fs-btns .bh-btn { padding: 11px 16px; }
.fs-posted { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--green); font-size: 12.5px; font-weight: 700; }
/* Clock at 0:00 — the Start button becomes "what to do next" (tapping it opens End Q / End game) */
.bn-startstop.over { flex-direction: column; gap: 0; padding: 6px; background: #000; box-shadow: inset 0 0 0 2px var(--amber); color: var(--amber); }
.bn-startstop.over b { font-family: var(--cond); font-size: 16px; letter-spacing: .1em; }
.bn-startstop.over small { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0; color: #fff; opacity: .85; }
.bn-startstop.over.game { box-shadow: inset 0 0 0 2px var(--red); color: var(--red); animation: blink 1.4s infinite; }

/* Winner = green everywhere */
.em-team.win { background: rgba(34, 197, 94, .14); box-shadow: inset 0 0 0 2px var(--green); }
.em-tag { background: var(--green); color: #04210f; }
.fs-winner { font-size: 12px; font-weight: 800; letter-spacing: .14em; padding: 4px 12px; border-radius: 999px; background: var(--green); color: #04210f; }
.fs-team.win .crest { filter: drop-shadow(0 0 14px rgba(34, 197, 94, .55)); }
.fs-nums span.w { color: var(--green); text-shadow: 0 0 30px rgba(34, 197, 94, .5); }
.fs-result { background: var(--green); color: #04210f; }
.off-note { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.off-note b { display: block; color: var(--text); font-size: 15px; }
.off-note small { font-size: 12.5px; }

/* 1-minute timeout countdown (orange) — under the team's score on the iPad, on the phone's black timeout card */
.to-count { font-family: var(--cond); font-weight: 800; font-size: 20px; letter-spacing: .08em; color: #F59E0B; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bn-score-wrap .to-count { background: rgba(245, 158, 11, .14); box-shadow: inset 0 0 0 1.5px #F59E0B; padding: 2px 10px; border-radius: 8px; }
.to-count.over { color: #000; background: #F59E0B; animation: blink 1s infinite; }
.brk-label .to-count { font-size: 26px; letter-spacing: .14em; }
.brk-label .to-count.over { padding: 0 10px; border-radius: 6px; }

/* ===================== iPad light theme (Settings → Display) ===================== */
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-row b { display: block; font-size: 16px; }
.theme-row small { color: var(--muted); font-size: 12.5px; }

.ipad-screen.light {
  --bg: #EEEEF2; --card: #FFFFFF; --card-2: #F1F1F5; --card-3: #E1E1E8;
  --line: rgba(0, 0, 0, .09); --text: #15151A; --muted: #6A6A78;
  background: #EEEEF2; color: var(--text);
}
.light .bn { background: radial-gradient(90% 60% at 50% 0%, #FCE7EA 0%, #EEEEF2 70%); }
.light .bn-topbar { background: linear-gradient(180deg, #FFFFFF, rgba(255, 255, 255, .6)); border-bottom-color: var(--line); }
.light .bn-brand img { filter: invert(1); }
.light .bn-team, .light .bn-roster, .light .bn-sel, .light .bn-refs, .light .bn-log, .light .bn-qt, .light .bh-game, .light .fs-col,
.light .bh-stats div { box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.light .bn-team.home { box-shadow: inset 0 3px 0 var(--home-tone), 0 1px 3px rgba(0, 0, 0, .06); }
.light .bn-team.away { box-shadow: inset 0 3px 0 var(--away-tone), 0 1px 3px rgba(0, 0, 0, .06); }
.light .bn-centre { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line), 0 1px 3px rgba(0, 0, 0, .06); }
.light .bn-clock { color: #111; }
.light .bn-clock.run { color: var(--red); text-shadow: none; }
.light .shot-num { background: #FFF3E0; }
.light .bn-poss { background: var(--card-2); color: #C9C9D2; }
.light .bn-player.sel .bn-no { background: #fff; color: #000; }
.light .bn-modal { background: #FFFFFF; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.light .bn-modal-bg { background: rgba(20, 20, 30, .45); }
.light .bn-modal p { color: var(--muted); }
.light select option, .light .off-grid select option, .light .fin-game select option, .light .pl-edit select option { background: #FFFFFF; color: #15151A; }
.light .pin-dots i.on { background: #15151A; border-color: #15151A; }
.light .bb { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.light .bb.endq { border-color: rgba(0, 0, 0, .15); }
.light .bh-btn:disabled, .light .fin-btn:disabled { opacity: 1; color: #A0A0AC; }
.light .draw-head span { color: #15151A; }
.light .draw-cell small { color: var(--muted); }
.light .draw-row.closed .draw-none { background: var(--card-3); }
.light .draw.bench .draw-row.here-row { background: rgba(225, 29, 46, .06); box-shadow: 0 0 0 2px var(--red); }
.light .draw.bench .draw-row.here-row .draw-court { background: var(--red); color: #fff; }
.light .draw.bench .draw-row.here-row .draw-court em { color: #fff; }
.light .draw.bench .draw-cell.here { box-shadow: inset 0 0 0 2px var(--red); }
.light .fs-hero { background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--win) 22%, #fff) 0%, #FFFFFF 70%); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.light .fs-kicker { color: var(--muted); }
.light .fs-nums span { color: rgba(0, 0, 0, .35); }
.light .bh-game.live { background: linear-gradient(90deg, rgba(34, 197, 94, .1), #fff 40%); }
.light .to-count.over { color: #000; }
.light .bn-flash { box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }

/* ---------- player IDs ---------- */
.pid { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .02em; color: var(--muted); background: var(--card-2); padding: 1px 5px; border-radius: 5px; }
.pid.big { display: inline-block; align-self: flex-start; font-size: 12px; color: var(--text); background: var(--card-3); margin: 2px 0; }
.id-card { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; background: linear-gradient(135deg, #2a0a0f, var(--card) 60%); box-shadow: inset 0 0 0 1px rgba(225, 29, 46, .35); }
.id-card small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.id-card b { display: block; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .06em; }
.id-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.id-teams span { display: inline-flex; align-items: center; gap: 6px; background: var(--card-2); padding: 4px 9px 4px 4px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.id-teams .crest.xs { width: 20px; height: 20px; }
.id-teams em { font-style: normal; color: var(--muted); }

/* ---------- RedCity ID card (profile) ---------- */
.id-card { display: flex; flex-direction: column; gap: 8px; }
.id-top small { display: block; }
.id-top b { font-size: 26px; }
.id-sec { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.id-list { display: flex; flex-direction: column; gap: 6px; }
.id-team { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 12px; padding: 8px 10px; width: 100%; text-align: left; }
.id-team .crest.xs { width: 28px; height: 28px; }
.id-team.pending { opacity: .7; }
.id-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.id-name b { font-size: 14px; }
.id-name small { color: var(--muted); font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.role-badge { flex: none; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--card-3); color: var(--text); white-space: nowrap; }
.role-badge.r-player { background: var(--red-soft); color: var(--red); }
.role-badge.r-coach, .role-badge.r-assistant-coach { background: rgba(14, 124, 102, .2); color: #3DD6B0; }
.role-badge.r-team-manager { background: rgba(59, 130, 246, .18); color: var(--blue); }
.role-badge.r-parent { background: rgba(212, 162, 58, .18); color: var(--gold); }
.role-badge.r-pending { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--card-3); margin-left: -4px; }
.id-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.id-add { width: 100%; padding: 11px; border-radius: 12px; border: 1.5px dashed rgba(255, 255, 255, .2); color: var(--text); font-weight: 700; font-size: 14px; text-align: center; }
.id-add:active { background: var(--card-2); }
.add-team label { display: flex; flex-direction: column; gap: 5px; }
.add-team small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.add-team select { background: var(--card-2); border: 0; border-radius: 14px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 14.5px; }
.add-team select option, .add-team select optgroup { background: #1D1D24; }
.id-card .id-name b { font-family: var(--sans); font-size: 14px; letter-spacing: 0; }
.id-card .id-top b { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .06em; }

/* ---------- Add team: Club → Team → Role steps ---------- */
.add-team { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.add-step { display: flex; gap: 10px; align-items: flex-start; }
.add-step > div { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.add-n { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--card-3); font-size: 12px; font-weight: 800; margin-top: 18px; }
.add-step.done .add-n { background: var(--green); color: #04210f; }
.add-team input { background: var(--card-2); border: 0; border-radius: 14px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 14.5px; outline: none; }
.seg-opts.wrap { flex-wrap: wrap; background: var(--card-2); }
.seg-opts.wrap button { flex: 1 1 auto; }
.add-team .btn-primary { margin: 6px 0 0; }
.add-team .btn-primary:disabled { background: var(--card-3); color: var(--muted); }
.role-badge.r-head-coach { background: rgba(14, 124, 102, .2); color: #3DD6B0; }
