/**
 * @file
 * @brief Shared winter visual system, responsive play layout, and accessible page controls.
 * @date 2026-10-03
 */
:root {
  /* The shared names below map onto web/tokens.css (doc/presentation.md, Tokens). */
  --bg: var(--ground-900);
  --panel: var(--ground-700);
  --line: var(--line-300);
  --text: var(--text-100);
  --muted: var(--text-300);
  --cyan: var(--frost-400);
  --warm: var(--lantern-400);
  color: var(--text);
  background: var(--bg);
}
body {
  background: radial-gradient(ellipse 90% 36% at 45% 0, #29474b50, transparent), var(--bg);
  background-attachment: fixed;
}
body, input, select, textarea { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
p { line-height: 1.6; }
a { color: var(--cyan); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
input, select, textarea { min-width: 0; }
.shell { max-width: 1440px; padding: 24px 32px 20px; }
.topbar { gap: 24px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid #304b5670; }
.brand { font-size: 18px; font-weight: 730; letter-spacing: -.025em; }
.brand-mark { width: 31px; height: 34px; font-size: 0; background: url("./favicon.svg") center / contain no-repeat; }
.brand small { display: none; }
.site-nav { gap: 4px; min-width: 0; }
.nav-link { min-height: 44px; padding: 11px 13px; color: var(--muted); font-weight: 550; border-radius: 8px; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); background: #213c45; border-color: #304b5670; }
.nav-personal { margin-left: 14px; }
.skip-link { position: fixed; left: 18px; top: 12px; z-index: 20; padding: 12px 18px; border-radius: 8px; background: var(--cyan); color: #102a2d; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
main:focus, .view h1[tabindex="-1"]:focus { outline: none; }
.menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 13px; border: 1px solid #3d5964; border-radius: 8px; background: #203c47; color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; }
.menu-toggle:hover { border-color: var(--cyan); background: #2b4b56; }
.button {
  min-height: 44px; padding: 10px 17px; border-radius: 8px;
  border-color: #3d5964; color: var(--text); background: #203c47;
  font-size: 14px; font-weight: 650; line-height: 1.3;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button.ghost { background: transparent; }
.button.primary { color: #15302e; background: var(--cyan); border-color: var(--cyan); }
.button:hover { background: #2b4b56; border-color: #b5eadc; }
.button.primary:hover { background: #d4f5eb; }
.button:disabled { opacity: .5; cursor: wait; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: .13em; }
.landing-card, .panel {
  position: relative; width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: #122832; box-shadow: none; backdrop-filter: none;
}
.landing-card::before { display: none; }
.landing-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 1360px; margin: auto; padding: 0 0 20px; justify-items: stretch; }
.landing-hero { position: relative; min-width: 0; overflow: hidden; border: 1px solid #45636b; border-radius: 18px; background: #152e37; }
.landing-hero .hero { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.landing-hero .hero-art { width: 100%; height: 100%; object-fit: cover; object-position: 64% 58%; }
.landing-hero .hero::after { inset: 0; background: linear-gradient(90deg, #11272feb 0%, #11272feb 23%, #11272fcc 39%, #11272f48 58%, #11272f08 80%), linear-gradient(0deg, #11272f70, transparent 45%); }
.hero-card { position: relative; width: 54%; min-width: 0; margin: 0; padding: 34px 40px 28px; }
.hero-card h1 { margin: 0 0 16px; font-size: 22px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.hero-promise { margin: 0 0 18px; color: #f5f8f3; font-size: clamp(42px, 4.25vw, 60px); font-weight: 760; letter-spacing: -.045em; line-height: 1.02; }
.hero-promise span { color: #b5eadc; }
.landing-copy { margin: 0; max-width: 62ch; color: #c7d6d8; font-size: 16px; line-height: 1.6; }
.hero-card .landing-copy { max-width: 41ch; font-size: 16px; }
.landing-actions { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 20px; }
.landing-actions > * { width: auto; }
.hero-actions { margin-top: 22px; }
.hero-actions[data-active="true"] button.primary { color: var(--text); background: #203c47; border-color: #3d5964; }
/* Each way to play keeps its own choices beside it (doc/web.md, Home). */
.landing-actions.hero-actions { display: grid; grid-template-columns: minmax(0, 1fr);
  align-items: start; gap: 14px; }
.hero-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 12px; width: 100%; }
.mode-choice { padding: 14px; border: 1px solid #638784; border-radius: 13px; background: #0a1d25e8; }
.mode-choice h2 { margin: 0; font-size: 18px; color: #f0fbfa; }
.mode-choice .mode-blurb { margin: 0; color: #c7d6d8; font-size: 12px; line-height: 1.5; }
@media (max-width: 580px) {
  .hero-paths { grid-template-columns: minmax(0, 1fr); }
}
.hero-actions > [data-resume-match], .hero-more { grid-column: 1 / -1; }
.hero-mode { display: grid; align-content: start; gap: 8px; min-width: 0; }
.hero-mode > .button { width: 100%; }
.hero-mode .practice-fields { margin: 0; gap: 8px; }
.hero-mode .practice-fields .setup-field { margin: 0 0 3px; font-size: 12px; }
.hero-mode .practice-fields select { min-height: 40px; padding: 8px 10px; font-size: 12px; }
.hero-mode .setup-summary { margin: 0; font-size: 12px; }
.home-practice-settings { border-top: 1px solid #34525b; }
.home-practice-settings > summary { min-height: 44px; padding: 12px 0; color: #c7d6d8; font-size: 12px; font-weight: 650; }
.home-practice-settings[open] { padding-bottom: 8px; }
.home-practice-settings .practice-fields { margin-top: 4px; }
.hero-live-entry { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid #34525b; }
.hero-live-entry > .button { width: 100%; }
.hero-population { margin: 0; font-size: 12px; color: #c7d6d8; }
.hero-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-more .button { min-height: 40px; padding: 8px 14px; }
.hero-readiness { min-height: 26px; margin-top: 15px; }
.hero-readiness .landing-note { margin: 0; font-size: 12px; color: #c7d6d8; }
.hero-readiness .button { margin-left: 6px; min-height: 36px; padding: 6px 10px; }
.hero-info { margin-top: 6px; border-top: 1px solid #34525b; }
.hero-info > summary { min-height: 44px; padding: 12px 0; color: #c7d6d8; font-size: 12px; font-weight: 650; }
.hero-info[open] { padding-bottom: 8px; }
.hero-info > div { display: grid; gap: 9px; }
.landing-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.landing-note:empty { display: none; }
.play-deck { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.play-deck > section { padding: 26px 28px; }
.mode-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; }
.mode-number { display: grid; place-items: center; width: 42px; height: 44px; flex: none; border: 1px solid #52706f; border-radius: 11px; color: var(--cyan); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mode-heading .eyebrow { margin: 0 0 4px; font-size: 10px; }
.mode-heading h2 { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 680; letter-spacing: -.025em; }
.play-deck .landing-copy { font-size: 14px; }
.practice-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 4px; }
.practice-fields select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-200); border-radius: 8px; background: var(--ground-800); color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.setup-field { color: #c3d3d9; font-size: 12px; font-weight: 650; }
.setup-summary { margin: 15px 0 0; padding-left: 12px; border-left: 2px solid #6c9a92; color: #bcced0; font-size: 12px; line-height: 1.5; }
.practice-card .setup-summary { min-height: 3em; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 2px; font-size: 13px; }
.online-card { display: block; margin: 0; background: #15313a; }
.play-deck > .online-card { grid-column: auto; grid-row: auto; }
.online-card .landing-actions { margin-top: 18px; }
.online-card .landing-actions .button { flex: 1 1 auto; }
.online-greeting { margin: 12px 0 0; font-size: 13px; }
.join-match { margin-top: 13px; border-top: 1px solid #34525b; }
.join-match summary { min-height: 44px; padding: 12px 0; font-size: 12px; }
.join-match[open] { padding-bottom: 6px; }
.join-match[open] > summary { margin-bottom: 0; }
.online-join { gap: 8px; }
.online-readiness { min-height: 1.6em; }
.online-input, .settings-card select, .seed-row input, .board-choice select, [data-river-choice] {
  min-height: 44px; border: 1px solid var(--line-200); border-radius: 8px; background: var(--ground-800); color: var(--text);
}
.lore { margin: 0; padding: 26px 28px; background: transparent; border-color: #304b5680; }
.lore h2 { margin: 0 0 10px; font-size: 28px; font-weight: 680; letter-spacing: -.025em; }
.lore .landing-copy { max-width: 85ch; font-size: 14px; }
.lakes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.lakes li { border-color: #34515c; border-radius: 10px; background: #122832; }
.lakes img { object-fit: cover; }
.lakes h3 { margin: 14px 16px 7px; font-size: 16px; font-weight: 650; }
.lakes p { margin: 0 16px 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.site-foot { justify-content: space-between; align-items: center; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #304b5680; color: #a5bcc1; font-size: 12px; line-height: 1.6; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.site-foot a { color: #c7d6d8; font-size: 12px; }
.view { scroll-margin-top: 160px; }
.view:not([hidden]) { animation: page-arrival .22s ease-out; }
@keyframes page-arrival { from { opacity: .7; } to { opacity: 1; } }

/* Settings are grouped by the decision the player is making. */
.settings-view { max-width: 1120px; }
.settings-head { margin: 0 0 24px; }
.settings-head h1 { margin: 8px 0 12px; font-size: clamp(34px, 4vw, 44px); font-weight: 720; }
.settings-head > p:last-child { max-width: 65ch; color: var(--muted); font-size: 15px; line-height: 1.6; }
.section-tabs { display: flex; gap: 5px; width: 100%; padding: 5px; margin-bottom: 22px; border: 1px solid #304b56; border-radius: 11px; background: #0c1f29; overflow-x: auto; }
.section-tabs button { flex: 1 0 auto; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.section-tabs button:hover { color: var(--text); background: #1a3640; }
.section-tabs button[aria-selected="true"] { color: #eff7f3; border-color: #47686d; background: #24444b; }
.section-tabs button:focus-visible { outline: 3px solid #f8d193; outline-offset: -2px; }
.settings-section[tabindex="0"]:focus-visible { outline: 3px solid var(--warm); outline-offset: 5px; border-radius: 8px; }
.settings-section { min-width: 0; }
.settings-grid { gap: 20px; }
.settings-card { padding: 25px; }
.settings-card h2 { font-size: 20px; font-weight: 660; letter-spacing: -.02em; }
.settings-card > p { color: #c1d2d6; font-size: 14px; line-height: 1.65; }
.settings-card .eyebrow { color: var(--cyan); }
.settings-card > p:first-child { margin-top: 0; }
.settings-advanced { margin-top: 20px; padding: 0 20px; border: 1px solid #34515c; border-radius: 12px; background: #0e222c; }
.settings-advanced > summary { font-size: 14px; padding: 16px 0; min-height: 52px; }
.settings-advanced[open] { padding-bottom: 20px; }
.setting-choice { min-height: 74px; padding: 12px; background: #0c1e29; border-color: #34515c; border-radius: 8px; }
.setting-choice.active { background: #25453f; border-color: var(--cyan); }
.custom-settings { border-color: #34515c; border-radius: 10px; padding: 8px 16px 16px; }
.look-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.look-settings legend, .look-settings .look-features { grid-column: 1 / -1; }
.look-settings .setup-field { align-self: end; }
.look-settings select { grid-column: 2; }
.look-settings .look-features { margin-top: 14px; }
.toggle-field { min-height: 44px; }
.audio-control input[type="range"], .settings-card input[type="range"] { min-height: 44px; }
.seed-row { grid-template-columns: minmax(0, 1fr); }
.seed-row label { overflow-wrap: anywhere; }
.seed-row .button { justify-self: start; }
.settings-actions { align-items: center; padding-top: 20px; }
.angler-bio, .lore-fact { background: #0c1e29; border-color: #34515c; border-radius: 8px; }
.angler-poses, .vignette { background: linear-gradient(#24444b 0 46%, #c4d8db 46% 100%); }
.angler-card { padding: 20px; }
.angler-card h2 { margin: 17px 0 10px; font-weight: 650; letter-spacing: -.025em; }
.angler-card p { color: #c1d2d6; font-size: 14px; line-height: 1.7; }
.angler-poses { border-radius: 10px; padding-top: 18px; }
.angler-poses canvas { height: 120px; }
.angler-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.kit-panel { margin-bottom: 20px; }
.kit-look { background: #c4d8db; border-radius: 10px; }
.lore-panel > summary { font-size: 17px; padding: 0; min-height: 44px; }
.lore-panel[open] > summary { padding-bottom: 12px; }

/* Accounts and records stay readable without competing with the lake. */
.matches-card { max-width: 1040px; padding: 34px; }
.matches-card h1, .legal-card h1 { font-size: clamp(34px, 4vw, 44px); font-weight: 720; letter-spacing: -.035em; line-height: 1.1; }
.matches-card .landing-copy { font-size: 15px; }
.history { margin: 24px 0; gap: 12px; }
.history li { padding: 16px; border-color: #34515c; border-radius: 10px; background: #0c1e29; overflow-wrap: anywhere; }
.history small { margin-top: 5px; }
.your-data { display: block; margin-top: 26px; padding-top: 0; border-color: #34515c; }
.your-data > summary { font-size: 15px; padding: 16px 0; }
.your-data .landing-note { margin-top: 10px; }
.your-data .consent { margin-top: 12px; }
.account-card { max-width: 860px; }
.account-panels { gap: 18px; margin-top: 22px; }
.account-panels[data-account-out] { display: block; max-width: 540px; }
.account-tabs { margin-bottom: 16px; }
.account-panels[data-account-out] > details { margin-top: 18px; }
.account-form { gap: 9px; padding: 24px; border-color: #34515c; border-radius: 11px; background: #0c1e29; }
.account-form h2 { margin: 0 0 5px; font-size: 20px; }
.account-form .setup-field { margin-top: 13px; }
.account-form .account-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.account-form .landing-actions { margin-top: 16px; }
.account-panels[data-account-out] .account-form > .landing-actions .button { width: 100%; }
.account-status:not(:empty) { padding: 12px 14px; border-left: 3px solid var(--cyan); border-radius: 6px; background: #213c45; }
.account-status.is-error { border-color: #efaa8e; color: #ffd4c1; }
.account-birth { margin-top: 12px; gap: 10px; }
.account-codes { overflow-wrap: anywhere; }
.admin-output, .legal-table { border-radius: 8px; }
.admin-table th, .admin-table td { padding: 12px; }

/* During play, the lake gets the room; every next action sits beside it. */
.game-view { max-width: 1320px; min-height: 0; padding-top: 0; }
body[data-view="game"] .topbar { margin-bottom: 18px; padding-bottom: 14px; }
.game-head { align-items: center; margin: 0 0 12px; gap: 12px; }
.game-head h1 { font-size: 24px; font-weight: 660; }
.game-head .eyebrow { padding: 6px 10px; border-radius: 6px; color: #c5ded9; background: #17313b; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.fullscreen-btn { padding: 6px 10px; border-color: #34515c; border-radius: 6px; color: #c5ded9; background: #17313b; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.fullscreen-btn:hover { color: var(--cyan); border-color: var(--cyan); background: #1e3d4a; }
.fullscreen-btn[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); background: #133946; }
html[data-fullscreen="on"] .game-host [data-board-window],
html[data-fullscreen="on"] .game-host [data-game-canvas] {
  width: min(100%, calc((100vh - 100px) * 41 / 31)) !important;
  width: min(100%, calc((100dvh - 100px) * 41 / 31)) !important;
}
@media (orientation: portrait) and (max-width: 960px) {
  html[data-fullscreen="on"] body[data-mode="river"] .game-host [data-board-window],
  html[data-fullscreen="on"] body[data-mode="river"] .game-host [data-game-canvas] {
    aspect-ratio: 31 / 47;
    width: min(100%, calc((100vh - 120px) * 31 / 47)) !important;
    width: min(100%, calc((100dvh - 120px) * 31 / 47)) !important;
  }
}
html[data-fullscreen="on"] .game-host { background: transparent; border-color: transparent; }
.game-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.game-host { gap: 8px; padding: 8px; border-color: #34515c; border-radius: 14px; background: #0d232e; }
.game-host [data-game-canvas] { width: min(100%, calc((100vh - 238px) * 41 / 31)) !important; width: min(100%, calc((100dvh - 238px) * 41 / 31)) !important; min-width: 0; border-color: #34515c; border-radius: 9px; }
.position-card { grid-template-columns: 31px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 8px; padding: 8px 10px; border-radius: 8px; border-width: 1px; background: #13313e; }
.position-greedy { border-color: var(--seat-rival); background: var(--seat-rival-ground); box-shadow: none; }
.position-you { border-color: var(--seat-you); }
.position-card .player-portrait { width: 28px !important; height: 38px !important; grid-row: 1 / 3; }
.position-card > span:not(.player-energy) { font-size: 12px; font-weight: 650; letter-spacing: 0; }
.position-card > span small { display: none; }
.position-card strong { grid-column: 3; grid-row: 1 / 3; font-size: 24px; justify-self: end; white-space: nowrap; }
.position-card strong small { display: none; }
.position-card .player-energy { grid-column: 2; color: #c0d1d9; font-size: 11px; }
.game-panel { padding: 20px; gap: 16px; align-content: start; border-radius: 14px; background: #122832; }
.play-feedback { gap: 12px; }
.play-feedback .game-status { margin: 0; min-height: 3em; padding: 0 0 0 12px; color: #e0ece7; font-size: 14px; line-height: 1.5; border-color: var(--cyan); }
.play-feedback .energy-preview { min-height: 6em; padding: 11px 12px; border-color: #34515c; background: #0c1f29; color: #c7dadb; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.energy-preview:empty { display: none; }
/* Keep the lake under the same finger when the first strike preview appears. */
.play-feedback[data-live="true"] .energy-preview:empty { display: block; visibility: hidden; }
.game-host .play-feedback[data-live="true"] .game-status { height: 4.5em; overflow: auto; }
.play-feedback .danger-preview { border-color: #dc9a7b; color: #ffd0b9; }
.energy-control { margin: 0; gap: 4px; color: #d5e4df; font-size: 13px; }
.energy-control input { min-height: 44px; margin: 0; }
.strike-remaining { margin: -10px 0 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.game-empty h2 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.03em; }
.game-empty p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.game-empty .eyebrow { font-size: 10px; }
.inspect-panel, .keyboard-controls, .board-help, .board-table, .match-tools { padding: 0 14px; border: 1px solid #34515c; border-radius: 9px; background: #0e222c; }
summary { color: #c6d8d9; font-size: 13px; line-height: 1.5; }
details[open] > summary { border-color: #34515c; }
.keyboard-controls[open] { padding-bottom: 14px; }
.keyboard-controls p, .keyboard-controls small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.keyboard-controls .board-choice small { display: block; font-weight: 450; }
.game-layout > .board-table { grid-column: 1 / -1; }
.result-card, .lesson-card, .online-status { border: 1px solid #53746e; border-radius: 10px; background: #23434a; box-shadow: none; padding: 16px; }
.result-card h2 { color: #eff7ee; font-size: 27px; }
.result-card .result-actions .button { flex: 1 1 auto; font-size: 13px; padding: 10px 12px; }
.result-support { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.result-aftermath { color: #c1d4d6; }
.end-screen { color: var(--text); width: min(620px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: clamp(20px, 4vw, 36px); overflow: auto; box-sizing: border-box; }
.end-screen::backdrop { background: #020c14cc; }
.end-screen:not([open]) { display: none; }
.board-camera label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.board-camera input[type="checkbox"] { width: auto; margin: 0; }
.end-screen h2 { font-size: clamp(28px, 5vw, 42px); margin: 8px 0 16px; }
.end-performance { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.end-performance div { padding: 12px; border: 1px solid #53746e; border-radius: 8px; }
.end-performance dt { color: var(--muted); font-size: 13px; }
.end-performance dd { margin: 8px 0 0; font-size: 24px; font-weight: 700; }
@media (max-width: 380px) { .end-performance { gap: 8px; } .end-performance div { padding: 8px; } }
.play-feedback .lesson-card { padding: 16px; }
.play-feedback .lesson-card h2 { font-size: 21px; }
.play-feedback .lesson-card p { font-size: 13px; line-height: 1.6; }
.lesson-card .eyebrow { font-size: 10px; }
.online-status h2 { font-size: 21px; }
.online-status p { font-size: 13px; }
.chatter { font-size: 13px; padding: 7px 10px; border-radius: 8px; }
.round-recap { padding: 12px; background: #122c38; border-color: #34515c; }
.round-recap strong { text-transform: none; letter-spacing: 0; color: #bad5d2; }
.match-tools .event-panel { border-color: #34515c; }
.cell-info { color: #c5d6d9; }
.legal-card { max-width: 900px; padding: 38px 42px; color: #c1d2d6; }
.legal-card h2 { font-size: 22px; letter-spacing: -.025em; color: var(--text); }
.legal-card p { line-height: 1.75; }
.guide-steps { display: grid; gap: 18px; counter-reset: steps; padding: 0; list-style: none; margin-top: 30px; }
.guide-steps li { padding: 22px; border: 1px solid #34515c; border-radius: 10px; background: #0c1e29; }
.guide-steps h2 { margin: 0 0 10px; font-size: 20px; }
.guide-steps h2::before { counter-increment: steps; content: counter(steps) ". "; color: var(--cyan); }
.guide-steps p { margin: 0; }
.support-note { padding: 20px 24px; border: 1px solid #34515c; border-radius: 10px; background: #0c1e29; }

@media (max-width: 1100px) {
  .hero-card { width: 58%; padding-left: 28px; padding-right: 28px; }
  .hero-promise { font-size: 44px; }
  .play-deck > section { padding: 24px; }
  .practice-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lakes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { padding: 20px 22px; }
  .topbar { gap: 12px; }
  .nav-link { padding-left: 10px; padding-right: 10px; font-size: 13px; }
  .nav-personal { margin-left: 6px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .game-host [data-game-canvas] { width: 100% !important; min-width: 0; }
  .game-panel { padding: 20px; }
  .play-feedback .energy-preview { height: 6em; overflow: auto; }
}
@media (max-width: 760px) {
  .shell { padding: 16px 16px 18px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 18px; padding-bottom: 10px; }
  .brand { font-size: 17px; justify-self: start; }
  .brand-mark { width: 25px; height: 28px; }
  .site-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; justify-content: stretch; gap: 5px; overflow: visible; width: 100%; border: 0; padding: 4px 0 0; }
  .nav-link { display: flex; justify-content: center; align-items: center; min-width: 0; min-height: 44px; padding: 10px 6px; font-size: 12px; white-space: nowrap; }
  .nav-personal { margin-left: 0; }
  .landing-view { gap: 16px; padding-top: 0; }
  .landing-hero { border-radius: 14px; }
  .landing-hero .hero { height: 136px; }
  .landing-hero .hero-art { object-position: 82% 52%; }
  .landing-hero .hero::after { background: linear-gradient(0deg, #152e37 0%, #152e3708 45%); }
  .hero-card { width: 100%; padding: 118px 20px 20px; }
  .hero-card h1 { font-size: 20px; margin-bottom: 14px; }
  .hero-card .eyebrow { font-size: 10px; }
  .hero-promise { font-size: 32px; line-height: 1.08; margin-bottom: 12px; }
  .hero-card .landing-copy { max-width: none; font-size: 14px; }
  .hero-actions .button { flex: 1 1 auto; }
  .play-deck { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .play-deck > section, .lore { padding: 24px; }
  .practice-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .lore h2 { font-size: 25px; }
  .lakes { gap: 12px; }
  .lakes h3, .lakes p { margin-left: 13px; margin-right: 13px; }
  .settings-head { margin-bottom: 20px; }
  .settings-head h1 { font-size: 35px; }
  .section-tabs { gap: 4px; padding: 4px; overflow: visible; }
  .section-tabs[data-settings-tabs] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-tabs button { font-size: 12px; padding: 10px 12px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-card { padding: 22px; }
  .settings-advanced { padding-left: 14px; padding-right: 14px; }
  .scene-head { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .vignette { width: 120px; height: 105px; grid-row: 1 / span 2; }
  .vignette canvas { height: 102px; }
  .settings-head > p:last-child { grid-column: 1 / -1; margin-top: 8px; font-size: 14px; }
  .account-panels { grid-template-columns: minmax(0, 1fr); }
  .matches-card, .legal-card { padding: 26px 22px; }
  .account-form { padding: 20px; }
  .account-panels[data-account-out] { max-width: none; }
  .history li { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .history .button { grid-column: 1; grid-row: auto; justify-self: start; }
  body[data-view="game"] .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-bottom: 12px; padding-bottom: 8px; }
  body[data-view="game"] .brand { font-size: 15px; }
  body[data-view="game"] .brand-mark { width: 22px; height: 25px; }
  body[data-view="game"] .site-nav { gap: 5px; overflow: visible; justify-content: stretch; padding: 4px 0 0; }
  body[data-view="game"] .nav-link { font-size: 12px; padding: 11px 10px; }
  .game-head { gap: 8px; margin-bottom: 10px; flex-wrap: nowrap; }
  .game-head h1 { font-size: 20px; }
  .game-head .eyebrow { font-size: 10px; padding: 6px 8px; letter-spacing: 0; }
  .game-host { padding: 6px; gap: 7px; border-radius: 10px; }
  .position-card { padding: 6px 7px; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 5px; }
  .position-card .player-portrait { width: 24px !important; height: 33px !important; }
  .position-card > span:not(.player-energy) { font-size: 11px; }
  .position-card strong { font-size: 20px; }
  .game-panel { padding: 18px; gap: 14px; }
  .play-feedback .game-status { font-size: 13px; }
  .play-feedback .energy-preview { font-size: 12px; padding: 9px 10px; }
  .chatter { font-size: 12px; }
  .legal-card h1, .matches-card h1 { font-size: 34px; }
  .site-foot { justify-content: flex-start; margin-top: 20px; }
  .foot-links { width: 100%; gap: 10px 16px; }
}
@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .hero-card { padding-left: 20px; padding-right: 20px; }
  .hero-promise { font-size: 30px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions > * { width: 100%; }
  .practice-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lakes { grid-template-columns: minmax(0, 1fr); }
  .landing-actions .button { flex: 1 1 auto; }
  .play-deck > section, .lore { padding: 22px 20px; }
  .scene-head { grid-template-columns: minmax(0, 1fr); }
  .vignette { display: none; }
  .look-settings { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .look-settings select { grid-column: 1; }
  .account-birth { grid-template-columns: minmax(0, 1fr); }
  .settings-actions { align-items: flex-start; flex-direction: column; }
  .section-tabs button { padding: 10px; }
}
@media (prefers-contrast: more) {
  :root { --line: var(--line-300); --text: var(--text-100); --muted: var(--text-300); --cyan: var(--frost-400); }
  :is(.landing-card,.panel,.game-host,.setting-choice,.section-tabs,.settings-advanced,.energy-preview,.account-form) { border-color: #d9f7ff; }
}
html[data-contrast="high"] { --line: var(--line-300); --text: var(--text-100); --muted: var(--text-300); --cyan: var(--frost-400); }
html[data-contrast="high"] :is(.landing-card,.panel,.game-host,.setting-choice,.section-tabs,.settings-advanced,.energy-preview,.account-form) { border-color: #d9f7ff; }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Stories stay in one drawer; the gallery is a compact cast, not a biography feed. */
.angler-poses { grid-template-columns: 1fr; justify-items: center; }
.angler-poses canvas { width: 156px; height: 208px; max-width: 100%; }
.angler-card { display: flex; flex-direction: column; text-align: center; }
.angler-card .story-open { margin-top: auto; align-self: center; }
.story-open { color: var(--cyan); background: #233e45; border: 1px solid #41616a; border-radius: 8px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.story-drawer { box-sizing: border-box; position: fixed; inset: 0 0 0 auto; margin: 0; width: min(440px, 100%); max-width: 100%; height: 100vh; max-height: 100vh; height: 100dvh; max-height: 100dvh; z-index: 50; overflow-y: auto; padding: 26px 30px 40px; background: var(--panel); color: var(--text); border: 0; border-left: 1px solid var(--line); box-shadow: -20px 0 80px #0006; }
.story-drawer::backdrop { background: #06131bbb; }
.story-drawer:not([open]) { display: none; }
.story-close { display: block; margin-left: auto; padding: 10px 16px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #213c45; cursor: pointer; }
.story-portrait { display: block; width: 190px; height: 255px; max-width: 100%; margin: 16px auto 24px; }
.story-drawer h2 { font-size: 36px; margin: 8px 0 20px; }
.story-copy { font-size: 17px; line-height: 1.75; }
.angler-bio h3 { margin: 0 0 10px; }
.kit-inventory { display: flex; flex-wrap: wrap; gap: 8px; margin: 7px 0 18px; }
.kit-slot { position: relative; box-sizing: border-box; min-width: 44px; min-height: 44px; border-radius: 7px; border: 1px solid #4c6570; color: var(--text); background: #192e38; padding: 8px 10px; cursor: pointer; }
.kit-slot[aria-pressed="true"], .kit-accessory:has(input:checked) { outline: 2px solid var(--cyan); outline-offset: 2px; border-color: var(--cyan); }
.kit-slot:focus-visible, .kit-accessory:has(input:focus-visible) { outline: 3px solid var(--warm); outline-offset: 3px; }
.kit-swatch { width: 46px; height: 46px; font-size: 0; background: var(--kit-colour); }
.kit-swatch[aria-pressed="true"]::after { content: "✓"; font-size: 19px; color: white; text-shadow: 0 1px 3px #000; }
.kit-preset { border-top: 5px solid var(--kit-colour); font-size: 13px; }
.look-features { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-accessory { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; font-size: 12px; width: 78px; height: 74px; }
.kit-accessory svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kit-accessory input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; inset: 0; cursor: pointer; }
.look-settings { grid-template-columns: 1fr !important; max-width: 540px; }
.kit-panel summary { font-weight: 650; cursor: pointer; }
:root[data-contrast="high"] .story-drawer { border: 2px solid white; background: black; }
:root[data-contrast="high"] .kit-slot[aria-pressed="true"] { outline-color: white; }

@keyframes story-enter { from { transform: translateX(32px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.story-drawer[open] { animation: story-enter 220ms ease-out; }
:root[data-motion="reduced"] .story-drawer { animation: none; }
@media (prefers-reduced-motion: reduce) { .story-drawer { animation: none; } }

/* The dressing room: the mirror (web/mirror.js) and the angler controls beside one
   compact wardrobe. On a phone the mirror stays at the top while the wardrobe scrolls. */
.wardrobe-layout { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); grid-template-areas: "mirror look" "player look" "prizes prizes"; gap: 22px 28px; align-items: start; }
.wardrobe-layout > .look-prizes { grid-area: prizes; }
.wardrobe-layout[data-setup-active] { grid-template-areas: "mirror editor"; }
.wardrobe-layout[data-setup-active] > [data-setup-part] { grid-area: editor; }
[data-setup-nav] { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.wardrobe-mirror { grid-area: mirror; margin: 0; padding: 0 12px 6px; overflow: hidden; border-radius: 14px; background: #d7eaf2; box-shadow: inset 0 0 0 1px #8fd3ff38; text-align: center; }
.mirror-stage { position: relative; margin: 0 -12px; padding-top: 14px; background: linear-gradient(#173a55 0 64%, #d7eaf2 64% 100%); }
.mirror-stage::before { content: ""; position: absolute; left: 50%; bottom: 2px; width: min(62%, 240px); height: 22px; transform: translateX(-50%); border-radius: 50%; background: #9fc6d8; }
.wardrobe-mirror canvas { position: relative; display: block; height: 340px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; touch-action: pan-y; cursor: grab; }
.wardrobe-mirror canvas:active { cursor: grabbing; }
.wardrobe-mirror figcaption { color: #0f2a3d; font-weight: 650; font-size: 14px; margin-top: 4px; }
.mirror-turn { display: flex; align-items: center; gap: 10px; min-height: 44px; color: #0f2a3d; font-size: 13px; font-weight: 600; }
.mirror-turn input { flex: 1; min-width: 0; accent-color: #1f6f8b; }
.wardrobe-player { grid-area: player; }
.wardrobe-layout .look-settings { grid-area: look; }
.kit-prize { width: 128px; height: auto; min-height: 104px; padding: 8px 6px; text-align: center; }
.kit-prize span { font-weight: 650; font-size: 13px; }
.kit-prize small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.kit-prize[data-locked] { opacity: .6; border-style: dashed; cursor: not-allowed; }
.kit-prize[data-locked] input { cursor: not-allowed; }
.look-prizes .button { margin-top: 10px; }
.wardrobe-player .setup-field:first-child { margin-top: 0; }
.wardrobe-layout .look-settings { max-width: none; margin: 0; min-width: 0; }
.kit-categories { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kit-category { min-height: 44px; padding: 8px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; }
.kit-category[aria-selected="true"] { background: #29474f; color: var(--text); border-color: #4b7179; }
.kit-category:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
.look-settings .kit-inventory[role="tabpanel"], .look-settings .look-features { min-height: 100px; align-content: flex-start; margin: 10px 0 0; }
@media (max-width: 760px) {
  .wardrobe-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mirror" "player" "look" "prizes"; gap: 20px; }
  .wardrobe-layout[data-setup-active] { grid-template-areas: "mirror" "editor"; }
  .wardrobe-mirror { position: sticky; top: 0; z-index: 2; padding: 0 10px 2px; box-shadow: inset 0 0 0 1px #8fd3ff38, 0 10px 24px #0008; }
  .mirror-stage { margin: 0 -10px; padding-top: 8px; }
  .wardrobe-mirror canvas { height: 230px; }
  .wardrobe-mirror figcaption { display: none; }
  .kit-category { padding-inline: 8px; }
  .kit-prize { width: calc(50% - 4px); }
}
.art-review-image { display: block; width: 100%; height: auto; margin: 1rem 0; }
[data-art-review] { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.art-review-view { width: 100%; min-width: 0; max-height: 680px; overflow: auto; }
.art-review-image.expanded { width: auto; max-width: none; }
.art-review-card { min-width: 0; border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }


/* A touch-first alternative to SDL's held-finger gesture. Keep this in the playable
   board, not behind keyboard-only controls below the match (iOS Safari included). */
.tap-controls {
  order: 3;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #5b9d9a;
  border-radius: 10px;
  background: #16343d;
  color: #eaf7f4;
  text-align: left;
}
.tap-controls > strong { font-size: 15px; }
.tap-controls p { margin: 0; color: #cadbd9; font-size: 13px; line-height: 1.4; }
.tap-controls label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.tap-controls select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #649a9b;
  border-radius: 8px;
  background: #0b2633;
  color: #f2fbfb;
  font: inherit;
}
.tap-controls input[type="range"] { width: 100%; min-height: 44px; accent-color: #a4ffe7; }
.tap-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.tap-actions .button { min-height: 44px; }
/* Wide iPads still need touch controls; hide only on fine-pointer desktops. */
@media (min-width: 961px) and (hover: hover) and (pointer: fine) {
  .tap-controls { display: none !important; }
}
/* On a phone the board comes first under the scores, so text that grows while aiming
   (the status and the strike preview) pushes only what is below it, never the board
   under a finger. Every child has a place; anything new goes last. */
@media (max-width: 960px) {
  .game-host > * { order: 20; }
  .game-host .player-positions { order: 0; }
  .game-host .result-card, .game-host .game-empty, .game-host [data-game-start] { order: 1; }
  .game-host [data-game-canvas] { order: 2; }
  .game-host .replay-controls { order: 3; }
  .game-host .play-feedback { order: 4; }
  .game-host .tap-controls { order: 5; }
  .game-host .chatter { order: 6; }
  .game-host .round-recap { order: 7; }
  .game-host .online-status { order: 8; }
  .game-host .online-status[data-searching="1"] { order: 1; }
}
