:root {
  color-scheme: light;
  --paper: #f5f3e9;
  --ink: #233b30;
  --muted: #7c8275;
  --line: #dedfd2;
  --orange: #e66b3f;
  --lime: #d8ef91;
  --dark: #203c31;
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  touch-action: manipulation;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button:focus-visible,
a:focus-visible {
  outline: none;
}
button:active:not(:disabled) {
  transform: translateY(2px);
}
[hidden] {
  display: none !important;
}
.page {
  max-width: 1104px;
  margin: auto;
  padding: 0 40px;
  padding-top: env(safe-area-inset-top);
}
.header {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.language-button {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100px;
  min-height: 44px;
  padding: 3px;
  border: 1px solid #c9cebf;
  border-radius: 999px;
  background: transparent;
  font:
    600 11px ui-monospace,
    monospace;
}
.language-button:hover {
  background: #e9ecdf;
}
.language-button span {
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.language-button[aria-checked='false'] span:first-child,
.language-button[aria-checked='true'] span:last-child {
  background: var(--ink);
  color: var(--paper);
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1.7px;
}
.brand img {
  border-radius: 11px;
}
.orange {
  color: var(--orange);
}
.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c9cebf;
  border-radius: 999px;
  padding: 10px 17px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  min-height: 44px;
}
.header-button:hover {
  background: #e9ecdf;
}
.install-symbol {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.intro {
  padding: 45px 0 33px;
}
.eyebrow,
.section-number {
  font:
    600 10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 1.5px;
}
.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 16px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}
.edition {
  color: #919486;
  margin-left: 5px;
}
h1 {
  font-size: clamp(38px, 5vw, 60px);
  letter-spacing: -2.8px;
  line-height: 1.06;
  font-weight: 750;
  margin: 0;
}
h1 > span {
  color: var(--orange);
}
.intro-copy {
  color: #777e70;
  font-size: 13px;
  line-height: 1.6;
  margin: 17px 0 0;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 56px;
  align-items: start;
}
.game {
  background: var(--dark);
  border-radius: 17px;
  padding: 18px;
  box-shadow:
    0 9px 0 #d9ddce,
    0 20px 40px -25px #243c3033;
  overflow: hidden;
}
.game-top {
  height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: flex-start;
  padding: 0 6px;
  color: var(--paper);
}
.scores {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.score-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.score-item > span {
  font:
    500 9px ui-monospace,
    monospace;
  color: #adc0a7;
  letter-spacing: 1.5px;
}
.score-item strong {
  font:
    500 27px ui-monospace,
    SFMono-Regular,
    monospace;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  min-width: 4ch;
}
.best strong {
  color: var(--lime);
}
.game-actions {
  justify-self: end;
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.icon-button {
  border: 1px solid #52705a;
  background: transparent;
  border-radius: 9px;
  color: #d3e0c8;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.icon-button:hover:not(:disabled) {
  background: #34533e;
}
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.board-wrap {
  position: relative;
  aspect-ratio: 1;
  isolation: isolate;
  border: 1px solid #647b42;
  border-radius: 7px;
  background: var(--lime);
  overflow: hidden;
  touch-action: none;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.bonus-slot {
  width: 80px;
  min-width: 0;
  align-self: center;
  text-align: center;
  color: var(--lime);
}
.bonus-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  white-space: nowrap;
}
.bonus-hud > span {
  font:
    500 8px ui-monospace,
    monospace;
  color: #adc0a7;
  letter-spacing: 1px;
}
#bonus-time {
  font:
    500 19px ui-monospace,
    monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.8px;
  line-height: 1;
}
.bonus-hud.urgent {
  color: #ffc18e;
}
.bonus-hud.urgent #bonus-time {
  animation: bonus-blink 0.4s steps(1, end) infinite;
}
.bonus-toast {
  pointer-events: none;
  color: #ffe5a4;
  font:
    600 13px ui-monospace,
    monospace;
  letter-spacing: 0.4px;
  line-height: 1.3;
}
@keyframes bonus-blink {
  50% {
    opacity: 0.25;
  }
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background: #eef2ce99;
  backdrop-filter: blur(0.6px);
  -webkit-backdrop-filter: blur(0.6px);
}
.overlay-content {
  padding: 22px 16px;
  width: 100%;
}
.overlay-tag {
  font:
    600 9px ui-monospace,
    monospace;
  letter-spacing: 1.7px;
  color: #567037;
}
.overlay h2 {
  font-size: 32px;
  letter-spacing: -1.4px;
  line-height: 1.1;
  margin: 18px 0 12px;
}
.overlay p {
  font-size: 13px;
  line-height: 1.7;
  color: #536b3d;
  margin: 0 0 23px;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 16px 22px;
  min-height: 50px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 0 #152b21;
}
.primary-button:hover {
  background: #34563f;
}
.primary-button > span[aria-hidden='true'] {
  font-size: 20px;
  font-weight: 400;
}
.keyboard-hint {
  display: block;
  font:
    10px ui-monospace,
    monospace;
  margin-top: 18px;
  color: #6a7e50;
}
.subtle-button {
  display: block;
  margin: 15px auto 0;
  min-height: 38px;
  border: 1px solid #8da773;
  border-radius: 8px;
  background: #e4edbd66;
  color: #47623a;
  padding: 7px 17px;
  font-size: 11px;
}
.subtle-button:hover {
  background: #edf3d4;
}
.continue-countdown {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  border: 2px solid #789452;
  border-radius: 50%;
  background: #f0f5d5cc;
  font:
    600 22px ui-monospace,
    monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.resume-cue {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 13px 16px;
  border: 1px solid #7d985f;
  border-radius: 12px;
  background: #f1f5d9f0;
  color: #29472f;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 3px 12px #29472b18;
}
.resume-cue > span[aria-hidden] {
  font-size: 23px;
  line-height: 1;
}
.game-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 0;
  color: #b9cbaa;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
}
.live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--lime);
  border-radius: 50%;
  margin: 0 5px 1px 0;
}
.boost-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid #52705a;
  border-radius: 6px;
  background: #2b4a39;
  color: #cfe3b8;
  font: inherit;
  letter-spacing: inherit;
  padding: 0 7px;
  touch-action: none;
  white-space: nowrap;
}
.boost-button:disabled {
  opacity: 0.65;
}
.boost-button.boosting {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}
.joystick {
  position: fixed;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  z-index: 30;
  border: 2px solid #f0f4d5bd;
  border-radius: 50%;
  background: #203c3140;
  box-shadow: 0 3px 15px #173b3038;
  pointer-events: none;
  touch-action: none;
}
.joystick::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed #f2f5d88c;
  border-radius: 50%;
}
.joystick-thumb {
  position: absolute;
  left: calc(50% - 14px);
  top: calc(50% - 14px);
  width: 28px;
  height: 28px;
  border: 1px solid #fff7;
  border-radius: 50%;
  background: #eff5cd;
  box-shadow: 0 2px 7px #173b3044;
  transform: translate(0, 0);
}
.sidebar {
  padding-top: 15px;
}
.preferences-open {
  gap: 7px;
  width: max-content;
  max-width: 100%;
}
.preferences-open svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.preference-language {
  display: flex;
  justify-content: center;
}
.privacy-link {
  display: block;
  margin: 14px auto 0;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #697661;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#preferences-dialog .preference-toggle {
  min-height: 54px;
  font-size: 13px;
  margin-top: 10px;
}
.preference-copy {
  min-width: 0;
  text-align: left;
  padding: 4px 0;
}
.preference-copy small {
  display: block;
  margin-top: 4px;
  color: #737d6a;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
}
#preferences-dialog .subtle-button {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
}
#preferences-dialog .secondary-button {
  width: 100%;
  min-height: 44px;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.dialog-actions button {
  margin: 0;
  justify-content: center;
}
.section-number {
  display: block;
  color: #848a79;
  line-height: 1.6;
}
.sidebar h2 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.7px;
  margin: 10px 0 18px;
}
.tempo {
  display: flex;
  border: 1px solid #cdd2c3;
  border-radius: 10px;
  padding: 4px;
  gap: 3px;
}
.tempo button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  min-height: 39px;
  padding: 8px;
}
.tempo button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 2px 4px #233b301c;
}
.tempo button:disabled {
  opacity: 0.6;
}
.preference-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #cdd2c3;
  border-radius: 9px;
  background: transparent;
  font-size: 11px;
}
.preference-switch {
  position: relative;
  width: 28px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #c7cdbd;
}
.preference-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
}
.preference-toggle[aria-checked='true'] .preference-switch {
  background: var(--ink);
}
.preference-toggle[aria-checked='true'] .preference-switch::after {
  transform: translateX(12px);
}
.sidebar p {
  font-size: 12px;
  color: #858b7c;
  line-height: 1.8;
  margin: 13px 0 0;
}
.controls {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 26px;
}
.controls h2 {
  margin-bottom: 8px;
}
.controls p {
  margin-top: 0;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 46px);
  gap: 5px;
  justify-content: center;
  margin-top: 21px;
}
.dpad button {
  border: 1px solid #cbd0bf;
  border-bottom-width: 3px;
  background: #eeeee2;
  border-radius: 9px;
  font-size: 23px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.dpad button:hover {
  background: #e0e6d1;
}
.up {
  grid-area: 1/2;
}
.left {
  grid-area: 2/1;
}
.right {
  grid-area: 2/3;
}
.down {
  grid-area: 3/2;
}
.dpad-center {
  grid-area: 2/2;
  display: grid;
  place-items: center;
  font-size: 25px;
  color: #afb89b;
}
.little-note {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
  padding: 15px 0;
  border-top: 1px dashed #cdd2c3;
}
.note-star {
  font-size: 35px;
  color: var(--orange);
}
.little-note p {
  margin: 0;
  color: #7d8473;
  font-size: 11px;
}
.connection {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 25px;
  font:
    10px ui-monospace,
    monospace;
  color: #858a7c;
  line-height: 1.6;
}
.status-dot {
  width: 5px;
  height: 5px;
  background: #9ca28d;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.ready {
  background: #5c873d;
}
.status-dot.warning {
  background: var(--orange);
}
#update {
  margin-left: auto;
  border: 0;
  background: transparent;
  text-decoration: underline;
  font-size: 11px;
  min-height: 44px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 22px 0 calc(24px + env(safe-area-inset-bottom));
  margin-top: 36px;
  color: #919686;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 0.5px;
}
.footer-dot {
  color: var(--orange);
  font-size: 6px;
  padding: 0 6px;
}
dialog {
  border: 1px solid #d9dfc8;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  padding: 38px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 100px #162c3044;
}
dialog::backdrop {
  background: #19312680;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.orientation-guard {
  top: var(--viewport-top, 0px);
  max-width: none;
  width: 100vw;
  height: var(--app-height, 100dvh);
  max-height: none;
  margin: 0;
  padding: 30px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
  text-align: center;
}
.orientation-guard[open] {
  display: grid;
  place-content: center;
  justify-items: center;
}
.orientation-guard::backdrop {
  background: var(--paper);
}
.orientation-guard svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 12px;
}
.orientation-guard h2 {
  font-size: 28px;
  margin: 8px 0 12px;
}
.orientation-guard p {
  max-width: 320px;
  margin: 0;
  font-size: 13px;
}
dialog img {
  border-radius: 18px;
  display: block;
  margin-bottom: 23px;
}
dialog h2 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 12px 0 15px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: #697661;
}
.dialog-close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: 0;
  background: #e6e9db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 25px;
}
.install-note {
  padding: 13px;
  border-radius: 8px;
  background: #e8ecd9;
  font-size: 11px;
}
.secondary-button {
  min-height: 48px;
  border: 1px solid #c3cdb6;
  border-radius: 8px;
  background: transparent;
  width: 100%;
  margin-top: 12px;
  font-size: 13px;
}
#native-install {
  width: 100%;
  margin-top: 12px;
}
.no-script {
  position: fixed;
  bottom: 0;
  background: var(--orange);
  padding: 15px;
  width: 100%;
  margin: 0;
  text-align: center;
}
#map-dialog {
  max-width: 440px;
  padding-top: 44px;
}
#map-dialog h2 {
  font-size: 29px;
  margin-top: 10px;
}
#map-dialog > p {
  font-size: 12px;
}
.map-options {
  display: grid;
  gap: 9px;
  margin-top: 19px;
}
.map-options button {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 11px;
  border: 1px solid #d1d8c4;
  border-radius: 12px;
  background: #eeefe3;
  min-height: 72px;
}
.settings-speed {
  margin-top: 18px;
}
.settings-speed .section-number {
  margin-bottom: 8px;
}
.settings-speed small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.75;
}
#settings-play {
  display: flex;
  width: 100%;
  margin-top: 15px;
}
#map-dialog .map-options button {
  min-height: 58px;
  padding: 8px;
}
#map-dialog .map-preview {
  width: 36px;
  height: 36px;
  font-size: 23px;
}
#map-dialog .map-options strong {
  margin-bottom: 3px;
}
.map-options button:hover {
  background: #e5ead7;
}
.map-options button[aria-pressed='true'] {
  border-color: #547644;
  box-shadow: inset 0 0 0 1px #547644;
  background: #e4ebd5;
}
.map-preview {
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  border: 1px solid #91a970;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #d8ef91;
  color: #47643b;
  font-size: 25px;
}
.map-portal {
  background: #d9edbd;
  border-style: dashed;
}
.map-islands {
  background: #e8ecaa;
}
.map-garden {
  background: #d2e6b0;
}
.map-options strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.map-options small {
  display: block;
  font-size: 10px;
  color: #7a846e;
  line-height: 1.5;
}
.map-check {
  margin-left: auto;
  color: #547644;
  visibility: hidden;
  font-size: 18px;
}
[aria-pressed='true'] > .map-check {
  visibility: visible;
}
@media (min-width: 1500px) {
  .intro {
    padding-top: 55px;
  }
  .page {
    max-width: 1160px;
  }
}
@media (max-width: 780px) {
  .page {
    padding-left: 24px;
    padding-right: 24px;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 28px;
  }
  .overlay h2 {
    font-size: 26px;
  }
  .game {
    padding: 13px;
  }
  .intro {
    padding-top: 32px;
  }
  .sidebar {
    padding-top: 10px;
  }
  .game-top {
    gap: 24px;
  }
  .game-bottom {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .little-note {
    display: none;
  }
}
@media (min-width: 621px) and (max-width: 780px) {
  .game-top {
    gap: 8px;
  }
  .scores {
    gap: 8px;
  }
  .score-item strong {
    font-size: 18px;
  }
  .bonus-slot {
    width: 56px;
  }
  .bonus-toast {
    font-size: 10px;
    letter-spacing: 0;
  }
}
/* The mobile game uses the available viewport, including Safari's dynamic toolbar height. */
@media (max-width: 620px), (max-height: 500px) and (orientation: landscape) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overflow-anchor: none;
  }
  .page {
    position: fixed;
    top: var(--viewport-top, 0px);
    left: 0;
    width: 100%;
    max-width: none;
    height: var(--app-height, 100dvh);
    margin: 0;
    padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-rows: 44px minmax(0, 1fr);
    gap: 6px;
  }
  .header {
    height: auto;
    min-height: 0;
    border: 0;
    padding: 0 4px;
  }
  .brand {
    font-size: 25px;
    gap: 8px;
    letter-spacing: -1.2px;
  }
  .brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .header-button {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 10px;
    gap: 4px;
  }
  .preferences-open {
    min-height: 40px;
    gap: 5px;
  }
  .preferences-open svg {
    width: 16px;
    height: 16px;
  }
  .install-symbol {
    width: 16px;
    height: 16px;
  }
  main {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 5px;
  }
  .intro,
  footer {
    display: none;
  }
  .play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    align-items: stretch;
  }
  .game {
    display: grid;
    grid-template-rows: 50px minmax(0, 1fr) 37px;
    min-height: 0;
    width: 100%;
    padding: 8px;
    border-radius: 13px;
    box-shadow: none;
  }
  .game-top {
    height: auto;
    min-height: 0;
    align-items: center;
    padding: 0 2px;
    gap: 12px;
  }
  .scores {
    gap: 8px;
  }
  .bonus-slot {
    width: 64px;
  }
  .bonus-toast {
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .score-item {
    gap: 1px;
  }
  .score-item strong {
    font-size: 25px;
    line-height: 1;
  }
  .score-item > span {
    font-size: 8px;
  }
  .game-actions {
    gap: 6px;
  }
  .icon-button {
    width: 44px;
    height: 44px;
  }
  .board-wrap {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 6px;
  }
  canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .game-bottom {
    padding: 7px 3px 0;
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  .boost-button {
    min-height: 30px;
    gap: 5px;
    padding: 0 5px;
    letter-spacing: 0.2px;
  }
  .overlay h2 {
    font-size: 30px;
    margin-top: 16px;
  }
  .overlay p {
    font-size: 13px;
    margin-bottom: 23px;
  }
  .overlay-tag {
    font-size: 9px;
  }
  .keyboard-hint {
    display: none;
  }
  .continue-mode .overlay-content {
    padding: 14px 12px;
  }
  .continue-mode h2 {
    font-size: 28px;
    margin: 12px 0 8px;
  }
  .continue-mode p {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .continue-mode .continue-countdown {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    font-size: 20px;
  }
  .continue-mode .primary-button {
    min-height: 46px;
    padding: 12px 20px;
  }
  .continue-mode .subtle-button {
    min-height: 34px;
    margin-top: 10px;
    padding: 6px 14px;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    align-items: center;
    min-height: 48px;
    padding: 0;
  }
  .controls-copy {
    display: none;
  }
  .tempo {
    padding: 2px;
    border-radius: 10px;
    gap: 0;
  }
  .tempo button {
    min-height: 44px;
    padding: 4px 2px;
    font-size: 10px;
  }
  .controls {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 48px);
    gap: 6px;
    margin: 0;
  }
  .dpad button {
    font-size: 23px;
    min-height: 44px;
  }
  .dpad-center {
    display: none;
  }
  .dpad .up {
    grid-area: 1/2;
  }
  .dpad .down {
    grid-area: 2/2;
  }
  .dpad .left {
    grid-area: 1/1/3/2;
    align-self: center;
    height: 48px;
  }
  .dpad .right {
    grid-area: 1/3/3/4;
    align-self: center;
    height: 48px;
  }
  .connection {
    margin: 0;
    gap: 5px;
    min-height: 13px;
    font-size: 8px;
    line-height: 1.4;
    align-items: center;
  }
  #connection-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #update {
    flex-shrink: 0;
    font-size: 10px;
    padding: 0 5px;
  }
  dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 28px;
  }
}
@media (max-width: 360px) {
  .brand {
    font-size: 22px;
    gap: 6px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .header-actions {
    gap: 5px;
  }
  .header-button {
    padding: 6px 9px;
  }
  .dpad {
    grid-template-columns: repeat(3, 46px);
    gap: 5px;
  }
  .tempo button {
    font-size: 10px;
  }
  .game-top {
    gap: 8px;
  }
  .scores {
    gap: 6px;
  }
  .score-item strong {
    font-size: 21px;
  }
  .bonus-slot {
    width: 56px;
  }
  .bonus-toast {
    font-size: 10px;
  }
  .game-actions {
    gap: 4px;
  }
  .game-bottom {
    font-size: 7px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .page {
    grid-template-rows: 36px minmax(0, 1fr);
    gap: 3px;
  }
  .brand {
    font-size: 22px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .header-button {
    min-height: 34px;
  }
  .game {
    grid-template-rows: 44px minmax(0, 1fr) 33px;
    padding: 5px;
  }
  .game-top {
    gap: 22px;
  }
  .score-item strong {
    font-size: 21px;
  }
  .icon-button {
    width: 40px;
    height: 40px;
  }
  .play-layout {
    gap: 4px;
  }
  .sidebar {
    grid-template-columns: 1fr;
    justify-content: center;
  }
  .overlay-content {
    padding: 8px;
  }
  .overlay-tag,
  .overlay p {
    display: none;
  }
  .overlay h2 {
    font-size: 24px;
    margin: 0 0 12px;
  }
  .subtle-button {
    display: inline-block;
    margin: 0 0 0 10px;
    min-height: 44px;
  }
  .primary-button {
    min-height: 44px;
    padding: 9px 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .bonus-hud.urgent #bonus-time {
    animation: none;
  }
}
