* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  font-family: Arial, Helvetica, sans-serif; color: #fff;
  color-scheme: dark; --bg: #4056a1; --board-size: min(460px, calc(100vw - 20px), max(200px, calc(100dvh - 340px - var(--safe-top) - var(--safe-bottom))));
  --sky-top: #3f53a0; --sky-bottom: #5278c3; --halo: #85aeff20;
  --board-bg: #202d5b; --cell-bg: #253360; --cell-alt: #263562;
  --rim: #657fca; --accent: #bedbff; --stage-panel: #1a2e6659;
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
}
:root[data-stage="lagoon"] {
  --sky-top: #145567; --sky-bottom: #268d96; --halo: #6df5de30;
  --board-bg: #103943; --cell-bg: #16434e; --cell-alt: #194852;
  --rim: #55b6b5; --accent: #96ffe3; --stage-panel: #082d405e;
}
:root[data-stage="sunset"] {
  --sky-top: #603d72; --sky-bottom: #bb626e; --halo: #ffbd7d36;
  --board-bg: #372941; --cell-bg: #44324e; --cell-alt: #483650;
  --rim: #d190a2; --accent: #ffda9d; --stage-panel: #45243f59;
}
:root[data-stage="aurora"] {
  --sky-top: #253b70; --sky-bottom: #416b80; --halo: #8df7c84a;
  --board-bg: #1a2d46; --cell-bg: #233952; --cell-alt: #273e57;
  --rim: #82c6bc; --accent: #b0ffcf; --stage-panel: #152e505e;
}
:root[data-stage="cosmos"] {
  --sky-top: #281d52; --sky-bottom: #65439d; --halo: #e098ff3d;
  --board-bg: #201936; --cell-bg: #2d2346; --cell-alt: #32274b;
  --rim: #9f7acb; --accent: #eed0ff; --stage-panel: #1e133d70;
}
body { margin: 0; min-width: 280px; min-height: 100dvh; overflow-x: clip; overscroll-behavior: none; background: radial-gradient(ellipse at 80% 15%, var(--halo), transparent 65%), linear-gradient(175deg, var(--sky-top), var(--sky-bottom)); user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #ffe674; outline-offset: 4px; }
button:disabled { cursor: default; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.game { width: calc(var(--board-size) + 20px); margin: 0 auto; min-height: 100dvh; padding: calc(12px + var(--safe-top)) 10px calc(12px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; }
.record { display: flex; align-items: center; gap: 6px; color: #ffe066; font-size: 23px; font-weight: 800; letter-spacing: .3px; text-shadow: 0 2px 1px #293f85; font-variant-numeric: tabular-nums; }
.record svg { width: 32px; height: 30px; filter: drop-shadow(0 2px 0 #bf842c); }
.icon-button { width: 44px; height: 44px; background: none; display: grid; place-items: center; padding: 6px; color: #c7dbfa; }
.icon-button svg { width: 100%; height: 100%; }
.icon-button:hover { color: white; transform: rotate(8deg); }
.score-area { position: relative; width: 100%; height: 78px; display: flex; justify-content: center; padding-top: 2px; }
.score { font-weight: 800; font-size: 52px; line-height: 1.2; letter-spacing: 1px; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #2d4386; }
.score.pop { animation: score-pop 220ms ease-out; }
.combo-meter { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); align-items: center; gap: 9px; color: #ffe578; font-size: 13px; font-weight: 800; white-space: nowrap; }
.combo-meter:not([hidden]) { display: flex; }
.combo-pips { display: flex; gap: 3px; }
.combo-pips i { width: 5px; height: 5px; border-radius: 50%; background: #ffc742; }
.combo-pips i.off { opacity: .25; }
.stage { width: 100%; height: 52px; flex-shrink: 0; margin-bottom: 10px; padding: 5px 8px 5px 6px; display: flex; gap: 7px; align-items: center; border: 1px solid #ffffff26; border-radius: 10px; background: var(--stage-panel); position: relative; overflow: hidden; }
.stage-number { display: grid; place-items: center; flex: 0 0 auto; min-width: 28px; padding: 0 3px; height: 28px; border-radius: 7px; color: var(--accent); background: #ffffff0e; border: 1px solid #ffffff1f; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stage-details { flex: 1; min-width: 0; }
.stage-caption, .stage-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; line-height: 14px; }
.stage-meta { margin: 2px 0 4px; color: #f2f5ff; font-size: 9px; font-variant-numeric: tabular-nums; }
#skin-name { color: #fff; font-size: 10px; white-space: nowrap; }
#stage-count { white-space: nowrap; }
#stage-name { color: var(--accent); font-size: 12px; font-weight: 700; }
#stage-status { color: #f2f5ff; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage-progress { height: 3px; border-radius: 4px; background: #0003; overflow: hidden; }
.stage-progress > span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; transform: scaleX(var(--progress, 0)); }
.stage.stage-up { border-color: var(--accent); }
.stage.stage-up .stage-number { animation: stage-badge 650ms ease-out; }
.stage.stage-up #stage-status { color: var(--accent); font-weight: 700; }
.stage.stage-up::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 25%, #ffffff30 50%, transparent 75%); animation: stage-sweep 900ms ease-out both; }
.board-wrap { width: var(--board-size); height: var(--board-size); position: relative; }
.board { display: grid; width: 100%; height: 100%; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); gap: 2px; padding: 4px; background: var(--board-bg); border-radius: 5px; box-shadow: 0 3px 0 var(--rim), 0 -2px 0 var(--board-bg); touch-action: none; transition: background-color 350ms, box-shadow 350ms; }
.board.stage-up { animation: stage-glow 1100ms ease-out; }
.cell { min-width: 0; min-height: 0; padding: 0; border-radius: 1px; background: var(--cell-bg); position: relative; }
.cell:nth-child(16n + 2), .cell:nth-child(16n + 4), .cell:nth-child(16n + 6), .cell:nth-child(16n + 8), .cell:nth-child(16n + 9), .cell:nth-child(16n + 11), .cell:nth-child(16n + 13), .cell:nth-child(16n + 15) { background: var(--cell-alt); }
[data-color="0"] { --face: #4284f0; --light: #77b7ff; --dark: #2457c5; --edge: #346bd9; }
[data-color="1"] { --face: #ff8128; --light: #ffbe5f; --dark: #db4b16; --edge: #f1681d; }
[data-color="2"] { --face: #32cce9; --light: #7df2fa; --dark: #128fbd; --edge: #23b0cf; }
[data-color="3"] { --face: #ffc626; --light: #fff479; --dark: #dd8f0c; --edge: #eeb11a; }
[data-color="4"] { --face: #b153e0; --light: #e396f8; --dark: #7b2bad; --edge: #9945ca; }
[data-color="5"] { --face: #57d92b; --light: #a0fa61; --dark: #289b16; --edge: #41be1f; }
.tile { background: var(--face) !important; border: 1px solid var(--dark); border-radius: 2px; box-shadow: inset 0 1px 0 var(--light), 0 1px 2px #0c14344d; position: relative; }
.tile::before { content: ''; position: absolute; inset: 0; border-style: solid; border-width: 5px; border-color: var(--light) var(--edge) var(--dark) var(--edge); border-radius: 1px; opacity: .9; }
.tile::after { content: ''; position: absolute; inset: 5px; background: linear-gradient(140deg, #ffffff19, transparent 65%); border: 1px solid #ffffff13; }
.cell.preview { opacity: .46; }
.cell.will-clear { filter: brightness(1.45); box-shadow: 0 0 12px #fff8, inset 0 0 0 2px #fff9; z-index: 1; }
.cell.cursor { outline: 2px solid #ffeb94; outline-offset: -1px; }
.cell.just-placed { animation: place 170ms ease-out; }
.cell.clearing { animation: clear 270ms ease-in forwards; z-index: 2; }
.tray { width: calc(100% + 10px); height: 110px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; margin-top: 12px; gap: 4px; touch-action: none; }
.piece-slot { height: 110px; display: flex; align-items: center; justify-content: center; border-radius: 16px; position: relative; }
.piece-button { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: transparent; border-radius: 12px; touch-action: none; transition: background 120ms ease; padding: 0; }
.piece-button.selected { background: #a1c1ff18; }
.piece-button.selected::after { content: ''; position: absolute; bottom: 1px; width: 23px; height: 3px; background: #e8f3ff; border-radius: 4px; }
.piece-button.unavailable { filter: grayscale(.9); opacity: .45; }
.piece-button.is-dragging .piece-shape { opacity: .18; }
.piece-shape { display: grid; grid-template-columns: repeat(var(--cols), var(--unit)); grid-template-rows: repeat(var(--rows), var(--unit)); gap: 1px; filter: drop-shadow(0 3px 1px #1c33745e); pointer-events: none; }
.piece-shape .tile { width: var(--unit); height: var(--unit); }
.piece-shape .tile::before { border-width: 3px; }
.piece-shape .tile::after { inset: 3px; }
.piece-button.entering .piece-shape { animation: tray-in 220ms ease-out both; }
.hint { font-size: 15px; line-height: 20px; color: #c5d6fc; margin: 6px 0 0; min-height: 20px; text-align: center; transition: opacity .2s; }
.bottom-mark { display: none; }
.bottom-mark span { display: block; }
.bottom-mark span:last-child { font-size: 13px; letter-spacing: 1px; }
.drag-piece { display: none; position: fixed; left: 0; top: 0; pointer-events: none; z-index: 15; filter: drop-shadow(0 10px 9px #14234455); }
.drag-piece.active { display: block; }
.drag-piece .piece-shape { gap: 2px; }
.drag-piece .tile::before { border-width: 5px; }
.drag-piece .tile::after { inset: 5px; }
/* One root material styles board, tray, placement preview and floating drag alike.
   Keep silhouettes square and colors stable: the material never encodes game rules. */
:root[data-skin="glass"] .tile {
  background: linear-gradient(135deg, var(--light), var(--face) 55%, var(--dark)) !important;
  border-color: var(--light); border-radius: 5px;
  box-shadow: inset 0 0 0 1px #ffffff65, inset 0 -4px 6px #12244355, 0 1px 2px #0005;
}
:root[data-skin="glass"] .tile::before { inset: 2px; border: 1px solid #ffffff70; border-radius: 3px; background: linear-gradient(135deg, #fff9, #fff1 45%, transparent 46%); opacity: 1; }
:root[data-skin="glass"] .tile::after { inset: 12% 12% 55%; border: 0; border-radius: 2px; background: linear-gradient(#ffffff80, #ffffff10); }
:root[data-skin="neon"] .tile {
  background: color-mix(in srgb, var(--dark) 30%, #101525) !important;
  border: 2px solid var(--light); border-radius: 3px;
  box-shadow: inset 0 0 6px var(--face), 0 0 3px var(--face);
}
:root[data-skin="neon"] .tile::before { inset: 3px; border: 1px solid var(--face); border-radius: 0; opacity: 1; background: none; }
:root[data-skin="neon"] .tile::after { inset: 43% 30%; border: 0; background: var(--light); box-shadow: 0 0 5px var(--face); }
:root[data-skin="candy"] .tile {
  background: linear-gradient(var(--light), var(--face) 55%, var(--edge)) !important;
  border: 1px solid var(--dark); border-radius: 26%;
  box-shadow: inset 0 2px 1px #fff9, inset 0 -4px 1px var(--dark), 0 1px 2px #0005;
}
:root[data-skin="candy"] .tile::before { inset: 12% 15% 51%; border: 0; border-radius: 50%; opacity: 1; background: linear-gradient(#fffc, #fff1); }
:root[data-skin="candy"] .tile::after { inset: 63% 25% 20%; border: 0; border-radius: 50%; background: #ffffff30; }
:root[data-skin="mosaic"] .tile {
  background: conic-gradient(from 0deg, var(--light) 0 90deg, var(--face) 90deg 180deg, var(--dark) 180deg 270deg, var(--edge) 270deg) !important;
  border: 1px solid var(--light); border-radius: 2px;
  box-shadow: inset 0 0 0 1px #15203f80, 0 1px 2px #0006;
}
:root[data-skin="mosaic"] .tile::before { inset: 0; border: 0; opacity: 1; border-radius: 0; background: linear-gradient(transparent calc(50% - .5px), #182238aa calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)), linear-gradient(90deg, transparent calc(50% - .5px), #182238aa calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)); }
:root[data-skin="mosaic"] .tile::after { inset: 38%; border: 1px solid #fff9; background: var(--light); transform: rotate(45deg); }
:root[data-skin] .cell.will-clear { box-shadow: 0 0 12px #fff8, inset 0 0 0 2px #fff9; }
.celebration { pointer-events: none; position: absolute; z-index: 12; top: 41%; left: 0; width: 100%; text-align: center; font-weight: 900; font-style: italic; font-size: 43px; color: #fff481; -webkit-text-stroke: 1px #b95413; text-shadow: 0 4px 0 #b75726, 0 7px 0 #26376480; opacity: 0; }
.celebration.show { animation: celebrate 1100ms ease-out forwards; }
.celebration small { display: block; margin-top: 10px; font-size: 27px; color: white; -webkit-text-stroke: 0; text-shadow: 0 3px 0 #263764; }
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.particle { position: absolute; width: 6px; height: 6px; background: var(--face); border-radius: 1px; animation: particle 540ms ease-out forwards; }
.particle.star { width: 5px; height: 5px; background: #fff3a3; box-shadow: 0 0 6px #fff; border-radius: 50%; }
.modal { width: min(340px, calc(100vw - 36px)); border: 2px solid #98bbff8a; border-radius: 22px; padding: 28px 23px 22px; color: #fff; background: linear-gradient(#567aca, #36549f); text-align: center; box-shadow: 0 9px 0 #1f347790, 0 16px 70px #0b163b70; }
.modal::backdrop { background: #0c173aaa; backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in 180ms ease-out; }
.modal h1 { font-size: 29px; margin: 4px 0 22px; text-shadow: 0 2px 0 #26438c; }
.modal p { font-size: 16px; line-height: 1.5; color: #e3edff; }
.modal-close { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; }
.settings-list { margin: 14px 0 27px; }
.setting { display: flex; justify-content: space-between; align-items: center; width: 100%; background: #24438a55; padding: 14px; margin-bottom: 8px; border-radius: 11px; font-weight: 600; }
.setting > span { display: flex; gap: 12px; align-items: center; }
.setting svg { width: 24px; height: 24px; }
.switch { display: block; width: 45px; height: 26px; border-radius: 20px; background: #68cc36; box-shadow: inset 0 2px 2px #0003; padding: 3px; }
.switch::after { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; transform: translateX(19px); box-shadow: 0 2px 2px #0003; transition: transform .15s; }
[aria-checked="false"] .switch { background: #8395bb; }
[aria-checked="false"] .switch::after { transform: translateX(0); }
.action { display: block; width: 100%; min-height: 50px; padding: 12px; border-radius: 12px; font-weight: 800; font-size: 19px; margin-top: 13px; }
.action:active { transform: translateY(3px); box-shadow: none; }
.primary { color: white; background: linear-gradient(#79de3b, #4ebd24); border-top: 2px solid #bcfa7b; box-shadow: 0 5px 0 #278e22; text-shadow: 0 2px 0 #328e29; }
.secondary { background: linear-gradient(#5d94e7, #4078d3); border-top: 2px solid #98c4ff; box-shadow: 0 4px 0 #2859ad; }
.text-button { background: transparent; padding: 17px 10px 0; font-size: 15px; color: #d7e5ff; text-decoration: underline; text-underline-offset: 4px; }
.result-crown { width: 68px; height: 60px; margin-bottom: 5px; }
.result-modal h1 { margin-bottom: 8px; }
.result-modal p { font-size: 15px; }
.result-score { font-size: 65px; font-weight: 800; text-shadow: 0 4px 0 #28448b; margin: 20px 0 8px; }
.result-best { color: #ffe278; font-weight: 700; margin-bottom: 28px; }
.result-best span { padding-left: 8px; }
.help-modal { max-height: calc(100dvh - 36px); overflow-y: auto; }
.help-modal .keyboard-help { font-size: 14px; color: #bacff7; }
.mini-example { display: flex; gap: 3px; justify-content: center; }
.mini-example i { width: 23px; height: 23px; background: #ffcf31; border: 3px solid; border-color: #fff080 #e6ac15 #c98b17; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes place { from { transform: scale(1.13); filter: brightness(1.3); } to { transform: scale(1); } }
@keyframes clear { 0% { filter: brightness(1.8); transform: scale(1); } 40% { filter: brightness(2.1); } 100% { transform: scale(.15); opacity: 0; } }
@keyframes score-pop { 40% { transform: scale(1.12); } }
@keyframes tray-in { from { transform: translateY(15px) scale(.65); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes celebrate { 0% { opacity: 0; transform: scale(.4) rotate(-8deg); } 16% { opacity: 1; transform: scale(1.08) rotate(-4deg); } 25%, 65% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: translateY(-25px) scale(1.02) rotate(-4deg); } }
@keyframes particle { from { opacity: 1; transform: translate(0,0) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(160deg); } }
@keyframes modal-in { from { transform: scale(.88); opacity: 0; } }
@keyframes stage-badge { 35% { transform: scale(1.15); background: #ffffff30; } }
@keyframes stage-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes stage-glow { 35% { box-shadow: 0 3px 0 var(--rim), 0 0 0 2px var(--accent), 0 0 28px var(--halo); } }
@media (max-height: 690px) {
  :root { --board-size: min(460px, calc(100vw - 20px), max(200px, calc(100dvh - 300px - var(--safe-top) - var(--safe-bottom)))); }
  .game { padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .score-area { height: 60px; padding-top: 0; }
  .score { font-size: 38px; }
  .combo-meter { bottom: 0; font-size: 11px; }
  .stage { height: 48px; margin-bottom: 8px; }
  .tray { margin-top: 6px; height: 86px; }
  .piece-slot { height: 86px; }
  .hint { margin: 4px 0 0; font-size: 12px; line-height: 16px; min-height: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .particles { display: none; } .stage.stage-up .stage-number, .stage.stage-up::after, .board.stage-up { animation: none !important; } .stage.stage-up::after { display: none; } .stage-progress > span, .board { transition: none !important; } }

/* Screens are removed from layout and keyboard navigation, not covered by an overlay. */
[hidden] { display: none !important; }
:root[data-brand-loading] body { background: #171c25; }
.brand-loading { min-height: 100dvh; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
.brand-logo { display: block; width: min(330px, 100%); height: auto; margin: 0 auto; }
:root[data-brand="blackbetty"] .home-art { display: none; }
:root[data-brand="blackbetty"] .home-heading { width: 100%; }
:root[data-brand-logo] .home-art { display: none; }
:root[data-brand-logo] .home-heading { width: 100%; }
:root[data-brand="blackbetty"] .home-heading h1:not(.sr-only) { font-size: 40px; letter-spacing: -1px; }
.game > * { flex-shrink: 0; }
.modal { max-height: calc(100dvh - 36px); overflow-y: auto; }
.home { width: min(400px, 100%); min-height: 100dvh; margin: 0 auto; padding: calc(38px + var(--safe-top)) 26px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.home-art { --home-unit: 25px; display: grid; grid-template-columns: repeat(3, var(--home-unit)); grid-auto-rows: var(--home-unit); gap: 3px; transform: rotate(-9deg); filter: drop-shadow(0 8px 6px #17295466); }
.home-art i:first-child { visibility: hidden; }
.home-art .tile::before { border-width: 3px; }
.home-heading h1 { margin: 0; font-size: 58px; font-weight: 900; line-height: .95; letter-spacing: -2px; text-shadow: 0 4px 0 #21376b; }
.home-heading h1 span { display: block; color: #ffdc69; margin-top: 4px; text-shadow: 0 4px 0 #ad691f, 0 7px 0 #21376b80; }
.home-eyebrow { margin: 0 0 16px; color: #d5e4ff; font-size: 11px; letter-spacing: .7px; }
.home-tagline { margin: 16px 0 0; color: #e2ecff; font-size: 15px; }
.home-record { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1px solid #ffffff24; border-radius: 30px; background: #1a2e6638; }
.home-record svg { width: 29px; height: 26px; }
.home-record span { font-size: 12px; color: #dce8ff; }
.home-record strong { margin-left: 8px; font-size: 18px; color: #ffe383; font-variant-numeric: tabular-nums; }
.home-actions { width: 100%; }
.home-play { margin-top: 0; margin-bottom: 14px; min-height: 68px; }
.home-play span { display: block; font-size: 23px; }
.home-play small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; letter-spacing: .2px; text-shadow: none; }
.home-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.home-links button { min-height: 52px; border-radius: 12px; background: #21376b45; border: 1px solid #ffffff26; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; }
.home-links svg, .home-links span { width: 20px; height: 20px; }
.home-links span { display: grid; place-items: center; border: 1.5px solid #c7dbfa; border-radius: 50%; font-weight: 700; }
.home-links button:hover { background: #21376b80; }
.home-footer { margin: 0; color: #cbdbfa; font-size: 11px; }
@media (max-height: 690px) {
  .brand-logo { width: min(240px, 100%); }
  .home { padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(12px + var(--safe-bottom)); gap: 14px; }
  .home-art { --home-unit: 20px; }
  .home-heading h1 { font-size: 44px; }
  .home-eyebrow { margin-bottom: 12px; }
  .home-tagline { margin-top: 12px; }
  .home-play { min-height: 58px; padding: 9px 12px; }
  .home-play span { font-size: 21px; }
  .home-play small { margin-top: 2px; }
  .home-links { margin-top: 16px; }
}
@media (min-width: 560px) and (max-height: 500px) {
  :root { --board-size: min(460px, calc(100vw - 260px), calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom))); }
  .game { width: calc(var(--board-size) + 260px); height: 100dvh; padding-top: calc(12px + var(--safe-top)); padding-bottom: calc(12px + var(--safe-bottom)); display: grid; grid-template-columns: var(--board-size) 220px; grid-template-rows: 44px 56px 58px minmax(86px, 1fr) 32px; column-gap: 20px; }
  .board-wrap { grid-column: 1; grid-row: 1 / 6; align-self: center; }
  .topbar, .score-area, .stage, .tray, .hint { grid-column: 2; }
  .topbar { grid-row: 1; }
  .score-area { grid-row: 2; height: 56px; }
  .stage { grid-row: 3; margin: 0; }
  .tray { grid-row: 4; width: 100%; margin: 0; height: 86px; }
  .hint { grid-row: 5; margin: 0; font-size: 11px; }
  .record { font-size: 18px; gap: 3px; }
  .record svg { width: 24px; }
}
