:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #183d34;
  background: #f6f1e7;
  font-synthesis: none;
  --paper: #f6f1e7;
  --ink: #183d34;
  --court: #184e42;
  --player: #efa866;
  --cpu: #84c3ad;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 24px; min-width: 320px; min-height: 100svh; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a, canvas, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b95224; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
button, input, .game-column, .playbook, .dialog-content { min-width: 0; }
.app { max-width: 1040px; margin: 0 auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-8deg); }
.brand-mark i { background: var(--court); border-radius: 2px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--player); }
.eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .17em; line-height: 1.5; }
h1 { font-size: 22px; letter-spacing: -.06em; line-height: 1.3; }
.match-label { font-size: 10px; letter-spacing: .11em; font-weight: 700; text-align: right; }
.match-label span { display: block; font-size: 15px; letter-spacing: .03em; margin-top: 2px; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 64px; align-items: center; }
.game-column { width: min(100%, 560px, calc((100svh - 264px) * .78947368)); justify-self: center; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin-bottom: 10px; min-height: 54px; }
.score { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 5px; justify-content: start; }
.score-label { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 750; margin-bottom: 1px; }
.score strong { font-size: 28px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.score-unit { font-size: 10px; }
.score-cpu { justify-content: end; }
.score-cpu .score-label { justify-content: end; }
.owner-mark { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; border: 1.5px solid var(--ink); background: var(--player); vertical-align: middle; }
.player-mark { border-radius: 50%; }
.cpu-mark { background: var(--cpu); transform: rotate(45deg); border-radius: 1px; margin-inline: 1px; }
.clock { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 7px 15px 8px; border: 1px solid #bbc5b8; border-radius: 12px; }
.clock span { font-size: 10px; }
.clock strong { font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.court-frame { position: relative; isolation: isolate; width: 100%; aspect-ratio: 600 / 760; border-radius: 16px; box-shadow: 0 7px 0 #d9decf, 0 15px 35px #183d3412; background: var(--court); }
#court { width: 100%; height: 100%; display: block; border-radius: inherit; touch-action: none; user-select: none; -webkit-user-select: none; }
.state-panel { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(350px, calc(100% - 32px)); padding: 25px; text-align: center; border: 1px solid #fff8; border-radius: 18px; background: #faf7ee; box-shadow: 0 12px 50px #052c2a66; }
.panel-kicker { display: inline-block; font-size: 11px; line-height: 1.3; letter-spacing: .07em; font-weight: 800; padding-bottom: 13px; }
.state-panel h2 { font-size: clamp(22px, 2.4vw, 29px); line-height: 1.4; letter-spacing: -.06em; }
.rule-flow { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 800; margin-top: 16px; }
.rule-flow b { font-size: 11px; font-weight: 500; }
.panel-copy { font-size: 12px; line-height: 1.8; margin-top: 10px; }
.intro-controls { font-size: 12px; line-height: 1.7; margin: 17px 0; font-weight: 650; }
.intro-controls span { font-size: 11px; font-weight: 500; }
kbd { display: inline-flex; min-width: 19px; height: 21px; align-items: center; justify-content: center; border: 1px solid #b5c1b3; border-bottom-width: 2px; border-radius: 4px; padding: 0 3px; font-family: inherit; font-size: 11px; line-height: 1; }
.button { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--ink); border-radius: 10px; font-size: 14px; font-weight: 750; line-height: 1.4; }
.button-primary { background: var(--ink); color: #fffaf0; }
.button-primary:hover { background: #26594a; }
.button-primary span { font-size: 19px; }
.button-secondary { background: transparent; margin-top: 9px; }
.button-secondary:hover { background: #e9ecdf; }
.panel-footnote { font-size: 10px; margin-top: 10px; }
.pause-panel .button { margin-top: 21px; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; color: #fffaf0; font-size: clamp(44px, 7vw, 78px); font-weight: 850; letter-spacing: -.04em; text-shadow: 0 4px 0 #183d34, 0 0 35px #183d34; background: #183d343d; border-radius: inherit; pointer-events: none; }
.result-scores { display: flex; justify-content: center; gap: 23px; margin: 22px 0; align-items: center; }
.result-scores > div { display: grid; justify-items: center; gap: 3px; }
.result-scores div > span { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.result-scores strong { font-size: 45px; line-height: 1.15; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.result-scores small { font-size: 10px; }
.result-separator { font-size: 26px; font-weight: 300; }
.feedback { min-height: 21px; margin: 14px 0 5px; font-size: 11px; font-weight: 600; line-height: 1.6; text-align: center; overflow-wrap: anywhere; }
.game-controls { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; }
.control-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; border: 1px solid #9eafa1; border-radius: 9px; background: transparent; font-size: 12px; font-weight: 650; padding: 8px 5px; white-space: nowrap; }
.control-button:hover { background: #e8ecdf; border-color: var(--ink); }
.control-button > span { font-size: 18px; line-height: 1; }
.pause-icon { display: block; width: 11px; height: 13px; border-inline: 3px solid currentColor; }
.help-icon { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1.3px solid currentColor; border-radius: 50%; font-size: 11px !important; }
.playbook { padding: 12px 0; }
.playbook h2 { font-size: 34px; letter-spacing: -.065em; line-height: 1.45; margin-top: 14px; }
.playbook-lead { font-size: 13px; line-height: 1.9; margin-top: 15px; }
.rule-list { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 21px; }
.rule-list li { display: flex; gap: 15px; align-items: start; }
.step-number { color: #547362; font-size: 11px; letter-spacing: .05em; font-weight: 750; padding-top: 3px; }
.rule-list h3 { font-size: 15px; margin-bottom: 5px; }
.rule-list p { font-size: 12px; line-height: 1.8; }
.shot-guide { border-top: 1px solid #c5cdbd; border-bottom: 1px solid #c5cdbd; padding: 19px 0 16px; }
.shot-guide h3 { font-size: 12px; margin-bottom: 14px; }
.paddle-guide { display: flex; width: 88%; margin: 0 auto 7px; background: var(--ink); color: var(--paper); border-radius: 10px; }
.paddle-guide span { flex: 1; text-align: center; padding: 6px 0; font-size: 19px; }
.paddle-guide span + span { border-left: 1px solid #f6f1e733; }
.shot-labels { display: flex; text-align: center; font-size: 10px; }
.shot-labels span { flex: 1; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 11px; margin-top: 21px; }
.legend > span { display: inline-flex; gap: 6px; align-items: center; }
.legend .landing-key { flex-basis: 100%; font-size: 10px; }
.keyboard-note { margin-top: 14px; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.unsupported { margin-top: 18px; padding: 16px; background: #fff8; border: 2px solid var(--ink); border-radius: 10px; }
.unsupported h2 { font-size: 16px; }
.unsupported p { font-size: 13px; line-height: 1.8; margin-top: 8px; }
dialog { width: min(480px, calc(100% - 28px)); max-width: none; max-height: calc(100svh - 28px); margin: auto; padding: 0; overflow: auto; border: 1px solid #ffffff80; border-radius: 20px; background: #faf7ee; color: var(--ink); box-shadow: 0 20px 80px #052c2a66; }
dialog::backdrop { background: #0d302bcc; }
.dialog-content { padding: 26px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.dialog-header h2 { font-size: 23px; letter-spacing: -.05em; line-height: 1.4; margin-top: 5px; }
.close-button { min-width: 44px; min-height: 44px; margin: -7px -9px 0 0; display: inline-grid; place-items: center; border: 1px solid #aebdac; border-radius: 50%; background: transparent; font-size: 26px; font-weight: 300; line-height: 1; }
.close-button:hover { background: #e8ecdf; }
.dialog-lead { font-size: 14px; line-height: 1.8; font-weight: 650; margin: 20px 0 12px; }
.help-rules { list-style: none; display: grid; gap: 18px; padding: 0; margin: 23px 0; counter-reset: help-step; }
.help-rules li { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; }
.help-rules li::before { counter-increment: help-step; content: "0" counter(help-step); font-size: 10px; font-weight: 750; padding-top: 3px; }
.help-rules strong { font-size: 14px; }
.help-rules li > span { grid-column: 2; font-size: 12px; line-height: 1.8; margin-top: 4px; }
.help-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.help-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dialog-note { font-size: 12px; line-height: 1.85; }
.dialog-note + .dialog-note { margin-top: 12px; }
#share { min-width: 0; max-width: 100%; }
#share .share { min-width: 0; }
.manual-copy { margin-top: 20px; }
.manual-copy label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.manual-copy input { display: block; width: 100%; min-height: 44px; border: 1px solid #7e9684; border-radius: 8px; color: var(--ink); background: #fffdf5; font-size: 13px; padding: 10px; }
.manual-copy p { font-size: 11px; line-height: 1.7; margin-top: 8px; }
@media (min-width: 1100px) { .app { padding-top: 8px; } .play-layout { gap: 80px; } }
@media (max-width: 799px) {
  body { padding: 12px 16px; }
  .app { max-width: 560px; }
  .app-header { margin-bottom: 10px; min-height: 38px; }
  .brand { gap: 9px; }
  .brand-mark { width: 28px; height: 28px; gap: 3px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 19px; }
  .match-label { font-size: 8px; }
  .match-label span { font-size: 12px; }
  .play-layout { display: block; }
  .game-column { width: min(100%, 560px, calc((100svh - 218px) * .78947368)); margin-inline: auto; }
  .scoreboard { min-height: 49px; margin-bottom: 8px; gap: 12px; }
  .score strong, .clock strong { font-size: 27px; }
  .clock { border-radius: 10px; padding: 7px 12px; }
  .court-frame { border-radius: 13px; }
  .state-panel { padding: 20px; border-radius: 16px; width: min(340px, calc(100% - 28px)); }
  .state-panel h2 { font-size: 25px; }
  .panel-kicker { padding-bottom: 10px; font-size: 10px; }
  .rule-flow { margin-top: 13px; font-size: 12px; }
  .panel-copy { font-size: 11px; }
  .intro-controls { margin: 13px 0; font-size: 11px; }
  .panel-footnote { font-size: 9px; }
  .feedback { margin-top: 13px; margin-bottom: 5px; font-size: 10px; min-height: 19px; }
  .playbook { display: none; }
  .dialog-content { padding: 23px; }
  .dialog-header .eyebrow { font-size: 9px; }
  .dialog-header h2 { font-size: 21px; }
}
@media (max-height: 700px) and (max-width: 799px) {
  body { padding: 10px 12px; }
  .app-header { margin-bottom: 7px; }
  .game-column { width: min(100%, calc((100svh - 207px) * .78947368)); }
  .scoreboard { min-height: 47px; margin-bottom: 6px; }
  .state-panel { padding: 18px; }
  .state-panel h2 { font-size: 23px; }
  .intro-controls { margin: 11px 0; }
  .rule-flow { margin-top: 11px; }
  .feedback { margin-top: 12px; min-height: 16px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  body { padding: 8px 12px; }
  .app { max-width: 980px; padding-top: 0; }
  .app-header { min-height: 32px; margin-bottom: 6px; }
  .brand { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .eyebrow, .match-label { font-size: 8px; }
  h1 { font-size: 16px; }
  .match-label span { font-size: 12px; }
  .play-layout { display: block; }
  .playbook { display: none; }
  .game-column { --landscape-court: calc((100svh - 62px) * .78947368); position: relative; display: grid; grid-template-columns: var(--landscape-court) minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) auto 44px; gap: 6px 20px; width: 100%; height: calc(100svh - 62px); margin: 0; }
  .court-frame { display: contents; }
  #court { grid-column: 1; grid-row: 1 / -1; width: 100%; height: 100%; border-radius: 12px; background: var(--court); box-shadow: 0 5px 0 #d9decf; }
  .scoreboard { grid-column: 2; grid-row: 1; min-height: 44px; margin: 0; gap: 12px; }
  .score strong, .clock strong { font-size: 25px; }
  .score-label { font-size: 10px; }
  .clock { padding: 6px 12px; }
  .state-panel { position: static; grid-column: 2; grid-row: 2; align-self: center; transform: none; width: 100%; max-height: 100%; overflow: auto; padding: 8px 12px; border-radius: 12px; }
  .state-panel h2 { font-size: 22px; }
  .panel-kicker { font-size: 10px; padding-bottom: 5px; }
  .panel-copy { font-size: 11px; }
  .state-panel .button { min-height: 44px; padding: 8px; font-size: 12px; gap: 7px; }
  .button-primary span { font-size: 16px; }
  .intro-panel { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 4px 10px; }
  .intro-panel h2 { display: none; }
  .intro-panel .panel-kicker, .intro-panel .rule-flow, .intro-panel .button, .intro-panel .panel-footnote { grid-column: 1 / -1; margin: 0; padding-bottom: 0; }
  .intro-panel .rule-flow { font-size: 12px; }
  .intro-panel .panel-copy { margin: 0; line-height: 1.55; }
  .intro-panel .intro-controls { margin: 0; font-size: 11px; line-height: 1.6; }
  .intro-panel .panel-footnote { font-size: 9px; line-height: 1.4; }
  .pause-panel .button { margin-top: 8px; }
  .result-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
  .result-panel .panel-kicker, .result-panel .panel-copy { display: none; }
  .result-panel h2, .result-panel .result-scores { grid-column: 1 / -1; }
  .result-scores { margin: 3px 0 5px; }
  .result-scores > div { gap: 2px; }
  .result-scores div > span { font-size: 11px; line-height: 1.3; }
  .result-scores strong { font-size: 30px; line-height: 1.05; }
  .result-scores small { font-size: 9px; line-height: 1.3; }
  .result-panel .button-secondary { margin: 0; }
  .countdown { inset: 0 auto 0 0; width: var(--landscape-court); border-radius: 12px; font-size: 44px; }
  .feedback { grid-column: 2; grid-row: 3; min-height: 16px; margin: 0; font-size: 10px; }
  .game-controls { grid-column: 2; grid-row: 4; }
  .unsupported { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
