/* Santas on Monroe Street — game page only (SANTAS-GAME-001). */
:root {
  --sg-night: #0f1733;
  --sg-deep: #0a0f24;
  --sg-ink: #15131f;
  --sg-snow: #f4f6fb;
  --sg-snow-2: #c3cee6;
  --sg-red: #d8343a;
  --sg-red-dark: #962230;
  --sg-gold: #ffd447;
  --sg-gold-dark: #d39a2a;
  --sg-font: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--sg-deep);
  color: var(--sg-snow);
  font-family: var(--sg-font);
}
html.sg-playing, html.sg-playing body { overflow: hidden; overscroll-behavior: none; }

.sg-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sg-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 960px;
  margin: 0 auto;
}

.sg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  font-size: 13px;
  flex: none;
}
.sg-brand { display: grid; gap: 3px; min-width: 0; }
.sg-masthead { margin: 0; color: var(--sg-snow); font-weight: 700; }
.sg-home {
  justify-self: start;
  color: var(--sg-gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.sg-nav { display: flex; gap: 14px; }
.sg-nav a { color: var(--sg-snow-2); text-decoration: none; white-space: nowrap; }
.sg-nav a:hover { text-decoration: underline; }
.sg-home:focus-visible, .sg-nav a:focus-visible, .sg-story-link:focus-visible { outline: 3px solid var(--sg-gold); outline-offset: 3px; }

.sg-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sg-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  padding: 0 16px 8px;
  flex: none;
}
.sg-tool {
  font: 700 13px/1 var(--sg-font);
  color: var(--sg-snow);
  background: var(--sg-night);
  border: 2px solid var(--sg-snow-2);
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  touch-action: manipulation;
}
.sg-tool:disabled { opacity: 0.45; cursor: default; }
.sg-tool[aria-pressed="true"] { border-color: var(--sg-red); color: var(--sg-snow-2); }

/* The 198x150 canvas scales to fit, keeping its pixels square and crisp. */
.sg-stage {
  position: relative;
  width: min(100%, calc((100dvh - 190px) * 1.32));
  aspect-ratio: 33 / 25;
  flex: none;
  background: var(--sg-night);
  touch-action: none;
}
@supports not (height: 100dvh) {
  .sg-stage { width: min(100%, calc((100vh - 190px) * 1.32)); }
}
.sg-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.sg-yard-signs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: inline-size;
}
.sg-yard-sign {
  position: absolute;
  top: 63%;
  width: max(13.5%, 76px);
  transform: translateX(-50%);
}
.sg-yard-sign[hidden] { display: none; }
.sg-yard-sign::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 18%;
  right: 18%;
  height: max(0.7cqw, 5px);
  border-inline: max(0.23cqw, 1px) solid #54483a;
}
.sg-tree-house-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: max(0.55cqw, 3px);
  padding: max(0.35cqw, 3px);
  border: max(0.2cqw, 1px) solid #27231f;
  background: #fffdf7;
  color: #201d1b;
  text-align: center;
}
.sg-tree-house-sign img {
  width: 16%;
  mix-blend-mode: multiply;
}
.sg-tree-house-sign strong { display: block; font: 600 max(1.55cqw, 8px)/1 Georgia, serif; }
.sg-tree-house-sign small {
  display: block;
  margin-top: 2px;
  font: 700 max(0.76cqw, 5px)/1 Arial, sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.sg-tattler-sign img, .sg-shoppe-billboard img { display: block; width: 100%; height: auto; }
.sg-shoppe-billboard {
  top: auto;
  bottom: 33%;
  width: 15%;
  border: max(0.25cqw, 1px) solid #432d35;
}
.sg-shoppe-billboard::after { height: max(1.2cqw, 5px); }

.sg-deliver {
  position: relative;
  flex: 1;
  width: calc(100% - 32px);
  max-width: 928px;
  min-height: 72px;
  max-height: 150px;
  margin: 12px 16px;
  margin-bottom: max(12px, env(safe-area-inset-bottom));
  font: 900 clamp(22px, 6vw, 34px)/1 var(--sg-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-snow);
  --sg-press-face: var(--sg-red);
  background: var(--sg-red-dark);
  border: 4px solid var(--sg-ink);
  box-shadow: 0 0 0 2px var(--sg-snow-2);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.sg-press-face {
  position: absolute;
  inset: 0 0 8px;
  display: grid;
  place-items: center;
  background: var(--sg-press-face);
  box-shadow: inset 0 2px rgba(255, 255, 255, 0.24), inset 0 -2px rgba(0, 0, 0, 0.16);
  transition: inset 85ms ease-out, box-shadow 85ms ease-out;
  pointer-events: none;
}
.sg-deliver:active .sg-press-face, .sg-deliver.is-down .sg-press-face {
  inset: 5px 2px 2px;
  box-shadow: inset 0 4px 5px rgba(0, 0, 0, 0.4), inset 0 -1px rgba(255, 255, 255, 0.12);
  transition-duration: 35ms;
}
@media (pointer: coarse) {
  .sg-deliver {
    margin-top: 12px;
    align-self: center;
  }
  .sg-main > .sg-stage { margin-bottom: auto; }
  .sg-main:has(.sg-launch:not([hidden])) > .sg-stage { margin-bottom: 0; }
}
.sg-deliver:disabled { opacity: 0.35; cursor: default; }
.sg-deliver[data-state="wait"] { --sg-press-face: #8d2a34; color: var(--sg-snow-2); }
.sg-deliver[data-state="ready"], .sg-deliver[data-state="cue"] { box-shadow: 0 0 0 3px var(--sg-gold); }
.sg-deliver[data-state="cue"] { animation: sg-cue 0.5s steps(2) infinite; }
@keyframes sg-cue { 50% { box-shadow: 0 0 0 6px var(--sg-gold); } }
@media (prefers-reduced-motion: reduce) { .sg-deliver[data-state="cue"] { animation: none; } .sg-press-face { transition: none; } }
@media (min-width: 700px) { .sg-deliver { flex: none; height: 76px; } }

.sg-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: rgba(10, 15, 36, 0.72);
  overflow: auto;
  z-index: 2;
}
.sg-overlay[hidden] { display: none; }
.sg-launch { background: rgba(10, 15, 36, 0.55); text-align: center; }
.sg-launch .sg-ov-title { max-width: 24ch; font-size: clamp(22px, 5vw, 36px); }
.sg-instructions { max-width: 32ch; margin: 0; line-height: 1.45; }
.sg-end { background: rgba(10, 15, 36, 0.94); justify-content: flex-start; padding-top: 32px; }

.sg-ov-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sg-btn {
  font: 900 18px/1 var(--sg-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-snow);
  background: var(--sg-night);
  border: 3px solid var(--sg-snow);
  padding: 14px 22px;
  min-height: 52px;
  min-width: 150px;
  cursor: pointer;
  touch-action: manipulation;
}
.sg-btn-primary {
  background: var(--sg-red);
  border-color: var(--sg-ink);
  box-shadow: inset 0 -6px 0 var(--sg-red-dark), 0 0 0 3px var(--sg-gold);
}
.sg-btn-small { min-height: 40px; min-width: 0; padding: 10px 16px; font-size: 14px; }
.sg-btn:focus-visible, .sg-tool:focus-visible, .sg-deliver:focus-visible { outline: 3px solid var(--sg-gold); outline-offset: 3px; }

.sg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 520px);
  margin: 0;
}
.sg-stat { border: 2px solid var(--sg-snow-2); padding: 10px 8px; text-align: center; min-width: 0; }
.sg-stat-big { grid-column: 1 / -1; border-color: var(--sg-gold); }
.sg-stat dt { font-size: 12px; color: var(--sg-snow-2); text-transform: uppercase; letter-spacing: 0.06em; }
.sg-stat dd { margin: 6px 0 0; font-size: 22px; font-weight: 900; }
.sg-stat-big dd { font-size: 40px; color: var(--sg-gold); }

.sg-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 420px) {
  .sg-bar { font-size: 12px; gap: 8px; }
  .sg-nav { gap: 10px; }
  .sg-stats { grid-template-columns: 1fr 1fr; }
  .sg-stat:last-child { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .sg-bar { flex-wrap: wrap; gap: 6px 12px; }
  .sg-bar .sg-nav { flex-direction: column; align-items: flex-end; gap: 4px; }
}

#sg-other-route, #sg-school-route { color: var(--sg-snow); }

.sg-main:has(.sg-launch:not([hidden])) {
  justify-content: flex-start;
  padding-top: 12px;
}
.sg-main:has(.sg-launch:not([hidden])) .sg-stage {
  width: min(100%, calc((100dvh - 250px) * 1.32));
}
.sg-main:has(.sg-launch:not([hidden])) .sg-tools,
.sg-main:has(.sg-launch:not([hidden])) .sg-deliver {
  display: none;
}
.sg-launch {
  justify-content: flex-end;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent 56%, #0a0f24 75%);
}
.sg-launch .sg-ov-title {
  color: #ffd447;
  text-shadow: 2px 2px #962230, 4px 4px #15131f;
}
@media (max-height: 500px) {
  .sg-main:has(.sg-launch:not([hidden])) .sg-stage {
    width: min(100%, calc((100dvh - 155px) * 1.32));
  }
  .sg-launch { gap: 6px; padding-bottom: 8px; }
}

.sg-ready {
  background: #0a0f2460;
  pointer-events: none;
}
.sg-ready-title {
  margin: 0;
  color: var(--sg-gold);
  font-size: clamp(34px, 9vw, 86px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 3px 3px var(--sg-red-dark), 6px 6px var(--sg-ink);
  animation: sg-ready-pulse 650ms ease-out 2;
}
@keyframes sg-ready-pulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-ready-title { animation: none; }
}

.sg-ready-load:empty { display: none; }
.sg-ready-load {
  margin: 0;
  color: var(--sg-snow);
  font-size: clamp(16px, 4vw, 28px);
  font-weight: 700;
  text-align: center;
}

.sg-school-ready .sg-ready-title {
  max-width: 14ch;
  font-size: clamp(30px, 7vw, 64px);
}

.sg-hedgewood-banner {
  inset: 44px 0 auto;
  padding: 4px 12px;
  background: transparent;
}
.sg-hedgewood-banner .sg-ready-title {
  max-width: 100%;
  padding: 5px 10px;
  background: rgba(10, 15, 36, 0.86);
  font-size: clamp(13px, 3.5vw, 25px);
  text-shadow: 1px 2px var(--sg-ink);
  animation: none;
}

.sg-home-board {
  width: min(280px, 100%);
  padding: 8px 14px;
  border: 1px solid #697ba0;
  background: var(--sg-deep);
  color: var(--sg-snow);
  font-size: 13px;
}
.sg-board-header { display: flex; justify-content: space-between; gap: 12px; }
.sg-board-header strong, #sg-final-board strong { color: var(--sg-gold); }
.sg-score-list { margin: 5px 0 0; padding: 0 0 0 23px; text-align: left; }
.sg-score-list li { padding: 2px 0; }
.sg-score-list.sg-no-scores li { list-style: none; }
.sg-home-board .sg-score-list:not(.sg-no-scores) li:first-child { color: var(--sg-gold); }
.sg-home-board .sg-score-list li + li { border-top: 1px solid #ffffff24; }
.sg-home-board .sg-score-list.sg-no-scores { padding-left: 0; }
.sg-launch:has(.sg-home-board:not([hidden])) { gap: 9px; }
.sg-score-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.sg-score-form[hidden], #sg-replay-blocks[hidden] { display: none; }
#sg-initials {
  padding: 7px;
  font: inherit;
  text-transform: uppercase;
  color: var(--sg-snow);
  background: var(--sg-night);
  border: 2px solid var(--sg-snow-2);
}
.sg-score-feedback { margin: 0; }
.sg-score-feedback:empty { display: none; }
.sg-finale-support:not([hidden]) { display: grid; justify-items: center; gap: 8px; }
.sg-finale-support > p { margin: 0; }
.sg-finale-support a { text-decoration: none; }
.sg-finale-support .sg-story-link {
  margin-bottom: 4px;
  padding: 4px 2px;
  color: var(--sg-gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sg-share-url:not([hidden]) { width: min(100%, 340px); padding: 6px; font: inherit; }
.sg-quick-ready .sg-ready-title { font-size: clamp(16px, 4vw, 30px); }
.sg-share-button, .sg-support-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sg-bill-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 23px;
  height: 15px;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px);
  background: #91d78f;
  box-shadow: inset 0 0 0 2px #38794a;
  color: #143826;
  font: 900 11px/1 monospace;
}
.sg-share-icon {
  position: relative;
  width: 16px;
  height: 17px;
  flex: none;
  background:
    linear-gradient(currentColor, currentColor) center 2px / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 100% 2px no-repeat;
}
.sg-share-icon::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}
#sg-replay-blocks summary { cursor: pointer; width: fit-content; margin-inline: auto; padding: 8px 12px; }
#sg-replay-blocks > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
#sg-replay-blocks a {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  color: var(--sg-snow);
  border: 1px solid var(--sg-snow-2);
}
@media (max-width: 460px) {
  .sg-score-form { display: grid; grid-template-columns: auto auto; }
}

.sg-title-replays { font-size: 13px; }
.sg-title-replays summary { cursor: pointer; }
.sg-title-replays div { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.sg-title-replays a, #sg-exit, .sg-exit-link { color: var(--sg-snow); }
.sg-title-replays a { display: grid; place-items: center; width: 36px; height: 38px; border: 1px solid var(--sg-snow-2); }

.sg-trial-link { color: var(--sg-snow); font-size: 13px; }

.sg-block-summary { background: rgba(10, 15, 36, 0.94); text-align: center; }
.sg-tally { width: min(100%, 340px); margin: 0; }
.sg-tally div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  animation: sg-tally-in 240ms both;
}
.sg-tally div:nth-child(2) { animation-delay: 260ms; }
.sg-tally div:nth-child(3) { border-top: 1px solid currentColor; animation-delay: 520ms; font-weight: 800; }
.sg-tally dd { margin: 0; font-variant-numeric: tabular-nums; }
@keyframes sg-tally-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-tally div { animation: none; }
}

.sg-preview-levels { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px 12px; font-size: 13px; }
.sg-preview-levels[hidden] { display: none; }
.sg-preview-levels span { margin-right: 4px; }
.sg-preview-levels a {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 6px;
  color: var(--sg-snow);
  border: 1px solid var(--sg-snow-2);
}
.sg-preview-levels a[aria-current="page"] { color: var(--sg-ink); background: var(--sg-gold); }

.sg-finale {
  gap: 14px;
  padding: clamp(16px, 4vw, 34px) 16px 32px;
  background: radial-gradient(ellipse at top, #1a4840, #101630 68%);
  border: 4px solid #c24d52;
  box-shadow: inset 0 0 0 2px #e2ba68;
}
.sg-finale .sg-ov-title { text-align: center; color: #fff3d0; font-size: clamp(22px, 6vw, 46px); }
.sg-finale-garland { display: none; }
.sg-finale .sg-finale-garland {
  display: block;
  flex: none;
  width: min(100%, 580px);
  height: 29px;
  background:
    radial-gradient(circle at 10px 18px, #ffe09c 0 3px, transparent 4px) 0 0 / 64px 29px,
    radial-gradient(circle at 26px 22px, #fb6e6e 0 3px, transparent 4px) 0 0 / 64px 29px,
    radial-gradient(circle at 42px 20px, #96c8ff 0 3px, transparent 4px) 0 0 / 64px 29px,
    radial-gradient(circle at 58px 15px, #8de6a4 0 3px, transparent 4px) 0 0 / 64px 29px,
    radial-gradient(ellipse at 32px 5px, #37694f 0 68%, #264d3b 70% 81%, transparent 83%) 0 0 / 64px 25px repeat-x;
}
.sg-finale .sg-stat-big { background: #182543; animation: sg-tally-in 350ms 700ms both; }
.sg-finale .sg-stat-big dd { font-size: clamp(38px, 9vw, 72px); }
@media (prefers-reduced-motion: reduce) {
  .sg-finale .sg-stat-big { animation: none; }
}

.sg-shell:has(.sg-finale:not([hidden])) {
  height: auto;
  min-height: 100dvh;
}
.sg-main:has(.sg-finale:not([hidden])) > :is(.sg-tools, .sg-stage, .sg-deliver) { display: none; }
.sg-finale {
  position: relative;
  inset: auto;
  isolation: isolate;
  width: 100%;
  min-height: 75dvh;
  overflow: visible;
  gap: 12px;
  padding: 16px 16px 28px;
  border: 6px solid transparent;
  background:
    radial-gradient(ellipse at 50% 0, #25583d, #131a39 65%) padding-box,
    repeating-linear-gradient(135deg, #c83d48 0 9px, #fff2d0 9px 15px, #458461 15px 24px, #fff2d0 24px 30px) border-box;
}
.sg-finale .sg-finale-garland { height: 31px; }
.sg-finale-trees { display: none; }
.sg-finale .sg-finale-trees {
  display: flex;
  justify-content: space-between;
  position: absolute;
  inset: 66px 23px auto;
  pointer-events: none;
  z-index: -1;
}
.sg-finale-trees i {
  width: clamp(60px, 15vw, 170px);
  height: clamp(90px, 24vw, 245px);
  clip-path: polygon(50% 0, 65% 29%, 59% 29%, 81% 55%, 73% 55%, 98% 86%, 57% 86%, 57% 100%, 43% 100%, 43% 86%, 2% 86%, 27% 55%, 19% 55%, 41% 29%, 35% 29%);
  background:
    radial-gradient(circle at 7px 8px, #ffd875 0 2px, transparent 3px) 0 0 / 22px 26px,
    radial-gradient(circle at 18px 17px, #e96468 0 3px, transparent 4px) 0 0 / 31px 23px,
    radial-gradient(circle at 5px 13px, #c9eaff 0 2px, transparent 3px) 0 0 / 17px 20px,
    repeating-linear-gradient(158deg, #26724b 0 10px, #c3d9c9 10px 12px, #225f46 12px 21px);
}
.sg-finale .sg-stat-big {
  box-shadow: inset 0 0 0 3px #714843, 0 0 16px #efb84035;
  background: radial-gradient(circle at 12px 12px, #fff4ce90 0 1px, transparent 2px) 0 0 / 28px 25px, #1c2746;
}
.sg-finale #sg-final-board { padding-bottom: max(4px, env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  .sg-finale { gap: 8px; padding: 10px 10px 20px; }
  .sg-finale .sg-ov-title { max-width: 20ch; line-height: 1.12; }
  .sg-finale .sg-finale-trees { inset: 48px 6px auto; opacity: 0.38; }
  .sg-finale .sg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .sg-finale .sg-stat { padding: 5px 2px; }
  .sg-finale .sg-stat:last-child { grid-column: auto; }
  .sg-finale .sg-stat dt { font-size: 10px; }
  .sg-finale .sg-stat dd { font-size: 15px; margin-top: 3px; }
  .sg-finale .sg-stat-big dd { font-size: 40px; }
  .sg-finale .sg-actions { gap: 7px; }
  .sg-finale .sg-actions .sg-btn { font-size: 13px; min-width: 0; padding: 8px 12px; }
  .sg-finale #sg-replay-blocks { width: 100%; font-size: 12px; gap: 4px; }
  .sg-finale #sg-replay-blocks a { width: 33px; min-height: 34px; }
}

.sg-shell:has(.sg-launch:not([hidden])) {
  height: auto;
  min-height: 100dvh;
}
.sg-main:has(.sg-launch:not([hidden])) {
  flex: none;
}
.sg-main:has(.sg-launch:not([hidden])) .sg-launch {
  position: static;
  width: 100%;
  padding-top: 12px;
  overflow: visible;
  background: transparent;
}
@media (min-width: 700px) {
  .sg-main:has(.sg-launch:not([hidden])) .sg-stage {
    width: min(100%, max(230px, calc((100dvh - 345px) * 1.32)));
  }
}

.sg-landing-title { display: none; }
.sg-main:has(.sg-launch:not([hidden])) .sg-stage {
  position: relative;
  width: min(100%, 820px, max(240px, calc((100dvh - 218px) * 1.9)));
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  container-type: inline-size;
}
.sg-main:has(.sg-launch:not([hidden])) .sg-stage canvas { height: 113.64%; }
.sg-main:has(.sg-launch:not([hidden])) .sg-landing-title {
  position: absolute;
  inset: 8% auto auto 3.5%;
  display: grid;
  gap: 1cqw;
  margin: 0;
  color: #fff1c1;
  font-size: 3cqw;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.sg-landing-title strong {
  color: var(--sg-gold);
  font-size: 9.4cqw;
  text-shadow: 0.45cqw 0.45cqw #962230;
}

.sg-speed-link { color: var(--sg-gold); font-weight: 700; padding: 5px 8px; }

.sg-finale {
  min-height: 0;
  gap: 8px;
  padding: 10px 14px 14px;
}
.sg-finale .sg-ov-title {
  max-width: none;
  font-size: clamp(19px, 4.7vw, 34px);
  line-height: 1.12;
}
.sg-finale .sg-finale-garland { height: 26px; }
.sg-finale .sg-finale-results {
  width: min(100%, 260px);
}
.sg-finale .sg-finale-results .sg-stats { display: block; width: 100%; }
.sg-finale .sg-stat:not(.sg-stat-big),
.sg-finale:has(#sg-score-form[hidden]) .sg-finale-results,
.sg-finale .sg-actions[hidden] { display: none; }
.sg-finale .sg-stat-big dd { font-size: clamp(22px, 5vw, 30px); }
.sg-finale:has(#sg-score-form:not([hidden])) .sg-ov-title { font-size: clamp(15px, 3.8vw, 23px); }
.sg-finale #sg-speed-run { text-decoration: none; }

.sg-finale .sg-score-form:not([hidden]) {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: center;
  gap: 9px 12px;
  padding: 12px 14px;
  border: 2px solid var(--sg-gold);
  background: #642b41;
  box-shadow: 0 0 0 2px #ffd44740;
  animation: sg-initials-pulse 1.15s ease-in-out 3;
}
.sg-finale .sg-score-form label {
  grid-column: 1 / -1;
  color: #fff0ba;
  font-weight: 900;
  font-size: clamp(27px, 7vw, 46px);
  line-height: 1.08;
  text-transform: uppercase;
}
.sg-finale .sg-score-form:focus-within { animation: none; }
.sg-finale .sg-score-form button[type="submit"] {
  color: var(--sg-snow);
  grid-column: 1;
  justify-self: end;
}
.sg-finale #sg-skip-score { justify-self: start; }
.sg-finale #sg-initials {
  grid-column: 1 / -1;
  width: 104px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}
@keyframes sg-initials-pulse {
  50% { box-shadow: 0 0 0 4px #ffd44766, 0 0 16px #ffd44766; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-finale .sg-score-form:not([hidden]) { animation: none; }
}

.sg-finale #sg-final-board { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0; }
.sg-finale #sg-final-board[hidden] { display: none; }
.sg-finale #sg-final-board .sg-score-list { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.sg-finale #sg-final-board .sg-score-list li { padding: 0; }
.sg-finale #sg-final-board.sg-expanded-board:not([hidden]) {
  display: grid;
  justify-content: stretch;
  width: min(100%, 540px);
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid #697ba0;
  background: var(--sg-deep);
}
.sg-finale #sg-final-board.sg-expanded-board .sg-score-list {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--score-rows, 1), max-content);
  grid-auto-columns: minmax(0, 1fr);
  gap: 0 36px;
  max-height: clamp(106px, calc(100dvh - 255px), 325px);
  overflow-y: auto;
  padding-inline-start: 36px;
  list-style: decimal;
  font-size: 14px;
  line-height: 1.25;
}
.sg-finale #sg-final-board.sg-expanded-board li { padding: 3px 0; border-bottom: 1px solid #ffffff24; }
.sg-finale #sg-final-board.sg-expanded-board .sg-score-list:not(.sg-no-scores) li:first-child { color: var(--sg-gold); }

@media (max-width: 600px) {
  .sg-finale { gap: 4px; padding: 6px 8px 8px; }
  .sg-finale #sg-final-board.sg-expanded-board li { padding-block: 2px; }
  .sg-finale .sg-finale-garland { height: 20px; }
  .sg-finale .sg-score-feedback { font-size: 12px; text-align: center; }
}
@media (min-width: 850px) {
  .sg-finale .sg-finale-trees { inset-inline: 12px; }
  .sg-finale .sg-finale-trees i { width: 105px; height: 168px; }
}

.sg-key-label { display: none; font: inherit; }
@media (pointer: fine) {
  .sg-key-label { display: inline; }
  .sg-touch-label { display: none; }
}

/* Leave the full height below the header available to the playfield. */
@media (min-width: 960px), (orientation: landscape) and (pointer: coarse) {
  .sg-playing .sg-shell { max-width: none; }
  .sg-playing .sg-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(116px, 18vw, 220px);
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 12px;
    padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    container-type: size;
  }
  .sg-playing .sg-main > .sg-stage {
    grid-area: 1 / 1 / -1 / 2;
    width: min(100%, calc(100cqh * 1.32));
    margin: 0;
    justify-self: end;
  }
  .sg-playing .sg-tools {
    grid-area: 2 / 2;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 0 8px;
  }
  .sg-playing .sg-deliver {
    grid-area: 3 / 2;
    width: 100%;
    margin: 0;
    height: 76px;
    font-size: clamp(16px, 2.4vw, 30px);
  }
}

@media (pointer: coarse) {
  .sg-playing .sg-deliver {
    flex: none;
    width: 100%;
    max-width: none;
    min-height: 52px;
    height: 52px;
    margin: 4px 0 max(4px, env(safe-area-inset-bottom));
    font-size: 20px;
  }
}
@media (orientation: landscape) and (pointer: coarse) {
  .sg-playing .sg-main {
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .sg-playing .sg-main > .sg-stage {
    grid-area: 1 / 1;
    width: min(100%, calc((100cqh - 56px) * 1.32));
  }
  .sg-playing .sg-tools { grid-area: 1 / 2; }
  .sg-playing .sg-deliver {
    grid-area: 2 / 1 / 3 / -1;
    margin-bottom: 0;
  }
}

.sg-deliver.is-charged {
  --sg-press-face: #ffd447;
  color: #261b26;
  box-shadow: 0 0 0 2px #fff1c1, 0 0 18px #ffd44780;
}
