:root {
  color-scheme: dark;
  --bg: #14121c;
  --line: #2f2b3a;
  --line-2: #433d52;
  --text: #f1ebdd;
  --muted: #b5ab98;
  --quiet: #8b8296;
  --paper: #fbf6ea;
  --ink: #2a2230;
  --cinnabar: #c0392b;
  --gold: #e8c46a;
  --shell: #d9dce4;
  --shell-2: #b9bdc9;
  --shell-3: #8f93a2;
  --heading: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --body: "Noto Sans SC", "DM Sans", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --title: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  /* 银月, as the title's seal cuts it (ui.mjs SEAL_FONT): ZCOOL draws 银 like 裉 */
  --seal: "Noto Serif SC", "Songti SC", "Noto Sans SC", serif;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
/* English in DM Sans: the Chinese faces set ’ “ ” … in full-width cells */
html[data-lang='en'] {
  --body: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  --title: "DM Sans", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 300px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -20%, #5a6ab830, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #c0392b14, transparent 45%),
    var(--bg);
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- top bar: the site's <tipo-bar> (/tipo/tipo.css) in the handheld's colours ---------- */
tipo-bar {
  --tipo-fg: var(--text);
  --tipo-muted: var(--quiet);
  --tipo-line: var(--line-2);
  --tipo-hover: #ffffff10;
  --tipo-accent: var(--gold);
  --tipo-accent-bg: #e8c46a1f;
  --tipo-lab: linear-gradient(100deg, #e6e9f4 10%, #a8b4e8 60%, #e3d4aa);
}
.topbar { padding: 10px 22px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.icon-btn { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: #ffffff06; transition: background 0.2s, border-color 0.2s; }
.icon-btn:hover { background: #ffffff10; border-color: #5a5470; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-mute { display: none; }
.icon-btn[aria-pressed='false'] .i-mute { display: inline; }
.icon-btn[aria-pressed='false'] .i-wave { display: none; }
.icon-btn[aria-pressed='false']:not(#fullBtn) { color: var(--quiet); }
.icon-btn .i-exit, .icon-btn[aria-pressed='true'] .i-enter { display: none; }
.icon-btn[aria-pressed='true'] .i-exit { display: inline; }

/* ---------- the handheld ---------- */
.stage { flex: 1; display: grid; place-items: center; padding: 6px 16px 10px; min-height: 0; }
.console {
  --scr-w: min(calc(100vw - 72px), calc((100dvh - 300px) * 10 / 9), 960px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(var(--scr-w) + 56px);
  padding: 22px 28px 26px;
  border-radius: 26px 26px 26px 26px;
  background:
    linear-gradient(160deg, #f1f2f6 0%, var(--shell) 30%, var(--shell-2) 78%, #a5aab8 100%);
  box-shadow:
    inset 0 2px 0 #ffffffc0,
    inset 0 -3px 0 #7d8292,
    inset 2px 0 0 #ffffff60,
    0 30px 60px -20px #000000b0,
    0 2px 0 #00000040;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.bezel {
  width: 100%;
  padding: 10px 14px 10px;
  border-radius: 14px 14px 34px 14px;
  background: linear-gradient(180deg, #4a4c5e, #33343f);
  box-shadow: inset 0 2px 6px #00000080, 0 1px 0 #ffffff80;
}
.bezel-top { display: flex; align-items: center; gap: 8px; height: 16px; margin-bottom: 6px; color: #b8bdd4; font: 700 9px/1 var(--heading); letter-spacing: 0.2em; }
.led { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffb0a8, #e0402a 60%); box-shadow: 0 0 8px #ff5a3a; }
.bezel-stripes { flex: 1; height: 5px; background: linear-gradient(180deg, #8a5ab8 0 2px, transparent 2px 3px, #4a7ad8 3px 5px); border-radius: 2px; opacity: 0.85; }
.screen-wrap { position: relative; width: 100%; aspect-ratio: 10 / 9; background: #0d0b10; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 2px #1a1a22; }
#screen { display: block; width: 100%; height: 100%; image-rendering: pixelated; outline: none; }
.bezel-bottom { margin-top: 6px; text-align: center; color: #c9cde0; font: 15px var(--title); letter-spacing: 0.3em; }
.bezel-bottom em { color: #e8c46a; font-style: normal; }
.bezel-bottom .seal { font: 900 14px var(--seal); }
.bezel-bottom .en { font: 700 11px/22px var(--heading); letter-spacing: 0.22em; text-transform: uppercase; }

.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; margin-top: 16px; padding: 0 4px; }
/* the pad's and the buttons' sizes: --pad and --btn (the layouts for touch screens below grow them to fit the room) */
.dpad { position: relative; justify-self: start; width: var(--pad, 112px); height: var(--pad, 112px); touch-action: none; }
.dpad-arm, .dpad-hub { position: absolute; background: linear-gradient(180deg, #3a3c48, #22232c); box-shadow: inset 0 1px 0 #ffffff26, 0 3px 0 #15161c; }
.dpad-arm.up, .dpad-arm.down { left: 33%; width: 34%; height: 36%; }
.dpad-arm.up { top: 0; border-radius: 7px 7px 0 0; }
.dpad-arm.down { bottom: 0; border-radius: 0 0 7px 7px; }
.dpad-arm.left, .dpad-arm.right { top: 33%; width: 36%; height: 34%; }
.dpad-arm.left { left: 0; border-radius: 7px 0 0 7px; }
.dpad-arm.right { right: 0; border-radius: 0 7px 7px 0; }
.dpad-hub { left: 33%; top: 33%; width: 34%; height: 34%; box-shadow: none; background: radial-gradient(circle, #2a2b34 40%, #24252e 41%); }
.mid-btns { display: flex; gap: 12px; align-self: end; padding-bottom: 6px; }
.pill { margin: 0 3px; padding: 6px 14px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #8a8e9c, #6a6e7c); color: #eef0f6; font: 800 10px/1 var(--heading); letter-spacing: 0.14em; box-shadow: inset 0 1px 0 #ffffff50, 0 3px 0 #4a4d58; transform: rotate(-22deg); }
.ab { justify-self: end; position: relative; width: calc(var(--btn, 56px) * 2.36); height: calc(var(--btn, 56px) * 1.86); }
.round { position: absolute; width: var(--btn, 56px); height: var(--btn, 56px); border: 0; border-radius: 50%; color: #fff4ee; font: 800 calc(var(--btn, 56px) * 0.32)/1 var(--heading); box-shadow: inset 0 2px 0 #ffffff60, inset 0 -3px 0 #00000030, 0 4px 0 #6a1a1a; background: radial-gradient(circle at 40% 30%, #ff7a6a, #c0392b 70%); }
.round.a { right: 0; top: 0; }
.round.b { left: 0; bottom: 0; background: radial-gradient(circle at 40% 30%, #ff9a7a, #b0302a 70%); }
.round:active, .pill:active, .round.down { transform: translateY(2px); box-shadow: inset 0 2px 0 #ffffff40, 0 2px 0 #6a1a1a; }
.pill:active { transform: rotate(-22deg) translateY(2px); }
/* held (input.mjs): the pad tips toward the way it is pressed (data-dir) and that arm sinks; a button sinks and darkens */
.dpad { transition: transform 0.06s; }
.dpad[data-dir='up'] { transform: perspective(360px) rotateX(8deg); }
.dpad[data-dir='down'] { transform: perspective(360px) rotateX(-8deg); }
.dpad[data-dir='left'] { transform: perspective(360px) rotateY(-8deg); }
.dpad[data-dir='right'] { transform: perspective(360px) rotateY(8deg); }
.dpad[data-dir='up'] .dpad-arm.up, .dpad[data-dir='down'] .dpad-arm.down, .dpad[data-dir='left'] .dpad-arm.left, .dpad[data-dir='right'] .dpad-arm.right {
  background: linear-gradient(180deg, #2a2b34, #17181f); box-shadow: inset 0 2px 5px #000000a0, 0 1px 0 #15161c;
}
.round.down { filter: brightness(0.88); }
.pill.down { transform: rotate(-22deg) translateY(2px); box-shadow: inset 0 1px 0 #ffffff40, 0 1px 0 #4a4d58; }
/* no zooming, text picking or page dragging by accident on a touch screen (main.mjs stops pinches on the handheld) */
html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { touch-action: manipulation; }
.console, .topbar { -webkit-touch-callout: none; }

.keyhint { display: none; margin-top: 10px; color: #6a6e7e; font: 600 12px var(--body); letter-spacing: 0.06em; text-align: center; }
.keyhint kbd { min-width: 0; padding: 1px 6px; font-size: 11px; background: #f4f5f8; border-color: #b9bdc9; box-shadow: 0 2px 0 #9da1ae; color: #3a3c48; }
/* desktop: keyboard players don't need the pad; give the screen the room (and the key hint) */
@media (hover: hover) and (pointer: fine) {
  .console { --scr-w: min(calc((100dvh - 250px) * 10 / 9), 1024px, calc(100vw - 120px)); padding-bottom: 18px; }
  .controls { display: none; }
  .keyhint { display: block; }
}
/* phones: the console fills the width; the screen gives way to short viewports */
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 10px; }
  .icon-btn { min-width: 36px; height: 36px; border-radius: 10px; }
  .stage { padding: 4px 6px 8px; place-items: start center; }
  .console { --scr-w: min(calc(100vw - 40px), calc((100dvh - 330px) * 10 / 9)); width: 100%; padding: 14px 14px 22px; border-radius: 22px; }
  .bezel { width: min(100%, calc(var(--scr-w) + 16px)); padding: 8px 8px 8px; border-radius: 10px 10px 26px 10px; }
  .controls { margin-top: 18px; }
  .foot { display: none; }
}
/* landscape phones: controls on the sides of the screen, the top bar's buttons down the left edge */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    position: fixed; inset: 0 auto 0 0; z-index: 2; flex-direction: column; gap: 8px;
    width: calc(56px + env(safe-area-inset-left, 0px)); max-width: none; margin: 0;
    padding: 8px 8px 8px calc(8px + env(safe-area-inset-left, 0px)); background: none;
  }
  .topbar .tipo-word, .topbar .tipo-crumb, .topbar .tipo-feedback { display: none; }
  .topbar .tipo-home { min-height: 0; }
  .topbar .tipo-lang { flex-direction: column; }
  .topbar .tipo-lang button { min-width: 30px; height: 28px; padding: 0 4px; }
  .top-actions { margin-left: 0; flex-direction: column; gap: 6px; }
  .icon-btn { min-width: 36px; height: 36px; border-radius: 10px; }
  .stage { padding: 0 0 0 calc(56px + env(safe-area-inset-left, 0px)); place-items: center; }
  .console {
    --scr-w: min(calc((100dvh - 96px) * 10 / 9), calc(100vw - 410px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    flex-direction: row; width: auto; padding: 10px 14px; border-radius: 22px;
  }
  .bezel { width: calc(var(--scr-w) + 28px); order: 2; }
  .controls { display: contents; }
  .dpad { order: 1; margin-right: 18px; }
  .mid-btns { order: 4; position: absolute; right: 26px; bottom: 16px; padding: 0; }
  .ab { order: 3; margin-left: 18px; }
  .foot { display: none; }
}

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; width: 100%; max-width: 1680px; margin: 0 auto; padding: 6px 24px 14px; color: var(--quiet); font-size: 12px; letter-spacing: 0.02em; }

/* ---------- dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: #0a0910c0; backdrop-filter: blur(4px); }
.card { width: min(520px, 100%); max-height: 90dvh; overflow: auto; padding: 22px 24px; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px #000a; }
.card.narrow { width: min(380px, 100%); }
.eyebrow { color: #a0503a; font: 800 10px var(--heading); letter-spacing: 0.22em; }
.card h2 { margin: 4px 0 14px; font: 26px var(--title); letter-spacing: 0.04em; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys td { padding: 7px 4px; border-top: 1px solid #e3d8c0; }
.keys td:first-child { color: #6a5e58; }
kbd { display: inline-block; min-width: 22px; margin: 0 2px; padding: 2px 6px; border-radius: 6px; background: #fff; border: 1px solid #d8ccb4; box-shadow: 0 2px 0 #d8ccb4; font: 700 12px var(--heading); text-align: center; color: var(--ink); }
.tips { margin: 14px 0 4px; padding-left: 18px; font-size: 13.5px; line-height: 1.7; color: #4a4048; }
.row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn { padding: 10px 22px; border: 0; border-radius: 12px; background: var(--cinnabar); color: #fff; font: 700 15px var(--body); box-shadow: 0 3px 0 #7a1e18; }
#nameInput { width: 100%; padding: 12px 14px; border: 2px solid #d8ccb4; border-radius: 12px; background: #fff; color: var(--ink); font: 700 20px var(--body); text-align: center; letter-spacing: 0.1em; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.presets button { padding: 6px 12px; border: 1px solid #d8ccb4; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; }
/* a save to download, or a save file to pick (存档管理, saves.mjs): a real button, as a phone wants one */
.file-about { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: #4a4048; }
.file-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.file-actions .btn { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 46px; text-align: center; }
.btn.ghost { background: #efe4cf; color: var(--ink); box-shadow: 0 3px 0 #d3c19e; }
.file-note { margin: 14px 0 0; color: #8a7e78; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .led { box-shadow: none; }
}
@media (max-width: 640px), (max-height: 520px) and (orientation: landscape) {
  .foot { display: none; }
}

/* ---------- full screen: only the game (and the pad on touch screens) ---------- */
html.is-full, html.is-full body { background: #07060a; }
html.is-full .foot, html.is-full .keyhint, html.is-full .tipo-home, html.is-full .tipo-crumb, html.is-full .tipo-feedback, html.is-full .tipo-lang, html.is-full .bezel-top, html.is-full .bezel-bottom { display: none; }
html.is-full .topbar { justify-content: flex-end; max-width: none; padding: calc(4px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px)) 4px 8px; }
html.is-full .top-actions { opacity: 0.6; transition: opacity 0.2s; }
html.is-full .top-actions:hover, html.is-full .top-actions:focus-within { opacity: 1; }
html.is-full .stage { padding: 0; place-items: start center; }
html.is-full .console {
  --scr-w: min(100vw, calc((100dvh - 230px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 10 / 9));
  width: 100%; padding: 0 0 12px; border-radius: 0; background: none; box-shadow: none;
}
html.is-full .bezel { width: var(--scr-w); padding: 0; border-radius: 0; background: none; box-shadow: none; }
html.is-full .screen-wrap { border-radius: 0; box-shadow: none; }
html.is-full .controls { max-width: 560px; margin-top: 20px; padding: 0 18px; }
/* desktop: no pad; the screen takes the whole height and the buttons wait beside it */
@media (hover: hover) and (pointer: fine) {
  html.is-full .topbar { position: fixed; top: 0; right: 0; z-index: 3; width: auto; padding: 10px; }
  html.is-full .top-actions { flex-direction: column; }
  html.is-full .stage { place-items: center; }
  html.is-full .console { --scr-w: min(calc(100vw - 128px), 100dvh * 10 / 9); width: auto; padding: 0; }
}
/* phones sideways: the pad on either side of the screen, the buttons down the left edge */
@media (max-height: 520px) and (orientation: landscape) {
  html.is-full .topbar { position: fixed; inset: 0 auto 0 0; flex-direction: column; justify-content: flex-start; width: calc(56px + env(safe-area-inset-left, 0px)); padding: 8px 8px 8px calc(8px + env(safe-area-inset-left, 0px)); }
  html.is-full .stage { place-items: center; }
  html.is-full .console { --scr-w: min(100dvh * 10 / 9, calc(100vw - 330px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); width: auto; flex-direction: row; padding: 0 10px; }
}

/* 320px phones: a smaller pad and A/B, so the console (and the full screen's pad) fits the width and A isn't cut off */
@media (max-width: 340px) {
  .console { padding: 12px 10px 20px; }
  .controls { padding: 0 2px; }
  .dpad { --pad: 100px; }
  .pill { padding: 6px 10px; }
  .ab { --btn: 52px; width: 116px; height: 96px; }
  html.is-full .controls { padding: 0 12px; }
}

/* ---------- touch screens: the handheld fills the window ---------- */
/* Phones and tablets (no mouse): upright, the screen is as wide as the handheld can be and the pad, A, B and START share
   the room below it, growing to fill it; sideways, the screen is as tall as the window allows, with the pad and the
   buttons in the room either side. Clear of the notch and the home bar; the pixels stay even at any size (ui.mjs
   Screen). Desktops keep the layouts above. */
@media not all and (hover: hover) and (pointer: fine) {
  .foot, .keyhint { display: none; }
  @media (orientation: portrait) {
    /* a definite height all the way down, so the room under the screen can size the pad and the buttons (cqh) */
    body { height: 100dvh; }
    .stage {
      display: flex; flex-direction: column; align-items: center;
      padding: 4px max(6px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    }
    .console {
      /* as wide as it can be, leaving the pad and the buttons a fifth of the height and more */
      --scr-w: min(calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), calc((78dvh - 160px - env(safe-area-inset-bottom, 0px)) * 10 / 9), 900px);
      flex: 1; width: min(100%, calc(var(--scr-w) + 32px)); padding: 10px 8px 10px; border-radius: 22px;
    }
    .bezel { width: calc(var(--scr-w) + 16px); padding: 8px; border-radius: 10px 10px 26px 10px; }
    /* the room under the screen: the pad on the left, B and A on the right, START just below between them */
    .controls {
      flex: 1; min-height: 140px; margin-top: 10px; padding: 0 4% 2px; container-type: size;
      grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; align-content: center; align-items: center;
    }
    /* each as big as its half allows, above START's row (44px) */
    .dpad { grid-area: 1 / 1; --pad: clamp(96px, min(40cqw, calc(100cqh - 44px)), 160px); }
    .ab { grid-area: 1 / 2; --btn: clamp(46px, min(18.5cqw, calc((100cqh - 44px) / 1.86)), 80px); width: calc(var(--btn) * 2.36); height: calc(var(--btn) * 1.86); }
    .mid-btns { grid-area: 2 / 1 / 3 / 3; justify-self: center; padding: 6px 0 4px; }
  }
  @media (orientation: landscape) {
    /* --gl / --gr: the room kept at the left and right edges (the top bar's column on phones, the notch) */
    :root { --gl: max(16px, env(safe-area-inset-left, 0px)); --gr: max(16px, env(safe-area-inset-right, 0px)); }
    .stage { place-items: center; padding: 6px var(--gr) 10px var(--gl); }
    .console {
      /* the screen as tall as it fits (--chrome-h: the top bar, the margins, the bezel and its labels), leaving at least
         --side either side; --room is what each side gets */
      --side: clamp(110px, 15vw, 170px);
      --chrome-h: 180px;
      --chrome-w: 64px;
      --scr-w: min(calc((100dvh - var(--chrome-h)) * 10 / 9), calc(100vw - var(--gl) - var(--gr) - var(--chrome-w) - 2 * var(--side)));
      --room: calc((100vw - var(--gl) - var(--gr) - var(--chrome-w) - var(--scr-w)) / 2);
      flex-direction: row; align-items: center; width: 100%; padding: 14px 18px; border-radius: 26px;
    }
    .bezel { order: 2; flex: none; width: calc(var(--scr-w) + 28px); }
    .controls { display: contents; }
    .dpad { order: 1; margin: auto; --pad: clamp(96px, min(calc(var(--room) * 0.84), calc((100dvh - var(--chrome-h)) * 0.5)), 176px); }
    .ab { order: 3; margin: auto; --btn: clamp(44px, min(calc(var(--room) * 0.38), calc((100dvh - var(--chrome-h)) * 0.24)), 80px); width: calc(var(--btn) * 2.36); height: calc(var(--btn) * 1.86); }
    .mid-btns { order: 4; position: absolute; right: calc(var(--room) / 2 - 22px); bottom: 14px; padding: 0; }
  }
  /* phones on their side: the top bar's buttons down the left edge (above), no labels on the bezel, thin margins */
  @media (orientation: landscape) and (max-height: 520px) {
    :root { --gl: calc(56px + env(safe-area-inset-left, 0px)); --gr: max(8px, env(safe-area-inset-right, 0px)); }
    .stage { padding: 6px var(--gr) 6px var(--gl); }
    .console { --chrome-h: 36px; --chrome-w: 32px; --side: clamp(104px, 16vw, 170px); padding: 6px 10px; border-radius: 18px; }
    .bezel { width: calc(var(--scr-w) + 12px); padding: 6px; border-radius: 10px; }
    .bezel-top, .bezel-bottom { display: none; }
    .mid-btns { bottom: 8px; }
  }

  /* full screen: only the game and the pad */
  @media (orientation: portrait) {
    html.is-full .stage { padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
    html.is-full .console {
      --scr-w: min(calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), calc((100dvh - 230px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 10 / 9));
      width: 100%; padding: 0 0 8px;
    }
    html.is-full .bezel { width: var(--scr-w); padding: 0; }
    html.is-full .controls { width: 100%; max-width: 560px; margin-top: 12px; padding: 0 5% 2px; }
  }
  @media (orientation: landscape) {
    :root.is-full { --gl: calc(56px + env(safe-area-inset-left, 0px)); --gr: max(8px, env(safe-area-inset-right, 0px)); }
    html.is-full .topbar {
      position: fixed; inset: 0 auto 0 0; z-index: 2; flex-direction: column; justify-content: flex-start; gap: 8px;
      width: calc(56px + env(safe-area-inset-left, 0px)); max-width: none; margin: 0;
      padding: 8px 8px 8px calc(8px + env(safe-area-inset-left, 0px)); background: none;
    }
    html.is-full .top-actions { margin-left: 0; flex-direction: column; gap: 6px; }
    html.is-full .icon-btn { min-width: 36px; height: 36px; border-radius: 10px; }
    html.is-full .stage { place-items: center; padding: 0 var(--gr) 0 var(--gl); }
    html.is-full .console {
      --chrome-h: 0px; --chrome-w: 0px;
      --scr-w: min(calc((100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 10 / 9), calc(100vw - var(--gl) - var(--gr) - 2 * var(--side)));
      --room: calc((100vw - var(--gl) - var(--gr) - var(--scr-w)) / 2);
      width: 100%; padding: 0; flex-direction: row;
    }
    html.is-full .bezel { width: var(--scr-w); padding: 0; }
    html.is-full .mid-btns { bottom: 16px; }
  }
}
