:root {
  --ink: #101526;
  --muted: #667085;
  --line: #e3e7ef;
  --paper: #ffffff;
  --surface: #f4f6fa;
  --night: #11182b;
  --night-soft: #202a45;
  --accent: #d8ff4f;
  --blue: #2457d6;
  --danger: #bd2c3c;
  --success: #16734b;
  --warning: #946200;
  --radius: 18px;
  --control-height: 44px;
  --shadow: 0 10px 35px rgba(20, 29, 50, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand strong { font-family: ui-rounded, "Arial Rounded MT Bold", Inter, system-ui, sans-serif; }
h1 { margin-bottom: .45rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin-bottom: .35rem; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.025em; }
h3 { margin-bottom: .3rem; }
.shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: .45rem; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.site-header { position: sticky; z-index: 20; top: 0; color: white; background: rgba(17, 24, 43, .97); border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(12px); }
.header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { line-height: 1.2; }
.brand small { color: #aeb7ca; font-size: .73rem; }
.brand-ball { display: grid; width: 35px; aspect-ratio: 1; place-items: center; color: var(--night); background: var(--accent); border-radius: 50%; box-shadow: inset 0 0 0 5px rgba(17,24,43,.12); }
.brand-logo { display: grid; width: 96px; height: 44px; place-items: center; padding: 5px 7px; background: white; border-radius: 8px; }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.main-nav, .admin-nav { display: flex; align-items: center; gap: 5px; }
.main-nav a, .admin-nav a { padding: 9px 15px; color: #bdc5d6; border-radius: 9px; font-size: .9rem; font-weight: 600; }
.main-nav a:hover, .main-nav a.active, .admin-nav a:hover, .admin-nav a.active { color: white; background: rgba(255,255,255,.09); }
.site-footer { margin-top: 70px; color: #b8c0d0; background: var(--night); }
.footer-inner { display: flex; min-height: 90px; align-items: center; justify-content: space-between; }
.footer-inner a { color: white; font-weight: 600; }

.hero { position: relative; overflow: hidden; color: white; background: var(--night); }
.hero::before { position: absolute; inset: auto -10vw -32vw auto; width: 58vw; aspect-ratio: 1; content: ""; opacity: .5; background: repeating-radial-gradient(circle at center, transparent 0 7%, rgba(216,255,79,.16) 7.5% 8%, transparent 8.5% 14%); }
.hero-grid { position: relative; display: grid; min-height: 390px; align-items: center; grid-template-columns: 1.2fr .8fr; gap: 70px; padding-block: 70px; }
.hero .eyebrow, .page-hero .eyebrow { color: var(--accent); }
.hero-logo { display: grid; width: min(430px, 100%); min-height: 105px; place-items: center; margin-bottom: 22px; padding: 14px 18px; background: rgba(255,255,255,.96); border-radius: 14px; box-shadow: 0 12px 35px rgba(0,0,0,.18); }
.hero-logo img { display: block; width: 100%; max-height: 115px; object-fit: contain; }
.hero-copy { max-width: 630px; color: #c5cede; font-size: 1.15rem; }
.announcement { display: inline-block; margin: 18px 0 0; padding: 10px 14px; color: var(--night); background: var(--accent); border-radius: 9px; font-weight: 700; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); background: rgba(255,255,255,.05); backdrop-filter: blur(8px); }
.hero-facts div { padding: 26px 18px; text-align: center; }
.hero-facts div + div { border-left: 1px solid rgba(255,255,255,.1); }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts strong { color: var(--accent); font-family: ui-rounded, Inter, sans-serif; font-size: 1.65rem; }
.hero-facts span { margin-top: 3px; color: #aeb7ca; font-size: .73rem; }
.page-hero { color: white; background: var(--night); }
.page-hero .shell { padding-block: 55px; }
.page-hero h1 { margin-bottom: .5rem; font-size: clamp(2.4rem, 5vw, 3.8rem); }
.page-hero p:last-child { margin: 0; color: #b9c2d3; }
.page-section { padding-block: 38px; }

.filter-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; padding: 13px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 16px rgba(20,29,50,.04); }
.filter-bar label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.filter-bar label > span { margin: 0; }
.filter-bar select { min-width: 220px; padding: 8px 34px 8px 10px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; }
.filter-bar label:last-of-type select { min-width: 310px; }
.filter-reset { align-self: end; min-height: var(--control-height); padding: 11px 3px; color: var(--blue); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.team-filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -12px 0 32px; padding: 18px 20px; color: white; background: var(--night); border-radius: var(--radius); box-shadow: var(--shadow); }
.team-filter-summary h2, .team-filter-summary p { margin: 0; }
.team-filter-summary .eyebrow { margin-bottom: 3px; color: var(--accent); }
.team-filter-summary div > p:last-child { color: #b9c2d3; font-size: .8rem; }
.team-filter-summary > strong { display: grid; min-width: 82px; min-height: 50px; place-items: center; padding: 7px 12px; color: var(--night); background: var(--accent); border-radius: 10px; font-family: ui-rounded, Inter, sans-serif; text-align: center; }
.content-section { margin-bottom: 42px; }
.section-heading, .admin-card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2, .section-heading p, .admin-card-heading h2, .admin-card-heading p { margin-bottom: 0; }
.section-heading > a, .admin-card-heading > a { color: var(--blue); font-size: .88rem; font-weight: 700; }
.live { display: flex; align-items: center; gap: 7px; color: #d23543; }
.live i { width: 8px; aspect-ratio: 1; background: #e74451; border-radius: 50%; box-shadow: 0 0 0 5px rgba(231,68,81,.13); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.overview-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .65fr); gap: 36px; }
.overview-grid.team-overview-grid { grid-template-columns: minmax(0, 1fr); }
.overview-grid.schedule-overview-grid { grid-template-columns: minmax(0, 1fr); }
.match-list { display: grid; gap: 9px; }
.match-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 3px 13px rgba(20,29,50,.035); }
.match-card:hover { border-color: #cad1dd; box-shadow: 0 7px 22px rgba(20,29,50,.07); }
.match-meta { display: flex; align-items: center; gap: 11px; padding: 8px 15px; color: #81899a; background: #fafbfc; border-bottom: 1px solid #edf0f4; font-size: .72rem; }
.match-meta time { min-width: 42px; color: var(--ink); font-weight: 800; }
.match-context { min-width: 0; }
.category-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; }
.category-chip::before { width: 7px; height: 7px; content: ""; background: var(--chip); border-radius: 50%; }
.field-chip { padding: 2px 7px; color: #41506c; background: #e9edf5; border-radius: 99px; font-weight: 700; }
.match-state-chip { margin-left: auto; padding: 3px 8px; border-radius: 99px; font-size: .63rem; font-weight: 800; white-space: nowrap; }
.match-state-finished { color: #0d5a3a; background: rgba(22,115,75,.14); }
.match-state-current { color: #624700; background: rgba(235,178,0,.22); }
.match-teams { display: grid; min-height: 67px; align-items: center; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); gap: 14px; padding: 12px 18px; }
.match-teams strong:first-child { text-align: right; }
.score { display: grid; min-width: 0; min-height: 38px; align-items: center; justify-content: center; grid-template-columns: repeat(3, max-content); gap: 5px; padding-inline: 5px; color: white; background: var(--night); border-radius: 8px; font-family: ui-rounded, Inter, sans-serif; font-size: 1.08rem; white-space: nowrap; }
.score b { font-weight: 700; }
.score i { font-style: normal; }
.score-open { color: #8a92a3; background: #edf0f5; }
.score-open i { font-style: normal; }
.score-open b { font-weight: 500; }
.match-card.match-finished { background: rgba(22,115,75,.09); border-color: rgba(22,115,75,.30); border-left: 4px solid var(--success); }
.match-card.match-finished .match-meta { background: rgba(22,115,75,.08); border-bottom-color: rgba(22,115,75,.18); }
.match-card.match-current { background: rgba(235,178,0,.14); border-color: rgba(210,153,0,.38); border-left: 4px solid #d79d00; box-shadow: 0 6px 20px rgba(165,119,0,.10); }
.match-card.match-current .match-meta { background: rgba(235,178,0,.12); border-bottom-color: rgba(210,153,0,.22); }
.featured-list .match-card { border-left: 3px solid #e74451; }
.results-panel { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.compact-results { margin-bottom: 18px; }
.compact-results article { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 10px; padding: 12px 3px; border-bottom: 1px solid #edf0f4; }
.compact-results article > div { display: grid; }
.compact-results small { margin-bottom: 4px; color: var(--muted); }
.compact-results article strong { display: grid; text-align: center; }
.compact-results article strong span { color: white; background: var(--night); border-radius: 5px; }
.compact-results article strong span + span { margin-top: 3px; }
.empty-state { padding: 34px 24px; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); border: 1px dashed #cbd2df; border-radius: var(--radius); }
.empty-state strong { color: var(--ink); font-family: ui-rounded, Inter, sans-serif; font-size: 1.1rem; }
.empty-state p { margin: 7px 0 0; }
.empty-state.compact { padding: 22px 15px; }
.empty-state.large { padding-block: 75px; }

.schedule-day { padding: 26px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20,29,50,.045); }
.day-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 19px; }
.day-heading > span { display: grid; width: 48px; aspect-ratio: 1; place-items: center; color: var(--night); background: var(--accent); border-radius: 12px; font-family: ui-rounded, Inter, sans-serif; font-size: 1.25rem; font-weight: 800; }
.day-heading small { color: var(--muted); }
.day-heading h2 { margin: 0; font-size: 1.15rem; }
.schedule-slots { display: grid; gap: 26px; }
.schedule-slot { display: grid; gap: 11px; padding-top: 22px; border-top: 1px solid var(--line); }
.schedule-slot:first-child { padding-top: 0; border-top: 0; }
.slot-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 2px; }
.slot-time time { font-family: ui-rounded, Inter, sans-serif; font-size: 1.2rem; font-weight: 800; }
.slot-time span { padding: 4px 10px; color: #4c5870; background: #edf1f7; border-radius: 99px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.field-match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-match-grid .match-card { min-width: 0; }
.field-match-grid .match-meta { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px 10px; padding: 10px 13px; }
.field-match-grid .match-meta time { display: none; }
.field-match-grid .match-context { overflow: hidden; align-self: center; text-overflow: ellipsis; white-space: nowrap; }
.field-match-grid .match-teams { min-height: 82px; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); gap: 10px; padding: 15px 16px; }
.field-match-grid .match-teams strong { min-width: 0; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.25; }

.standings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.table-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-card-heading { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-top: 4px solid var(--chip); }
.table-card-heading h2, .table-card-heading p { margin-bottom: 0; }
.status { padding: 4px 9px; color: var(--warning); background: #fff5d6; border-radius: 99px; font-size: .68rem; font-weight: 700; }
.status-done { color: var(--success); background: #e4f5ec; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 11px 8px; text-align: center; border-top: 1px solid #edf0f4; white-space: nowrap; }
th { color: var(--muted); background: #fafbfc; font-size: .68rem; text-transform: uppercase; }
.team-cell { min-width: 140px; text-align: left; white-space: normal; }
.team-table-link { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 5px 7px; margin: -5px -7px; color: var(--blue); border-radius: 7px; font-weight: 750; }
.team-table-link i { font-size: 1rem; font-style: normal; transition: transform .15s ease; }
.team-table-link:hover, .team-table-link:focus-visible { color: #173fa5; background: #edf3ff; outline: none; }
.team-table-link:hover i, .team-table-link:focus-visible i { transform: translateX(2px); }

.button { display: inline-flex; min-height: var(--control-height); align-items: center; justify-content: center; padding: 9px 17px; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 9px; font-weight: 700; box-shadow: 0 4px 12px rgba(36,87,214,.18); }
.button:hover { filter: brightness(.94); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-secondary { color: var(--ink); background: white; border-color: #d5dae4; box-shadow: none; }
.button-danger { color: white; background: var(--danger); border-color: var(--danger); box-shadow: 0 4px 12px rgba(198,45,61,.18); }
.button-ghost { color: white; background: transparent; border-color: rgba(255,255,255,.2); box-shadow: none; }
.button-small { min-height: var(--control-height); padding: 6px 11px; font-size: .78rem; }
.button-full { width: 100%; }
.back-link { color: var(--blue); font-size: .87rem; font-weight: 600; }
.icon-button { display: grid; width: var(--control-height); height: var(--control-height); place-items: center; padding: 0; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 1.15rem; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.icon-button.danger { color: var(--danger); }
.icon-button.danger:hover { background: #fff0f1; }
.text-button { padding: 3px 5px; color: var(--blue); background: transparent; border: 0; font-size: .72rem; font-weight: 700; }

.flash-stack { position: relative; z-index: 30; display: grid; gap: 7px; margin-top: 16px; }
.flash { padding: 11px 14px; color: #234; background: white; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 9px; box-shadow: var(--shadow); font-size: .88rem; }
.flash-error { border-left-color: var(--danger); }
.flash-success { border-left-color: var(--success); }
.flash-warning { border-left-color: #e1a100; }

input, select, textarea { width: 100%; padding: 10px 11px; color: var(--ink); background: white; border: 1px solid #cfd5e0; border-radius: 8px; outline: none; }
input:not([type="hidden"]), select { min-height: var(--control-height); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,214,.12); }
input[type="color"] { height: var(--control-height); padding: 3px; }
label { color: #394155; font-size: .8rem; font-weight: 700; }
label > span { display: block; margin-bottom: 4px; }
label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.form-stack { display: grid; gap: 15px; }
.form-stack label { display: grid; gap: 5px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-hint { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.form-actions { display: flex; justify-content: flex-end; }
.warning-text { color: var(--warning); text-align: center; }

.admin-body { padding-bottom: 70px; background: #f1f3f7; }
.admin-header { position: sticky; z-index: 20; top: 0; color: white; background: var(--night); border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-header-inner { display: flex; min-height: 72px; align-items: center; gap: 35px; }
.admin-nav { margin-right: auto; }
.admin-actions { display: flex; align-items: center; gap: 8px; }
.admin-actions form { margin: 0; }
.admin-main { padding-top: 42px; }
.admin-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.admin-titlebar h1 { margin-bottom: .35rem; font-size: clamp(2rem, 4vw, 3rem); }
.admin-titlebar p:last-child { margin: 0; color: var(--muted); }
.admin-card { margin-bottom: 24px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 7px 25px rgba(24,32,52,.045); }
.schedule-warning { display: flex; align-items: center; gap: 12px; margin: -9px 0 22px; padding: 13px 16px; color: #634400; background: #fff5d8; border: 1px solid #eed89a; border-radius: 11px; font-size: .84rem; }
.schedule-warning strong { white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; margin-bottom: 24px; }
.stat-grid article { display: grid; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.stat-grid article > span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.stat-grid article > strong { margin: 6px 0 2px; font-family: ui-rounded, Inter, sans-serif; font-size: 2rem; line-height: 1; }
.stat-grid article > strong i { color: #9aa2b2; font-size: .85rem; font-style: normal; }
.stat-grid article a { margin-top: 8px; color: var(--blue); font-size: .78rem; font-weight: 700; }
.stat-grid article small { margin-top: 8px; color: var(--muted); }
.admin-dashboard-grid { display: grid; align-items: start; grid-template-columns: 1.3fr .7fr; gap: 24px; }
.structure-summary { display: grid; gap: 3px; }
.structure-summary > div { display: grid; align-items: center; grid-template-columns: 12px 1fr auto; gap: 10px; padding: 11px 5px; border-bottom: 1px solid #edf0f4; }
.structure-summary > div > span:last-child { color: var(--muted); font-size: .78rem; }
.color-dot { width: 9px; height: 9px; background: var(--dot); border-radius: 50%; }
.generate-card { display: grid; gap: 18px; color: white; background: var(--night); border-color: var(--night); }
.generate-card .eyebrow { color: var(--accent); }
.generate-card p { color: #b7c0d1; }
.generate-card dl { display: grid; margin: 0; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.generate-card dl div { padding: 10px; text-align: center; }
.generate-card dl div + div { border-left: 1px solid rgba(255,255,255,.1); }
.generate-card dt { color: #97a2b7; font-size: .65rem; }
.generate-card dd { margin: 2px 0 0; font-size: .83rem; font-weight: 700; }
.generate-card .button { color: var(--night); background: var(--accent); border-color: var(--accent); box-shadow: none; }
.generate-actions { display: grid; gap: 9px; }
.generate-actions form { margin: 0; }
.generate-card .generate-actions .button-secondary { color: white; background: transparent; border-color: rgba(255,255,255,.35); }
.generate-card .warning-text { color: #ffda71; }
.summary-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.summary-pills span { padding: 8px 12px; background: #f3f5f8; border-radius: 99px; font-size: .82rem; }
.summary-pills strong { margin-right: 3px; }

.settings-form { display: grid; gap: 28px; }
.settings-form fieldset { margin: 0; padding: 0 0 28px; border: 0; border-bottom: 1px solid var(--line); }
.settings-form fieldset:last-of-type { padding-bottom: 0; border: 0; }
.settings-form legend { width: 100%; margin-bottom: 17px; padding: 0; font-family: ui-rounded, Inter, sans-serif; font-size: 1.05rem; font-weight: 700; }
.logo-settings-card { overflow: hidden; padding: 0; }
.logo-settings-heading { padding: 24px; border-bottom: 1px solid var(--line); }
.logo-settings-heading h2, .logo-settings-heading p:last-child { margin-bottom: 0; }
.logo-settings-heading p:last-child { max-width: 780px; color: var(--muted); font-size: .84rem; }
.logo-settings-layout { display: grid; align-items: center; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: 24px; padding: 22px 24px; }
.logo-preview { display: grid; min-height: 135px; place-items: center; gap: 10px; padding: 16px; background: #f6f7f9; border: 1px solid var(--line); border-radius: 12px; }
.logo-preview img { display: block; width: 100%; max-width: 320px; max-height: 115px; object-fit: contain; }
.logo-preview .brand-ball { width: 52px; }
.logo-preview small { color: var(--muted); font-size: .7rem; }
.logo-upload-panel { display: flex; min-width: 0; align-items: end; gap: 9px; }
.logo-upload-form { display: grid; min-width: 0; flex: 1; align-items: end; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.logo-upload-form input[type="file"] { min-width: 0; height: var(--control-height); padding: 6px; font-size: .72rem; }
.logo-upload-form .button, .logo-upload-panel > form > .button { min-height: var(--control-height); white-space: nowrap; }
.sound-settings-card { overflow: hidden; padding: 0; }
.sound-settings-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px; border-bottom: 1px solid var(--line); }
.sound-settings-heading h2, .sound-settings-heading p:last-child { margin-bottom: 0; }
.sound-settings-heading p:last-child { max-width: 760px; color: var(--muted); font-size: .84rem; }
.sound-settings-heading .button { flex: 0 0 auto; }
.sound-upload-list { display: grid; }
.sound-upload-row { display: grid; min-width: 0; align-items: center; grid-template-columns: minmax(150px, .55fr) minmax(220px, .8fr) minmax(360px, 1.35fr); gap: 18px; padding: 18px 24px; }
.sound-upload-row + .sound-upload-row { border-top: 1px solid var(--line); }
.sound-description, .sound-preview { display: grid; min-width: 0; gap: 4px; }
.sound-description small, .sound-preview small { color: var(--muted); font-size: .7rem; }
.sound-preview audio { width: 100%; height: 38px; }
.sound-default-badge { justify-self: start; padding: 6px 9px; color: #36513e; background: #eaf7ef; border-radius: 99px; font-size: .72rem; font-weight: 800; }
.sound-upload-actions { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.sound-upload-form { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.sound-upload-form label { min-width: 0; }
.sound-upload-form input[type="file"] { min-width: 0; height: var(--control-height); padding: 6px; font-size: .72rem; }
.sound-upload-form .button, .sound-delete-form .button { min-height: var(--control-height); white-space: nowrap; }
.sound-upload-hint { margin: 0; padding: 14px 24px 18px; color: var(--muted); background: #f8f9fb; border-top: 1px solid var(--line); font-size: .75rem; }
.data-management-card { overflow: hidden; padding: 0; }
.data-management-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px; border-bottom: 1px solid var(--line); }
.data-management-heading h2, .data-management-heading p:last-child { margin-bottom: 0; }
.data-management-heading p:last-child { max-width: 700px; color: var(--muted); font-size: .84rem; }
.data-counts { display: flex; flex: 0 0 auto; gap: 7px; }
.data-counts span { display: grid; min-width: 90px; gap: 2px; padding: 9px 11px; color: var(--muted); text-align: center; background: #f3f5f8; border-radius: 9px; font-size: .65rem; }
.data-counts strong { color: var(--ink); font-size: 1rem; }
.data-cleanup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.data-cleanup-action { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 22px; padding: 22px 24px; }
.data-cleanup-action + .data-cleanup-action { border-left: 1px solid var(--line); }
.data-cleanup-action h3 { margin-bottom: 5px; font-size: .95rem; }
.data-cleanup-action p { margin: 0; color: var(--muted); font-size: .75rem; }
.data-cleanup-action form { flex: 0 0 auto; }
.data-cleanup-action .button { white-space: nowrap; }
.data-cleanup-danger { background: #fff8f8; }

.add-category-card { display: grid; gap: 18px; }
.property-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.property-section-heading h2, .property-section-heading p { margin-bottom: 0; }
.property-section-heading > p { max-width: 480px; text-align: right; }
.category-create-form, .category-edit-form { display: grid; align-items: end; gap: 12px; }
.category-create-form { grid-template-columns: minmax(180px, 2fr) minmax(190px, 1.5fr) repeat(2, minmax(130px, 1fr)) minmax(100px, .75fr) minmax(145px, 1.1fr) 68px minmax(105px, .8fr); }
.category-edit-form { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.category-create-form label, .category-edit-form label { display: grid; grid-template-rows: auto var(--control-height); }
.category-create-form input, .category-create-form select, .category-edit-form input, .category-edit-form select, .category-create-form .button, .category-edit-form .button { width: 100%; height: var(--control-height); min-height: var(--control-height); }
.property-form-hint { margin: -4px 0 0; color: var(--muted); font-size: .75rem; }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form label:first-of-type { flex: 1; }
.small-input { width: 105px; }
.tiny-input { width: 80px; }
.rank-input { width: 165px; }
.start-date-input { width: 145px; }
.start-time-input { width: 110px; }
.color-input { width: 64px; }
.category-create-form .color-input, .category-edit-form .color-input { width: auto; }
.category-stack { display: grid; gap: 24px; }
.category-admin-card { overflow: hidden; padding: 0 22px 22px; background: white; border: 1px solid var(--line); border-top: 5px solid var(--category); border-radius: var(--radius); box-shadow: 0 7px 25px rgba(24,32,52,.045); }
.category-properties { display: grid; gap: 15px; padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
.category-properties-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-properties-title .eyebrow { margin-bottom: 2px; }
.category-properties-title h2 { margin: 0; font-size: 1.15rem; }
.category-properties-title form { margin: 0; }
.category-help { margin: -2px 0 0; color: var(--muted); font-size: .75rem; }
.pool-grid { display: grid; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 20px; }
.pool-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.pool-heading { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; background: #f6f7f9; border-bottom: 1px solid var(--line); }
.pool-edit-form { display: flex; flex: 1; align-items: center; gap: 5px; }
.pool-edit-form input { padding: 6px 8px; background: transparent; border-color: transparent; font-weight: 800; }
.pool-edit-form input:focus { background: white; }
.pool-edit-form .order-input { width: 50px; color: var(--muted); font-weight: 500; }
.team-list { padding: 5px 11px; }
.team-edit-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0f4; }
.team-edit-row > form:first-child { display: flex; flex: 1; align-items: center; gap: 4px; }
.team-edit-row input { padding: 8px 5px; background: transparent; border-color: transparent; }
.team-edit-row input:focus { background: white; }
.add-team-form { display: flex; gap: 7px; padding: 10px; background: #fafbfc; }
.add-team-form input { min-width: 80px; padding: 7px 9px; }
.add-team-form button { white-space: nowrap; }
.add-team-form .button, .compact-form .button { min-height: var(--control-height); }
.new-pool-card { padding: 17px; border-style: dashed; }
.new-pool-card h3 { font-size: .9rem; }
.compact-form { margin-top: 12px; gap: 10px; }

.admin-filter { width: fit-content; }
.result-list { display: grid; gap: 8px; }
.result-round-list { display: grid; gap: 26px; }
.result-round { overflow: hidden; background: white; border: 1px solid #d9deE8; border-radius: 16px; box-shadow: 0 8px 26px rgba(20,29,50,.07); }
.result-round-header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; color: white; background: var(--night); }
.result-round-heading { display: flex; align-items: center; gap: 18px; }
.result-round-heading div { display: grid; gap: 1px; }
.result-round-heading p { margin: 0; color: var(--accent); font-size: .67rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.result-round-heading strong { font-family: ui-rounded, Inter, sans-serif; font-size: 1.42rem; line-height: 1.15; }
.result-round-heading > span { padding-left: 18px; color: #b9c2d3; border-left: 1px solid rgba(255,255,255,.18); font-size: .78rem; font-weight: 650; }
.result-round-status { display: grid; min-width: 104px; padding: 8px 12px; color: #d7deeb; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; text-align: center; }
.result-round-status strong { color: white; font-family: ui-rounded, Inter, sans-serif; font-size: 1rem; }
.result-round-status span { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.result-round-status.is-complete { color: var(--night); background: var(--accent); border-color: var(--accent); }
.result-round-status.is-complete strong { color: var(--night); }
.result-round-games .result-entry { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.result-round-games .result-entry:first-of-type { border-top: 0; }
.result-round-games .result-entry.is-complete { padding-left: 10px; border-left: 4px solid var(--success); }
.result-round-footer { display: flex; min-height: 72px; align-items: center; justify-content: flex-end; gap: 22px; padding: 13px 16px 13px 20px; background: #f8f9fb; border-top: 1px solid var(--line); }
.result-round-footer p { margin: 0 auto 0 0; color: var(--muted); font-size: .75rem; }
.result-round-footer .button { min-width: 194px; }
.result-entry { display: grid; min-height: 80px; align-items: center; grid-template-columns: 75px 190px minmax(0, 1fr); padding: 10px 14px; background: white; border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 12px; }
.result-entry.is-complete { border-left-color: var(--success); }
.result-time { display: grid; padding-right: 15px; text-align: center; border-right: 1px solid var(--line); }
.result-time strong { font-family: ui-rounded, Inter, sans-serif; font-size: 1.12rem; }
.result-time small { color: var(--muted); }
.result-context { display: grid; gap: 4px; padding-left: 18px; }
.result-context small { color: var(--muted); }
.score-form { display: grid; min-width: 0; align-items: center; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); gap: 8px; }
.score-form label { display: grid; min-width: 0; align-items: center; gap: 9px; }
.score-form .score-home { grid-template-columns: minmax(0, 1fr) 64px; }
.score-form .score-away { grid-template-columns: 64px minmax(0, 1fr); }
.score-form .score-home span { grid-column: 1; text-align: right; }
.score-form .score-home input { grid-column: 2; }
.score-form .score-away span { grid-column: 2; grid-row: 1; text-align: left; }
.score-form .score-away input { grid-column: 1; grid-row: 1; }
.score-form label span { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.score-form label input { height: 43px; padding: 6px; text-align: center; font-size: 1.1rem; font-weight: 800; }
.score-form > b { align-self: center; text-align: center; }

.plan-edit-list { display: grid; gap: 10px; }
.plan-edit-row { display: grid; min-height: 104px; align-items: center; grid-template-columns: 50px 145px minmax(220px, 1fr) minmax(540px, .95fr); gap: 14px; padding: 14px 16px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 3px 12px rgba(20,29,50,.025); }
.plan-edit-number { display: grid; width: var(--control-height); height: var(--control-height); place-items: center; color: #526078; background: #eef1f6; border-radius: 10px; font-size: .75rem; font-weight: 800; }
.plan-edit-context { display: grid; gap: 4px; }
.plan-edit-context .category-chip { font-size: .86rem; }
.plan-edit-context small { color: var(--muted); font-size: .75rem; }
.plan-edit-teams { display: grid; min-width: 0; align-items: center; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; }
.plan-edit-teams strong { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.25; }
.plan-edit-teams strong:first-child { text-align: right; }
.plan-edit-teams i { color: var(--muted); font-size: .7rem; font-style: normal; }
.plan-edit-form { display: grid; align-items: end; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-edit-form > * { min-width: 0; }
.plan-edit-form > label, .plan-edit-action { display: grid; grid-template-rows: 18px var(--control-height); gap: 4px; }
.plan-edit-form label > span, .plan-edit-action > span { margin: 0; color: #394155; font-size: .72rem; font-weight: 700; line-height: 18px; }
.plan-edit-form input, .plan-edit-form select, .plan-edit-form .button { width: 100%; min-width: 0; height: var(--control-height); min-height: var(--control-height); padding: 8px 10px; font-size: .82rem; }

.referee-page { padding: 24px; background: #e9ecf2; }
.print-toolbar { position: sticky; z-index: 5; top: 12px; display: flex; width: min(1180px, 100%); align-items: end; gap: 10px; margin: 0 auto 22px; padding: 10px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.print-filter-form { display: grid; flex: 1; grid-template-columns: minmax(180px, .7fr) minmax(280px, 1.3fr); gap: 10px; }
.print-filter-form label { display: grid; min-width: 0; gap: 3px; }
.print-filter-form label > span, .print-toolbar-action > span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.print-filter-form select { min-width: 0; height: var(--control-height); padding-block: 8px; }
.print-toolbar-action { display: grid; flex: 0 0 auto; gap: 3px; }
.print-toolbar-action > span { text-align: right; }
.print-toolbar-action .button { min-width: 145px; }
.print-toolbar .button:disabled { cursor: not-allowed; opacity: .45; }
.referee-grid { width: min(1100px, 100%); margin: auto; }
.referee-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.referee-card { padding: 18px; background: white; border: 2px solid #222; break-inside: avoid; }
.referee-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 2px solid #222; }
.referee-card > header div { display: grid; }
.referee-card > header span { font-size: .75rem; }
.referee-card > header > b { padding: 5px 9px; color: white; background: var(--night); }
.referee-meta { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #555; font-size: .72rem; }
.referee-teams { display: grid; align-items: center; grid-template-columns: 1fr 20px 1fr; gap: 5px; padding: 13px 0; }
.referee-teams div { display: grid; min-height: 45px; align-content: center; text-align: center; border: 1px solid #999; }
.referee-teams small { color: var(--muted); font-size: .63rem; }
.referee-teams > b { text-align: center; }
.goal-tally { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; font-size: .68rem; }
.goal-tally > span { align-self: center; font-weight: 700; }
.goal-tally > div { display: grid; grid-template-columns: repeat(10, 1fr); }
.goal-tally i { padding: 2px 0; text-align: center; border: 1px solid #aaa; font-style: normal; }
.referee-score { display: grid; align-items: center; grid-template-columns: 95px 36px 12px 36px 1fr; gap: 5px; margin: 12px 0; font-size: .72rem; }
.referee-score b { height: 30px; border: 1px solid #222; }
.referee-score i { text-align: center; font-style: normal; }
.penalty-table { font-size: .7rem; }
.penalty-table th, .penalty-table td { height: 24px; padding: 3px 6px; border: 1px solid #555; }
.penalty-table th:first-child, .penalty-table td:first-child { width: 55%; text-align: left; }
.referee-card > footer { margin-top: 12px; font-size: .72rem; }

.clock-console { overflow: hidden; margin-bottom: 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.clock-round-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.clock-round-heading > label { display: grid; flex: 1; max-width: 620px; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.clock-round-heading select { height: var(--control-height); }
.clock-round-nav { display: flex; gap: 8px; }
.clock-console > .schedule-warning { margin: 14px 20px 0; }
.clock-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 20px; padding: 20px; }
.clock-stage { display: grid; min-height: 385px; align-content: center; justify-items: center; padding: 28px; color: white; text-align: center; background: radial-gradient(circle at 50% 35%, #2a385f 0, var(--night) 58%); border-radius: 17px; }
.clock-phase { color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.clock-display { margin: 8px 0 0; font-family: ui-rounded, "Arial Rounded MT Bold", Inter, sans-serif; font-size: clamp(5.5rem, 12vw, 9.5rem); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.07em; }
.clock-elapsed { margin-top: 7px; color: #c8d0df; font-size: .82rem; font-variant-numeric: tabular-nums; }
.clock-progress { overflow: hidden; width: min(540px, 100%); height: 10px; margin: 22px 0 14px; background: rgba(255,255,255,.13); border-radius: 99px; }
.clock-progress i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s linear; }
.clock-stage p { margin: 0; color: #dfe4ee; }
.clock-settings { display: grid; align-content: start; gap: 11px; padding: 18px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 15px; }
.clock-settings h2 { margin-bottom: 3px; }
.clock-duration { display: grid; gap: 5px; padding-bottom: 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 700; }
.clock-duration > span:last-child { display: grid; align-items: center; grid-template-columns: 90px 1fr; gap: 8px; color: var(--ink); font-size: .85rem; }
.clock-duration input { height: var(--control-height); }
.clock-toggle { display: flex; min-height: 54px; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.clock-toggle input { width: 19px; height: 19px; min-height: 19px; flex: 0 0 auto; accent-color: var(--blue); }
.clock-toggle > span { display: grid; gap: 2px; margin: 0; }
.clock-toggle strong { font-size: .77rem; }
.clock-toggle small { color: var(--muted); font-size: .65rem; font-weight: 400; }
.clock-sequence { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: clock-step; }
.clock-sequence li { display: grid; min-height: 50px; align-content: center; grid-template-columns: 29px minmax(0, 1fr); column-gap: 9px; padding: 7px 9px; background: white; border: 1px solid var(--line); border-radius: 10px; counter-increment: clock-step; }
.clock-sequence li::before { display: grid; width: 27px; height: 27px; grid-row: 1 / span 2; place-items: center; align-self: center; content: counter(clock-step); color: var(--night); background: var(--accent); border-radius: 50%; font-family: ui-rounded, Inter, sans-serif; font-size: .72rem; font-weight: 850; }
.clock-sequence strong { align-self: end; font-size: .78rem; }
.clock-sequence small { color: var(--muted); font-size: .65rem; }
.clock-sequence .clock-step-disabled { opacity: .42; }
.toggle-row { display: grid; align-items: center; grid-template-columns: 22px 1fr; gap: 11px; padding: 9px; background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.toggle-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); font-size: .68rem; }
.clock-sound-tests { display: grid; gap: 6px; padding-top: 5px; }
.clock-sound-tests > span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.clock-sound-tests > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.clock-sound-tests .button { min-width: 0; padding-inline: 8px; font-size: .72rem; }
.clock-controls { display: grid; grid-template-columns: minmax(230px, 1.3fr) repeat(3, minmax(150px, .7fr)); gap: 10px; padding: 0 20px 20px; }
.clock-controls .button { width: 100%; }
.clock-controls .button:disabled { cursor: not-allowed; opacity: .45; }
.clock-start { color: var(--night); background: var(--accent); border-color: var(--accent); }
.clock-next-ready { color: white; background: var(--success); border-color: var(--success); box-shadow: 0 4px 12px rgba(22,115,75,.2); }
.clock-pairing-section { border-top: 1px solid var(--line); }
.clock-pairing-heading { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 20px; background: #f7f8fa; }
.clock-pairing-heading h2, .clock-pairing-heading p { margin-bottom: 0; }
.clock-pairing-heading > span { padding: 5px 10px; color: #41506c; background: #e9edf5; border-radius: 99px; font-size: .7rem; font-weight: 750; white-space: nowrap; }
.clock-pairing-heading .button { flex: 0 0 auto; }
.clock-next-pairings { background: #eef4ff; }
.clock-next-pairings .clock-pairing-heading, .clock-next-pairings .clock-field-grid { background: #eef4ff; }
.clock-next-pairings .clock-pairing-heading { border-bottom: 1px solid #d8e3f7; }
.clock-next-pairings .clock-field-grid article { border-color: #cad9f2; }
.clock-no-next { padding: 20px; }
.clock-no-next h2, .clock-no-next p { margin-bottom: 0; }
.clock-field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 20px 20px; background: #f7f8fa; }
.clock-field-grid article { display: grid; min-width: 0; align-items: center; grid-template-columns: 1fr auto 1fr; gap: 5px 8px; padding: 12px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 11px; }
.clock-field-grid article > span, .clock-field-grid article > small { grid-column: 1 / -1; }
.clock-field-grid article > span { color: var(--blue); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.clock-field-grid article > strong { min-width: 0; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.2; }
.clock-field-grid article > i { color: var(--muted); font-size: .62rem; font-style: normal; }
.clock-field-grid article > small { color: var(--muted); font-size: .65rem; }

.login-body { display: grid; min-height: 100vh; place-items: center; padding: 25px; color: white; background: radial-gradient(circle at 80% 20%, #2b385b 0, var(--night) 44%); }
.login-body::before { position: fixed; top: -18vw; right: -18vw; width: 53vw; aspect-ratio: 1; content: ""; opacity: .18; background: repeating-radial-gradient(circle at center, var(--accent) 0 1px, transparent 2px 8%); border-radius: 50%; }
.login-card { position: relative; display: grid; width: min(430px, 100%); gap: 27px; padding: 36px; color: var(--ink); background: white; border-radius: 22px; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.login-brand { color: var(--ink); }
.login-card h1 { margin-bottom: 5px; font-size: 2.35rem; }

@media (max-width: 980px) {
  .overview-grid, .admin-dashboard-grid { grid-template-columns: 1fr; }
  .standings-grid { grid-template-columns: 1fr; }
  .admin-header-inner { flex-wrap: wrap; gap: 10px; padding-block: 10px; }
  .admin-header .brand { margin-right: auto; }
  .admin-nav { order: 3; width: 100%; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .category-create-form, .category-edit-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-create-form .category-name-input, .category-create-form .category-copy-input, .category-edit-form .category-name-input { grid-column: span 2; }
  .result-entry { grid-template-columns: 65px 160px 1fr; }
  .score-form { grid-template-columns: 1fr 22px 1fr; }
  .score-form .button { grid-column: 1 / -1; justify-self: end; }
  .score-form .score-home { grid-template-columns: minmax(0, 1fr) 56px; }
  .score-form .score-away { grid-template-columns: 56px minmax(0, 1fr); }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .plan-edit-row { grid-template-columns: 50px 145px 1fr; }
  .plan-edit-form { grid-column: 2 / -1; }
  .clock-layout { grid-template-columns: 1fr; }
  .clock-controls { grid-template-columns: repeat(2, 1fr); }
  .clock-field-grid { grid-template-columns: repeat(2, 1fr); }
  .sound-upload-row { grid-template-columns: 1fr 1fr; }
  .sound-upload-actions { grid-column: 1 / -1; }
  .logo-settings-layout { grid-template-columns: 1fr; }
  .data-management-heading { align-items: flex-start; flex-direction: column; }
  .data-cleanup-grid { grid-template-columns: 1fr; }
  .data-cleanup-action + .data-cleanup-action { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 16px, 1180px); }
  .header-inner { min-height: 0; flex-wrap: wrap; gap: 6px; padding-block: 7px 5px; }
  .header-inner .brand { width: 100%; }
  .header-inner .brand small { display: none; }
  .header-inner .brand { gap: 9px; }
  .header-inner .brand-logo { width: 78px; height: 36px; padding: 4px 6px; border-radius: 7px; }
  .header-inner .brand strong { font-size: .9rem; }
  .main-nav { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main-nav a { display: flex; min-height: 36px; align-items: center; justify-content: center; padding: 6px 3px; border-radius: 7px; font-size: .72rem; }
  .hero-grid { min-height: 0; grid-template-columns: 1fr; gap: 33px; padding-block: 45px; }
  .hero-facts div { padding: 17px 6px; }
  .hero-facts strong { font-size: 1.25rem; }
  .page-hero .shell { padding-block: 24px; }
  .page-hero h1 { font-size: 2rem; }
  .page-hero p:last-child { max-width: 36rem; font-size: .82rem; line-height: 1.4; }
  .page-section { padding-block: 20px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { width: 100%; }
  .filter-bar select { min-width: 0; min-height: 44px; }
  .filter-bar label:last-of-type select { min-width: 0; }
  .filter-reset { align-self: flex-start; min-height: 0; padding: 4px 0; }
  .team-filter-summary { align-items: flex-start; margin-top: -4px; }
  .match-meta { flex-wrap: wrap; gap: 5px 9px; }
  .match-teams { min-height: 82px; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 5px; padding: 11px 8px; }
  .match-teams strong { min-width: 0; overflow-wrap: break-word; word-break: normal; font-size: .8rem; line-height: 1.22; }
  .score { min-height: 38px; gap: 3px; padding-inline: 3px; font-size: .84rem; }
  .schedule-day { padding: 10px; }
  .schedule-slots { gap: 22px; }
  .schedule-slot { gap: 9px; padding-top: 18px; }
  .slot-time { align-items: center; gap: 8px; padding: 0; }
  .slot-time time { font-size: 1.08rem; }
  .slot-time span { padding: 3px 8px; }
  .field-match-grid { grid-template-columns: 1fr; gap: 9px; }
  .field-match-grid .match-meta { grid-template-columns: auto minmax(0, 1fr); gap: 5px 7px; padding: 8px 9px; font-size: .68rem; }
  .field-match-grid .match-context { grid-column: 1 / -1; overflow: visible; text-overflow: clip; white-space: normal; }
  .field-match-grid .match-teams { min-height: 68px; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 5px; padding: 10px 8px; }
  .field-match-grid .match-teams strong { overflow-wrap: break-word; word-break: normal; font-size: .8rem; line-height: 1.22; }
  .field-match-grid .score { min-height: 38px; }
  .standings-grid { gap: 16px; }
  .table-card { border-radius: 14px; }
  .table-card-heading { padding: 14px; }
  .table-card-heading .eyebrow { margin-bottom: .25rem; font-size: .62rem; }
  .table-card-heading h2 { font-size: 1.1rem; }
  .table-card-heading .status { padding: 4px 8px; font-size: .6rem; }
  .table-scroll { overflow-x: hidden; }
  .table-card table { table-layout: fixed; font-size: .7rem; }
  .table-card th, .table-card td { padding: 8px 1px; white-space: nowrap; }
  .table-card th { font-size: .56rem; }
  .table-card th:nth-child(1), .table-card td:nth-child(1) { width: 6%; }
  .table-card th:nth-child(2), .table-card td:nth-child(2) { width: 35%; }
  .table-card th:nth-child(3), .table-card td:nth-child(3) { width: 8%; }
  .table-card th:nth-child(4), .table-card td:nth-child(4),
  .table-card th:nth-child(5), .table-card td:nth-child(5),
  .table-card th:nth-child(6), .table-card td:nth-child(6) { width: 6%; }
  .table-card th:nth-child(7), .table-card td:nth-child(7) { width: 14%; }
  .table-card th:nth-child(8), .table-card td:nth-child(8) { width: 10%; }
  .table-card th:nth-child(9), .table-card td:nth-child(9) { width: 9%; }
  .team-cell { min-width: 0; white-space: normal; }
  .team-table-link { display: grid; width: 100%; min-height: 30px; align-items: center; grid-template-columns: minmax(0, 1fr) auto; gap: 3px; padding: 3px; margin: -3px; line-height: 1.2; }
  .team-table-link span { min-width: 0; overflow-wrap: break-word; word-break: normal; }
  .team-table-link i { font-size: .8rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .admin-titlebar { align-items: stretch; flex-direction: column; }
  .admin-titlebar .button { align-self: flex-start; }
  .schedule-titlebar .button { align-self: stretch; }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-wrap: wrap; }
  .inline-form label:first-of-type { flex: 1 0 100%; }
  .property-section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .property-section-heading > p { text-align: left; }
  .category-create-form, .category-edit-form { grid-template-columns: 1fr 1fr; }
  .category-create-form .category-name-input, .category-create-form .category-copy-input, .category-edit-form .category-name-input, .category-create-form .button, .category-edit-form .button { grid-column: 1 / -1; }
  .pool-grid { grid-template-columns: 1fr; }
  .category-admin-card { padding-inline: 12px; }
  .category-properties { gap: 13px; }
  .result-entry { align-items: stretch; grid-template-columns: 60px 1fr; }
  .result-context { align-self: center; }
  .result-round-list { gap: 19px; }
  .result-round-header { min-height: 72px; padding: 13px 14px; }
  .result-round-heading { gap: 11px; }
  .result-round-heading strong { font-size: 1.2rem; }
  .result-round-heading > span { padding-left: 11px; font-size: .7rem; }
  .result-round-status { min-width: 83px; padding: 6px 8px; }
  .score-form { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
  .score-form label, .score-form .score-home, .score-form .score-away { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(38px, auto) var(--control-height); align-items: stretch; gap: 6px; }
  .score-form .score-home span, .score-form .score-away span { grid-column: 1; grid-row: 1; min-height: 38px; text-align: center; }
  .score-form .score-home input, .score-form .score-away input { grid-column: 1; grid-row: 2; }
  .score-form .button { justify-self: stretch; }
  .result-round-footer { align-items: stretch; flex-direction: column; gap: 9px; padding: 13px; }
  .result-round-footer p { margin: 0; text-align: center; }
  .result-round-footer .button { width: 100%; min-width: 0; }
  .admin-actions .button { display: none; }
  .login-card { padding: 27px 22px; }
  .plan-edit-row { min-height: 0; align-items: center; grid-template-columns: var(--control-height) 1fr; gap: 12px; padding: 13px; }
  .plan-edit-context { grid-column: 2; }
  .plan-edit-teams { grid-column: 1 / -1; padding-block: 5px; }
  .plan-edit-form { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .plan-edit-form > label:first-of-type { grid-column: 1 / -1; }
  .referee-page { padding: 10px; }
  .referee-sheet { grid-template-columns: 1fr; }
  .print-toolbar { align-items: stretch; flex-wrap: wrap; }
  .print-filter-form { width: 100%; flex-basis: 100%; grid-template-columns: 1fr; }
  .print-toolbar-action { width: 100%; grid-template-columns: 1fr auto; align-items: end; }
  .print-toolbar-action > span { text-align: left; }
  .clock-round-heading { align-items: stretch; flex-direction: column; }
  .clock-round-heading > label { max-width: none; }
  .clock-round-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .clock-pairing-heading { align-items: stretch; flex-direction: column; }
  .clock-pairing-heading .button { width: 100%; }
  .clock-stage { min-height: 300px; padding: 22px 15px; }
  .clock-display { font-size: clamp(4.7rem, 25vw, 7rem); }
  .clock-controls { grid-template-columns: 1fr; }
  .clock-field-grid { grid-template-columns: 1fr; }
  .sound-settings-heading { align-items: stretch; flex-direction: column; }
  .sound-settings-heading .button { align-self: flex-start; }
  .sound-upload-row { grid-template-columns: 1fr; gap: 13px; padding-inline: 16px; }
  .sound-upload-actions { grid-column: auto; grid-template-columns: 1fr; }
  .sound-upload-form { grid-template-columns: 1fr; }
  .sound-upload-form .button, .sound-delete-form .button { width: 100%; }
  .logo-settings-heading, .logo-settings-layout { padding-inline: 16px; }
  .logo-upload-panel { align-items: stretch; flex-direction: column; }
  .logo-upload-form { grid-template-columns: 1fr; }
  .logo-upload-form .button, .logo-upload-panel > form > .button { width: 100%; }
  .data-management-heading, .data-cleanup-action { padding-inline: 16px; }
  .data-counts { width: 100%; }
  .data-counts span { min-width: 0; flex: 1; }
  .data-cleanup-action { align-items: stretch; flex-direction: column; }
  .data-cleanup-action .button { width: 100%; }
}

@media (max-width: 420px) {
  .main-nav { gap: 0; }
  .main-nav a { padding-inline: 6px; }
  .brand strong { font-size: .86rem; }
  .brand-ball { width: 30px; }
  .hero-facts span { font-size: .64rem; }
  .category-chip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 360px) {
  .category-create-form, .category-edit-form { grid-template-columns: 1fr; }
  .category-create-form .category-name-input, .category-create-form .category-copy-input, .category-edit-form .category-name-input, .category-create-form .button, .category-edit-form .button { grid-column: auto; }
  .plan-edit-form { grid-template-columns: 1fr; }
  .plan-edit-form > label:first-of-type { grid-column: auto; }
}

@media print {
  @page { size: A4 portrait; margin: 8mm; }
  .site-header, .site-footer, .filter-bar, .admin-header { display: none; }
  body { background: white; }
  .page-hero { color: black; background: white; }
  .page-hero .eyebrow, .page-hero p:last-child { color: #555; }
  .match-card, .table-card { break-inside: avoid; box-shadow: none; }
  .referee-page { padding: 0; background: white; }
  .print-toolbar { display: none; }
  .referee-grid { width: 188mm; margin: 0 auto; }
  .referee-sheet { display: grid; width: 188mm; height: 250mm; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 123mm); gap: 4mm; margin: 0; break-inside: avoid; page-break-inside: avoid; }
  .referee-sheet + .referee-sheet { break-before: page; page-break-before: always; }
  .referee-card { width: 100%; height: 123mm; min-width: 0; min-height: 0; overflow: hidden; padding: 3mm; break-inside: avoid; page-break-inside: avoid; }
  .referee-card, .referee-card * { color: #111 !important; background-color: transparent !important; box-shadow: none !important; }
  .referee-card > header { gap: 2mm; padding-bottom: 2mm; }
  .referee-card > header > b { padding: 1mm 2mm; border: .3mm solid #111; }
  .referee-meta { padding: 1.4mm 0; }
  .referee-teams { padding: 2.5mm 0; }
  .referee-teams div { min-height: 10mm; }
  .goal-tally { grid-template-columns: 15mm minmax(0, 1fr); gap: .8mm 1.2mm; font-size: 6pt; }
  .goal-tally > div { min-width: 0; }
  .goal-tally i { min-width: 0; min-height: 2.55mm; overflow: hidden; padding: .15mm 0; line-height: 1; }
  .referee-score { margin: 1.8mm 0; }
  .referee-score b { height: 7mm; }
  .penalty-table th, .penalty-table td { height: 5mm; padding: .4mm 1.2mm; }
  .referee-card > footer { margin-top: 1.8mm; }
}
