/* PadelCup in the browser. The design language of padelcounter.com (website/assets/site.css):
   Apple product pages — SF system type, lots of white, #f5f5f7 tiles, one blue for actions;
   lime is the product colour. System fonts only (the page's CSP loads nothing else). */
:root {
  color-scheme: light;
  --brand: #0071e3; --brand-dark: #0077ed; --brand-light: #e8f1fc; --link: #0066cc;
  --accent: #D7FF3A; --accent-dark: #BEE820; --navy: #0D1A33;
  --ink: #1d1d1f; --gray-600: #6e6e73; --gray-400: #86868b; --gray-300: #c7c7cc; --gray-200: #d2d2d7; --gray-100: #f5f5f7;
  --surface: #ffffff; --paper: #f5f5f7; --hairline: rgba(0, 0, 0, 0.08);
  --danger: #e30000; --warning: #bf4800; --live: #ff3b30; --green: #1a7f37;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 28px;
  --sh-sm: 0 2px 12px rgba(0, 0, 0, .06); --sh-md: 0 4px 24px rgba(0, 0, 0, .08); --sh-lg: 0 18px 48px rgba(0, 0, 0, .14);
  --max-w: 1120px; --gutter: clamp(20px, 5vw, 44px);
  --sweep: linear-gradient(90deg, #0071e3 0%, #22a6b3 55%, #7ac70c 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 17px/1.47 var(--font-body); letter-spacing: -0.022em; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.07; }
h1 { font-size: clamp(34px, 4.2vw, 48px); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 19px; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0.35em 0; }
.muted { color: var(--gray-600); }
.small { font-size: 15px; }
.strong { font-weight: 600; }
.error { color: var(--danger); }
.eyebrow { font-size: 17px; font-weight: 600; color: #bf4800; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons: Apple's pills, one blue for actions; "›" text links */
.button { font: inherit; font-size: 16px; font-weight: 400; letter-spacing: -0.01em; color: var(--brand); background: transparent; border: 1px solid var(--brand); border-radius: 980px; padding: 8px 18px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.button:hover { background: var(--brand); color: #fff; }
.button:disabled { opacity: .4; cursor: default; }
.button:disabled:hover { background: transparent; color: var(--brand); }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.primary:disabled:hover { background: var(--brand); color: #fff; }
.button.danger { color: var(--danger); border-color: rgba(227, 0, 0, .45); }
.button.danger:hover { background: var(--danger); color: #fff; }
.button.ghost { border-color: transparent; }
.button.ghost:hover { background: rgba(0, 113, 227, .08); color: var(--brand); }
.button.small { font-size: 14px; padding: 6px 13px; }
.button.wide { width: 100%; padding: 12px 22px; font-size: 17px; }
.more { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }
.more:hover { text-decoration: underline; }
.more.small { font-size: 14px; }
.icon-button, .mini { font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.icon-button { width: 32px; height: 32px; font-size: 18px; }
.icon-button:hover, .mini:hover { background: rgba(0, 0, 0, .06); }
.icon-button:disabled { opacity: .3; cursor: default; }
.mini { padding: 2px 5px; font-size: 15px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 9px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 113, 227, .18); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); box-shadow: none; }
input[type=range] { padding: 0; border: 0; accent-color: var(--brand); box-shadow: none; }
input[type=color] { padding: 2px; height: 34px; }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.field > span { font-size: 15px; color: var(--gray-600); font-weight: 600; letter-spacing: -0.005em; }
.check { display: flex; gap: 9px; align-items: center; margin: 9px 0; cursor: pointer; font-size: 16px; }
.chip { font: inherit; font-size: 15px; color: var(--ink); background: rgba(255, 255, 255, .86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--hairline); border-radius: 980px; padding: 5px 13px; cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* The lockup: PadelCup mark, the word with its colour sweep, "by PadelCounter" */
.lockup { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); }
.lockup .mark { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 10px 30px rgba(122, 199, 12, .35); }
.lockup .names { display: grid; justify-items: start; gap: 2px; }
.word { font-family: var(--font-display); font-weight: 700; font-size: 40px; letter-spacing: -0.03em; line-height: 1; }
.word em, .signin-hero h1 em { font-style: normal; background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; }
.by { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--gray-600); letter-spacing: -0.01em; }
.by img { width: 18px; height: 18px; border-radius: 4.5px; }
.lockup.small { gap: 8px; }
.lockup.small .mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: none; }
.lockup.small .word { font-size: 23px; letter-spacing: -0.02em; }

/* Boot and sign-in: a product-page hero */
.boot { display: grid; place-content: center; justify-items: center; height: 100%; gap: 14px; color: var(--gray-600); }
.boot-mark { border-radius: 17px; animation: breathe 1.6s ease-in-out infinite; }
/* Signing in for a padelcounter.com page (brand.js sets html.pc-brand): PadelCounter's mark on the loading screen. */
.boot-mark.pc, .pc-brand .boot-mark.cup { display: none; }
.pc-brand .boot-mark.pc { display: block; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .75; } }
.signin { min-height: 100%; background: var(--surface); }
.signin-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(64px, 9vw, 112px) var(--gutter) 56px; }
.signin-hero .lockup { margin-bottom: 30px; }
.signin-hero h1 { font-size: clamp(40px, 6.2vw, 72px); max-width: 920px; }
.hero-sub { max-width: 680px; margin: 18px auto 40px; font-size: clamp(19px, 2vw, 24px); line-height: 1.33; color: var(--gray-600); letter-spacing: .009em; }
.signin-card { width: min(440px, 100%); background: var(--paper); border-radius: var(--r-xl); padding: 34px 34px 28px; text-align: left; }
.signin-card h2 { font-size: 28px; margin-bottom: 6px; }
.signin-card.sent { text-align: center; }
.signin-form { display: grid; gap: 10px; margin-top: 10px; }
.signin-form .field { margin: 4px 0 0; }
/* The app's sign-in pills (AccountView.swift ProviderSignInButton / SignInPillStyle). */
.pills { display: grid; gap: 12px; margin: 14px 0 6px; }
.signin-pill { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 12px 56px; font: inherit; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: #000; background: #fff; border: 0.75px solid #a6a6a6; border-radius: 18px; cursor: pointer; }
.signin-pill:hover { background: #fafafa; }
.signin-pill:active { background: #ebebeb; }
.signin-pill:disabled { opacity: .5; cursor: default; background: #fff; }
.signin-pill.last { border: 3px solid #abeb21; }
.pill-icon { position: absolute; left: 16px; top: 0; bottom: 0; display: flex; align-items: center; }
.pill-icon img { width: 24px; height: 24px; }
/* Apple's artwork carries its own clear space (31 × 44); multiply hides its white canvas. */
.pill-icon.apple { left: 10px; }
.pill-icon.apple img { width: 36.6px; height: 52px; mix-blend-mode: multiply; }
.last-badge { position: absolute; top: -9px; right: 14px; padding: 3px 8px; border-radius: 980px; background: #abeb21; color: var(--navy); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.back-link { font-size: 16px; margin-bottom: 10px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: var(--max-w); margin: 0 auto; padding: 24px var(--gutter) 80px; }
.feature-tile { background: var(--paper); border-radius: var(--r-xl); padding: 32px 30px; }
.feature-icon { font-size: 30px; display: block; margin-bottom: 12px; }
.feature-tile h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.feature-tile p { color: var(--gray-600); font-size: 17px; }
.signin-foot, .site-foot { text-align: center; padding: 22px var(--gutter) 34px; color: var(--gray-600); font-size: 14px; border-top: 1px solid var(--hairline); }
.signin-foot .by, .site-foot .by { font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: center; align-items: center; gap: 4px; }
.noscript { padding: 24px; }

/* Shell: Apple's global nav, content on #f5f5f7 with white tiles */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.globalnav { position: sticky; top: 0; z-index: 20; background: rgba(251, 251, 253, .8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline); }
.globalnav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 24px; }
.globalnav-home { text-decoration: none !important; }
.globalnav-links { display: flex; gap: 2px; flex: 1; justify-content: center; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; font-size: 17px; font-weight: 500; color: rgba(0, 0, 0, .8); white-space: nowrap; text-decoration: none !important; border-radius: 980px; }
.nav-link:hover { color: #000; background: rgba(0, 0, 0, .04); }
.nav-link.active { color: #000; font-weight: 600; background: rgba(0, 0, 0, .06); }
.count { font-size: 14px; font-weight: 400; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.account { display: flex; align-items: center; gap: 14px; font-size: 16px; color: var(--gray-600); white-space: nowrap; }
.account .more { font-size: inherit; }
.handle { font-weight: 600; color: var(--ink); }
.content { flex: 1; width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 48px var(--gutter) 88px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head p { max-width: 640px; font-size: 19px; line-height: 1.42; color: var(--gray-600); margin-top: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; margin-bottom: 14px; font-size: 16px; }
.empty { text-align: center; padding: 72px 24px; background: var(--surface); border-radius: var(--r-xl); display: grid; gap: 10px; justify-items: center; }
.empty h2 { font-size: 32px; }
.empty p { max-width: 520px; font-size: 17px; }
.callout { background: var(--brand-light); color: var(--ink); padding: 14px 18px; border-radius: var(--r-lg); margin-bottom: 20px; font-size: 16px; }
.callout.warn { background: #fff4e5; color: var(--warning); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { background: var(--surface); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.card-body { padding: 18px 22px 22px; display: grid; gap: 4px; }
.card-body h3 { font-size: 21px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.meta { font-size: 15px; color: var(--gray-600); }
.thumb { display: block; border: 0; padding: 18px 18px 0; background: var(--surface); cursor: pointer; }
.thumb svg, .venue-link svg { display: block; width: 100%; height: auto; border-radius: 14px; }
.club-head { display: flex; gap: 12px; align-items: center; }
.accent-dot { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.club-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: var(--paper); }

.rows { display: grid; gap: 1px; margin: 14px 0 36px; background: var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.row { font: inherit; color: inherit; text-align: left; display: grid; grid-template-columns: 104px 1fr auto 200px; gap: 16px; align-items: center; background: var(--surface); border: 0; padding: 16px 20px; cursor: pointer; }
.row:hover { background: #fbfbfd; }
.row-main { display: grid; }
.row-main strong { font-weight: 600; }
.row .muted { font-size: 15px; }
section > h2 { margin: 6px 0 4px; font-size: 24px; }
.badge { font-size: 14px; font-weight: 600; border-radius: 980px; padding: 3px 10px; justify-self: start; background: var(--paper); color: var(--gray-600); }
.badge.live { background: var(--live); color: #fff; }
.badge.scheduled { background: var(--brand-light); color: var(--brand); }
.badge.draft { background: var(--paper); color: var(--gray-600); }
.badge.finished { background: #e3f6e8; color: var(--green); }
.archive summary { cursor: pointer; font-weight: 600; margin: 8px 0; color: var(--link); }

.panel { background: var(--surface); border-radius: var(--r-xl); padding: 26px 28px; margin-bottom: 20px; }
.panel h2 { margin-bottom: 12px; }
.event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.event-grid .panel { margin: 0; }
.venue-link { display: grid; gap: 8px; text-decoration: none !important; color: var(--ink); font-weight: 600; max-width: 340px; }
.players { list-style: none; padding: 0; margin: 0 0 14px; columns: 2; }
.players li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; break-inside: avoid; font-size: 16px; }
.players li.left > span { color: var(--gray-600); }
.warn { color: var(--warning); }
.subhead { font-size: 16px; margin: 16px 0 6px; }
.late-arrival { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.late-arrival input { flex: 1 1 180px; width: auto; }
.late-arrival select { flex: 0 1 150px; width: auto; }
.sharing a { word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; font-size: 16px; }
.facts dt { color: var(--gray-600); }
.facts dd { margin: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; letter-spacing: .04em; }
.players.requests { columns: 1; }
.request-actions { display: flex; gap: 6px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); font-size: 16px; }
th { font-size: 14px; color: var(--gray-600); font-weight: 600; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
.table { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
/* Wide tables scroll inside their card on phones instead of widening the page. */
.table-scroll { overflow-x: auto; border-radius: var(--r-lg); }
.table-scroll td { white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fbfbfd; }
.search { max-width: 380px; margin-bottom: 16px; border-radius: 980px; padding-left: 16px; }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.round { background: var(--paper); border-radius: var(--r-lg); padding: 16px 18px; }
.round h3, .round summary { margin-bottom: 8px; font-size: 17px; }
.round summary { cursor: pointer; font-weight: 600; }
.round .round-edit, .round .round-delete { margin-left: 10px; vertical-align: middle; }
.round.done { opacity: .9; }
.matches td { padding: 7px 8px; border-color: rgba(0, 0, 0, .06); }
.matches td:first-child { white-space: nowrap; font-size: 15px; }
.matches .score { text-align: center; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.matches .win { color: var(--green); font-weight: 600; }
.standings td:last-child { font-variant-numeric: tabular-nums; }
.score-edit { display: inline-flex; align-items: center; gap: 4px; }
.score-input { width: 60px; padding: 6px 4px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 10px; }
.round-actions { margin-top: 18px; }
.bracket { margin-bottom: 16px; }
.draw-preview { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px 10px; margin-bottom: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

/* Dialogs and toasts */
dialog { background: var(--surface); color: var(--ink); border: 0; border-radius: var(--r-xl); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--sh-lg); }
dialog::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-form { padding: 28px 30px; display: grid; gap: 2px; }
.dialog-form h2 { margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.choices { display: grid; gap: 8px; margin-top: 6px; }
.choices .button { text-align: left; }
/* Venue & courts in the event dialogs: all courts, or the ones clicked on the plan. */
.fields { display: grid; gap: 2px; }
.court-picker { display: grid; gap: 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; background: var(--paper); border-radius: 11px; }
.segmented .tab { font-size: 15px; padding: 7px 10px; }
.court-plan .plan-picture { display: block; width: 100%; height: auto; border-radius: 14px; }
.court-plan.pickable .court { cursor: pointer; transition: opacity .12s; }
.court-plan.pickable .court:hover { opacity: .8; }
.court-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.court-count { font-size: 15px; font-weight: 600; margin: 0; }
.court-count.error { color: var(--danger); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.icon-choice { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid transparent; border-radius: 14px; padding: 10px 8px; display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.icon-choice:hover { border-color: var(--brand); background: #fff; }
.icon-choice .glyph { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; }
.shortcuts th { font-size: 15px; color: var(--ink); white-space: nowrap; font-weight: 600; }
.shortcuts td { color: var(--gray-600); font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: rgba(29, 29, 31, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; padding: 11px 20px; border-radius: 980px; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(227, 0, 0, .92); }

/* Editor: Freeform-style light chrome around the plan */
.editor-root { position: fixed; inset: 0; background: var(--paper); }
.editor { display: flex; flex-direction: column; height: 100%; }
.editor > .editor-body { flex: 1; }
.editor-top { display: flex; align-items: center; gap: 6px; padding: 7px 14px; background: rgba(251, 251, 253, .9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline); }
.editor-top .button.ghost { font-size: 15px; }
.title-input { width: auto; min-width: 180px; max-width: 380px; font-family: var(--font-display); font-weight: 600; font-size: 17px; background: transparent; border-color: transparent; border-radius: 8px; padding: 5px 8px; }
.title-input:hover { border-color: var(--gray-200); }
.title-input:focus { background: #fff; }
.divider { width: 1px; height: 22px; background: var(--gray-200); margin: 0 6px; }
.spacer { flex: 1; }
.save-status { font-size: 14px; padding: 3px 10px; border-radius: 980px; background: rgba(0, 0, 0, .05); color: var(--gray-600); }
.save-status.saving, .save-status.unsaved { color: var(--warning); }
.save-status.offline, .save-status.conflict, .save-status.error { background: var(--danger); color: #fff; }
.conflict-bar { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: #fff4f4; border-bottom: 1px solid rgba(227, 0, 0, .25); font-size: 16px; }
.editor-body { display: grid; grid-template-columns: auto 1fr 340px; min-height: 0; }
.tool-palette { background: #fbfbfd; border-right: 1px solid var(--hairline); padding: 10px 8px; overflow-y: auto; display: grid; align-content: start; gap: 10px; }
.tool-group { display: grid; grid-template-columns: repeat(2, 40px); gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.tool-group:last-child { border-bottom: 0; }
.tool { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.tool:hover { background: rgba(0, 0, 0, .05); }
.tool.active { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 113, 227, .15); }
.canvas-wrap { position: relative; min-width: 0; min-height: 0; background: #ececf0; overflow: hidden; }
.plan-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--font-body); cursor: default; }
.plan-canvas:focus { outline: none; }
/* Plans are drawn in metres: an inherited letter-spacing in px would squeeze every label. */
.plan-canvas, .plan-picture { letter-spacing: normal; }
.plan-canvas[data-tool=pan] { cursor: grab; }
.plan-canvas[data-tool=court], .plan-canvas[data-tool^="el:"], .plan-canvas[data-tool^="icon:"], .plan-canvas[data-tool=measure] { cursor: crosshair; }
.plan-canvas .objects [data-id] { cursor: move; }
.plan-canvas:not([data-tool=select]) .objects [data-id] { cursor: crosshair; }
.overlay * { pointer-events: none; }
.overlay .handle { pointer-events: all; fill: #fff; stroke: var(--brand); stroke-width: 2; cursor: grab; }
.overlay .handle.square { cursor: nwse-resize; }
.overlay .knob { fill: var(--brand); stroke: #fff; cursor: alias; }
.overlay .knob-line { stroke: var(--brand); stroke-width: 1.5; }
.overlay .outline { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 4; }
.overlay .outline.hover { stroke: #fff; stroke-opacity: .8; stroke-dasharray: none; }
.overlay .outline-line { stroke: var(--brand); stroke-opacity: .45; stroke-width: 10; stroke-linecap: round; }
.overlay .outline-line.hover { stroke: #fff; stroke-opacity: .45; }
.overlay .group-frame { fill: none; stroke: var(--brand); stroke-width: 1; }
.overlay .floor-edge { fill: none; stroke: #000; stroke-opacity: .12; }
.overlay .guide { stroke: #ff2d92; stroke-width: 1; stroke-dasharray: 4 3; }
.overlay .marquee { fill: rgba(0, 113, 227, .1); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 6 4; }
.overlay .ruler { stroke: #7ac70c; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 6 4; }
.overlay .snap { fill: none; stroke: #7ac70c; stroke-width: 2.5; }
.overlay .measure rect { fill: var(--accent); }
.overlay .measure text { fill: #1d1d1f; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.overlay .scale-bar rect { fill: rgba(255, 255, 255, .85); }
.overlay .scale-bar text { fill: var(--ink); font-size: 13px; font-weight: 600; }
.overlay .scale-bar path { stroke: var(--ink); stroke-width: 2.5; }
.level-bar { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.editor-sidebar { background: #fbfbfd; border-left: 1px solid var(--hairline); overflow-y: auto; min-height: 0; }
.tabs { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 10px 12px; background: #fbfbfd; border-bottom: 1px solid var(--hairline); }
.tab { font: inherit; font-size: 15px; color: var(--ink); background: transparent; border: 0; border-radius: 8px; padding: 6px; cursor: pointer; }
.tab:hover { background: rgba(0, 0, 0, .04); }
.tab.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); font-weight: 600; }
.tab-body { padding: 4px 16px 30px; }
.tab-body .panel { background: transparent; border-radius: 0; border-bottom: 1px solid var(--hairline); padding: 16px 0; margin: 0; }
.tab-body .panel h3 { font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .02em; }
.tab-body p { font-size: 15px; }
.num { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; font-size: 15px; }
.num > span { color: var(--gray-600); font-weight: 600; min-width: 14px; }
.num input { padding: 6px 8px; font-variant-numeric: tabular-nums; font-size: 15px; border-radius: 9px; }
.num em { font-style: normal; color: var(--gray-600); font-size: 14px; }
.grid3 .num { grid-template-columns: 1fr auto; }
.grid3 .num > span { grid-column: 1 / -1; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; padding: 0; font-size: 14px; color: var(--gray-600); background: #fff; }
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }
.swatch.custom { width: 30px; height: 26px; border-radius: 8px; }
.layers { display: grid; gap: 1px; }
.layer { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; font-size: 15px; }
.layer:hover { background: rgba(0, 0, 0, .04); }
.layer.selected { background: var(--brand); color: #fff; }
.layer.selected .kind { color: rgba(255, 255, 255, .8); }
.layer.nested { margin-left: 22px; }
.layer.group { font-weight: 600; }
.layer.drop { border-top-color: var(--brand); }
.layer .kind { width: 18px; text-align: center; color: var(--gray-600); }
.layer .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.levels { display: grid; gap: 0; }
.template-row { display: grid; gap: 8px; }
.template { font: inherit; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 11px 14px; cursor: pointer; display: grid; gap: 2px; }
.template:hover { border-color: var(--brand); }
.template strong { font-size: 16px; }
.template span { color: var(--gray-600); font-size: 15px; }
.editor-status { display: flex; align-items: center; gap: 16px; padding: 6px 14px; background: #fbfbfd; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--gray-600); }
.coords { font-variant-numeric: tabular-nums; min-width: 170px; }
.toggles { display: flex; gap: 14px; align-items: center; }
.switch { display: flex; gap: 5px; align-items: center; cursor: pointer; color: var(--ink); }
.view-menu { position: relative; }
.view-menu summary { cursor: pointer; list-style: none; color: var(--link); padding: 2px 6px; }
.view-menu .menu { position: absolute; bottom: 28px; right: 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--hairline); box-shadow: var(--sh-md); border-radius: 14px; padding: 8px 14px; min-width: 190px; z-index: 5; }
.view-menu .check { margin: 7px 0; color: var(--ink); }

@media (max-width: 1100px) {
  .editor-body { grid-template-columns: auto 1fr 300px; }
  .event-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 96px 1fr auto; }
  .row > :last-child { display: none; }
  .features { grid-template-columns: 1fr; }
}
/* Narrower windows: the product and the account on the first row, the sections on a second row
   of their own (scrolls sideways if it has to, without a scrollbar), so the links keep their size. */
@media (max-width: 960px) {
  .globalnav-inner { height: auto; flex-wrap: wrap; gap: 2px 12px; padding-top: 8px; padding-bottom: 6px; }
  .globalnav-home { flex: 1; min-width: 0; }
  .globalnav-links { order: 3; flex: 0 0 calc(100% + 20px); justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; }
  .globalnav-links::-webkit-scrollbar { display: none; }
  .nav-link { padding: 7px 12px; font-size: 16px; }
  .account .handle { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 800px) {
  .lockup.small .word { font-size: 21px; }
  .content { padding: 28px 16px 56px; }
  .editor-body { grid-template-columns: auto 1fr; }
  .editor-sidebar { position: absolute; right: 0; top: 50px; bottom: 32px; width: min(320px, 85vw); box-shadow: var(--sh-lg); }
  .editor-top .button.ghost:not(:first-child) { display: none; }
  .players { columns: 1; }
  .rounds { grid-template-columns: 1fr; }
  .lockup.large .mark { width: 56px; height: 56px; border-radius: 13px; }
  .word { font-size: 32px; }
}
/* Phones: all five sections fit in the second row without the counts; list rows put the status
   on a line of its own so the event name keeps the width. */
@media (max-width: 560px) {
  .nav-link { padding: 7px 9px; }
  .nav-link .count { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .row > .badge { grid-column: 1 / -1; }
  .content .panel { padding: 22px 18px; border-radius: 22px; }
  .match-card { padding: 12px; }
  .card-teams { font-size: 15px; gap: 6px; }
}
@media (max-width: 400px) { .nav-link { font-size: 15px; } }

/* Venue editor: the web map under a placed plan, aligning it, and grouping in Layers. */
.map-tiles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: #dfe3e8; }
.tile-level { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tile-level img { position: absolute; width: 256.6px; height: 256.6px; max-width: none; user-select: none; -webkit-user-select: none; }
.map-credit { position: absolute; right: 8px; bottom: 6px; font-size: 13px; color: var(--ink); background: rgba(255, 255, 255, .78); padding: 1px 7px; border-radius: 6px; text-decoration: none; }
.map-credit:hover { text-decoration: underline; }
.plan-canvas[data-tool=align] { cursor: grab; }
.plan-canvas[data-tool=aligning] { cursor: grabbing; }
.plan-canvas[data-tool=pin], .plan-canvas[data-tool=pin] .objects [data-id] { cursor: crosshair; }
.plan-canvas[data-tool=align] .objects [data-id] { cursor: pointer; }
.overlay .pin-aim { fill: none; stroke: #ff2d55; stroke-width: 2; }
.overlay .pin-aim.dot { fill: #ff2d55; stroke: #fff; stroke-width: 1; }
.map-bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 28px)); display: grid; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: var(--sh-md); z-index: 4; }
.canvas-wrap.has-levels .map-bar { top: 54px; }
.map-row { display: flex; gap: 8px; align-items: center; }
.map-search { flex: 1; min-width: 0; padding: 6px 12px; border-radius: 980px; font-size: 15px; }
.map-style { width: auto; padding: 5px 8px; font-size: 15px; border-radius: 9px; }
.map-results { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }
.map-result { font: inherit; font-size: 15px; text-align: left; color: var(--ink); background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.map-result:hover { background: var(--brand-light); }
.map-credit-line { font-size: 13px; color: var(--gray-600); padding: 0 8px; }
.map-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.map-slider { display: grid; grid-template-columns: auto 1fr 66px auto; align-items: center; gap: 6px; font-size: 14px; }
.map-slider > span { color: var(--gray-600); font-weight: 600; }
.map-slider em { font-style: normal; color: var(--gray-600); }
.map-slider input[type=range] { min-width: 0; }
.map-number { padding: 3px 6px; font-size: 15px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.map-pinned { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 15px; }
.map-hint { font-size: 14px; color: var(--gray-600); margin: 0; }
.map-hint.active { color: #fff; background: #ff2d55; border-radius: 8px; padding: 5px 9px; font-weight: 600; }
.editor-top .button.ghost.active { background: var(--ink); color: #fff; }
.geo-details summary { cursor: pointer; color: var(--link); font-size: 15px; margin: 6px 0; }
.layer-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.layer.faded .name { opacity: .45; }
.layer .count { font-size: 13px; font-weight: 600; color: var(--gray-600); background: rgba(0, 0, 0, .06); border-radius: 980px; padding: 0 6px; }
.layer.selected .count { color: #fff; background: rgba(255, 255, 255, .22); }
.layer.drop-above { border-top-color: var(--brand); border-top-width: 2px; }
.layer.drop-below { border-bottom-color: var(--brand); border-bottom-width: 2px; }
.layer.drop-into { background: var(--brand-light); border-color: var(--brand); }
.layer-rename { flex: 1; min-width: 0; padding: 2px 6px; font-size: 15px; font-weight: 600; border-radius: 6px; }
.layer-end { display: none; font-size: 14px; color: var(--gray-600); text-align: center; padding: 8px; border: 1px dashed var(--gray-300); border-radius: 8px; margin-top: 4px; }
.layers.dragging .layer-end { display: block; }
.layer-end.drop-above { border-color: var(--brand); color: var(--brand); }
@media (max-width: 1100px) { .map-controls { grid-template-columns: 1fr; gap: 4px; } }
.editor-top .save-status, .editor-top .chip { white-space: nowrap; }

/* Public venues: the "Find a venue" dialog (venue-directory.js) and the Private badge. */
dialog:has(.directory) { width: min(880px, calc(100vw - 32px)); overflow: hidden; }
.directory { padding: 28px 30px 20px; display: flex; flex-direction: column; gap: 10px; height: min(780px, calc(100vh - 48px)); }
.directory > p.muted { font-size: 16px; margin: 0; }
.directory-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.directory-search { flex: 1 1 220px; min-width: 0; border-radius: 980px; padding-left: 16px; }
.directory-bar .button.near[aria-pressed=true] { background: var(--brand); color: #fff; }
.directory-note { margin: 0; font-size: 15px; color: var(--warning); background: #fff4e5; border-radius: var(--r-sm); padding: 9px 12px; }
.directory-heading { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--gray-600); min-height: 1.4em; }
.directory-results { flex: 1; min-height: 120px; overflow-y: auto; margin: 0 -30px; padding: 0 30px; background: var(--paper); transition: opacity .15s; }
.directory-results.busy { opacity: .55; }
.directory-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 16px 0; }
.directory-card .thumb { cursor: default; padding: 14px 14px 0; }
.directory-card .card-body { padding: 12px 16px 16px; }
.directory-card .card-body h3 { font-size: 17px; }
.directory-card .card-body .muted, .directory-card .meta { font-size: 15px; margin: 0; }
.directory-card:hover { transform: none; }
.directory-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 56px 16px; }
.directory-state p { max-width: 460px; font-size: 16px; }
.directory .dialog-actions { margin-top: 2px; }
.directory-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--gray-200); border-top-color: var(--brand); animation: directory-spin .8s linear infinite; }
@keyframes directory-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .directory-spinner { animation-duration: 2.4s; } }
.badge.private { font-size: 13px; margin-left: 8px; vertical-align: middle; background: var(--paper); color: var(--gray-600); }
@media (max-width: 800px) {
  .directory { padding: 22px 16px 16px; }
  .directory-results { margin: 0 -16px; padding: 0 16px; }
}

/* Add by @name (account-search.js): the app's AccountSearchSection, a face, the name and the @name per account. */
.account-search { max-width: 480px; margin-top: 14px; }
.account-field { position: relative; }
.account-at { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-600); font-weight: 600; pointer-events: none; }
.account-input { padding-left: 34px; padding-right: 40px; border-radius: 980px; }
.account-spinner, .account-field .mini { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.account-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gray-200); border-top-color: var(--brand); animation: directory-spin .8s linear infinite; }
.account-field .mini { color: var(--gray-600); }
.account-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.account-row { font: inherit; color: var(--ink); text-align: left; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; background: transparent; border: 0; border-radius: 12px; padding: 7px 10px; cursor: pointer; }
.account-row:hover:not(:disabled) { background: var(--paper); }
.account-row:disabled { cursor: default; }
.account-face { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--brand-light); color: var(--brand); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.account-face img { width: 100%; height: 100%; object-fit: cover; }
.account-names { display: grid; min-width: 0; }
.account-names strong { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-names small { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 17px; line-height: 1; }
.account-mark.added { background: var(--gray-200); color: var(--gray-600); font-size: 15px; }
.account-status { margin: 6px 0 0; min-height: 0; }
.account-status:empty { display: none; }
/* A team's first pick waiting for its partner, and the faces of the accounts playing as a roster's participant. */
.account-pending { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 6px 7px 10px; border-radius: 12px; background: var(--paper); }
.account-pending strong { margin-left: 4px; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pending .mini { color: var(--gray-600); }
.roster-faces { display: inline-flex; vertical-align: middle; margin-right: 6px; }
.roster-faces .account-face { width: 22px; height: 22px; font-size: 10px; border: 2px solid #fff; margin-left: -6px; }
.roster-faces .account-face:first-child { margin-left: 0; }

/* Leagues (pages.js) and their public pages (league-sharing.js): the app's LeagueLogo is the logo or a trophy. */
.league-logo { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--paper); display: grid; place-items: center; object-fit: cover; overflow: hidden; }
.league-logo svg { width: 26px; height: 26px; }
.league-logo.large { width: 72px; height: 72px; border-radius: 17px; }
.league-logo.large svg { width: 40px; height: 40px; }
.league-head { display: flex; align-items: center; gap: 18px; min-width: 0; }
.league-head h1 { overflow-wrap: anywhere; }
.league-badge { font-size: 13px; margin-left: 8px; vertical-align: middle; }
.league-url { overflow-wrap: anywhere; }
.league-state { margin-top: 10px; }
@media (max-width: 560px) {
  .league-head { gap: 12px; }
  .league-logo.large { width: 56px; height: 56px; border-radius: 13px; }
}

/* Rounds as Cards, List or Map (event-run.js): the app's MatchCard, CourtScoreList and VenueLiveMap. */
.segmented.round-style { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 360px; margin: 0 0 10px; }
.match-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.match-card { font: inherit; color: var(--ink); text-align: left; width: 100%; display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px; }
button.match-card { cursor: pointer; transition: border-color .15s; }
button.match-card:hover { border-color: var(--brand); }
.card-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-600); }
.card-state { letter-spacing: 0; text-transform: none; white-space: nowrap; }
.card-state.played { color: var(--green); }
.card-state.live { color: var(--live); }
.card-state.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--live); vertical-align: 1px; }
.card-state.next { color: var(--brand); }
.card-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 16px; line-height: 1.3; }
.card-team > span { display: block; }
.card-team:last-child { text-align: right; }
.card-team.win { color: var(--green); font-weight: 600; }
.card-score { font: 600 22px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; gap: 6px; }
/* The app's ScoreBox: team 1 blue, team 2 grey; a click on one enters that team's points. */
.card-side { min-width: 46px; padding: 9px 6px; border-radius: 10px; text-align: center; background: rgba(0, 113, 227, .14); border: 1px solid rgba(0, 113, 227, .55); }
.card-side.team-1 { background: rgba(142, 142, 147, .16); border-color: rgba(142, 142, 147, .65); }
.card-side.empty { color: var(--gray-400); }
button.match-card .card-side { transition: transform .12s, box-shadow .12s; }
button.match-card .card-side:hover { transform: scale(1.06); box-shadow: 0 0 0 2px var(--brand); }
button.match-card .card-side.team-1:hover { box-shadow: 0 0 0 2px #8e8e93; }
.card-note { font-size: 14px; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.card-note.warn { color: var(--warning); }
/* Live scores (live-scores.js): a match being scored now, the table's players on court, the TV's courts. */
.live-slot { display: block; }
.live-slot[hidden] { display: none; }
td .live-slot { margin-top: 4px; }
td .live-line { justify-content: center; }
td .live-line .muted { margin-left: 0; }
.live-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.live-line .muted { margin-left: auto; font-size: 13px; }
.live-tag { padding: 1px 6px; border-radius: 980px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--live); vertical-align: middle; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.tv-court.live { box-shadow: inset 0 0 0 2px var(--live); }
.tv .live-dot { width: .38em; height: .38em; margin-left: .45em; }
.tv-live { padding: 0 .45em; border-radius: 980px; background: var(--live); color: #fff; font-size: .7em; font-weight: 800; letter-spacing: .06em; line-height: 1.6; align-self: center; }
.tv-score.live { color: var(--live); font-size: 1.05em; white-space: nowrap; word-spacing: .2em; }
.round-map { display: grid; gap: 12px; }
button.bracket-box .bracket-line:hover b { color: var(--brand); }
/* The score dialog's pad (score-pad.js): both teams' score cards, then every number for the chosen one. */
.score-pad { display: grid; gap: 12px; margin-bottom: 8px; }
.pad-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pad-side { font: inherit; color: var(--ink); display: grid; gap: 8px; justify-items: center; padding: 10px 8px 12px; border-radius: var(--r-md); background: rgba(0, 113, 227, .12); border: 1px solid rgba(0, 113, 227, .5); text-align: center; opacity: .62; }
.pad-side.team-1 { background: rgba(142, 142, 147, .14); border-color: rgba(142, 142, 147, .6); }
button.pad-side { cursor: pointer; }
.pad-side.chosen, div.pad-side { opacity: 1; }
.pad-side.chosen { box-shadow: 0 0 0 3px var(--brand); }
.pad-side.team-1.chosen { box-shadow: 0 0 0 3px #8e8e93; }
.pad-names { font-size: 15px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pad-value { font: 600 40px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.pad-label { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--gray-600); }
.pad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.pad-number { font: 600 18px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--gray-100); border: 1px solid transparent; border-radius: var(--r-sm); height: 46px; min-width: 0; cursor: pointer; }
.pad-number:hover { border-color: var(--gray-300); }
.pad-number.on, .team-0 .pad-number.on { background: var(--brand); color: #fff; }
.team-1 .pad-number.on { background: #8e8e93; color: #fff; }
.pad-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pad-total { font-size: 14px; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.pad-total.warn { color: var(--warning); }
.pad-foot .chip { font-size: 14px; padding: 4px 12px; }
.pad-set { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md); }
.pad-set-head { display: flex; justify-content: space-between; align-items: center; }
.pad-games-row { display: grid; gap: 4px; }
.pad-games-team { font-size: 13px; font-weight: 600; color: var(--gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-games { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.pad-games .pad-number { height: 40px; font-size: 16px; }
.pad-error:empty { display: none; }
@media (max-width: 560px) { .pad-value { font-size: 34px; } .pad-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); } }
.court-plan.live .plan-picture { max-height: 75vh; }
.court-plan.live .tappable { cursor: pointer; }
.court-plan.live .tappable:hover { opacity: .85; }
.court-rows { display: grid; gap: 6px; }
.court-row { font: inherit; color: var(--ink); text-align: left; width: 100%; display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; background: var(--paper); border: 1px solid transparent; border-radius: 12px; padding: 10px 14px; }
button.court-row { cursor: pointer; }
button.court-row:hover { border-color: var(--brand); }
.court-row-name { font-size: 16px; font-weight: 600; }
.court-row-teams { font-size: 15px; color: var(--gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.court-row-score { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.court-row-score.live { color: var(--live); }
.court-row-score.next { color: var(--brand); }
@media (max-width: 560px) {
  .court-row { grid-template-columns: minmax(0, 1fr) auto; }
  .court-row-teams { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
}

/* Rounds on phones: a column never wider than the screen; each match reads court, then team · score · team. */
.rounds { grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); }
@media (max-width: 560px) {
  .round { padding: 12px 10px; }
  table.matches { display: block; }
  .matches tr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, .06); }
  .matches tr:last-child { border-bottom: 0; }
  .matches td { display: block; padding: 2px 0; border: 0; overflow-wrap: anywhere; }
  /* Court (and the ⋯ button of an editable row) on top, then team · score · team. */
  .matches td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
  .matches td:nth-child(5) { grid-area: 1 / 3; justify-self: end; }
  .matches td:nth-child(2) { grid-area: 2 / 1; }
  .matches td:nth-child(3) { grid-area: 2 / 2; }
  .matches td:nth-child(4) { grid-area: 2 / 3; text-align: right; }
  .score-input { width: 48px; }
  /* Standings: names wrap, numbers ("0–1") stay on one line. */
  .standings td:not(:nth-child(2)) { white-space: nowrap; }
  .standings th:nth-child(3), .standings td:nth-child(3) { display: none; }
  .standings td { padding-left: 4px; padding-right: 4px; }
}

/* Knockout, tie-breaks and avoid rematches (RoundRules.swift): setup toggles, the bracket as a tree
   (the app's BracketTreeView: stages left to right, empty boxes for rounds to come), the champion. */
.draw-toggles { display: grid; gap: 0; margin: 4px 0 6px; }
.check-hint { display: block; font-size: 14px; line-height: 1.35; margin-top: 2px; }
.tie-break-field > small { font-size: 14px; }
.tie-breaks { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.tie-breaks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--paper); border-radius: 12px; padding: 2px 6px 2px 12px; }
.tie-breaks li:not(.on) .check > span { color: var(--gray-600); }
.tie-breaks .check { margin: 6px 0; flex: 1; min-width: 0; }
.tie-breaks .check input { width: auto; flex: none; }
.tie-break-move { display: flex; gap: 2px; flex: none; }
.tie-break-move .mini { width: 30px; height: 30px; font-size: 16px; }
.tie-break-move .mini:disabled { opacity: .3; cursor: default; }
.draw-toggles .check input { width: auto; flex: none; }
.bracket-tree { display: flex; gap: 26px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 0 14px; }
.bracket-column { flex: 0 0 188px; display: flex; flex-direction: column; gap: 8px; }
.bracket-stage { align-self: flex-start; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--gray-600); }
.bracket-slots { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bracket-box { font: inherit; color: var(--ink); text-align: left; width: 100%; display: grid; padding: 0; background: var(--paper); border: 1px solid transparent; border-radius: 10px; min-height: 62px; }
button.bracket-box { cursor: pointer; }
button.bracket-box:hover { border-color: var(--brand); }
.bracket-box.open { border-color: rgba(0, 113, 227, .45); }
.bracket-box.empty { place-items: center; border: 1px dashed var(--gray-300); background: transparent; font-size: 14px; color: var(--gray-600); }
.bracket-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; font-size: 15px; min-width: 0; }
.bracket-line + .bracket-line { border-top: 1px solid var(--hairline); }
.bracket-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-line b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--gray-600); }
.bracket-line.win { color: var(--green); font-weight: 600; }
.bracket-line.win b { color: var(--green); }
.bracket-line.bye { color: var(--gray-600); }
.champion-card { display: grid; justify-items: center; gap: 4px; text-align: center; background: var(--paper); border-radius: var(--r-lg); padding: 22px 18px; margin-top: 16px; }
.champion-card strong { font: 600 21px/1.2 var(--font-display); }
.champion-trophy { width: 44px; height: 44px; fill: #bf4800; }
.more:disabled { opacity: .4; cursor: default; text-decoration: none; }

/* The format picker (format-picker.js, like the app's format step): a search, the popular formats, and every format by
   category (a chip in its colour) and subcategory; each card in its category's colour (--tint). */
dialog:has(.format-field) { width: min(820px, calc(100vw - 32px)); }
.format-field { gap: 10px; }
.format-search { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 12px; padding: 0 10px; }
.format-search:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.format-search-icon { color: var(--gray-600); font-size: 18px; }
.format-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 10px 0; outline: none; }
.format-search input::-webkit-search-cancel-button { display: none; }
.format-search-clear { border: 0; background: var(--gray-300); color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: 13px; line-height: 20px; padding: 0; cursor: pointer; }
.format-body { display: grid; gap: 10px; }
.format-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.format-card { --tint: #007AFF; font: inherit; color: var(--ink); text-align: left; display: grid; gap: 2px; align-content: start; min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 2px solid transparent; cursor: pointer;
  background: color-mix(in srgb, var(--tint) 10%, var(--surface)); }
.format-card:hover { background: color-mix(in srgb, var(--tint) 18%, var(--surface)); }
.format-card.active { background: color-mix(in srgb, var(--tint) 28%, var(--surface)); border-color: var(--tint); }
.format-card-title { font-size: 16px; font-weight: 600; }
.format-card-tagline { font-size: 14px; line-height: 1.3; color: var(--gray-600); }
.format-all { justify-self: start; font-weight: 600; }
.format-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.format-chip { --tint: #007AFF; font: inherit; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 980px; border: 0; cursor: pointer;
  color: color-mix(in srgb, var(--tint) 75%, #000); background: color-mix(in srgb, var(--tint) 14%, var(--surface)); }
.format-chip.active { color: #fff; background: var(--tint); }
.format-chip.active .format-dot { background: #fff; }
.format-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint, #007AFF); display: inline-block; flex: none; }
.format-family { --tint: #007AFF; display: grid; gap: 6px; }
.format-family h4 { margin: 8px 0 0; font-size: 17px; display: flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--tint) 80%, #000); }
.format-family h5 { margin: 4px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-600); }
.format-info-card { --tint: #007AFF; background: var(--paper); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; }
.format-info-card strong { display: flex; align-items: center; gap: 8px; }
.format-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.format-fact { font-size: 14px; font-weight: 600; padding: 3px 8px; border-radius: 980px; color: color-mix(in srgb, var(--tint) 75%, #000); background: color-mix(in srgb, var(--tint) 14%, var(--surface)); }
.format-rules .field { margin: 6px 0; }

/* Simulation (simulation.js, the app's SimulationView). */
dialog:has(.simulation) { width: min(760px, calc(100vw - 32px)); }
.sim-summary { background: var(--paper); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 6px; }
.sim-verdict { font-weight: 600; margin: 0; }
.sim-verdict.ok { color: var(--green); }
.sim-verdict.warn, .simulation .warn { color: var(--warning); }
.sim-champion { font: 600 20px/1.2 var(--font-display); margin: 2px 0; }
.sim-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 16px; }
.sim-icon { display: inline-block; width: 1.6em; }
.sim-stepper { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 14px; }
.sim-step-title { display: grid; justify-items: center; text-align: center; }
.sim-nav { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; }
.sim-nav:disabled { opacity: .35; cursor: default; }
.simulation input[type=range] { width: 100%; margin: 6px 0; }
.sim-table td:first-child { width: 36px; text-align: center; }

/* Win streaks (event-export.js streakBadge, the app's StreakBadge) and the toast's Undo (undo-toast.js). */
.streak { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 1px 7px 1px 5px; border-radius: 980px; background: rgba(255, 149, 0, .15); color: #c25e00; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 1px; white-space: nowrap; }
.streak-flame { width: 12px; height: 12px; fill: currentColor; }
.toast.with-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 12px; }
.toast-undo { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.toast-undo:hover { background: rgba(255, 255, 255, .14); }

/* Leaderboard on a photo (leaderboard-photo.js, the app's LeaderboardPhotoView). */
dialog:has(.leaderboard-photo) { width: min(620px, calc(100vw - 32px)); }
.photo-frame { display: flex; justify-content: center; min-width: 0; background: var(--paper); border-radius: var(--r-lg); padding: 12px; margin-bottom: 4px; }
.photo-preview { display: block; max-width: 100%; max-height: min(46vh, 460px); width: auto; height: auto; border-radius: 14px; box-shadow: var(--sh-md); }
.segmented.photo-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photo-count { flex-direction: row; align-items: center; justify-content: space-between; }
.photo-stepper { display: flex; gap: 4px; }
.photo-stepper .mini { width: 36px; height: 32px; font-size: 18px; background: var(--paper); }
.photo-stepper .mini:disabled { opacity: .35; cursor: default; }
.leaderboard-photo .dialog-actions { flex-wrap: wrap; }
@media (max-width: 560px) { .leaderboard-photo.dialog-form { padding: 22px 18px; } }

/* TV mode (tv-mode.js, the app's TVModeView): black, type that reads across the hall, nothing to scroll on a TV.
   Sizes follow the screen's width and height, so a laptop, a 1080p TV and a 4K TV all fit one page; --fit (set
   by tv-mode.js) shrinks a page whose names or rows would still run over. */
.tv { --tv-accent: var(--accent); --tv-muted: rgba(255, 255, 255, .62); position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #000; color: #fff; padding: clamp(14px, 2.4vh, 44px) clamp(16px, 2.6vw, 56px) clamp(10px, 1.4vh, 26px); overflow: hidden; letter-spacing: -0.01em; outline: none; user-select: none; -webkit-user-select: none; }
.tv.idle { cursor: none; }
.tv-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(12px, 2.4vh, 34px); }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.tv-title { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 24px); min-width: 0; flex: 1 1 420px; }
.tv-mark { width: clamp(14px, 1.4vw, 30px); height: clamp(14px, 1.4vw, 30px); border-radius: 50%; background: var(--tv-accent); flex: none; }
.tv-title > div { min-width: 0; }
.tv-title h1 { font-size: clamp(26px, min(3.2vw, 5.6vh), 76px); font-weight: 700; color: #fff; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-sub { margin: 4px 0 0; font-size: clamp(15px, min(1.7vw, 3vh), 40px); font-weight: 600; color: var(--tv-muted); line-height: 1.25; }
.tv-page { color: var(--tv-accent); }
.tv-clocks { display: flex; gap: clamp(14px, 1.6vw, 34px); align-items: baseline; font-size: clamp(24px, min(2.6vw, 4.6vh), 64px); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-timer { color: var(--tv-accent); }
.tv-timer.over { color: var(--live); }
.tv-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: clamp(10px, 1.8vh, 26px); }
.tv-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--tv-muted); font-size: clamp(22px, min(2.4vw, 4vh), 56px); }
.tv-empty p { margin: 0; }
/* Courts now and Up next: a card per court, up to eight a page. */
.tv-courts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vh, 24px); align-content: start; }
.tv-courts.n1 { grid-template-columns: minmax(0, 960px); justify-content: center; }
.tv-courts.n3, .tv-courts.n5, .tv-courts.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv-courts.n7, .tv-courts.n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tv-court { min-width: 0; display: grid; gap: clamp(6px, 1.2vh, 16px); background: rgba(255, 255, 255, .08); border-radius: clamp(14px, 1.2vw, 26px); padding: clamp(12px, 2vh, 30px) clamp(14px, 1.4vw, 30px); }
.tv-court-name { display: flex; justify-content: space-between; gap: 10px; color: var(--tv-accent); font-weight: 700; font-size: calc(clamp(17px, min(1.7vw, 3vh), 40px) * var(--fit, 1)); line-height: 1.2; }
.tv-check { color: #30d158; }
.tv-team { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: calc(clamp(19px, min(2vw, 3.5vh), 48px) * var(--fit, 1)); font-weight: 600; line-height: 1.15; }
.tv-team > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.tv-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.2em; }
.tv-score.done { color: var(--tv-accent); }
.tv-resting { margin: 0; color: var(--tv-muted); font-size: calc(clamp(15px, min(1.5vw, 2.7vh), 36px) * var(--fit, 1)); }
/* The table: ten rows a page, the leader brighter, places 1–3 in the accent. */
.tv-table { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(4px, .8vh, 10px); align-content: start; }
.tv-row { display: grid; grid-template-columns: clamp(34px, 4vw, 96px) minmax(0, 1fr) auto clamp(58px, 7vw, 170px); align-items: center; gap: clamp(10px, 1.4vw, 32px); padding: calc(clamp(5px, 1.1vh, 16px) * var(--fit, 1)) clamp(12px, 1.4vw, 32px); border-radius: clamp(10px, .9vw, 20px); background: rgba(255, 255, 255, .06); font-size: calc(clamp(18px, min(2vw, 3.6vh), 48px) * var(--fit, 1)); line-height: 1.2; }
.tv-row.first { background: rgba(255, 255, 255, .14); }
.tv-row.first .tv-name { font-weight: 700; }
.tv-place { text-align: right; font-weight: 700; color: var(--tv-muted); font-variant-numeric: tabular-nums; }
.tv-place.top { color: var(--tv-accent); }
.tv-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-record { color: var(--tv-muted); font-size: .85em; font-variant-numeric: tabular-nums; }
.tv-points { text-align: right; color: var(--tv-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.tv-streak { display: inline-flex; align-items: center; gap: .15em; margin-left: .5em; padding: .05em .45em; border-radius: 980px; background: rgba(255, 159, 10, .22); color: #ff9f0a; font-size: .7em; font-weight: 700; vertical-align: .1em; }
.tv-flame { width: 1em; height: 1em; fill: currentColor; }
/* Podium: 2 – 1 – 3 on steps (gold, silver, bronze), then the awards. */
.tv-podium { width: 100%; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(10px, 1.4vw, 28px); }
.tv-step { min-width: 0; display: grid; justify-items: center; gap: clamp(4px, .8vh, 10px); text-align: center; }
.tv-step.p1 { color: #ffd700; } .tv-step.p2 { color: #c0c0c0; } .tv-step.p3 { color: #cd7f32; }
.tv-step strong { color: #fff; font-size: calc(clamp(17px, min(1.9vw, 3.4vh), 46px) * var(--fit, 1)); line-height: 1.15; overflow-wrap: anywhere; }
.tv-step-value { color: var(--tv-muted); font-size: calc(clamp(14px, min(1.3vw, 2.4vh), 32px) * var(--fit, 1)); font-variant-numeric: tabular-nums; }
.tv-medal { width: calc(clamp(24px, min(2.6vw, 4.6vh), 64px) * var(--fit, 1)); height: calc(clamp(24px, min(2.6vw, 4.6vh), 64px) * var(--fit, 1)); fill: currentColor; }
.tv-block { width: 100%; display: grid; justify-items: center; align-content: start; padding-top: .3em; border: 2px solid currentColor; border-bottom: 0; border-radius: 12px 12px 0 0; font-size: calc(clamp(24px, min(2.8vw, 5vh), 68px) * var(--fit, 1)); font-weight: 800; }
.tv-step.p1 .tv-block { height: calc(clamp(80px, 16vh, 260px) * var(--fit, 1)); background: rgba(255, 215, 0, .3); }
.tv-step.p2 .tv-block { height: calc(clamp(56px, 11.2vh, 182px) * var(--fit, 1)); background: rgba(192, 192, 192, .3); }
.tv-step.p3 .tv-block { height: calc(clamp(40px, 8vh, 130px) * var(--fit, 1)); background: rgba(205, 127, 50, .3); }
.tv-awards { width: 100%; max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: clamp(8px, 1.2vh, 18px); }
.tv-award { min-width: 0; display: grid; gap: 4px; background: rgba(255, 255, 255, .08); border-radius: clamp(12px, 1vw, 20px); padding: clamp(10px, 1.6vh, 22px) clamp(12px, 1.2vw, 24px); }
.tv-award-title { display: flex; align-items: center; gap: 8px; color: var(--tv-muted); font-weight: 600; font-size: calc(clamp(13px, min(1.1vw, 2vh), 26px) * var(--fit, 1)); }
.tv-award-icon { width: 1.1em; height: 1.1em; flex: none; fill: var(--tv-accent); }
.tv-award strong { font-size: calc(clamp(15px, min(1.5vw, 2.7vh), 36px) * var(--fit, 1)); line-height: 1.2; overflow-wrap: anywhere; }
.tv-award-value { color: var(--tv-accent); font-weight: 700; font-variant-numeric: tabular-nums; font-size: calc(clamp(15px, min(1.4vw, 2.5vh), 34px) * var(--fit, 1)); }
/* The latest announcement and the QR codes to check in, join and pay. */
.tv-bottom { display: flex; align-items: flex-end; gap: clamp(10px, 1.4vw, 28px); }
.tv-announcement { flex: 1; min-width: 0; margin: 0; padding: clamp(10px, 1.6vh, 20px) clamp(14px, 1.4vw, 28px); border-radius: 16px; background: var(--tv-accent); color: #000; font-weight: 600; font-size: clamp(17px, min(1.8vw, 3.2vh), 44px); line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tv-qr { margin: 0; display: grid; justify-items: center; gap: 6px; font-size: clamp(12px, min(1vw, 1.8vh), 22px); font-weight: 600; }
.tv-qr .qr-svg { display: block; width: clamp(80px, min(7vw, 13vh), 190px); height: auto; padding: 6px; border-radius: 12px; background: #fff; }
.tv-spacer { flex: 1; }
.tv-foot { display: flex; align-items: center; gap: 12px; padding-top: clamp(8px, 1.4vh, 20px); color: var(--tv-muted); font-size: clamp(12px, min(1vw, 1.8vh), 20px); font-weight: 600; }
.tv-dots { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tv-dot { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .3); transition: width .3s, background .3s; }
.tv-dot.on { width: 24px; background: var(--tv-accent); }
.tv-paused { white-space: nowrap; }
.tv-brand { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tv-brand img { border-radius: 5px; }
.tv-controls { display: flex; gap: 8px; transition: opacity .3s; }
.tv.idle .tv-controls { opacity: 0; }
.tv-button { font: inherit; font-size: 15px; font-weight: 400; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 980px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.tv-button:hover { background: rgba(255, 255, 255, .26); }
.tv-close { padding: 7px 12px; }
@media (prefers-reduced-motion: reduce) { .tv-dot { transition: none; } }
/* Phones and narrow windows: one column that scrolls, the table's record column dropped. */
@media (max-width: 700px) {
  .tv { overflow-y: auto; }
  .tv-stage, .tv-body { flex: none; overflow: visible; }
  .tv-courts, .tv-courts.n3, .tv-courts.n5, .tv-courts.n6, .tv-courts.n7, .tv-courts.n8 { grid-template-columns: minmax(0, 1fr); }
  .tv-row { grid-template-columns: 30px minmax(0, 1fr) 54px; }
  .tv-record { display: none; }
  .tv-bottom { flex-wrap: wrap; }
  .tv-announcement { flex-basis: 100%; }
  .tv-foot { flex-wrap: wrap; }
  .tv-button { font-size: 15px; padding: 6px 11px; }
}

/* The printed report (event-export.js printReport, the app's PDF report): only the sheet prints. */
.report-sheet { display: none; }
@media print {
  body.printing-report { background: #fff; }
  body.printing-report > :not(.report-sheet) { display: none !important; }
  body.printing-report .report-sheet { display: block; }
  .report { color: #000; font: 10pt/1.35 var(--font-body); letter-spacing: 0; }
  .report h1 { font-size: 22pt; line-height: 1.1; margin: 3mm 0 1mm; }
  .report h2 { font-size: 13pt; margin: 6mm 0 2mm; }
  .report h3 { font-size: 10.5pt; margin: 3mm 0 1mm; }
  .report-brand { display: flex; align-items: center; gap: 2mm; margin: 0; font: 700 11pt var(--font-display); }
  .report-brand img { width: 7mm; height: 7mm; border-radius: 1.6mm; }
  .report-by { font-weight: 400; color: #555; }
  .report-meta { margin: 0; color: #333; font-size: 11pt; }
  .report-podium ol, .report-awards { margin: 0; padding-left: 0; list-style: none; }
  .report-awards { margin-top: 2mm; columns: 2; }
  .report-table { width: 100%; border-collapse: collapse; }
  .report-table th, .report-table td { padding: 1.1mm 2mm; border-bottom: .2mm solid #ccc; font-size: 9.5pt; text-align: left; vertical-align: top; }
  .report-table th { font-size: 8pt; color: #555; }
  .report-table tr { break-inside: avoid; }
  .report-round { break-inside: avoid; }
  .report-score { text-align: center !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .report-muted { color: #555; }
  .report-strong { font-weight: 700; }
  .report-foot { margin-top: 8mm; font-size: 8pt; color: #555; }
}

/* Running an event (round-timer.js, event-tools.js): the round timer under the Rounds heading, the event
   menu's tools under the rounds, announcements and the entry fee beside each other, and their sheets. */
.round-timer { margin: 4px 0 16px; }
.timer-round { margin: 0 0 6px; }
.timer-off { margin: 0 0 12px; }
.timer-note { margin: 8px 0 0; }
.timer-bar { display: flex; align-items: center; gap: 10px; }
.timer-bar.running { display: grid; gap: 10px; background: var(--paper); border-radius: var(--r-lg); padding: 12px 14px 14px 16px; }
.timer-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.timer-icon { font-size: 20px; line-height: 1; flex: none; }
.timer-clock { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; flex: none; }
.timer-state { flex: 1; min-width: 0; color: var(--gray-600); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-bar.over .timer-clock, .timer-bar.over .timer-state { color: var(--live); }
.timer-start { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; font: inherit; text-align: left; color: var(--brand); background: var(--brand-light); border: 0; border-radius: var(--r-lg); padding: 10px 16px; cursor: pointer; }
.timer-start:hover { background: #dcebfb; }
.timer-start-label { flex: 1; min-width: 0; font-weight: 600; }
.timer-start .timer-clock { color: var(--ink); font-size: 24px; }
.timer-round-button, .timer-options { width: 40px; height: 40px; flex: none; border-radius: 50%; font: inherit; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.timer-round-button { border: 0; background: var(--brand); color: #fff; font-size: 13px; letter-spacing: 2px; text-indent: 2px; }
.timer-round-button.reset { background: var(--live); font-size: 20px; letter-spacing: 0; text-indent: 0; }
.timer-options { border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font-size: 18px; }
.timer-options:hover { background: var(--gray-100); }
.timer-bar progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 980px; overflow: hidden; -webkit-appearance: none; appearance: none; background: rgba(0, 0, 0, .08); }
.timer-bar progress::-webkit-progress-bar { background: rgba(0, 0, 0, .08); border-radius: 980px; }
.timer-bar progress::-webkit-progress-value { background: var(--brand); border-radius: 980px; }
.timer-bar progress::-moz-progress-bar { background: var(--brand); border-radius: 980px; }
.timer-bar.over progress::-webkit-progress-value { background: var(--live); }
.timer-bar.over progress::-moz-progress-bar { background: var(--live); }
.event-tools { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.tools-grid { align-items: start; }
.announce-form { display: grid; gap: 4px; }
.announce-form .button-row { justify-content: flex-end; margin-bottom: 0; }
.announce-list { list-style: none; padding: 0; margin: 0; }
.announce-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.announce-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.announce-text p { margin: 0; }
.announce-actions { display: flex; gap: 6px; flex: none; }
.fees-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.fees-head h2 { margin: 0; }
.fees-count { margin: 0; font-size: 15px; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.fees-count strong { color: var(--ink); }
.fee-field input { max-width: 220px; }
.paid-list { list-style: none; padding: 0; margin: 10px 0; columns: 2; column-gap: 24px; }
.paid-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; break-inside: avoid; font-size: 16px; }
.paid-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--gray-200); background: var(--surface); color: var(--gray-400); font: inherit; font-size: 14px; font-weight: 700; display: grid; place-items: center; padding: 0; cursor: pointer; }
.coin:hover { border-color: var(--green); color: var(--green); }
.coin.on { background: var(--green); border-color: var(--green); color: #fff; }
dialog:has(.oop-sheet), dialog:has(.draw-editor) { width: min(720px, calc(100vw - 32px)); }
/* A sheet's rows never widen the dialog: long names shorten instead. */
.dialog-form.sheet { grid-template-columns: minmax(0, 1fr); }
.dialog-form.sheet .dialog-actions { flex-wrap: wrap; }
.oop-round h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; margin: 16px 0 6px; }
.oop-time { color: var(--gray-600); font-weight: 400; font-variant-numeric: tabular-nums; }
.oop-round ul, .level-list { list-style: none; padding: 0; margin: 0; }
.oop-round li { display: grid; grid-template-columns: minmax(64px, max-content) minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.oop-court { font-weight: 600; white-space: nowrap; }
.oop-teams { overflow-wrap: anywhere; }
.oop-done { color: var(--green); font-weight: 700; }
.level-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto 3.4em; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
.level-name { display: grid; min-width: 0; }
.level-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-name small { font-size: 14px; }
.level-old, .level-arrow { color: var(--gray-600); }
.level-delta { text-align: right; font-weight: 600; color: var(--gray-600); }
.level-delta.up { color: var(--green); }
.level-delta.down { color: var(--danger); }
.draw-hint { margin: 0 0 10px; }
.draw-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.draw-match { background: var(--paper); border-radius: var(--r-md); padding: 10px 12px; min-width: 0; }
.draw-match.locked { opacity: .6; }
.draw-court { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.draw-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.draw-team { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.draw-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-chip:disabled { cursor: default; color: var(--gray-600); }
@media (max-width: 560px) {
  .timer-clock { font-size: 24px; }
  .paid-list { columns: 1; }
  .dialog-form.sheet { padding: 22px 18px; }
}

/* Insights, league Elo and setups (event-insights.js, svg-chart.js, league-view.js, event-setups.js).
   Charts are plain SVG; every colour is a class (the CSP allows no inline styles). The six series
   colours are the validated categorical palette in a fixed order, so a colour follows its entity. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.panel .stat, dialog .stat { background: var(--paper); }
.stat strong { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--brand); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: 14px; color: var(--gray-600); }
.stat.highlight strong { color: var(--warning); }
.stat.good strong { color: var(--green); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.panel .panel-head h2 { margin: 0; }
.segmented.narrow { min-width: 180px; }
.tabular { font-variant-numeric: tabular-nums; }
.table.compact th, .table.compact td { padding: 7px 10px; font-size: 15px; }
.series-1 { color: #2a78d6; } .series-2 { color: #eb6834; } .series-3 { color: #1baf7a; }
.series-4 { color: #eda100; } .series-5 { color: #e87ba4; } .series-6 { color: #008300; }
.chart-wrap { display: grid; gap: 8px; margin: 4px 0 8px; }
.chart-box { width: 100%; min-width: 0; }
.chart { display: block; max-width: 100%; font-family: var(--font-body); }
.chart-grid line { stroke: var(--hairline); stroke-width: 1; }
.chart-grid line.chart-axis { stroke: var(--gray-300); }
.chart-tick { fill: var(--gray-600); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-title { fill: var(--gray-600); font-size: 12px; font-weight: 600; }
.chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.chart-end { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-cross { stroke: var(--gray-400); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-hit { fill: transparent; cursor: crosshair; outline: none; }
.chart-hit:focus-visible { stroke: var(--brand); stroke-width: 2; }
.chart-tip { pointer-events: none; }
.chart-tip-bg { fill: var(--surface); stroke: var(--gray-200); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .12)); }
.chart-tip-head { fill: var(--gray-600); font-size: 12px; font-weight: 600; }
.chart-tip-text { fill: var(--ink); font-size: 13px; }
.chart-tip-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-key line, line.chart-key { stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-table summary, .play-details summary { cursor: pointer; color: var(--link); font-size: 15px; }
.chart-table .table-scroll, .play-details .table-scroll { margin-top: 8px; }
.insight-rows { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.insight-row { font: inherit; color: inherit; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--paper); border: 0; padding: 12px 16px; cursor: pointer; }
.insight-row:hover { background: #ececf0; }
.insight-name { display: grid; min-width: 0; }
.insight-name small { font-size: 14px; white-space: pre-wrap; }
.insight-total { font-size: 21px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.highlights { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.highlights li, .fairness { display: flex; align-items: center; gap: 10px; }
.highlight-icon { width: 20px; height: 20px; fill: var(--warning); flex: none; }
.progress-picker { display: grid; gap: 10px; margin-top: 10px; }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; }
.pick-chip:disabled { opacity: .45; cursor: default; }
.pick-key { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px #fff; }
.insight-list { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 1px; background: var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.insight-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; background: var(--paper); padding: 9px 14px; font-size: 15px; }
.insight-list.breakdown li { display: grid; }
.insight-list li > small:first-child { flex-basis: 100%; }
.matrix-scroll { max-width: 100%; }
table.matrix { width: auto; border-collapse: separate; border-spacing: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.matrix th, .matrix td { border: 0; font-size: 13px; }
.matrix th { padding: 4px 6px; text-align: center; white-space: nowrap; }
.matrix th[scope=row] { text-align: left; }
.heat { min-width: 30px; height: 28px; padding: 0 4px; text-align: center; border-radius: 6px; background: var(--paper); color: var(--ink); }
.heat-1 { background: #dbe8f8; } .heat-2 { background: #b5d0f1; } .heat-3 { background: #85b1e8; }
.heat-4 { background: #4d8fdc; color: #fff; } .heat-5 { background: #1d5fae; color: #fff; }
.heat.self { background: transparent; color: var(--gray-400); }
.league-player-link { color: var(--ink); font-weight: 600; }
.league-player-link:hover { color: var(--link); }
.league-event-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); padding: 14px 20px; color: inherit; }
.league-event-row:hover { background: #fbfbfd; text-decoration: none; }
.league-event-row .row-main strong { overflow-wrap: anywhere; }
.place-badge { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--paper); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.place-badge.leader { background: var(--accent); color: var(--navy); }
.setups { margin-bottom: 28px; }
.setup-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.setup-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.setup-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.setup-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
@media (max-width: 560px) {
  .stats, .stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 22px; }
  .league-event-row { padding: 12px 16px; gap: 10px; }
}

/* Verified places (place-field.js): the address search, its results and the picked place on a small map. */
.place-field { gap: 8px; }
.place-search-row { display: flex; gap: 8px; align-items: center; }
.place-search-row .place-input { flex: 1; min-width: 0; }
.place-results { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 4px; background: var(--surface); }
.place-result { display: grid; gap: 1px; }
.place-results.busy { opacity: .6; }
.place-result:focus-visible { background: var(--brand-light); outline: none; }
/* The venues page (pages.js venueCard): calm cards; the menu opens upwards inside the card. */
.venue-card .card-body { gap: 2px; }
.venue-card .venue-address { margin: 0; font-size: 15px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.venue-card .meta { display: flex; align-items: center; gap: 8px; margin: 0; }
.venue-card .card-actions { align-items: center; }
.venue-card .menu-list { top: auto; bottom: calc(100% + 8px); }
.badge.added { font-size: 13px; padding: 2px 9px; background: var(--brand-light); color: var(--brand); }
.plan-note { margin: -2px 0 10px; font-size: 15px; }
.place-result strong { font-weight: 600; }
.place-result span { color: var(--gray-600); font-size: 14px; }
.place-chosen { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.place-summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.place-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.place-text strong { font-weight: 600; }
.place-text span { color: var(--gray-600); font-size: 14px; }
.place-icon { width: 20px; height: 20px; flex: none; fill: currentColor; }
.place-icon.check { color: var(--green); }
.place-icon.warn { color: var(--warning); }
.place-map { position: relative; height: 150px; overflow: hidden; background: #dfe3e8; border-top: 1px solid var(--hairline); }
.place-map-layer { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.place-map-layer img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-select: none; }
.place-pin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -100%); color: var(--live); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); pointer-events: none; }
.place-pin .place-icon { width: 34px; height: 34px; }
.place-error { color: var(--danger); font-size: 14px; margin: 0; }
.place-note:empty { display: none; }
.place-duplicate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: #fff4e5; color: var(--warning); }
.place-duplicate p { flex: 1; min-width: 180px; margin: 0; font-size: 14px; font-weight: 600; }
.place-match { margin: 0; font-size: 14px; color: var(--green); }
.place-hint { display: block; margin-top: -4px; }
.place-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; color: var(--gray-600); font-size: 15px; }
.place-line .place-icon { width: 16px; height: 16px; }
.place-line.unverified { color: var(--warning); }
.place-line .button { margin-left: auto; }
.editor-sidebar .place-map { height: 120px; }

/* Logos of venues and organizers (logos.js): on a white plate so dark and light logos both read. */
.logo-badge { display: inline-block; background: #fff; object-fit: contain; border-radius: 8px; padding: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); vertical-align: middle; }
.logo-badge.small { height: 28px; max-width: 96px; border-radius: 6px; padding: 3px; }
.logo-badge.medium { height: 56px; max-width: 240px; border-radius: 12px; padding: 6px; }
.logo-badge.large { height: clamp(48px, 7vh, 120px); max-width: clamp(140px, 20vw, 420px); border-radius: clamp(10px, 1.2vh, 22px); padding: clamp(6px, .8vh, 14px); flex: none; }
h3 .logo-badge.small { margin-right: 8px; }
.event-logos { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 -4px; }
.logo-field .logo-preview { display: flex; align-items: center; min-height: 56px; }
.logo-library { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-library:empty { display: none; }
.logo-choice { border: 2px solid transparent; border-radius: 10px; background: var(--paper); padding: 4px; cursor: pointer; }
.logo-choice.active { border-color: var(--accent); }
