:root {
  color-scheme: dark;
  --bg: #101424;
  --header: #171d32;
  --panel: #1c2239;
  --raised: #282e49;
  --field: #14192d;
  --border: #535c7a;
  --line: #353d58;
  --gold: #ffd58b;
  --gold-hover: #ffe5b4;
  --gold-text: #211b12;
  --accent-surface: #393245;
  --text: #f6f4ff;
  --muted: #bdc5dc;
  --positive: #a9ecdb;
  --positive-surface: #1e373b;
  --shell: #181e32;
  --glass: #252d48;
  --accent-line: #ab8d61;
  --scene-base: #181e35;
  --hero: linear-gradient(105deg, #191c34, #22283e);
  --display: "Cascadia Mono", Consolas, "Courier New", monospace;
  --corner: 5px;
  --step: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px,
    calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px),
    calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px),
    calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%,
    6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
}

body[data-theme="black"] {
  --bg: #0e1014;
  --header: #16181e;
  --panel: #1a1d23;
  --raised: #252931;
  --field: #121419;
  --border: #565b64;
  --line: #343941;
  --gold: #e9ca8f;
  --gold-hover: #ffe0a7;
  --accent-surface: #363128;
  --text: #f4f2ed;
  --muted: #bbc0c9;
  --positive: #afdbc9;
  --positive-surface: #24332c;
  --shell: #16191f;
  --glass: #24282f;
  --accent-line: #9b815d;
  --scene-base: #14161b;
  --hero: linear-gradient(110deg, #181b20, #242527);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 Inter, "Segoe UI Variable Text", system-ui, "Segoe UI", sans-serif; }
a { color: var(--gold); text-underline-offset: .22em; }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.16; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 2rem; font-size: clamp(1.85rem, 3.6vw, 3rem); letter-spacing: -.045em; font-weight: 760; }
h2 { margin: 0 0 1rem; font-size: 1.25rem; font-size: clamp(1.15rem, 2vw, 1.38rem); letter-spacing: -.025em; }
h3 { margin: 1rem 0 .65rem; font-size: 1.06rem; }
p { margin: .65rem 0; }
.muted, footer { color: var(--muted); font-size: .9rem; }
.layout { width: min(100%, 1216px); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.layout > main { min-width: 0; min-height: 52vh; padding-block: clamp(1.5rem, 5vw, 3.2rem); }
.layout > main > h1 { margin-bottom: 1.35rem; }
footer { margin-top: 1.25rem; border-top: 1px solid var(--line); padding: 1.35rem 0 2rem; }
header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 92px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; }
.brand img { display: block; width: clamp(78px, 10vw, 118px); height: auto; aspect-ratio: 1.436; object-fit: contain; }
.app-nav { display: flex; gap: .25rem; padding: .28rem; border: 1px solid var(--line); background: var(--header); border-radius: 12px; }
button, .action { font: inherit; }
button { cursor: pointer; }
.action, .theme-button, .app-nav button, .workspace-menu button {
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 650;
  line-height: 1.35;
}
.action { background: var(--gold); color: var(--gold-text); }
.action:is(a) { display: inline-flex; align-items: center; }
.action:hover { background: var(--gold-hover); color: var(--gold-text); }
.theme-button { background: var(--raised); border-color: var(--border); color: var(--text); }
.theme-button:hover { color: var(--gold); }
.theme-button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: var(--accent-surface); }
.app-nav button { background: transparent; color: var(--muted); }
.app-nav button:hover { color: var(--text); }
.app-nav button[aria-current="page"] { background: var(--accent-surface); color: var(--gold); }
button:disabled { opacity: .58; cursor: default; }
.app-club-link { flex: 0 0 auto; white-space: nowrap; background: transparent; font-size: .9rem; display: inline-flex; align-items: center; text-align: center; }
.header-actions, .actions, .themes { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.actions { margin-top: 1rem; }
.text-link { display: inline-block; margin: .6rem 1rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.grid, .staff-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.grid { margin: 1.25rem 0; }
.card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1rem, 2.6vw, 1.65rem);
  overflow-wrap: anywhere;
}
.card > :last-child, .card-body > :last-child { margin-bottom: 0; }
main > .card + .card { margin-top: 1rem; }
.card article { padding-block: .7rem; border-top: 1px solid var(--line); }
.empty-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.2rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.event-card { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.event-card h1, .event-card h2, .event-card > p { margin: 0; }
.event-card h2 a { color: inherit; text-decoration: none; }
.event-card h2 a:hover { color: var(--gold); }
.event-card-footer { width: 100%; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line); }
.event-card.is-detail { padding: clamp(1rem, 4vw, 2.5rem); }
.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border-radius: 6px;
  padding: .22rem .55rem;
  margin-bottom: .4rem;
  color: var(--muted);
  background: var(--raised);
  font-size: .875rem;
  font-weight: 650;
}
.tag[data-state="open"] { color: var(--positive); background: var(--positive-surface); }
.club-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.35rem, 5vw, 3rem);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--hero);
}
.club-intro .action { margin-top: 1rem; }
.public-site .intro { max-width: 65ch; margin-top: 1rem; color: var(--muted); font-size: 1.05rem; }
.public-site main > .card { margin: 1rem 0; }
.public-site summary { cursor: pointer; }

input:not([type="checkbox"],[type="radio"],[type="hidden"]), select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 43px;
  margin: .3rem 0 .75rem;
  padding: .5rem .7rem;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); }
input[readonly] { color: var(--muted); }
textarea { width: min(100%, 620px); resize: vertical; }
select {
  appearance: none;
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
form label { display: inline-block; min-width: 0; max-width: 100%; font-weight: 560; font-size: .91rem; }
form label:has(input[type="checkbox"]) { display: flex; gap: .5rem; align-items: baseline; }
form + form { margin-top: 1.25rem; }
summary { cursor: pointer; }
fieldset { min-width: 0; border: 1px solid var(--border); border-radius: 10px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 13rem),1fr)); gap: .65rem .9rem; }
.field-grid label, .block { display: block; }
.field-grid .wide { grid-column: 1 / -1; }
.site-preview { margin: 1rem 0; padding: 1.1rem; border: 1px solid var(--line); }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; white-space: nowrap; padding: .65rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 650; }
th:first-child { text-align: left; }
tfoot th, tfoot td { color: var(--text); font-weight: 700; }
#notice { color: var(--gold); }
#notice:empty, .workspace-context p:empty, .report-data:empty { display: none; }

.ui-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  vertical-align: -.24em;
}
.app-header .app-nav {
  background: transparent;
  border-color: transparent;
}
.app-nav button { display: inline-flex; align-items: center; justify-content: center; gap: .48rem; }
.app-nav button[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--border); }
.app-club-link { border-color: var(--line); }
.app-header { gap: clamp(.7rem, 3vw, 2rem); }
.app-header .brand img { width: clamp(84px, 10vw, 113px); }
.staff-page .layout { width: min(100%, 1720px); padding-inline: clamp(1rem, 3vw, 2.5rem); }
.staff-page .app-header { min-height: 76px; }
.staff-page .app-header .brand img { width: 92px; }
.staff-page .cabinet > main { padding-block: 1.65rem 2.6rem; }
.staff-shell {
  display: grid;
  grid-template-columns: minmax(13.4rem, 15.3rem) minmax(0,1fr);
  align-items: start;
  gap: clamp(1rem, 2.9vw, 2.3rem);
}
.staff-sidebar {
  position: sticky;
  top: 1rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--shell);
}
.staff-sidebar-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .14rem .35rem .6rem;
  padding: .45rem .35rem .85rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: .875rem;
  font-weight: 700;
}
.staff-sidebar-title svg { color: var(--gold); width: 17px; height: 17px; }
.workspace-menu { display: grid; grid-template-columns: minmax(0,1fr); gap: .2rem; }
.workspace-menu button {
  display: flex;
  align-items: center;
  gap: .7rem;
  position: relative;
  color: var(--muted);
  background: transparent;
  text-align: start;
  padding: .7rem .72rem;
  font-size: .9rem;
  font-weight: 620;
}
.workspace-menu button:hover { color: var(--text); background: var(--glass); }
.workspace-menu button[aria-current="page"] { color: var(--gold); background: var(--accent-surface); }
.workspace-menu button[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: .64rem auto .64rem 0;
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
}
.workspace-menu .ui-icon { width: 18px; height: 18px; }
.staff-section-picker { display: none; }
.staff-content { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 1rem; }
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-width: 0;
  padding: .1rem 0 .42rem;
}
.workspace-heading h1 { font-size: clamp(1.8rem,3.1vw,2.75rem); }
.workspace-heading .action, .hero-actions :is(.action,.theme-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .43rem;
  white-space: nowrap;
}
.workspace-heading .action { min-height: 42px; font-size: .9rem; }
.workspace-heading .ui-icon { width: 17px; height: 17px; }
.workspace-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  border-bottom: 1px solid var(--line);
  padding: 0 0 .65rem;
}
.workspace-tools button {
  padding: .42rem .78rem;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .91rem;
  font-weight: 630;
}
.workspace-tools button:hover { color: var(--text); background: var(--shell); }
.workspace-tools button[aria-pressed="true"] { color: var(--gold); background: var(--accent-surface); border-color: var(--border); }
.staff-panels { display: grid; grid-template-columns: minmax(0, 1fr); }
.staff-panels > section { min-width: 0; }
.staff-panels label + label { margin-inline-end: .4rem; }
.staff-panels .field-grid label + label, .staff-panels .report-filters label + label { margin-inline-end: 0; }
.staff-panels form fieldset { margin-bottom: .75rem; }
.staff-panels button:not([type="button"]) + button { margin-block: .25rem; }
.staff-content #notice:not(:empty) {
  margin: 0;
  padding: .7rem .9rem;
  background: var(--accent-surface);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
}
.workspace { padding-block: .8rem; background: var(--shell); }
.workspace-context { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; }
.workspace-context label { flex: 1 1 16rem; font-size: .88rem; font-weight: 650; min-width: 0; }
.workspace-context select { margin-bottom: 0; }
.workspace-context p { margin: 0; align-self: center; color: var(--muted); font-size: .9rem; }
.timer-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--shell);
}
.timer-banner strong { color: var(--text); font-size: 1.12rem; }
.timer-banner .tag { margin: 0; }
.timer-controls { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .5rem; }
.timer-fields > br { display: none; }
.hero-content { position: relative; z-index: 1; min-width: 0; }
.section-label {
  display: block;
  color: var(--gold);
  font-size: .875rem;
  font-weight: 680;
  letter-spacing: .045em;
  margin-bottom: .6rem;
}
.overview-hero, .agenda-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--hero);
  padding: clamp(1.25rem,4vw,2.6rem);
  box-shadow: 0 18px 36px #04070e3d;
}
.overview-hero h2 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.75rem,4vw,3.15rem);
  letter-spacing: -.045em;
  line-height: 1.07;
}
.overview-hero p { max-width: 53ch; color: var(--muted); margin: .85rem 0; }
.hero-meta, .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.hero-meta .tag { margin: 0; }
.hero-actions { margin-top: 1.3rem; }
.hero-stats { display: flex; flex-wrap: wrap; margin: 1.25rem 0 0; gap: 1rem 2rem; }
.hero-stats dt { color: var(--muted); font-size: .88rem; }
.hero-stats dd { margin: .15rem 0 0; font-size: clamp(1.5rem, 3vw, 2.45rem); line-height: 1.1; font-weight: 730; font-variant-numeric: tabular-nums; }
.hero-stats dd span { color: var(--muted); font-size: .54em; }
.overview-events { margin-top: 1.15rem; padding-block: 1.15rem .8rem; }
.overview-events h2 { margin-bottom: .65rem; }
.overview-events ul { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.overview-events li + li { border-top: 1px solid var(--line); }
.overview-event { width: 100%; min-width: 0; min-height: 68px; display: flex; align-items: center; text-align: start; gap: .75rem; padding: .6rem .5rem; border: 0; border-radius: 8px; color: var(--text); background: transparent; }
.overview-event:hover { background: var(--raised); }
.overview-event > svg { width: 22px; height: 22px; color: var(--gold); }
.overview-event-name { display: grid; gap: .12rem; flex: 1; min-width: 0; }
.overview-event-name time { color: var(--muted); font-size: .87rem; }
.overview-event .tag { flex: 0 0 auto; align-self: center; margin: 0; }
.agenda-hero { min-height: 190px; display: flex; align-items: center; }
.agenda-hero h1 { font-size: clamp(2.2rem,6vw,4.3rem); }
.agenda-hero .muted:empty { display: none; }
#tournament-list { grid-template-columns: minmax(0,1fr); gap: .65rem; }
.agenda-item {
  display: grid;
  grid-template-columns: minmax(8.5rem,.95fr) minmax(0,2fr) minmax(9rem,auto);
  align-items: center;
  gap: 1.15rem;
  padding: 1rem 1.2rem;
}
.agenda-item h2, .agenda-item p { margin: 0; }
.agenda-item h2 a { color: var(--text); text-decoration: none; }
.agenda-item h2 a:hover { color: var(--gold); }
.agenda-date { align-self: stretch; display: flex; align-items: center; min-width: 0; gap: .6rem; border-right: 1px solid var(--border); padding-right: .8rem; color: var(--muted); }
.agenda-date svg { color: var(--gold); }
.agenda-event { min-width: 0; }
.agenda-event .muted { margin-top: .3rem; }
.agenda-action { align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .48rem; }
.agenda-action strong { color: var(--text); font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .7rem; margin: 0; }
.metrics > div { grid-column: span 2; padding: clamp(.78rem, 2vw, 1.15rem); border: 1px solid var(--border); border-radius: 12px; background: var(--raised); }
.metrics > div:nth-child(n+4) { grid-column: span 3; }
.metrics dt { color: var(--muted); font-size: .875rem; }
.metrics dd { margin: .3rem 0 0; font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 740; line-height: 1.18; font-variant-numeric: tabular-nums; }
.metrics > div:nth-child(n+4) dd { color: var(--gold); }
.analytics-overview .muted { margin-top: .85rem; }
.report-filters { display: grid; align-items: end; gap: .7rem; grid-template-columns: repeat(3,minmax(0,1fr)) auto; }
.report-filters input { margin-bottom: 0; }
.report-data { margin-top: 1rem; }
.report-periods { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 23rem),1fr)); gap: .7rem; }
.report-periods > article { min-width: 0; border: 1px solid var(--border); padding: 1rem; border-radius: 12px; background: var(--field); }
.report-periods h3 { margin-top: 0; }

.seat-tables { display: grid; gap: 1rem; margin: 1rem 0; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: .5rem; }
.seat-grid .seat { min-height: 44px; overflow-wrap: anywhere; }
.seat-grid .seat:disabled { color: var(--muted); }
.seat-choice { min-height: 1.5em; }
.table-closure { margin: 1.4rem 0 .75rem; border-block-start: 1px solid var(--line); padding-block-start: 1rem; }
.table-closure summary { font-weight: 650; }
.table-closure form { margin-top: .85rem; }
.closure-seats label { min-width: 0; }
.seat-history { margin-block: 1rem; }
.seat-history ol { padding: 0; list-style: none; }
.seat-history li { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .35rem 1rem; padding-block: .7rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.seat-history small { color: var(--muted); }
.result-places { display: grid; gap: .4rem; }
.result-places label { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .35rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.result-places input { width: 5rem; flex: none; }
.result-actions { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin-top: .9rem; }
.result-places .result-exclusion { justify-content: flex-start; font-size: .85rem; }
.result-exclusion input { width: auto; }
.rating-table { overflow-x: auto; margin-block: 1rem; }
.rating-table table { border-collapse: collapse; width: 100%; }
.rating-table th,.rating-table td { text-align: left; padding: .55rem; border-bottom: 1px solid var(--line); }
.weekly-schedule { margin-block: 1.25rem; }
.week-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1rem; }
.weekly-schedule form { margin-top: .8rem; }
.weekdays { display: flex; flex-wrap: wrap; gap: .8rem; }
.weekdays label { display: inline-flex; align-items: center; gap: .25rem; }
.weekdays input { width: auto; }

.scoreboard { max-width: 1560px; margin-inline: auto; padding: 0 3vw 3vw; }
.scoreboard > h1 { margin: 1.2rem 0; }
.scoreboard #board-notice { border-inline-start: .35rem solid var(--gold); padding: .7rem 1rem; font-size: clamp(1.3rem, 3vw, 3rem); font-weight: 650; overflow-wrap: anywhere; }
.board-tables:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap: .8rem; margin-bottom: 1rem; }
.board-tables article { background: var(--panel); padding: .8rem; border-radius: .6rem; }
.board-seats { display: flex; flex-wrap: wrap; gap: .4rem; }
.board-seats span { border: 1px dashed var(--muted); min-width: 2.5rem; padding: .35rem; text-align: center; border-radius: .4rem; }
.board-seats [data-occupied=true] { color: var(--gold-text); background: var(--gold); border: 1px solid var(--gold); font-weight: bold; }
.scoreboard #connection { color: var(--muted); text-align: end; }
.score-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 1.1rem; margin: 1.1rem 0; }
.score-grid.blinds { grid-template-columns: repeat(2,minmax(0,1fr)); }
.scoreboard .card { text-align: center; }
.scoreboard .card h2 { color: var(--muted); }
.scoreboard strong { color: var(--gold); font-size: clamp(1.65rem, 7vw, 7.5rem); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.scoreboard .clock strong { font-size: clamp(3.5rem, 16vw, 13.5rem); }
.scoreboard #blinds { font-size: clamp(1.35rem, 6vw, 6.25rem); }

@media (max-width: 1120px) {
  .report-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-filters button { justify-self: start; }
}

@media (max-width: 800px) {
  .staff-shell { grid-template-columns: minmax(0,1fr); }
  .staff-sidebar { position: static; }
  .workspace-menu, .staff-sidebar-title { display: none; }
  .staff-section-picker { display: block; font-size: .875rem; color: var(--muted); }
  .staff-section-picker select { margin-bottom: 0; color: var(--text); }
}

@media (max-width: 720px) {
  .cabinet { padding-bottom: 5rem; }
  header { min-height: 75px; gap: .55rem; }
  .app-nav {
    position: fixed;
    z-index: 2;
    bottom: 0;
    inset-inline: 0;
    justify-content: stretch;
    gap: .15rem;
    padding: .45rem .35rem max(.45rem, env(safe-area-inset-bottom));
    border-radius: 0;
    border-width: 1px 0 0;
  }
  .app-header .app-nav { border-top-color: var(--line); background: var(--header); }
  .workspace-tools button { min-height: 44px; }
  .app-nav button { flex: 1; flex-direction: column; gap: .2rem; min-width: 0; min-height: 48px; padding: .35rem .22rem; font-size: .83rem; }
  .app-nav .ui-icon { width: 18px; height: 18px; }
  .header-actions .action, .header-actions .theme-button { font-size: .85rem; padding-inline: .55rem; }
  .grid { grid-template-columns: minmax(0,1fr); }
  .workspace-heading { align-items: flex-start; flex-wrap: wrap; }
  .agenda-date { grid-column: 1/-1; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .58rem; font-size: .9rem; }
  .agenda-item { grid-template-columns: minmax(0,1fr); gap: .65rem; }
  .agenda-action { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics > div, .metrics > div:nth-child(n+4) { grid-column: auto; }
  .metrics > div:last-child { grid-column: 1 / -1; }
  .score-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 430px) {
  .overview-event { flex-wrap: wrap; }
  .overview-event-name { flex-basis: calc(100% - 2.2rem); }
  .overview-event .tag { margin-left: 2.1rem; }
}
@media (max-width: 390px) {
  .report-filters { grid-template-columns: minmax(0,1fr); }
  .header-actions { justify-content: flex-end; }

}

@media (prefers-reduced-motion: no-preference) {
  .action, .theme-button, .app-nav button, .workspace-menu button, .workspace-tools button, .overview-event {
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  }
}

/* The stepped corner is decorative; focus outlines stay on the complete control. */
h1, .overview-hero h2, .hero-stats dd, .metrics dd, .scoreboard strong {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
h1, .overview-hero h2 { letter-spacing: -.055em; }
.brand img { width: clamp(76px, 8vw, 98px); }
.card, .app-nav, .theme-button, .action, .workspace-tools button, .app-nav button,
.metrics > div, .report-periods > article, .timer-banner, .empty-message, .tag,
.workspace-menu button, fieldset { border-radius: var(--corner); }
.action, .theme-button { min-height: 44px; }
.action, .action:hover { position: relative; isolation: isolate; background: transparent; }
.action::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--gold); clip-path: var(--step); box-shadow: inset 0 -3px #251d132b;
}
.action:hover::before { background: var(--gold-hover); }
.tag { font-family: var(--display); font-size: .84rem; }
.app-nav button[aria-current="page"] { box-shadow: inset 0 -2px var(--gold); }
body[data-theme="black"] .club-art::before { filter: grayscale(1) brightness(.68); }
.club-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: var(--scene-base); }
.club-art::before {
  content: ""; position: absolute; inset: 0;
  background: url("/arcade-night.png") center right / cover no-repeat;
  image-rendering: pixelated;
}
.club-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--scene-base) 4%, transparent 87%);
}
.club-art img {
  position: absolute; z-index: 1; width: clamp(145px, 22%, 250px); max-height: 85%; object-fit: contain;
  right: clamp(1rem, 4%, 4.5rem); top: 50%; transform: translateY(-50%);
  filter: drop-shadow(0 2px 4px #0d1027);
}
.club-intro, .overview-hero, .agenda-hero, .staff-content:not([data-section="overview"]) .workspace-heading {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--corner);
  border: 1px solid var(--border); background: var(--scene-base);
}
:is(.club-intro,.overview-hero,.agenda-hero) .hero-content { width: 65%; }
.club-intro { min-height: 16rem; display: grid; align-items: center; }
.club-intro h1 { max-width: 16ch; font-size: clamp(2rem, 4vw, 3.4rem); }
.public-feature { margin-top: 1.15rem; display: grid; gap: .3rem; }
.public-feature strong { font-size: 1.25rem; line-height: 1.25; overflow-wrap: anywhere; }
.public-feature .section-label { margin: 0; }
.public-feature time, .event-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.club-intro .event-time { display: block; margin-top: .7rem; }
.club-intro .hero-actions .action { margin-top: 0; }
.back-link { display: inline-block; margin-bottom: .85rem; }
.event-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: 1rem; margin: 0; }
.event-facts dt { font-size: .9rem; color: var(--muted); }
.event-facts dd { margin: .15rem 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.club-intro, .agenda-hero, .overview-hero { clip-path: var(--step); }
.rating-status { margin-top: 1rem; }
.player-number { display: inline-block; color: var(--positive); font-family: var(--display); }
.public-schedule { margin-block: 2rem; scroll-margin-block-start: 1.5rem; }
.public-schedule .grid { grid-template-columns: repeat(auto-fit,minmax(min(100%, 17rem),1fr)); }
.public-schedule .event-card { border-top: 2px solid var(--border); }
.public-schedule .event-card > a { margin-top: auto; padding-block: .6rem 0; font-weight: 650; }
.visit-guide { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 20rem),1fr)); gap: 1rem; margin-block: 1.5rem; }
.event-card.is-detail { margin-top: 1rem; border-top: 3px solid var(--gold); }
.event-card.is-detail .action { margin-block-start: 1rem; }
.agenda-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; }
.agenda-item[data-mine="true"] { border-inline-start: 3px solid var(--positive); }
.agenda-action .mine-label { color: var(--positive); font-size: .875rem; font-weight: 650; }
.staff-page .layout { max-width: 1480px; }
.staff-shell { display: block; }
.staff-sidebar { position: static; padding: .55rem; margin-bottom: 1.15rem; border-radius: var(--corner); }
.staff-sidebar-title { display: none; }
.workspace-menu { display: flex; flex-wrap: wrap; gap: .25rem; }
.workspace-menu button { min-height: 44px; padding: .55rem .75rem; flex: 1 1 auto; justify-content: center; }
.workspace-menu button[aria-current="page"]::before { inset: auto .7rem 0; width: auto; height: 2px; }
.workspace-heading .club-art { display: none; }
.staff-content:not([data-section="overview"]) .workspace-heading {
  min-height: 9rem; justify-content: flex-start; flex-wrap: wrap;
  padding: 1rem 29% 1rem clamp(1rem,3vw,2.2rem);
}
.staff-content:not([data-section="overview"]) .workspace-heading .club-art { display: block; }
.workspace-heading :is(h1,button) { position: relative; z-index: 1; }
.workspace-heading .club-art img { max-height: 82%; }
.staff-overview { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(0,1.2fr); gap: 1rem; }
.overview-hero { grid-column: 1 / -1; min-height: 16rem; display: flex; align-items: center; }
.overview-events { margin: 0; }
.shift-shortcuts[hidden] + .overview-events { grid-column: 1 / -1; }
.shift-shortcuts > div { display: grid; gap: .5rem; margin-top: 1rem; }
.shift-shortcuts .theme-button { text-align: left; display: flex; gap: .7rem; align-items: center; }
.shift-shortcuts .ui-icon { color: var(--gold); }
.hero-stats dd { color: var(--positive); }
.profile-security { margin-block: 1rem; }
.profile-security > summary { font-weight: 680; font-size: 1.12rem; }
.profile-security > section { margin-top: 1rem; border-top: 1px solid var(--line); padding: 1rem 0 0; }
.scoreboard .clock { background: var(--field); border-top: 2px solid var(--gold); }
.scoreboard .clock strong { color: var(--positive); }
@media (max-width: 800px) {
  .workspace-menu { display: none; }
  .staff-sidebar { padding: .75rem; }
  .staff-overview { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  .public-site > header { flex-wrap: wrap; padding-block: .55rem; }
  .public-site .header-actions { flex: 1 1 12rem; justify-content: end; }
  .club-intro, .agenda-hero, .overview-hero { display: flex; flex-direction: column; align-items: stretch; padding: 0; min-height: 0; }
  :is(.club-intro,.agenda-hero,.overview-hero) .club-art {
    position: relative; inset: auto; min-height: 7.7rem; overflow: hidden; border-bottom: 1px solid var(--line);
  }
  :is(.club-intro,.agenda-hero,.overview-hero) .club-art img { inset: 50% auto auto 1rem; width: 8.4rem; max-height: 90%; }
  :is(.club-intro,.agenda-hero,.overview-hero) .hero-content { width: 100%; padding: 1.1rem; }
  .hero-actions .theme-button, .hero-actions .action { white-space: normal; }
  .staff-content:not([data-section="overview"]) .workspace-heading { min-height: 7.5rem; padding-right: 36%; }
  .workspace-heading .club-art img { width: 28%; }
}
