/* Organizer: one thumb-friendly column; tabs at the bottom. */
body {
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 40% at 50% -5%, rgba(27,122,86,.28), transparent 70%), var(--ink);
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11,19,17,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ivory); text-decoration: none; }
.brand b { font-family: var(--f-display); font-weight: 400; font-size: 18px; white-space: nowrap; }
.banner { background: #4a1f19; color: #ffd8d0; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid #7a3328; }
.page { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.05; margin: 0 0 14px; }
h2.label { margin: 22px 0 8px; }

.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
input:not([type=radio]), select, textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px; font-size: 17px; min-height: 48px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--chalk); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink-3); font-weight: 600; font-size: 16px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brass); border-color: var(--brass); color: #1b1305; }
.btn.danger { color: #ffc7bd; border-color: rgba(239,122,106,.5); background: rgba(239,122,106,.08); }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.link { background: none; border: 0; color: var(--muted); padding: 0; font-family: var(--f-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; margin-bottom: 8px; min-height: 32px; }

.seg { display: flex; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-height: 42px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--felt); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--felt-hi); }
.seg input:focus-visible + span { outline: 2px solid var(--chalk); }
.seg.small { margin-bottom: 14px; }
.seg.small span { min-height: 36px; }

.stepper { display: grid; grid-template-columns: 46px 1fr 46px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ink); }
.stepper button { background: var(--ink-3); border: 0; font-size: 22px; min-height: 48px; }
.stepper input { border: 0; border-radius: 0; text-align: center; font-family: var(--f-display); font-size: 20px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.saved { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.saved .open { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.saved b { display: block; font-size: 17px; }
.saved small { color: var(--muted); }

.thead { margin-bottom: 14px; }
.thead h1 { margin-bottom: 8px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-label); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); }
.chip.st-live { border-color: var(--felt-hi); color: #bff0d6; }
.chip.st-finished { border-color: var(--brass); color: #ffe5a3; }

.addbox { display: grid; gap: 8px; }
.addbox .label { margin: 0; }
.addbox .hint { margin: 0; }
.addbox textarea { min-height: 96px; resize: none; overflow-y: auto; }
.paste { margin-top: 10px; }
.paste summary { color: var(--chalk); cursor: pointer; padding: 8px 0; font-weight: 600; }
.paste[open] { display: grid; gap: 8px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; min-height: 52px; }
.players .n { color: var(--muted); font-family: var(--f-label); width: 2ch; text-align: right; }
.players .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.players input { flex: 1; min-height: 40px; padding: 6px 10px; }
/* Check-in: only the players here are drawn */
.checkin { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.checkin .hint { margin: 0; }
.herebtn { flex: none; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink-3); color: var(--muted); font-family: var(--f-label); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; }
.herebtn[aria-pressed="true"] { background: rgba(95,211,154,.16); border-color: rgba(95,211,154,.6); color: var(--ok); }
.players li.away .nm { color: var(--muted); }
.players li .ns { margin-left: auto; }
.mcard .row .ns { margin-left: auto; }
/* No-show buttons in the result dialog */
.nsbox { display: grid; gap: 8px; margin: 4px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.nsbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.nsbtns .btn { flex: 1 1 auto; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink-3); flex: none; font-size: 17px; }
.iconbtn.del { color: #ffb4a8; }
.sticky { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding-top: 14px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }

.group h2.label:first-child { margin-top: 4px; }
.mlist { display: grid; gap: 8px; }
.mcard { width: 100%; text-align: left; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; }
.mcard.ready { border-color: rgba(95,211,154,.5); }
.mcard .top { display: flex; justify-content: space-between; font-family: var(--f-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.mcard .top .tb { color: #072315; background: var(--ok); padding: 0 8px; border-radius: 5px; }
.mcard .top .tb.wait { color: var(--ivory); background: var(--ink-3); }
.mcard .row { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; font-weight: 600; }
.mcard .row .s { font-family: var(--f-display); }
.mcard .row.w { color: #ffe5a3; }
.mcard .row.l { color: var(--muted); font-weight: 500; }
.mcard .row.tbd { color: var(--muted); font-style: italic; font-weight: 500; }

.champ { text-align: center; padding: 18px; border-radius: 16px; margin-bottom: 14px; background: radial-gradient(ellipse at 50% 0, rgba(216,178,90,.3), transparent 70%), var(--felt-dark); border: 1px solid var(--brass); }
.champ b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 30px; color: #ffe5a3; overflow-wrap: anywhere; }

.mini { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px 10px; }
.mini .bracket { --gap: 22px; --col-min: 168px; --m-size: 14px; --h-size: 12px; width: max-content; }
.mini .m { cursor: pointer; }

.code { text-align: center; justify-items: center; }
.bigcode { font-family: var(--f-display); font-size: clamp(40px, 13vw, 64px); letter-spacing: .12em; color: var(--brass); line-height: 1.1; }
.steps { text-align: left; margin: 0; padding-left: 20px; color: var(--muted); }
.steps b { color: var(--ivory); overflow-wrap: anywhere; }
.stat { margin: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(18,29,26,.97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs button { background: none; border: 0; padding: 8px 2px 10px; min-height: 60px; display: grid; justify-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabs .ico { font-size: 16px; }
.tabs button[aria-current="page"] { color: var(--brass); }

.sheet { border: 1px solid var(--line); background: var(--ink-2); color: var(--ivory); border-radius: 18px; padding: 18px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.sheet::backdrop { background: rgba(0,0,0,.6); }
/* Link a TV: the code shown on the TV */
.linktv { display: flex; gap: 10px; }
.linktv input { flex: 1; min-width: 0; font-family: var(--f-display); font-size: 24px; letter-spacing: .18em; text-transform: uppercase; text-align: center; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px; color: var(--brass); }
.linktv input:focus { border-color: var(--brass); outline: none; }
#tvPick:empty, #tvDlgErr:empty { display: none; }
.sheet form { display: grid; gap: 12px; }
.sheet .label { margin: 0; }
.sheet .hint { margin: 0; }
.score { display: grid; gap: 10px; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.srow .who { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.srow .who button { display: block; margin-top: 6px; font-size: 13px; min-height: 32px; padding: 4px 10px; }
.srow .stepper { grid-template-columns: 44px 56px 44px; }
.srow.lead { border-color: var(--brass); }
.err { color: #ffb4a8; margin: 0; min-height: 1.2em; font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.actions .btn { flex: 1 1 auto; }
.ctitle { font-weight: 700; font-size: 18px; margin: 0; }
.affected { margin: 0; padding-left: 20px; color: var(--muted); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 40; background: var(--ivory); color: #111; padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.bad { background: #ffd3cb; }
/* A new draw: the page waits under this until the TV's wheel stops (js/draw-wait.js) */
.drawwait { position: fixed; inset: 0; z-index: 35; background: var(--ink); display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.drawwait[hidden] { display: none; }
.dw-in { display: grid; gap: 12px; justify-items: center; max-width: 340px; }
.dw-t { font-family: var(--f-display); font-weight: 400; font-size: 44px; color: var(--brass); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.dw-in p { color: var(--muted); margin: 0; }
@media (prefers-reduced-motion: no-preference) { .dw-ball { animation: dwspin 1.6s linear infinite; } }
@keyframes dwspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .2s ease-out; } }
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } }

/* Account */
.bar-r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct { color: var(--ivory); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct:hover { border-color: var(--muted); }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #1b1305; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.promo-acct { gap: 8px; }
.promo-acct b { font-size: 18px; }
.promo-acct .hint { margin: 0; }
.saved li { display: flex; gap: 8px; align-items: center; }
.saved li > .open { flex: 1; min-width: 0; }
.saved li.empty { color: var(--muted); display: block; padding: 14px; text-align: left; border: 1px dashed var(--line); border-radius: 14px; }
.link.inline { display: inline; margin: 0; min-height: 0; color: var(--chalk); font-size: inherit; text-transform: none; letter-spacing: 0; font-family: inherit; text-decoration: underline; }
#ownerText a { color: var(--chalk); }
/* Reminder to link the TV before the first draw */
.tvhint { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.35; background: rgba(240,192,80,.12); border: 1px solid rgba(240,192,80,.45); color: #f6e2b0; }
.tvhint.ok { background: rgba(95,211,154,.1); border-color: rgba(95,211,154,.4); color: #c9f0dc; }
.tvhint a { color: inherit; font-weight: 700; }
.podl { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.podl li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.podl li span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; width: 34px; }
.podl .wi { width: 18px; height: 18px; }
.champ b .wi { width: 26px; height: 26px; vertical-align: -3px; margin-right: 6px; }
.nextcard { border-color: var(--brass); background: radial-gradient(ellipse at 50% 0, rgba(216,178,90,.18), transparent 70%), var(--ink-2); }
.roster { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 12px; }
.roster li { break-inside: avoid; display: flex; align-items: baseline; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.roster li .pn { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.roster li.out { color: var(--muted); font-weight: 500; }
.roster li.out .pn { text-decoration: line-through; }
.roster li.champ { color: #ffe5a3; }
.roster li.champ .pn::before { content: "★ "; }
/* Win percentage (racks won) to the right of the name */
.pct { flex: none; font-family: var(--f-label); font-weight: 700; font-size: 13px; color: var(--chalk); font-variant-numeric: tabular-nums; }
.roster li.out .pct { color: var(--muted); }
.roster li.noshow { color: var(--muted); font-weight: 500; }
.roster li.late { color: var(--muted); }
.roster li.late::after { content: "Waiting"; flex: none; margin-left: auto; font-family: var(--f-label); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }
.mcard .row .wt, .players li .wt { margin-left: auto; }
.ccwait { display: grid; gap: 8px; }
.ccwait .who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink); }
.ccwait .who b { flex: 1 1 100%; }
.ccwait .who .btn { flex: 1 1 auto; }
.roster li.noshow::after { content: "No-show"; flex: none; margin-left: auto; font-family: var(--f-label); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--danger); }
.mini .bracket.free .pair { flex: 0 1 auto; }
.mini .bracket.free .col-body { justify-content: flex-start; }
/* Tournament and template lists: actions next to each row */
.lhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.lhead .label { margin: 0; }
.saved .open.static { cursor: default; }
.saved .row-acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) {
  .saved li { flex-wrap: wrap; }
  .saved .row-acts { width: 100%; }
  .saved .row-acts .btn { flex: 1; }
}
/* Store profile on the account page */
.logo-box { display: flex; align-items: center; gap: 14px; }
.logo-prev { width: 96px; height: 96px; flex: none; border-radius: 14px; border: 1px dashed var(--line); background: var(--ink); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.promo-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.promo-admin li { display: flex; align-items: center; gap: 10px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.promo-admin img { height: 44px; width: 120px; object-fit: contain; background: #f3ede0; border-radius: 8px; flex: none; }
.promo-admin span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Split winners */
.champ b.sw { font-size: 24px; }
.champ #unsplitBtn { margin-top: 12px; }
.splitcard { border-color: rgba(216,178,90,.5); }
.mcard.off { opacity: .55; }
/* Format choice: the two options fit a phone */
.seg span { text-align: center; padding: 0 6px; line-height: 1.15; }
#drawBar #ownBtn { width: 100%; margin-top: 8px; }
/* The organizer's own first-round matches */
.pairlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: m; }
.pairlist button { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; text-align: left; background: var(--felt-dark); border: 1px solid var(--felt-hi); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.pairlist button span { min-width: 0; overflow-wrap: anywhere; }
.pairlist .vs { color: var(--brass); font-family: var(--f-label); text-transform: uppercase; font-size: 13px; }
.pairlist .x { color: var(--muted); }
.pool { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { border: 1px solid var(--line); background: var(--ink); border-radius: 999px; padding: 8px 12px; font-weight: 600; min-height: 40px; }
.pchip.on { background: var(--brass); color: #1b1305; border-color: var(--brass); }
#pairDlg { max-height: calc(100dvh - 24px); overflow-y: auto; }
/* Shot clock */
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--felt-hi); flex: none; }
.clockcard { position: sticky; top: 62px; z-index: 5; gap: 10px; border-color: var(--felt-hi); }
.clockhead { display: flex; justify-content: space-between; align-items: center; }
.clockhead .label { margin: 0; }
.ct { font-family: var(--f-display); font-weight: 400; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.ct[data-s="paused"], .ct[data-s="off"] { color: var(--muted); }
.ct[data-s="warn"] { color: var(--warn); }
.ct[data-s="red"], .ct[data-s="up"] { color: var(--danger); }
.clockbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.clockbtns .btn { width: 100%; min-width: 0; }
/* Fixed sizes: a big button is two lines (what it does, then the time), the others one */
.clockbtns .btn.big { height: 72px; min-height: 0; display: grid; align-content: center; justify-items: stretch; gap: 2px; padding: 6px 10px; font-size: 20px; line-height: 1.15; }
.clockbtns .btn.big b, .clockbtns .btn.big small, .clockbtns .btn > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clockbtns .btn.big small { font-size: 14px; font-weight: 600; opacity: .8; }
.clockbtns .btn:not(.big) { height: 46px; min-height: 0; padding: 0 10px; }
/* Control: the organizer's control center */
#tour.wide { max-width: 1180px; }
.ccstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.ccstat { background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.ccstat small { display: block; color: var(--muted); font-family: var(--f-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.ccstat b { display: block; font-family: var(--f-label); font-weight: 700; font-size: 24px; line-height: 1.15; overflow-wrap: break-word; }
.ccstat b i { font-style: normal; color: var(--muted); font-size: 18px; }
.ccstat.ok b { color: var(--ok); }
.ccstat.bad b { color: var(--warn); }
.ccgrid { display: grid; gap: 0 18px; grid-template-areas: "clock" "main" "recent"; grid-template-columns: minmax(0, 1fr); }
.ccgrid > .clockcard { grid-area: clock; }
.ccgrid > .ccmain { grid-area: main; min-width: 0; }
.ccgrid > #ccRecent { grid-area: recent; min-width: 0; }
@media (min-width: 900px) {
  .ccgrid { grid-template-areas: "main clock" "main recent"; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .ccgrid > #ccRecent { align-self: start; }
}
.ccnext { border-color: var(--brass); background: radial-gradient(ellipse at 50% 0, rgba(216,178,90,.16), transparent 70%), var(--ink-2); }
.ccnext .label { margin: 0; }
.ccnext .hint { margin: 0; }
.ccchamp { font-family: var(--f-display); font-weight: 400; font-size: 28px; color: #ffe5a3; overflow-wrap: anywhere; }
.ccchamp .wi { width: 26px; height: 26px; vertical-align: -3px; margin-right: 6px; }
.ccbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.ccbtns .btn { flex: 1 1 160px; }
.ccsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ccsteps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.ccsteps .mk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: #072315; }
.ccsteps li.ok .mk { background: var(--ok); border-color: var(--ok); }
.ccsteps b { display: block; }
.ccsteps small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.cctables { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 12px; background: var(--felt-dark); border: 1px solid var(--felt-hi); border-radius: 14px; padding: 10px 12px; }
.tile .tn { grid-row: span 2; display: grid; align-content: center; justify-items: center; min-width: 48px; border-right: 1px solid rgba(243,237,224,.15); padding-right: 12px; }
.tile .tn small { font-family: var(--f-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; color: var(--muted); }
.tile .tn b { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1; color: var(--brass); }
.tile .tp { background: none; border: 0; padding: 0; text-align: left; display: grid; gap: 1px; min-width: 0; }
.tile .tp small { color: var(--muted); font-family: var(--f-label); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; font-size: 12px; }
.tile .tp span { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; line-height: 1.2; }
.tile .tp i { font-style: normal; color: var(--brass); font-family: var(--f-label); text-transform: uppercase; font-size: 12px; }
.tile .ta { display: flex; gap: 6px; flex-wrap: wrap; }
.tile .ta .btn { flex: 1 1 90px; }
.tile.free { background: var(--ink-2); border-style: dashed; border-color: var(--line); grid-template-rows: auto; }
.tile.free .tn { grid-row: auto; }
.tile.free p { margin: 0; align-self: center; color: var(--muted); font-weight: 600; }
.tile.clocked { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }
#ccQueue .mlist, #ccRecent .mlist { margin-bottom: 8px; }
#ccRecent .hint { margin: 0 0 14px; }
/* Shot clock: who is at the table, time fouls, more controls */
.turns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.turn { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); min-width: 0; }
.turn b, .turn small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn b { color: var(--ivory); font-size: 16px; }
.turn small { font-size: 12px; }
.turn.on { border-color: var(--brass); background: rgba(216,178,90,.12); box-shadow: inset 0 0 0 1px var(--brass); }
.turn.on b::before { content: "● "; color: var(--brass); }
/* Status: always two lines high, so a time foul or a long name never moves the buttons */
.cstat { margin: 0; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); font-size: 14px; line-height: 1.35;
  height: calc(2 * 1.35em + 16px); display: flex; align-items: center; }
.cstat span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cstat[data-s="running"] { color: var(--ivory); }
.cstat[data-s="paused"] { color: var(--warn); }
.cstat[data-s="foul"] { background: rgba(239,122,106,.14); border-color: var(--danger); color: #ffd0c8; font-weight: 600; }
.clockmore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
/* Always room for two short lines, so narrow phones wrap "Restart shot" instead of cutting it */
.clockmore .btn { min-width: 0; height: 44px; min-height: 0; padding: 2px 6px; font-size: 13px; line-height: 1.15; text-align: center; overflow: hidden; }
.clockpanel .handback { border-color: var(--brass); color: #ffe5a3; }
.onclock { flex: 1 1 90px; display: grid; place-items: center; font-family: var(--f-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 12px; color: var(--brass); }
/* On a phone the clock card is tall now: it scrolls with the page */
@media (max-width: 899px) { .clockcard { position: relative; top: auto; } }
/* Copy icons (TV code and address, shot clock link) */
.copyline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copyline.inline { display: inline-flex; vertical-align: middle; max-width: 100%; }
.copyline input { flex: 1; min-width: 0; font-size: 14px; }
.code .copyline { justify-content: center; }
.iconbtn.copy { display: inline-grid; place-items: center; color: var(--chalk); }
.iconbtn.copy svg { width: 20px; height: 20px; }
.iconbtn.copy:active { background: var(--felt); }
/* Control tiles: the score so far next to each name */
.tile .tp span em { font-style: normal; font-family: var(--f-display); color: var(--chalk); margin-left: 4px; }
/* Tournament header like the TV's: store logo and name, tournament name, sponsors */
.obrand { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; min-width: 0; }
.obrand img { height: 44px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.obrand img[hidden] { display: none; }
.obrand span { font-family: var(--f-display); font-size: 20px; line-height: 1.1; color: var(--brass); overflow-wrap: anywhere; min-width: 0; }
.otitle { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; min-width: 0; }
.otitle h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.otitle .ball { flex: none; }
