:root {
  --navy: #10243e;
  --navy-light: #1d3b5f;
  --orange: #ef7d32;
  --cream: #f7f3e9;
  --paper: #ffffff;
  --ink: #172231;
  --muted: #657184;
  --line: #d9dee6;
  --green: #17735a;
  --gold: #d49a16;
  --shadow: 0 18px 45px rgba(16, 36, 62, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: linear-gradient(145deg, #f8f5ed 0%, #edf2f7 100%); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 10; background: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 92px; padding: .65rem clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; background: #050709; border-bottom: 3px solid #c9a55c; }
.brand { display: flex; gap: .75rem; align-items: center; font-size: 1.05rem; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.brand-logo { width: 68px; height: 68px; object-fit: contain; }
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-size: clamp(1rem, 2.2vw, 1.45rem); }
.brand-text small { margin-top: .3rem; color: #d8bc78; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.nav-link { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.admin-identity { color: #bec9d6; font-size: .85rem; }
.page-shell { width: min(1260px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0; }
.week-nav { display: grid; grid-template-columns: repeat(11, minmax(42px, 1fr)); gap: .35rem; margin-bottom: 2rem; }
.week-nav a { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: white; text-decoration: none; font-weight: 850; }
.week-nav a:hover { border-color: var(--orange); }
.week-nav a.active { color: white; background: var(--navy); border-color: var(--navy); box-shadow: inset 0 -3px var(--orange); }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.hero.compact { align-items: center; }
.hero h1 { max-width: 760px; margin: .25rem 0; font-size: clamp(2.35rem, 7vw, 5.4rem); line-height: .95; letter-spacing: -.055em; color: var(--navy); }
.hero.compact h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.hero-copy { max-width: 660px; color: var(--muted); font-size: 1.08rem; }
.eyebrow { margin: 0 0 .35rem; color: #a9470d; font-size: .76rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.sheet-picker { display: grid; gap: .35rem; min-width: 210px; color: var(--muted); font-size: .8rem; font-weight: 750; }
select, input, textarea { width: 100%; padding: .7rem .8rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(239, 125, 50, .38); outline-offset: 2px; }
.card { padding: clamp(1rem, 3vw, 2rem); background: rgba(255, 255, 255, .94); border: 1px solid rgba(217, 222, 230, .8); border-radius: 20px; box-shadow: var(--shadow); }
.board-card { overflow: hidden; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1.5rem; text-align: center; }
.matchup div { display: grid; gap: .25rem; }
.matchup strong { color: var(--navy); font-size: clamp(1rem, 2vw, 1.35rem); }
.muted, .hint { color: var(--muted); font-size: .8rem; font-weight: 500; }
.versus { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--orange); font-size: .74rem; font-weight: 900; }
.board-scroll { overflow-x: auto; padding: .25rem .25rem 1rem; }
.squares-board { position: relative; display: grid; grid-template-columns: 44px repeat(10, minmax(58px, 1fr)); min-width: 690px; border: 2px solid var(--navy); border-radius: 9px; overflow: hidden; background: var(--navy); gap: 1px; }
.squares-board::before { content: var(--team-label); position: absolute; top: 0; left: 44px; right: 0; z-index: 2; height: 17px; color: white; background: var(--navy); text-align: center; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.squares-board::after { content: var(--opponent-label); position: absolute; top: 55px; bottom: 0; left: 0; z-index: 2; width: 15px; display: grid; place-items: center; color: white; background: var(--navy); font-size: .55rem; font-weight: 800; letter-spacing: .06em; line-height: 1; text-transform: uppercase; writing-mode: vertical-rl; text-orientation: mixed; pointer-events: none; }
.board-corner, .axis-number { display: grid; place-items: center; height: 55px; color: white; background: var(--navy); font-weight: 850; transition: color .12s, background-color .12s; }
.board-corner { color: #d8bc78; font-size: .65rem; letter-spacing: .08em; }
.column-number { padding-top: 14px; }
.row-number { position: relative; padding-left: 14px; }
.square { display: grid; place-items: center; min-height: 58px; padding: .25rem; border: 0; background: white; text-align: center; overflow-wrap: anywhere; transition: color .12s, background-color .12s, box-shadow .12s; }
.square span { font-size: clamp(.62rem, 1.1vw, .78rem); line-height: 1.15; }
.square.open { color: var(--muted); background: #f8fafc; }
.square.reserved { color: #714d00; background: #fff0bd; }
.square.paid { color: #07583f; background: #ccebdd; }
.axis-number.axis-highlight { color: white; background: #666; }
.square.line-highlight { color: var(--navy); background: #f1f1f2; }
.square.intersection-highlight { z-index: 3; color: var(--navy); background: #99ffff; box-shadow: inset 0 0 0 3px #43caca; }
button.square { cursor: pointer; transition: transform .12s, filter .12s; }
button.square:hover { z-index: 4; filter: brightness(.97); transform: scale(1.05); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: .8rem; }
.legend span { display: flex; align-items: center; gap: .4rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #edf0f4; }
.dot.reserved { background: var(--gold); }.dot.paid { background: var(--green); }
.rules-card { margin-top: 1.5rem; }
.bye-card { text-align: center; }
.bye-card h2 { margin: .25rem 0 .5rem; color: var(--navy); font-size: clamp(1.8rem, 5vw, 3.4rem); }
.rules-card h2, .section-heading h2 { margin: .1rem 0 .75rem; color: var(--navy); }
.rules-card p:last-child { white-space: pre-line; line-height: 1.7; }
.notice { margin: -1rem 0 1rem; padding: .75rem 1rem; border-radius: 10px; color: #07583f; background: #d8f2e5; }
.notice.error { color: #8c241d; background: #f9dcd9; }
.admin-actions { display: flex; align-items: end; gap: .75rem; }
.number-actions { display: flex; align-items: center; gap: .75rem; }
.admin-layout { display: grid; gap: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
label { display: grid; gap: .4rem; font-size: .84rem; font-weight: 750; }
label.wide { grid-column: 1 / -1; }
textarea { resize: vertical; line-height: 1.5; }
.button { padding: .72rem 1rem; border: 1px solid var(--navy); border-radius: 9px; color: white; background: var(--navy); cursor: pointer; font-weight: 750; white-space: nowrap; }
.button.secondary { color: var(--navy); background: white; }
dialog { width: min(450px, calc(100% - 2rem)); padding: 1.5rem; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(8, 23, 39, .64); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 1rem; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #edf0f4; cursor: pointer; font-size: 1.4rem; }
.dialog-actions { display: flex; justify-content: end; gap: .75rem; margin-top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 1rem, 1260px); padding-top: 2rem; }
  .hero, .hero.compact { align-items: stretch; flex-direction: column; gap: 1.25rem; }
  .hero h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .admin-actions { align-items: stretch; flex-direction: column; }
  .number-actions { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label { grid-column: 1; }
  .admin-identity { display: none; }
  .site-header { padding-inline: 1rem; }
  .brand-logo { width: 54px; height: 54px; }
  .week-nav { grid-template-columns: repeat(5, 1fr); }
  .card { border-radius: 14px; }
  .squares-board { grid-template-columns: 38px repeat(10, 54px); min-width: 579px; }
  .squares-board::before { left: 38px; }
  .square { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
