@font-face { font-family: Pixel; src: url('vendor/pixelify-sans.woff2') format('woff2'); font-display: swap; }
:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #080d12; color: #f5f4f2; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.app { position:fixed; inset:0 auto auto 0; height:100dvh; width:100%; display:flex; align-items:center; justify-content:center; padding:max(8px,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right,0px)) max(8px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)); background:#080d12; }
.console { position:relative; width:min(calc(100vw - 16px),calc((100dvh - 16px) * 414 / 795)); aspect-ratio:414 / 795; flex:none; }
/* Give the status bar extra breathing room in the portrait Daniel edition. */
@media (orientation: portrait) and (pointer: coarse) {
  [data-edition="daniel"] .app {
    --console-top: calc(max(8px, env(safe-area-inset-top, 0px)) + 12px);
    --console-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    padding-top: var(--console-top);
  }
  [data-edition="daniel"] .console {
    width: min(calc(100vw - 16px), calc((100dvh - var(--console-top) - var(--console-bottom)) * 414 / 795));
  }
}
.skin-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit:contain; pointer-events: none; user-select: none; }
.bezel { position: absolute; left: 4.830918%; top: 6.645702%; width: 90.338164%; height: 31.362683%; border-radius: 1.3369% / 2.0053%; overflow: hidden; }
.screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; font-family: Pixel, sans-serif; container-type: size; }
.game-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: contain; image-rendering: pixelated; }
.pad, .face, .meta, .shoulders { display: contents; }
.dpad { position: absolute; left: 7.246%; top: 63.451%; width: 35.265%; height: 19.837%; z-index: 2; touch-action: none; border-radius: 24%; }
.dpad-arm { display: none; }
.dpad[data-dir]:not([data-dir=""]) { background: #ffffff1a; }
.pad-button, .pad-pill, .skin-control { position: absolute; transform: translate(-50%,-50%); z-index: 2; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: transparent; font-size: 0; touch-action: none; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.pad button, .dpad { touch-action: none; }
.pad-button.is-down, .pad-pill.is-down, .skin-control:active, #turbo[aria-pressed=true] { background: #ffffff40; box-shadow: inset 0 0 0 2px #ffffff50; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #ffcf7a; outline-offset: 2px; }
.card { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; text-align: center; background: #090d13; }
.app[data-state=title] .card-title, .app[data-state=loading] .card-loading, .app[data-state=error] .card-error { display: flex; }
.button { min-height: 44px; border: 1px solid #4a6776; border-radius: 10px; padding: 10px 16px; font: 600 18px Pixel, sans-serif; color: #f5f4f2; background: #213441; }
.button:active { background: #36576b; }
.button:disabled { opacity: .45; }
.button-play { background: #356b77; font-size: 24px; }
.card-heading { margin: 0; font: 20px Pixel, sans-serif; }
.card-note { margin: 0; font-size: 12px; }
.meter { width: 70%; height: 8px; border: 1px solid #80b6c4; padding: 1px; }
.meter-fill { height: 100%; width: 0; background: #80b6c4; }
/* Panels occupy only the LCD; SP controls remain reachable below it. */
.screen-panel { position:absolute; inset:0; z-index:5; padding:3cqw; display:flex; flex-direction:column; gap:2cqh; background:#111d27; color:#f5f4f2; font-size:3.5cqw; overflow:hidden; }
.panel-header { display:flex; align-items:center; justify-content:space-between; }
.panel-header h2 { margin:0; font:6cqw Pixel,sans-serif; }
.screen-panel .button { min-height:0; padding:1.6cqh 2cqw; border-radius:1.5cqw; font-size:4.2cqw; line-height:1; }
.screen-panel .button[data-selected], #battle-style[data-selected] { outline:2px solid #ffcf7a; outline-offset:1px; background:#36576b; }
.menu-actions { display:grid; grid-template-columns:1fr 1fr; gap:2cqh 2cqw; }
#save-status { margin:0; font-size:3.2cqw; line-height:1.1; min-height:2.2em; overflow:hidden; }
.screen-panel small { font-size:3cqw; color:#bad1dc; margin-top:auto; }
.screen-panel .mode-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.screen-panel #battle-style { width:100%; min-height:0; padding:1.8cqh 2cqw; font:max(16px,4cqw) Pixel,sans-serif; color:inherit; background:#213441; border:1px solid #4a6776; border-radius:1.5cqw; }
.record-stats { width:100%; border-collapse:collapse; font-size:3.7cqw; font-variant-numeric:tabular-nums; }
.record-stats th, .record-stats td { padding:2.5cqh 1cqw; border-bottom:1px solid #304653; text-align:center; }
.record-stats th:first-child { text-align:left; }
.record-stats thead { color:#bad1dc; }
[hidden] { display: none !important; }

.mode-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 360px; }
.mode-buttons .button { padding: 8px 6px; font-size: 18px; }
#resume-save { grid-column: 1 / -1; font-size: 16px; }

/* This fixed game window owns gestures. */
html { -webkit-text-size-adjust:100%; }
.console { touch-action:pan-x pan-y; -webkit-touch-callout:none; }
.dpad, [data-button], .skin-control { touch-action:none; -webkit-user-select:none; user-select:none; }
.mode-buttons { grid-template-columns:1fr; gap:2cqh; }
.mode-buttons .button { min-height:0; padding:2.5cqh 2cqw; font-size:5cqw; }
.mode-buttons [data-selected] { outline:2px solid #ffcf7a; }
.card-title { gap:2cqh; padding:4cqw; }
.card-title .card-heading { font-size:7cqw; }
.card-title .card-note { font-size:3.5cqw; }
.install-note { font-family:inherit; background:none; color:#bad1dc; border:0; padding:1cqh; font-size:3.3cqw; }
@media (display-mode:standalone), (display-mode:fullscreen) { #install { display:none; } }

.console, .console * { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
#powers-detail { flex:1; min-height:0; overflow:auto; font-size:3.4cqw; }
#powers-detail p { margin:1.4cqh 0; }
.powers-help { margin:1.4cqh 0 0; font-size:3.7cqw; line-height:1.35; }

#menu-dialog { gap:1.4cqh; }
#menu-dialog .menu-actions { gap:1.4cqh 2cqw; }
.screen-panel #battle-style { flex:none; min-height:26px; padding:1cqh 2cqw; line-height:1.2; }
