/* Палитра Sweetie 16 — классическая пиксельная палитра */
:root {
  --ink: #0c0a24;
  --ink2: #05041a;
  --plum: #b02bd6;
  --red: #ff2e63;
  --orange: #ff7a1a;
  --yellow: #ffe14d;
  --lime: #39ff14;
  --green: #14c95a;
  --navy: #170f4d;
  --blue: #3d63ff;
  --sky: #29b6ff;
  --cyan: #29f0ff;
  --white: #ffffff;
  --steel: #c3bbff;
  --slate: #5a48e8;
  --dusk: #2b1f7a;
  --sq-light: #8ad8ff;
  --sq-dark: #3d63ff;
  --px: 'Press Start 2P', monospace;
  --ui: 'Rubik', system-ui, sans-serif;
  --body: 'Rubik', system-ui, sans-serif;
  --sq: 60px;
  --ratio: 0.5714;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-weight: 500;
  color: var(--white);
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 46, 136, 0.08) 2px, transparent 2px),
    linear-gradient(90deg, rgba(41, 240, 255, 0.06) 2px, transparent 2px);
  background-size: 24px 24px;
  min-height: 100vh;
  image-rendering: pixelated;
}
button { font: inherit; color: inherit; }

.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.app { max-width: 1280px; margin: 0 auto; padding: 16px 20px 28px; }

/* ---------------------------------------------------------------- кнопки и панели */
.pbtn {
  font-family: var(--ui); font-weight: 800; font-size: 14px; line-height: 1; letter-spacing: 0.06em;
  padding: 10px 14px 9px; cursor: pointer; white-space: nowrap;
  background: var(--slate); color: var(--white);
  border: 4px solid var(--ink);
  box-shadow: inset -4px -4px 0 var(--dusk), inset 4px 4px 0 var(--steel), 4px 4px 0 var(--ink2);
}
.pbtn:hover { background: #6d5cff; }
.pbtn:active { transform: translate(4px, 4px); box-shadow: inset 4px 4px 0 var(--dusk), inset -4px -4px 0 var(--steel); }
.pbtn:disabled { opacity: 0.4; cursor: default; transform: none; }
.pbtn.hot { background: var(--orange); color: var(--ink); box-shadow: inset -4px -4px 0 var(--red), inset 4px 4px 0 var(--yellow), 4px 4px 0 var(--ink2); }
.pbtn.hot:hover { background: #ff9a40; }
.pbtn.hot:active { box-shadow: inset 4px 4px 0 var(--red), inset -4px -4px 0 var(--yellow); }
.pbtn.small { font-size: 12px; padding: 8px 10px 7px; }
.pbtn.big { font-size: 16px; padding: 13px 20px 12px; }
.pbtn:focus-visible, .opt input:focus-visible + span { outline: 4px solid var(--yellow); outline-offset: 2px; }

.panel {
  background: var(--dusk); padding: 14px 16px;
  border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 var(--slate), inset -4px -4px 0 var(--navy), 6px 6px 0 var(--ink2);
}
.panel-title { font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 0.08em; color: var(--yellow); margin-bottom: 12px; text-shadow: 2px 2px 0 var(--ink); }

/* ---------------------------------------------------------------- шапка */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.logo { font-family: var(--px); display: flex; gap: 10px; align-items: baseline; }
.logo-1 { font-size: 20px; color: var(--white); text-shadow: 3px 3px 0 var(--blue), 6px 6px 0 var(--ink2); }
.logo-2 { font-size: 20px; color: var(--yellow); text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--ink2); }
.top-actions { display: flex; gap: 10px; }

/* ---------------------------------------------------------------- раскладка */
.layout { display: grid; grid-template-columns: minmax(0, auto) 340px; gap: 24px; align-items: start; justify-content: center; }
.board-col { display: flex; flex-direction: column; gap: 10px; width: min(calc((100vh - 230px) * var(--ratio)), calc(100vw - 420px), 980px); min-width: 320px; }
.hud { display: flex; flex-direction: column; gap: 14px; }

/* ---------------------------------------------------------------- таблички игроков */
.plate {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--dusk); border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 var(--slate), inset -4px -4px 0 var(--navy), 4px 4px 0 var(--ink2);
  min-height: 60px;
}
.plate.active { background: #3b2a9e; box-shadow: inset 4px 4px 0 var(--yellow), inset -4px -4px 0 var(--orange), 4px 4px 0 var(--ink2); }
.p-tag { font-family: var(--ui); font-weight: 800; font-size: 13px; padding: 5px 7px 4px; background: var(--ink); color: var(--steel); }
.plate.active .p-tag { background: var(--yellow); color: var(--ink); }
.p-ava { width: 36px; height: 36px; flex: none; background-size: 100%; image-rendering: pixelated; }
.p-info { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; flex: 1; }
.p-caps:empty { display: none; }
.p-name { font-family: var(--ui); font-weight: 800; font-size: 15px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate.active .p-name::before { content: '► '; color: var(--yellow); animation: blink 0.8s steps(1) infinite; }
.p-caps { display: flex; align-items: center; min-height: 16px; flex-wrap: nowrap; overflow: hidden; }
.p-caps i { width: 16px; height: 16px; flex: none; background-size: 100%; image-rendering: pixelated; margin-right: -2px; }
.p-adv { font-family: var(--ui); font-weight: 800; font-size: 13px; color: var(--lime); margin-left: 6px; }
.p-think { font-family: var(--ui); font-weight: 800; font-size: 12px; color: var(--yellow); }
.p-think::after { content: '...'; animation: blink 0.6s steps(1) infinite; }
.clock {
  font-family: var(--px); font-size: 14px; padding: 9px 8px 8px; min-width: 84px; text-align: center;
  background: var(--ink); color: var(--lime); border: 4px solid var(--ink2); text-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
}
.plate:not(.active) .clock { color: var(--slate); text-shadow: none; }
.clock.low { color: var(--orange) !important; animation: blink 0.5s steps(1) infinite; }

/* ---------------------------------------------------------------- доска */
.frame {
  padding: 8px; background: var(--navy); border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 var(--blue), inset -4px -4px 0 var(--ink2), 6px 6px 0 var(--ink2);
}
.board-wrap { position: relative; width: 100%; aspect-ratio: var(--ratio); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--ink); }
.board { position: absolute; inset: 0; display: grid; }
.sq { position: relative; overflow: hidden; }
.sq.light { background: var(--sq-light); }
.sq.dark { background: var(--sq-dark); }
.sq.last::before { content: ''; position: absolute; inset: 0; background: rgba(255, 225, 77, 0.6); }
.sq.sel::before { content: ''; position: absolute; inset: 0; background: rgba(255, 225, 77, 0.4); box-shadow: inset 0 0 0 calc(var(--sq) * 0.07) var(--yellow); }
.sq.check::before { content: ''; position: absolute; inset: 0; background: var(--red); animation: blink 0.5s steps(1) infinite; }
.coord { position: absolute; font-family: var(--ui); font-weight: 800; font-size: max(9px, calc(var(--sq) * 0.17)); line-height: 1; pointer-events: none; z-index: 1; }
.coord.rank { top: 3px; left: 3px; }
.coord.file { bottom: 3px; right: 3px; }
.sq.light .coord { color: var(--blue); }
.sq.dark .coord { color: var(--sq-light); }

.dot { position: absolute; left: 38%; top: 38%; width: 24%; height: 24%; background: rgba(12, 10, 36, 0.6); z-index: 3; pointer-events: none; }
.cap { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  --c: rgba(26, 28, 44, 0.7); --l: 26%; --w: calc(var(--sq) * 0.08);
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) top left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--l) no-repeat;
}

/* вспыхнувшая клетка события (остальные клетки невидимы) */
.cell { position: absolute; inset: 0; z-index: 2; pointer-events: none; --b: calc(var(--sq) * 0.08); }
.cell.lit::before { content: ''; position: absolute; inset: 0; background: var(--ec); opacity: 0.85; animation: litFlash 0.5s steps(2) infinite; }
.cell.lit::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 var(--b) var(--white); }
@keyframes litFlash { 0% { opacity: 0.95; } 50% { opacity: 0.55; } }

/* диско-пол */
.disco { position: absolute; inset: 0; z-index: 4; display: none; pointer-events: none; }
.disco.on { display: grid; }
.disco i { opacity: 0.85; box-shadow: inset 0 0 0 calc(var(--sq) * 0.05) rgba(15, 16, 25, 0.4), 0 0 calc(var(--sq) * 0.25) rgba(255, 255, 255, 0.15); }

/* лава */
.lava { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  background-color: #ff3d00;
  background-image: repeating-conic-gradient(#ffb000 0 25%, #ff3d00 0 50%);
  background-size: calc(var(--sq) * 0.25) calc(var(--sq) * 0.25);
  box-shadow: inset 0 0 0 calc(var(--sq) * 0.06) #b31b00;
  animation: lavaBubble 0.5s steps(2) infinite;
}
.lava b { font-family: var(--px); font-weight: 400; font-size: calc(var(--sq) * 0.22); color: var(--white); text-shadow: 2px 2px 0 #4a0a00, -2px -2px 0 #4a0a00, 2px -2px 0 #4a0a00, -2px 2px 0 #4a0a00; }
@keyframes lavaBubble { 50% { background-position: calc(var(--sq) * 0.125) 0; filter: brightness(1.15); } }

/* ---------------------------------------------------------------- фигуры */
.pieces { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.pc {
  position: absolute; left: 0; top: 0;
  background-repeat: no-repeat; background-position: center 62%; background-size: 84%;
  image-rendering: pixelated;
  transition: transform 0.24s steps(6), opacity 0.2s steps(2);
  filter: drop-shadow(0 calc(var(--sq) * 0.05) 0 rgba(15, 16, 25, 0.45));
}
.pc.dragging { transition: none; z-index: 20; background-size: 100%; filter: drop-shadow(0 calc(var(--sq) * 0.15) 0 rgba(15, 16, 25, 0.5)); }
.pc.dying { animation: dying 0.36s steps(1) forwards; }
/* вмёрзшая фигура: ледяной блок поверх спрайта */
.pc.frozen { filter: drop-shadow(0 0 0 #29f0ff) brightness(1.1) saturate(0.6); }
.pc.frozen::after {
  content: ''; position: absolute; inset: 10%;
  border: max(2px, calc(var(--sq) * 0.05)) solid #29f0ff;
  background: repeating-conic-gradient(rgba(41, 240, 255, 0.42) 0 25%, rgba(255, 255, 255, 0.18) 0 50%) 0 0 / calc(var(--sq) * 0.125) calc(var(--sq) * 0.125);
  box-shadow: inset 0 0 0 max(2px, calc(var(--sq) * 0.04)) rgba(255, 255, 255, 0.6);
  animation: softBlink 1.4s steps(1) infinite;
}
@keyframes dying { 0% { opacity: 0; } 25% { opacity: 1; } 50% { opacity: 0; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes softBlink { 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- эффекты */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.fx { position: absolute; transform: translate(-50%, -50%); }
.fx.burst { width: var(--sq); height: var(--sq); box-shadow: 0 0 0 calc(var(--sq) * 0.08) var(--c, var(--white)); animation: burst 0.45s steps(4) forwards; }
.fx.flash { width: var(--sq); height: var(--sq); background: var(--c); animation: flash 0.7s steps(5) forwards; }
.fx.label { font-family: var(--px); font-size: max(10px, calc(var(--sq) * 0.22)); white-space: nowrap; color: var(--c, var(--white)); text-shadow: 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); animation: floatUp 1.3s steps(8) forwards; }
.fx.boom { width: calc(var(--sq) * 0.5); height: calc(var(--sq) * 0.5); background: var(--yellow);
  box-shadow: 0 0 0 calc(var(--sq) * 0.15) var(--orange), 0 0 0 calc(var(--sq) * 0.3) var(--red);
  animation: boom 0.6s steps(5) forwards; }
.fx.spark { width: calc(var(--sq) * 0.14); height: calc(var(--sq) * 0.14); background: var(--c); animation: spark 0.6s steps(6) forwards; }
.board-wrap.shake { animation: boardShake 0.4s steps(4); }
@keyframes burst { from { transform: translate(-50%, -50%) scale(0.3); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes flash { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; } }
@keyframes floatUp { 0% { transform: translate(-50%, -20%); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -200%); opacity: 0; } }
@keyframes fall { from { transform: translate(140%, -480%); } to { transform: translate(-50%, -50%); } }
@keyframes boom { from { transform: translate(-50%, -50%) scale(0.3); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes spark { from { transform: translate(-50%, -50%); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); opacity: 0; } }
@keyframes boardShake { 25% { transform: translate(-6px, 4px); } 50% { transform: translate(6px, -4px); } 75% { transform: translate(-4px, -2px); } }

/* баннер */
.banner {
  position: absolute; left: 50%; top: 50%; z-index: 9; pointer-events: none;
  transform: translate(-50%, -50%); display: none;
  background: var(--ink); border: 4px solid var(--c, var(--yellow));
  box-shadow: 0 0 0 4px var(--ink), 8px 8px 0 rgba(15, 16, 25, 0.6);
  padding: 16px 20px; text-align: center; min-width: 62%; max-width: 92%;
}
.banner.show { display: block; animation: bannerIn 0.25s steps(3); }
.banner .b-icon { width: calc(var(--sq) * 0.9); height: calc(var(--sq) * 0.9); margin: 0 auto 10px; background-size: 100%; image-rendering: pixelated; }
.banner .b-title { font-family: var(--px); font-size: clamp(11px, calc(var(--sq) * 0.27), 18px); line-height: 1.5; color: var(--c, var(--yellow)); text-shadow: 3px 3px 0 var(--ink2); animation: softBlink 0.5s steps(1) 4; }
.banner .b-text { font-size: 16px; color: var(--steel); margin-top: 8px; line-height: 1.3; }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(0.4); } to { transform: translate(-50%, -50%) scale(1); } }

/* ---------------------------------------------------------------- HUD */
.turn-big { font-family: var(--px); font-size: 16px; line-height: 1.4; display: flex; align-items: center; gap: 12px; }
.turn-chip { width: 22px; height: 22px; flex: none; border: 4px solid var(--ink); }
.turn-chip.w { background: var(--white); }
.turn-chip.b { background: var(--ink2); box-shadow: inset 0 0 0 2px var(--slate); }
.turn-sub { font-size: 16px; color: var(--steel); margin-top: 8px; }
.alert { margin-top: 12px; font-family: var(--ui); font-weight: 800; font-size: 14px; line-height: 1.4; letter-spacing: 0.04em; padding: 10px 12px 8px; }
.alert.check { background: var(--red); color: var(--white); animation: blink 0.7s steps(1) infinite; }
.alert.win { background: var(--lime); color: var(--ink); }
.alert.draw { background: var(--steel); color: var(--ink); }
.alert.turbo { background: var(--lime); color: var(--ink); animation: blink 0.5s steps(1) 6; }

.ev-row { display: flex; gap: 14px; align-items: center; }
.ev-swatch { width: 40px; height: 40px; flex: none; background: var(--c); border: 4px solid var(--ink); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35); animation: softBlink 0.8s steps(1) infinite; }
.hidden-count { font-family: var(--ui); font-weight: 800; font-size: 17px; color: var(--yellow); }
.disco-text { animation: discoText 0.3s steps(1) infinite; }
@keyframes discoText { 0% { color: #ff2e88; } 33% { color: #29f0ff; } 66% { color: #ffe14d; } }
.ev-name { font-family: var(--ui); font-weight: 800; font-size: 17px; line-height: 1.3; letter-spacing: 0.04em; }
.ev-text { font-size: 16px; color: var(--steel); line-height: 1.3; margin-top: 4px; }
.meter { display: flex; gap: 4px; margin-top: 12px; }
.meter i { flex: 1; height: 12px; background: var(--ink); border: 2px solid var(--ink2); }
.meter i.on { background: var(--c); }
.ev-idle { font-size: 16px; color: var(--steel); line-height: 1.35; }
.ev-idle b { font-family: var(--ui); font-weight: 800; font-size: 17px; letter-spacing: 0.04em; color: var(--white); display: block; margin-bottom: 8px; }
.ev-row + .ev-row, .meter + .ev-row { margin-top: 14px; }
.ev-hidden { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--dusk); font-size: 16px; color: var(--steel); }

.legend-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 2px dashed var(--slate); }
.legend-row:first-child { border-top: 0; padding-top: 0; }
.legend-sw { width: 30px; height: 30px; flex: none; background: var(--c); border: 4px solid var(--ink); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3); }
.legend-row b { font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 0.04em; color: var(--c); display: block; margin-bottom: 4px; line-height: 1.4; }
.legend-row span { font-size: 15px; color: var(--steel); line-height: 1.3; }

.history { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; display: grid; grid-template-columns: 34px 1fr 1fr; gap: 2px 6px; font-family: var(--ui); font-weight: 600; font-size: 15px; line-height: 1.7; }
.history li { display: contents; }
.history .n { color: var(--slate); }
.history .mv { padding: 0 4px; white-space: nowrap; }
.history .mv.lastmv { background: var(--yellow); color: var(--ink); }
.history .ev { display: inline-block; width: 8px; height: 8px; margin-right: 4px; background: var(--c); }
.history li.history-empty { display: block; grid-column: 1 / -1; color: var(--slate); font-size: 8px; }
.history::-webkit-scrollbar { width: 8px; }
.history::-webkit-scrollbar-thumb { background: var(--slate); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }

/* ---------------------------------------------------------------- диалоги */
.dlg { padding: 0; border: 4px solid var(--ink); background: var(--dusk); color: var(--white); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-x: hidden;
  box-shadow: inset 4px 4px 0 var(--slate), inset -4px -4px 0 var(--navy), 10px 10px 0 var(--ink2); }
.dlg.wide { width: min(700px, calc(100vw - 24px)); }
.dlg.small { width: min(420px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(15, 16, 25, 0.78); }
.dlg[open] { animation: dlgIn 0.2s steps(3); }
@keyframes dlgIn { from { transform: scale(0.85); } to { transform: none; } }
.dlg-body { padding: 22px 24px; }
.dlg-title { font-family: var(--px); font-size: 18px; color: var(--yellow); text-shadow: 3px 3px 0 var(--red); margin-bottom: 18px; line-height: 1.4; }
.dlg fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.dlg legend { font-family: var(--ui); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; color: var(--steel); margin-bottom: 8px; }
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opts.four { grid-template-columns: repeat(4, 1fr); }
.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.opt span { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 11px 10px 10px; cursor: pointer; background: var(--ink); border: 4px solid var(--ink2); }
.opt b { font-family: var(--ui); font-weight: 800; font-size: 14px; line-height: 1.3; letter-spacing: 0.04em; }
.opt small { font-size: 14px; color: var(--steel); line-height: 1.25; }
.opt span:hover { border-color: var(--slate); }
.opt input:checked + span { background: var(--yellow); border-color: var(--orange); color: var(--ink); }
.opt input:checked + span small { color: var(--dusk); }
.dlg-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dlg.hide-bot .bot-only { display: none; }

.rules p, .rules li { font-size: 17px; line-height: 1.4; color: #d7e0ea; }
.rules h3 { font-family: var(--ui); font-weight: 800; font-size: 16px; letter-spacing: 0.06em; color: var(--cyan); margin: 20px 0 10px; }
.rules ul { padding-left: 22px; margin: 0; }
.rules .legend-row span { font-size: 16px; }

.promo-choices { display: flex; gap: 12px; justify-content: center; }
.promo-choices button { width: 76px; height: 76px; cursor: pointer; border: 4px solid var(--ink); background: var(--sq-light) center 62% / 84% no-repeat; image-rendering: pixelated; box-shadow: 4px 4px 0 var(--ink2); }
.promo-choices button:hover { background-color: var(--yellow); }

.over { text-align: center; }
.over-icon { width: 72px; height: 72px; margin: 0 auto 14px; background-size: 100%; image-rendering: pixelated; }
.over p { font-size: 18px; color: var(--steel); margin: 0; }
.over .dlg-actions { justify-content: center; }
.over .dlg-title { margin-bottom: 10px; }

/* ---------------------------------------------------------------- адаптив */
@media (max-width: 1000px) {
  .app { padding: 12px 12px 22px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .board-col { width: min(100%, calc((100vh - 170px) * var(--ratio))); min-width: 0; margin: 0 auto; }
  .hud { width: 100%; max-width: 720px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .app { padding: 8px 8px 18px; }
  .board-col { width: 100%; }
  .logo-1, .logo-2 { font-size: 14px; }
  .topbar { gap: 10px; margin-bottom: 12px; }
  .top-actions { gap: 6px; width: 100%; }
  .top-actions .pbtn { flex: 1; font-size: 12px; padding: 9px 6px 8px; }
  .frame { padding: 4px; }
  .plate { min-height: 52px; padding: 6px 8px; gap: 8px; }
  .p-ava { width: 28px; height: 28px; }
  .clock { font-size: 11px; min-width: 70px; padding: 7px 6px 6px; }
  .opts.two { grid-template-columns: 1fr; }
  .opts.four { grid-template-columns: 1fr 1fr; }
  .dlg-body { padding: 18px 16px; }
  .banner .b-text { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
