:root {
  --p-bg: #0f0f0f; --p-surface: #1a1a1a; --p-ink: #ffffff; --p-muted: #8f8f8f;
  --p-accent: #dafa9c; --p-accent-ink: #0f0f0f; --p-action: #dafa9c; --p-action-ink: #0f0f0f;
  --p-inv-bg: #ffffff; --p-inv-surface: #ececec; --p-inv-ink: #0f0f0f; --p-inv-muted: #5f5f5f;
  --p-inv-accent: #0f0f0f; --p-inv-accent-ink: #ffffff; --p-inv-action: #0f0f0f; --p-inv-action-ink: #ffffff;
  --font-display: "Gabarito", system-ui, sans-serif;
  --font-text: "Figtree", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400; --display-tracking: -0.03em; --display-tracking-xl: -0.04em; --ly-scale: 0.98;
  --court-black: #101412;
  --paper: #f4f5f1;
  --paper-ink: #151b17;
  --hair-dark: #343c35;
  --hair-light: #cfd3ca;
  --zh: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
html {
  --nav: 64px;
  --gut: clamp(24px, 5.6vw, 88px);
  --container: 1360px;
  --padt: clamp(86px, 12svh, 126px);
  --padb: clamp(32px, 6svh, 66px);
}
body { background: var(--court-black); color: #f8faf6; font-family: var(--zh); -webkit-font-smoothing: antialiased; }
button, input, h1, h2, h3, .btn, .nav__logo { font-family: var(--zh); }
a:focus-visible, button:focus-visible, input:focus-visible, main:focus-visible { outline: 3px solid #168d66; outline-offset: 3px; }
main:focus-visible { outline-offset: -3px; }
main > section { scroll-margin-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.masthead {
  --bg: var(--court-black); --ink: #f7faf5; --muted: #c2c8c0;
  background: rgb(16 20 18 / 96%); color: var(--ink);
  border-bottom: 1px solid #343a35; backdrop-filter: blur(14px);
}
.masthead .nav__bar { justify-content: space-between; gap: 16px; }
.masthead .brand { gap: 6px; min-height: 44px; color: #fff; font-size: 20px; font-weight: 680; letter-spacing: -.055em; }
.masthead .brand img { width: 30px; height: 30px; }
.masthead .page-links { position: static; display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: clamp(10px, 2.5vw, 38px); width: auto; height: auto; padding: 0; background: none; visibility: visible; opacity: 1; }
.masthead .page-links a { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; width: auto; padding: 0 4px; color: #bdc4bd; font-size: 14px; font-weight: 520; letter-spacing: .035em; }
.masthead .page-links a[aria-current], .masthead .page-links a:hover { color: #fff; }
.masthead .page-links a::before { left: 5px; right: 5px; bottom: 3px; height: 1px; background: var(--p-accent); }
.masthead .page-links a[aria-current]::before { transform: scaleX(1); }
.masthead .skip-link:focus { color: #101412; background: var(--p-accent); }

main > .game-hero {
  --photo: 0px; --hgap: clamp(32px, 5.4svh, 66px); --hpadb: clamp(24px, 4.9svh, 54px);
  padding: calc(var(--nav) + var(--hgap)) 0 var(--hpadb);
  background: var(--court-black); color: #f8faf6;
}
main > section.game-hero > .wrap:not(.grid) { display: block; height: 100%; }
.game-hero > .wrap > .hero-text { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); justify-content: stretch; gap: clamp(28px, 4.3svh, 48px); }
.hero-head, .court-head, .court-browser, .local-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.hero-head, .court-head { align-items: start; }
.hero-head, .hero-identity { min-width: 0; }
.hero-identity, .court-head h2, .court-list, .local-details { grid-column: 1 / span 5; }
.hero-intro, .court-head p, .court-stage, .room-stage { grid-column: 6 / -1; }
.game-hero h1 { margin: 0; max-width: none; font-weight: 680; line-height: 1.08; letter-spacing: -.06em; }
.genre { display: flex; align-items: center; gap: 11px; margin: 0 0 clamp(12px, 1.9svh, 21px); color: var(--p-accent); font-size: clamp(14px, 1.05vw, 17px); line-height: 1.3; font-weight: 550; letter-spacing: .04em; }
.genre::before { content: ""; width: 27px; height: 2px; background: currentColor; }
.game-name { display: block; overflow-wrap: anywhere; font-size: clamp(66px, 6.8vw, 108px); letter-spacing: -.06em; }
.game-hero .hero-intro { width: 100%; padding: 0; background: none; }
.game-hero .hero__lead { max-width: 33rem; margin: 0; font: 460 clamp(16px, 1.26vw, 21px)/1.68 var(--zh); color: #d4dad2; text-wrap: pretty; }
.hero-intro .download-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: clamp(14px, 2.1svh, 26px); }
.download.btn { min-height: 48px; height: auto; padding: 13px 21px; gap: 9px; border: 0; border-radius: 999px; background: var(--p-action); color: #12200b; font-size: 16px; font-weight: 650; line-height: 1.3; white-space: nowrap; }
html[data-buttons] a.download::after { content: none; }
.download svg, .view-match svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.download.btn:hover { background: #e6ffb3; }
.package { display: grid; gap: 3px; color: #b9c2b7; font: 400 12px/1.4 var(--font-mono); letter-spacing: .015em; }
.match-stage { position: relative; overflow: hidden; min-height: 0; border-radius: 16px; background: #171e25; isolation: isolate; }
.match-stage picture, .match-stage img { display: block; width: 100%; height: 100%; }
.match-stage img { object-fit: cover; object-position: 50% 0%; }
.view-match {
  position: absolute; right: 18px; bottom: 18px; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border: 1px solid #788079; border-radius: 999px; background: #111914; color: white;
  font: 540 13px/1.3 var(--zh); transition: background .18s ease, transform .18s ease;
}
.view-match:hover { background: #273329; transform: translateY(-2px); }
.view-match:active { transform: translateY(1px); }

.courts { --bg: var(--paper); --ink: var(--paper-ink); --muted: #556152; background: var(--paper); color: var(--paper-ink); }
:is(.courts, .local-play) h2 { margin: 0; font: 650 clamp(39px, 4.15vw, 68px)/1.13 var(--zh); letter-spacing: -.055em; }
main > section .section-head { max-width: none; margin: 0; }
.court-head p, .local-head p { max-width: 32em; margin: 0; font: 450 clamp(16px, 1.15vw, 19px)/1.68 var(--zh); color: #4c584e; }
.court-browser {
  flex: 1 1 auto; min-height: 0; min-width: 0; align-items: stretch;
  margin: clamp(24px, 4.8svh, 52px) 0 0; padding: 0; border: 0;
}
.court-list { display: flex; flex-direction: column; min-width: 0; }
.court-option { flex: 1; display: flex; position: relative; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: clamp(8px, 1.4svh, 17px) 0; border-bottom: 1px solid var(--hair-light); cursor: pointer; }
.court-option:first-child { border-top: 1px solid var(--hair-light); }
.court-option input { order: 2; flex: none; width: 24px; height: 24px; margin: 0; border-radius: 50%; accent-color: #25422d; cursor: pointer; }
.court-option input:focus-visible { outline: 3px solid #00634a; outline-offset: 3px; }
.court-option > span { display: grid; gap: 3px; }
.court-option strong { color: #39443b; font: 570 clamp(16px, 1.35vw, 22px)/1.3 var(--zh); letter-spacing: -.025em; }
.court-option small { color: #505b51; font-size: 13px; line-height: 1.35; }
.court-option:has(:checked) strong { color: #132416; font-weight: 715; }
.court-option:hover strong { color: #183f22; }
.court-stage { position: relative; min-height: 0; overflow: hidden; border-radius: 16px; background: #202621; }
.court-stage img { display: none; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.court-browser:has([value="england"]:checked) [data-court="england"],
.court-browser:has([value="malaysia"]:checked) [data-court="malaysia"],
.court-browser:has([value="worlds"]:checked) [data-court="worlds"],
.court-browser:has([value="arctic"]:checked) [data-court="arctic"],
.court-browser:has([value="beijing"]:checked) [data-court="beijing"] { display: block; }
.strokes { margin-top: clamp(16px, 2.8svh, 32px); color: #47554b; }
.strokes.is-live .mo-mq__rail { width: calc(100% - 60px); padding-right: 0; }
.strokes.is-paused .mo-mq__rail { display: block; overflow: visible; mask: none; }
.strokes.is-paused .mo-mq__track:not(.mo-mq__clone) { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; width: 100%; animation: none; }
.strokes.is-paused .mo-mq__clone { display: none; }
.strokes.is-live.is-on:not(.is-paused):hover .mo-mq__track { animation-play-state: running; }
.strokes .mo-mq__track { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 27px; margin: 0; padding: 0; list-style: none; }
.strokes.is-live .mo-mq__track { flex-wrap: nowrap; gap: var(--mo-gap); }
.strokes .mo-mq__track li { display: inline-flex; align-items: center; gap: 12px; color: #48594c; font: 510 15px/1.5 var(--zh); }
.strokes .mo-mq__track li::before { content: ""; width: 13px; height: 1px; background: #889987; }
.strokes.is-paused li::before { display: none; }
.strokes:not(.mo-mq) { padding-block: 12px; }
.strokes .loop-pause { width: 44px; height: 44px; right: 0; background: var(--paper); border: 1px solid var(--hair-light); color: #27372b; }

.local-play { background: #162019; color: #f5f8f3; }
.local-head { display: block; }
.local-head p { margin-top: 12px; color: #bfcbbe; }
.local-layout { flex: 1 1 auto; min-height: 0; align-items: start; align-content: center; row-gap: 24px; }
.room-stage { min-width: 0; padding: 6px; border: 1px solid #636b62; border-radius: 22px; background: #111612; box-shadow: 0 15px 50px #0003; }
.room-stage img { display: block; width: 100%; height: auto; border-radius: 16px; }
.room-steps { list-style: none; counter-reset: room-step; margin: 0; padding: 0; }
.room-steps li { position: relative; counter-increment: room-step; padding: clamp(10px, 2svh, 20px) 22px clamp(10px, 2svh, 20px) 0; border-top: 1px solid #3a483e; }
.room-steps li::after { content: counter(room-step, decimal-leading-zero); position: absolute; top: clamp(14px, 2.5svh, 26px); right: 0; color: #c2df99; font: 500 13px/1.1 var(--font-mono); }
.room-steps strong { color: #f8faf5; font-size: clamp(17px, 1.45vw, 23px); font-weight: 620; letter-spacing: -.025em; }
.room-steps p { margin: 5px 0 0; color: #bec9bd; font-size: clamp(15px, 1.08vw, 17px); line-height: 1.6; }
.local-details .download { margin-top: clamp(12px, 2.3svh, 26px); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; color: #bac4b9; font-size: 13px; }
.site-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.site-footer a:hover { color: var(--p-accent); text-decoration: underline; text-underline-offset: 4px; }

#match-preview { position: fixed; inset: 0; width: min(1080px, calc(100% - 40px)); max-height: 92dvh; margin: auto; padding: 12px; overflow: auto; border: 1px solid #485449; border-radius: 18px; background: #131a16; color: white; box-shadow: 0 20px 80px #0008; }
#match-preview:not([open]) { display: none; }
#match-preview::backdrop { background: rgb(5 8 6 / 85%); }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 4px 10px; }
.preview-head h2 { margin: 0; font: 600 17px/1.5 var(--zh); letter-spacing: 0; }
.preview-controls { margin: 0 4px 12px; color: #c6d0c5; font-size: 14px; line-height: 1.65; }
.preview-head button { min-width: 53px; min-height: 44px; padding: 0 13px; border: 1px solid #647062; border-radius: 999px; background: transparent; color: white; font-size: 14px; cursor: pointer; }
.preview-head button:hover { background: #354336; }
#match-preview img { display: block; width: 100%; height: auto; border-radius: 8px; }
html:has(#match-preview[open]) { overflow: hidden; }

@media (min-width: 640px) and (max-width: 1023px) {
  html { --gut: clamp(32px, 5.5vw, 56px); }
  .game-name { font-size: clamp(60px, 8.45vw, 82px); }
  .court-head { display: block; }
  .court-head p { margin-top: 12px; }
  .court-browser { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 20px; }
  .court-list, .court-stage, .local-details, .room-stage { grid-column: auto; }
  .court-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
  .court-option, .court-option:first-child { align-items: flex-start; min-height: 60px; padding: 10px 0; border-top: 0; border-bottom: 2px solid var(--hair-light); }
  .court-option:has(:checked) { border-color: #294832; }
  .court-option input { width: 15px; height: 15px; }
  .court-option strong { font-size: 15px; }
  .local-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: space-evenly; gap: 24px; margin-top: 26px; }
  .room-stage { justify-self: center; width: min(100%, 760px); }
  .room-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
  .room-steps li { padding-top: 16px; }
}
@media (max-width: 639px) {
  html { --gut: clamp(18px, 5.5vw, 28px); --nav: 56px; --padt: 78px; --padb: 28px; }
  .masthead .brand { font-size: 17px; }
  .masthead .brand img { width: 25px; height: 25px; }
  .masthead .page-links { gap: 2px; }
  .masthead .page-links a { font-size: 13px; }
  main > section.game-hero:has(> .wrap) { height: max(100svh, 635px); min-height: 100svh; grid-template-rows: minmax(0,1fr); padding-top: calc(var(--nav) + clamp(22px, 5svh, 44px)); padding-bottom: 24px; }
  .game-hero > .wrap > .hero-text { gap: clamp(20px, 3.5svh, 30px); }
  .hero-head { display: block; }
  .genre { margin-bottom: 10px; font-size: 13px; }
  .game-name { font-size: clamp(54px, 13.5vw, 72px); }
  .game-hero .hero-intro { margin-top: 17px; }
  .game-hero .hero__lead { color: #d4dad2; font-size: 16px; line-height: 1.65; }
  .hero-intro .download-row { display: grid; gap: 8px; margin-top: 18px; }
  .download.btn { width: 100%; min-height: 46px; padding-block: 12px; }
  .package { display: flex; gap: 12px; font-size: 11px; }
  .match-stage, .court-stage { border-radius: 12px; }
  .match-stage picture { position: absolute; inset: 0; }
  .match-stage img { object-position: 62% 0%; }
  .view-match { right: 10px; bottom: 10px; min-height: 44px; padding-inline: 12px; font-size: 12px; }
  :is(.courts,.local-play) h2 { font-size: clamp(33px, 8.4vw, 45px); }
  .court-head { display: block; }
  .court-head p, .local-head p { margin-top: 10px; font-size: 15px; line-height: 1.6; }
  .court-browser { display: flex; flex-direction: column; min-width: 0; gap: 15px; margin-top: 18px; }
  .court-list { display: grid; flex: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 16px; }
  .court-option, .court-option:first-child { border: 0; border-bottom: 1px solid var(--hair-light); border-radius: 0; padding: 6px 0; min-height: 44px; gap: 0; }
  .court-option:has(:checked) { border-bottom: 2px solid #294832; }
  .court-option:has(:checked) strong { color: #1c3824; }
  .court-option strong { font-size: 14px; font-weight: 560; }
  .court-option small { display: none; }
  .court-option input { width: 16px; height: 16px; }
  .court-stage { min-height: 200px; flex: 1 0 auto; }
  .court-stage img { position: absolute; inset: 0; object-position: 52% 57%; }
  .strokes { margin-top: 16px; padding-block: 10px; }
  .strokes.is-live .mo-mq__rail { display: block; width: 100%; overflow: visible; mask: none; }
  .strokes.is-live .mo-mq__track:not(.mo-mq__clone) { display: flex; flex-wrap: wrap; gap: 5px 12px; animation: none; }
  .strokes.is-live .loop-pause, .strokes.is-live .mo-mq__clone { display: none; }
  .strokes .mo-mq__track { gap: 5px 12px; }
  .strokes .mo-mq__track li { gap: 6px; font-size: 12px; }
  .strokes .mo-mq__track li::before { width: 7px; }
  .local-layout { display: flex; flex-direction: column; justify-content: space-evenly; align-items: stretch; gap: 20px; margin-top: 20px; }
  .room-stage { padding: 4px; border-radius: 13px; }
  .room-stage img { border-radius: 9px; }
  .room-steps li { padding: 10px 22px 10px 0; }
  .room-steps li::after { top: 16px; font-size: 11px; }
  .room-steps strong { font-size: 17px; }
  .room-steps p { margin-top: 3px; font-size: 14px; }
  #match-preview { width: calc(100% - 16px); padding: 8px; border-radius: 13px; }
}
@media (max-height: 600px) and (min-width: 640px) {
  html { --nav: 48px; --padt: 56px; --padb: 20px; }
  main > .game-hero { --hgap: 14px; --hpadb: 15px; }
  .game-hero > .wrap > .hero-text { gap: 15px; }
  .game-name { font-size: clamp(46px, 6vw, 70px); }
  .genre { margin-bottom: 6px; }
  .game-hero .hero__lead { font-size: 14px; }
  .hero-intro .download-row { margin-top: 8px; }
  .court-browser { margin-top: 14px; }
  .court-option { padding-block: 4px; }
  .room-steps li { padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strokes.is-live .mo-mq__rail { width: 100%; }
}
