@import url('/interface-control-charter.css');
@import url('/scrollbars.css');
/* Live site: approved pixel interface, with the emulator's geometry kept separate. */
@font-face {
  font-family: "Fusion Pixel";
  src: url("/fonts/fusion-pixel/fusion-pixel-12px-proportional-ja.otf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
:root {
  color-scheme: dark;
  font-family: "Fusion Pixel";
  font-size: 24px;
  font-weight: 400;
  font-synthesis: none;
  --bg: #141820;
  --surface: #1e2530;
  --raised: #293442;
  --edge: #47556b;
  --edge-light: #738ba7;
  --ink: #f0f1f3;
  --muted: #a3afc1;
  --accent: #9bbfe8;
  --accent-ink: #1b2b43;
  --shadow: #080d14;
  --read-bg: #171e29;
  --error: #ffb5a9;
  --device: #95abc9;
  --device-edge: #4d6585;
  --device-screen: #d0e0f2;
  --device-dark: #23334a;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--shadow); }
.pixel-app, .pixel-app * { -webkit-user-select: none; user-select: none; caret-color: transparent; }
.pixel-app { cursor: default; }
.pixel-app :is(input,textarea,[contenteditable="true"]) { -webkit-user-select: text; user-select: text; caret-color: auto; }
button, input, select, textarea, kbd, code { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, summary:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 4px; }
h1, h2, h3, strong, b { font: inherit; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon, .console-card svg, .empty-art { fill: currentColor; shape-rendering: crispEdges; flex: none; }
.icon { width: 16px; height: 16px; }
.pixel-app { padding: 12px 12px 26px; height: 100svh; }
.app-shell { position: relative; height: 100%; min-height: 0; border: 2px solid var(--edge); background: var(--bg); box-shadow: 0 0 0 3px var(--shadow); }
.app-header { position: absolute; top: 14px; right: 14px; left: 14px; display: flex; justify-content: space-between; align-items: start; z-index: 1; pointer-events: none; }
.app-header > * { pointer-events: auto; }
.home-account-links { display: flex; gap: 10px; }
.home-profile-tools { display:flex; gap:10px; margin-left:auto; }
.home-profile-tools a { text-decoration:none; }
.home-profile-tools .account-icon { width:20px; height:20px; }
.guest-trial-status { flex: none; color: var(--muted); font-size: 16px; line-height: 1.4; margin: 16px 26px 0; }
#guest-dialog p { line-height: 1.5; }
#guest-dialog .dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
#guest-dialog .dialog-actions > * { flex: 1; text-align: center; text-decoration: none; }
.home-account-links a { text-decoration: none; }
.home-account-links .account-icon { width: 20px; height: 20px; }
#account-demo-link { color: #f2cf7b; width: auto; gap: 6px; }
#account-demo-link span { font-size: 16px; line-height: 1; }
[data-home="false"] .app-header { display: none; }
.home-legal { justify-self: center; display: grid; place-items: center; min-height: 44px; color: var(--muted); font-size: 18px; text-decoration: none; }
.home-legal:hover { color: var(--accent); }
.home-screen { height: 100%; min-height: 0; overflow: auto; display: grid; place-items: safe center; padding: 64px 40px 40px; }
.menu-options { width: min(100%,980px); min-width: 0; display: grid; gap: 28px; }
.home-brand { display: flex; justify-content: center; align-items: center; column-gap: 20px; margin-top: calc(-1 * clamp(20px,10svh,108px)); margin-bottom: clamp(40px,9svh,96px); }
.home-brand img { flex: none; width: 72px; height: auto; image-rendering: pixelated; }
.brand-wordmark { font-size: 80px; line-height: 1; white-space: nowrap; text-shadow: 0 4px 0 var(--device-edge),0 8px 0 var(--shadow); }
.brand-wordmark span { color: var(--accent); }
.home-brand .brand-wordmark .pixel-wordmark,.account-brand .brand-wordmark .pixel-wordmark{display:block;width:5em;height:1em;max-width:100%;image-rendering:pixelated;object-fit:contain}
.favorite-star .icon{width:24px;height:24px;display:block}
.favorite-star .favorite-full{display:none}
[aria-pressed=true] .favorite-star .favorite-empty{display:none}
[aria-pressed=true] .favorite-star .favorite-full{display:block}
.brand-wordmark:focus { outline: none; }
.language-options { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.language-option { position: relative; cursor: pointer; }
.language-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.language-option > span { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 10px 12px; border: 2px solid var(--edge); background: var(--surface); color: var(--muted); box-shadow: 3px 3px 0 var(--shadow); line-height: 1; }
.language-option:hover > span { border-color: var(--accent); color: var(--ink); background: var(--raised); }
.language-option input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.language-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 5px; }
.console-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.console-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 238px; min-width: 0; padding: 30px 14px; border: 2px solid var(--edge); background: var(--surface); box-shadow: 4px 4px 0 var(--shadow); line-height: 1.3; }
.console-card > svg { width: 144px; height: 96px; }
.console-card:hover { background: var(--raised); border-color: var(--accent); }
.console-card:hover::before { content: ""; position: absolute; top: 14px; left: 14px; width: 4px; height: 4px; background: var(--accent); box-shadow: 4px 0 0 var(--accent),4px 4px 0 var(--accent),8px 4px 0 var(--accent),4px 8px 0 var(--accent),0 8px 0 var(--accent); }
.device-shadow { fill: var(--shadow); }
.device-body { fill: var(--device); }
.device-edge { fill: var(--device-edge); }
.device-screen { fill: var(--device-screen); }
.device-dark { fill: var(--device-dark); }
.device-shine { fill: #f1f6ff90; }
.vocabulary-test { justify-self: center; max-width: 100%; white-space: normal; text-align: center; flex-wrap: wrap; }
.vocabulary-test span { font-size: 16px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) clamp(300px,21vw,380px); height: 100%; min-height: 0; }
.play-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 2px solid var(--edge); }
.console-stage { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; min-width: 0; padding: 22px; }
/* The host measures this space. No max-width or aspect rule may stretch the framebuffer. */
.ds-display { position: relative; flex: none; width: var(--fitted-width,0px); height: var(--fitted-height,0px); background: var(--read-bg); overflow: clip; box-shadow: 0 0 0 3px var(--shadow),0 0 0 5px var(--edge-light),0 0 0 8px var(--shadow); }
#emulator-frame, #demo-canvas, .empty-console { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; max-height: none; border: 0; margin: 0; background: var(--read-bg); image-rendering: pixelated; }
.empty-console { display: flex; flex-direction: column; }
.empty-screen { position: relative; flex: none; width: 100%; height: 50%; display: grid; place-items: center; overflow: hidden; }
.empty-actions { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 14px; }
.empty-art { width: 144px; height: 96px; }
.empty-touch { width: 32px; height: 32px; color: var(--edge-light); }
[data-console]:not([data-console="ds"]) .empty-screen { height: 100%; }
[data-console]:not([data-console="ds"]) .empty-screen.bottom { display: none; }
[data-ds-view="split"] #emulator-frame, [data-ds-view="split"] #demo-canvas, [data-ds-view="split"] .empty-console { height: 200%; }
[data-ds-view="split"][data-ds-primary="lower"] #emulator-frame, [data-ds-view="split"][data-ds-primary="lower"] #demo-canvas, [data-ds-view="split"][data-ds-primary="lower"] .empty-console { top: -100%; }
.player-dock { container-type: inline-size; position: relative; flex: none; padding: 12px; border-top: 2px solid var(--edge); background: var(--surface); }
.main-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,320px) minmax(0,1fr); align-items: center; gap: 12px; }
.control-group { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: 6px; }
.checkpoint-actions { display: flex; gap: 6px; }
.volume-control { position: relative; display: flex; }
.volume-popover { display: none; position: absolute; bottom: 100%; right: 0; width: 210px; padding-bottom: 10px; z-index: 20; }
.volume-control:hover .volume-popover, .volume-control:focus-within .volume-popover { display: block; }
.volume-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 14px; background: var(--raised); border: 2px solid var(--edge-light); box-shadow: 4px 4px 0 var(--shadow); font-size: 12px; }
.volume-panel label { grid-column: 1 / -1; }
.volume-panel input { width: 100%; min-width: 0; margin: 0; appearance: none; height: 8px; border: 1px solid var(--edge-light); background: var(--shadow); cursor: pointer; }
.volume-panel input::-webkit-slider-thumb { appearance: none; width: 12px; height: 18px; background: var(--accent); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.volume-panel input::-moz-range-thumb { width: 8px; height: 14px; border-radius: 0; background: var(--accent); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.volume-panel input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.volume-panel output { min-width: 42px; text-align: right; }
.control-group-start { justify-content: flex-end; }
.control-group-end { justify-content: flex-start; }
#player-settings-slot { display: contents; }
.pixel-button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 10px; border: 2px solid var(--edge); border-radius: 0; background: var(--raised); color: var(--ink); box-shadow: inset 2px 2px 0 #ffffff0b,inset -2px -2px 0 #0002,2px 3px 0 var(--shadow); line-height: 1; white-space: nowrap; }
.main-actions .pixel-button { padding-inline: 8px; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pixel-button.vocabulary-test { white-space: normal; }
.pixel-button:hover:not(:disabled), .button:hover:not(:disabled) { border-color: var(--accent); filter: brightness(1.08); }
.pixel-button:active:not(:disabled), .button:active:not(:disabled), .console-card:active { transform: translate(1px,2px); box-shadow: inset 2px 2px 0 #0002; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; min-height: 40px; padding: 8px; border: 2px solid var(--edge); border-radius: 0; background: var(--raised); color: var(--ink); }
.icon-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.capture-button { width: 100%; min-height: 52px; gap: 14px; }
.capture-button kbd { padding: 5px 7px; border: 1px solid currentColor; box-shadow: 0 2px 0 currentColor; font-size: 12px; line-height: 1; }
.secondary-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.reader-toolbar select { max-width: 100%; padding: 5px 7px; border: 1px solid var(--edge); border-radius: 0; background: var(--surface); color: var(--muted); font-size: 12px; }
.text-button { background: none; border: 0; color: var(--accent); padding: 4px 0; line-height: 1.4; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.secondary-actions .text-button { font-size: 12px; }
.translation-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 12px; background: var(--surface); }
.translation-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--edge) var(--surface); padding: 0 3px 12px 0; }
.reading-card { background: var(--read-bg); padding: 14px 12px; border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--shadow); }
.translation-body:has(#latest-result:not([hidden])) .translation-intro { display: none; }
.placeholder { color: var(--muted); }
/* Reading keeps the exact approved non-pixel typography. */
.language-block { margin: 0; padding: 0; }
.source-with-audio { display: flex; align-items: flex-start; gap: 8px; }
.source-with-audio > p { flex: 1; min-width: 0; }
.read-aloud { flex: none; width: 30px; min-height: 30px; padding: 4px; margin-top: 3px; }
.read-aloud[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.speech-status { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; }
.mode-test-indicator { display: block; font-size: 12px; color: var(--muted); margin-top: 12px; }
.language-block p { white-space: pre-line; overflow-wrap: anywhere; }
.japanese { font-family: "Yu Gothic",Meiryo,sans-serif; font-size: 23px; font-weight: 500; line-height: 1.65; margin: 0; }
.romaji { font-family: "Segoe UI",Arial,sans-serif; font-size: 17px; font-style: italic; line-height: 1.6; color: var(--muted); margin: 2px 0 0; }
.french { font-family: "Segoe UI",Arial,sans-serif; font-size: 20px; font-weight: 600; line-height: 1.6; margin: 8px 0 0; }
.romaji, .french { font-synthesis: weight style; }
.foldable-reading { display: grid; grid-template-columns: minmax(0,1fr) 32px; align-items: start; column-gap: 8px; }
.foldable-reading[data-reading-field="french"] { margin-top: 8px; }
.foldable-reading > p { grid-area: 1 / 1; min-width: 0; margin-top: 0; }
.reading-toggle { grid-area: 1 / 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 32px; min-height: 32px; padding: 4px 8px; border: 0; background: none; color: var(--muted); font-size: 14px; line-height: 1.4; text-align: left; }
.reading-toggle .icon { flex: none; width: 12px; height: 12px; }
.reading-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.reading-toggle:hover { color: var(--accent); }
.reading-collapsed .reading-toggle { grid-column: 1 / -1; padding-left: 0; }
.passage + .passage { border-top: 1px solid var(--edge); margin-top: 18px; padding-top: 18px; }
.screen-source { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.passage:only-of-type .screen-source { display: none; }
.translation-note { font-family: "Segoe UI",Arial,sans-serif; font-size: 14px; line-height: 1.6; color: var(--muted); white-space: pre-line; }
.result-message { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.translation-status { flex: none; color: var(--accent); font-size: 24px; line-height: 1.4; margin: 0 0 12px; overflow-wrap: anywhere; }
.error { color: var(--error); }
.history-panel { margin-top: 12px; border-bottom: 1px solid var(--edge); }
.history-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; color: var(--muted); list-style: none; }
.history-panel .icon { width: 12px; height: 12px; }
summary::-webkit-details-marker { display: none; }
.history-panel[open] > summary .icon { transform: rotate(180deg); }
#history-count { font-size: 12px; }
.empty-history { color: var(--muted); font-size: 12px; line-height: 1.5; }
.history { margin: 0; padding: 0; list-style: none; }
.history button { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; width: 100%; border: 0; border-top: 1px solid var(--edge); padding: 12px 4px; background: none; text-align: left; font-size: 12px; line-height: 1.5; }
.history button:hover, .history button[aria-pressed="true"] { background: var(--raised); }
.history time { color: var(--muted); }
.history-japanese, .history-french { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-japanese { font-family: "Yu Gothic",Meiryo,sans-serif; font-size: 14px; margin-top: 6px; }
.history-french { font-family: "Segoe UI",Arial,sans-serif; font-size: 11px; color: var(--muted); }
.secondary-screen { flex: none; margin-top: 12px; padding: 5px; border: 2px solid var(--edge); background: var(--shadow); box-shadow: 2px 2px 0 var(--shadow); }
.secondary-viewport { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: var(--read-bg); touch-action: none; user-select: none; }
.secondary-viewport.touch-enabled { cursor: crosshair; }
#secondary-video { position: absolute; width: 100%; height: 200%; max-width: none; max-height: none; left: 0; top: 0; object-fit: fill; pointer-events: none; image-rendering: pixelated; }
[data-ds-primary="upper"] #secondary-video { top: -100%; }
#secondary-demo { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#secondary-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--edge-light); }
#secondary-placeholder .icon { width: 32px; height: 32px; }
.game-notice { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 12px; width: max-content; max-width: min(650px,calc(100% - 24px)); padding: 12px 16px; border: 2px solid var(--edge-light); background: var(--surface); box-shadow: 4px 4px 0 var(--shadow); z-index: 10; }
.game-notice:has(.error) { border-color: var(--error); }
#game-message { flex: 1; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
#dismiss-notice { min-height: 28px; width: 28px; padding: 0; border: 0; }
.workspace:fullscreen { width: 100vw; height: 100svh; border: 0; background: var(--bg); }
dialog { width: min(620px,calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; padding: 22px; border: 3px solid var(--edge-light); border-radius: 0; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 3px var(--shadow),8px 8px 0 3px #0004; font: inherit; line-height: 1.4; }
dialog::backdrop { background: #080d14b8; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--edge); }
dialog p { color: var(--muted); }
dialog h3 { margin: 24px 0 10px; color: var(--ink); }
.speech-preference { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.speech-preference input { flex: none; width: 20px; height: 20px; margin-top: 6px; accent-color: var(--accent); }
dialog .settings-note { font-size: 12px; line-height: 1.6; }
#settings-dialog .voice-choice { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 20px; }
#settings-dialog .voice-choice > label { grid-column: 1 / -1; font-size: 20px; }
#settings-dialog .voice-choice select, #voice-help-device { min-width: 0; max-width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--edge-light); border-radius: 0; background: var(--read-bg); color: var(--ink); font: inherit; font-size: 18px; }
#voice-example { min-height: 44px; font-size: 18px; padding-inline: 12px; white-space: normal; }
#settings-dialog .voice-note { font-size: 17px; line-height: 1.5; margin: 10px 0; }
#settings-dialog .voice-note.error { color: var(--error); }
#settings-dialog #voice-help { margin-top: 12px; }
#voice-help summary { color: var(--accent); font-size: 19px; cursor: pointer; padding-block: 6px; }
#voice-help .voice-help-body { margin-top: 12px; font-size: 18px; }
#voice-help .voice-help-body > label { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
#voice-help-steps { padding-left: 24px; line-height: 1.5; }
#voice-help-steps li + li { margin-top: 10px; }
#voice-help .voice-help-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
#voice-help .voice-help-actions > * { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }
@media(max-width:600px) { #settings-dialog .voice-choice { grid-template-columns: minmax(0,1fr); } }
dialog details { border-top: 1px solid var(--edge); padding-top: 14px; margin-top: 20px; }
dialog .text-button, dialog .button { white-space: normal; text-align: left; }
.privacy-footer { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 18px; }
.current-game { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0; overflow-wrap: anywhere; }
.game-state { color: var(--accent); font-size: 12px; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.control-grid > span { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
dialog kbd { padding: 4px 6px; border: 1px solid var(--edge); background: var(--raised); white-space: nowrap; }
.extra-actions, .session-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 22px; }
.session-dialog-actions { justify-content: flex-end; }
.save-transfer select { width: 100%; max-width: 100%; margin-top: 18px; padding: 10px; border: 1px solid var(--edge); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 14px; }
.save-transfer .extra-actions { margin-top: 12px; }
.remembered-games { list-style: none; margin: 12px 0; padding: 0; }
.remembered-games li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--edge); }
.remembered-games li span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; color: var(--muted); }
.remembered-games li button { flex: none; }
.help-page { max-width: 940px; margin: 24px auto; padding: 28px; line-height: 1.5; border: 2px solid var(--edge); background: var(--surface); overflow-wrap: anywhere; }
.help-page h1, .help-page h2 { margin: 28px 0 16px; color: var(--accent); }
.help-page p, .help-page li { color: var(--muted); }
.help-page li + li { margin-top: 14px; }
.help-card { padding-block: 14px; border-top: 1px solid var(--edge); }
.help-card details { padding-block: 12px; border-bottom: 1px solid var(--edge); }
.help-page code { color: var(--ink); }
.legal-page { font-size: 20px; line-height: 1.55; -webkit-user-select: none; user-select: none; caret-color: transparent; }
.legal-page h1 { font-size: 32px; }
.legal-page h2 { font-size: 24px; }
.legal-page section + section { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--edge); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legal-page .legal-date { font-size: 16px; }
@container(max-width:1220px) {
  .main-actions { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; }
  .capture-button { grid-area: 1 / 1 / 2 / -1; justify-self: center; width: min(100%,360px); }
}
@container(max-width:800px) {
  .main-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .control-group { display: contents; }
  .capture-button { order: -1; flex: 0 0 100%; margin-bottom: 4px; }
}
@media(max-width:1000px) {
  .home-screen { padding: 64px 28px 28px; }
  .menu-options { gap: 24px; }
  .console-options { gap: 14px; }
  .console-card { min-height: 216px; padding-inline: 8px; }
  .console-card > svg { width: 120px; height: 80px; }
}
@media(max-width:760px) {
  .pixel-app { height: auto; min-height: 100svh; padding: 10px 10px 26px; }
  .app-shell { height: auto; min-height: calc(100svh - 36px); }
  .home-screen { min-height: calc(100svh - 40px); padding: 68px 18px 26px; }
  .home-brand { gap: 10px; margin-top: -16px; margin-bottom: 28px; }
  .home-brand img { width: 52px; height: auto; }
  .brand-wordmark { font-size: clamp(36px,12.2vw,52px); text-shadow: 0 3px 0 var(--device-edge),0 6px 0 var(--shadow); }
  .language-options { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .language-option:last-child { grid-column: 1 / -1; }
  .console-options { grid-template-columns: 1fr; gap: 14px; }
  .console-card { flex-direction: row; justify-content: flex-start; min-height: 94px; gap: 16px; padding: 12px; text-align: left; }
  .console-card > svg { width: 84px; height: 56px; }
  .workspace { grid-template-columns: minmax(0,1fr); height: auto; }
  .play-panel { border-right: 0; border-bottom: 2px solid var(--edge); }
  .console-stage { flex: none; width: 100%; aspect-ratio: 4/3; padding: 20px; }
  [data-console="gbc"] .console-stage { aspect-ratio: 10/9; }
  [data-console="gba"] .console-stage { aspect-ratio: 3/2; }
  [data-ds-view="stacked"] .console-stage { aspect-ratio: 2/3; }
  .empty-actions { gap: 8px; padding: 8px; }
  .empty-art { width: 84px; height: 56px; }
  .empty-actions .text-button { font-size: 12px; }
  .player-dock { padding: 10px; }
  .translation-panel { padding: 16px; }
  .translation-body { overflow: visible; padding-right: 0; }
  .secondary-screen { order: -1; width: min(100%,300px); align-self: center; margin: 0 0 16px; }
  .workspace:fullscreen { height: 100svh; overflow-y: auto; }
  .control-grid { grid-template-columns: 1fr; }
  .help-page { margin: 12px; padding: 18px; }
}
@media(max-height:620px) {
  .home-brand { margin-top: 0; margin-bottom: 28px; }
}
@media(min-width:761px) and (min-height:621px) and (max-height:850px) {
  .home-brand { margin-top: 0; margin-bottom: 36px; }
}
/* Discovery uses the existing pixel panels; no extra font or icon source. */
#site-language-toggle img { image-rendering: pixelated; width: 30px; height: 20px; object-fit: contain; }
.discovery-meter { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.discovery-meter progress { flex: 1; width: 100%; height: 16px; accent-color: var(--accent, #edc45c); }
.discovery-filters { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.discovery-filters label { display: flex; gap: 8px; align-items: center; font-size: 1rem; }
.discovery-filters select { font: inherit; min-height: 42px; max-width: 100%; }
.discovery-entry h3 { overflow-wrap: anywhere; }
.discovery-entry.is-locked { opacity: .58; }
.discovery-entry details { margin-top: 12px; overflow-wrap: anywhere; }
.discovery-entry details summary { cursor: pointer; }
.discovery-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.discovery-notice { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; pointer-events: none; max-width: calc(100vw - 32px); padding: 12px 16px; border: 2px solid #edc45c; background: #182230; color: #fff; font-size: 1rem; box-shadow: 4px 4px #080d14; }

/* Button interaction must not add browser selection frames. */
html body :is(button,a,[role=button],summary,label,select):is(:focus,:focus-visible,:active){outline:none!important;outline-offset:0!important;box-shadow:none!important}
html body :is(button,a,[role=button],summary,label){-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
