@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

    :root {
      --shell-red-1: #d84b43;
      --shell-red-2: #ba312f;
      --shell-red-3: #7f1f28;
      --cream: #f5eec8;
      --shadow: 0 14px 0 rgba(0,0,0,.22), 0 28px 70px rgba(0,0,0,.42);
    }

    * { box-sizing: border-box; }
    html, body { min-height: 100%; }

    body {
      margin: 0;
      overflow-x: hidden;
      overflow-y: auto;
      color: var(--cream);
      font-family: 'Press Start 2P', monospace;
      background:
        radial-gradient(circle at 20% 10%, rgba(114, 82, 166, .35), transparent 30%),
        radial-gradient(circle at 80% 15%, rgba(62, 102, 196, .25), transparent 28%),
        linear-gradient(180deg, #0d1120 0%, #11182d 45%, #081018 100%);
    }

    .page-stars,
    .page-stars::before,
    .page-stars::after {
      position: fixed;
      inset: 0;
      pointer-events: none;
      content: '';
      background-image:
        radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,.45) 0 1px, transparent 1px);
      background-size: 90px 90px, 140px 140px;
      background-position: 10px 18px, 52px 64px;
      opacity: .18;
      animation: twinkle 7s steps(6) infinite;
    }
    .page-stars::before { opacity: .07; transform: translateY(20px); }
    .page-stars::after { opacity: .05; transform: translateY(-20px); }

    .app {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 18px;
      position: relative;
      z-index: 1;
    }

    .device {
      width: min(1380px, 100%);
      background: linear-gradient(180deg, var(--shell-red-1), var(--shell-red-2) 45%, var(--shell-red-3));
      border: 6px solid #4f131a;
      box-shadow: inset 0 0 0 4px rgba(255,255,255,.07), var(--shadow);
      display: grid;
      grid-template-columns: minmax(0, 1.55fr) minmax(360px, .95fr);
      gap: 18px;
      padding: 18px;
      position: relative;
      image-rendering: pixelated;
    }

    .device::before {
      content: '';
      position: absolute;
      top: 16px;
      left: 20px;
      width: 44px;
      height: 44px;
      background: radial-gradient(circle at 30% 30%, #dff7ff 0 20%, #78d4ff 20% 58%, #2a8ccf 58% 100%);
      border: 5px solid #1b3f54;
      box-shadow: 0 0 0 4px rgba(255,255,255,.08), 4px 4px 0 rgba(0,0,0,.25);
    }

    .device::after {
      content: '';
      position: absolute;
      top: 18px;
      left: 84px;
      width: 92px;
      height: 14px;
      background: linear-gradient(90deg, #f87171 0 33%, #facc15 33% 66%, #4ade80 66% 100%);
      border: 4px solid #541b1a;
      box-shadow: 4px 4px 0 rgba(0,0,0,.18);
    }

    .left-shell,
    .right-shell {
      min-width: 0;
    }

    .left-shell {
      display: grid;
      grid-template-rows: auto auto;
      gap: 14px;
      min-width: 0;
    }

    .screen-shell {
      background: linear-gradient(180deg, #3a4758, #232b37);
      border: 6px solid #10151d;
      box-shadow: inset 0 0 0 4px rgba(255,255,255,.05), 8px 8px 0 rgba(0,0,0,.22);
      padding: 14px;
      width: 100%;
      min-width: 0;
    }

    .screen-topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
      color: #c6d1df;
      font-size: 10px;
      flex-wrap: wrap;
    }

    .screen-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: #1f2631;
      border: 4px solid #0e131a;
      padding: 8px 10px;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
      min-width: 0;
    }

    .dot-led {
      width: 12px;
      height: 12px;
      background: #7ef29a;
      border: 3px solid #1f5234;
      animation: blinkLed 1.2s steps(2) infinite;
      flex: 0 0 auto;
    }

    .screen {
      aspect-ratio: 16 / 10;
      width: 100%;
      background: linear-gradient(180deg, #101826, #182433);
      border: 8px solid #131820;
      box-shadow: inset 0 0 0 4px rgba(255,255,255,.05), inset 0 0 0 8px #2a3645;
      position: relative;
      overflow: hidden;
      isolation: isolate;
    }

    .screen::before {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(rgba(255,255,255,.02) 50%, transparent 50%),
        linear-gradient(90deg, rgba(255,255,255,.012) 50%, transparent 50%);
      background-size: 6px 6px;
      mix-blend-mode: soft-light;
      opacity: .24;
      z-index: 20;
    }

    .screen::after {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 12%, transparent 88%, rgba(0,0,0,.08));
      z-index: 21;
    }

    .screen.is-switching .scene-layer {
      opacity: 0;
      transform: scale(.985);
      filter: brightness(.96);
    }

    .scene-layer {
      position: absolute;
      inset: 0;
      transition: opacity 220ms steps(6), transform 220ms steps(6), filter 220ms steps(6);
      overflow: hidden;
    }

    .sky,
    .far,
    .mid,
    .front,
    .particles,
    .sprites {
      position: absolute;
      inset: 0;
    }

    .sky { z-index: 0; }
    .far { z-index: 1; }
    .mid { z-index: 2; }
    .front { z-index: 3; }
    .particles { z-index: 4; pointer-events: none; }
    .sprites { z-index: 5; pointer-events: none; }

    .pixel-floor {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 34%;
      border-top: 4px solid rgba(0,0,0,.25);
      background-size: 24px 24px;
    }

    .prop,
    .window,
    .lamp-glow,
    .neon-glow,
    .moon-glow,
    .lantern-glow,
    .soft-glow {
      position: absolute;
    }

    .prop {
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.06), 4px 4px 0 rgba(0,0,0,.16);
    }

    .window {
      background:
        linear-gradient(90deg, transparent 48%, rgba(56,68,82,.95) 48% 52%, transparent 52%),
        linear-gradient(180deg, transparent 48%, rgba(56,68,82,.95) 48% 52%, transparent 52%),
        linear-gradient(180deg, rgba(155,196,255,.26), rgba(55,79,116,.44));
      border: 5px solid #543629;
    }

    .pixel-drop,
    .pixel-steam,
    .pixel-firefly,
    .pixel-rune,
    .pixel-spark {
      position: absolute;
      image-rendering: pixelated;
    }

    .pixel-drop {
      width: 3px;
      height: 16px;
      background: linear-gradient(180deg, transparent, rgba(200,232,255,.95));
      animation: fall steps(10) infinite;
    }

    .pixel-steam {
      width: 18px;
      height: 18px;
      background: radial-gradient(circle, rgba(255,255,255,.3), rgba(255,255,255,.08) 55%, transparent 58%);
      animation: steamRise steps(10) infinite;
    }

    .pixel-firefly {
      width: 8px;
      height: 8px;
      background: #ffe07b;
      box-shadow: 0 0 0 2px rgba(255,208,99,.14);
      animation: firefly steps(12) infinite;
    }

    .pixel-rune {
      width: 14px;
      height: 14px;
      border: 3px solid rgba(180,204,255,.7);
      transform: rotate(45deg);
      animation: runeFloat steps(10) infinite;
    }

    .pixel-spark {
      width: 6px;
      height: 6px;
      background: rgba(255,255,255,.7);
      animation: sparkDrift steps(10) infinite;
    }

    .sprite {
      position: absolute;
      width: 84px;
      height: 84px;
      image-rendering: pixelated;
      animation: bob 1.4s steps(2) infinite;
      filter: drop-shadow(4px 4px 0 rgba(0,0,0,.26));
    }

    .sprite img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      image-rendering: pixelated;
    }

    .sprite.ghost { animation: ghostFloat 2.3s steps(6) infinite; }

    .screen-bottom {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      margin-top: 10px;
      align-items: center;
    }

    .status-box,
    .meter-box {
      background: #1f2631;
      border: 4px solid #0e131a;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
      padding: 10px 12px;
      min-width: 0;
    }

    .status-box { display: grid; gap: 8px; }
    .status-small { color: #b4c4c8; font-size: 10px; }
    .status-big {
      color: #e9f1bf;
      font-family: 'VT323', monospace;
      font-size: 28px;
      line-height: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .meter {
      width: 150px;
      height: 24px;
      border: 4px solid #0b1016;
      background: #19212b;
      display: flex;
      gap: 2px;
      padding: 2px;
    }

    .meter i { flex: 1; background: #334453; opacity: .35; }
    .meter i.on { background: #d9ff72; opacity: 1; }

    .device-controls {
      display: grid;
      grid-template-columns: 180px 1fr 170px;
      gap: 14px;
      align-items: end;
    }

    .dpad {
      position: relative;
      width: 132px;
      height: 132px;
      margin-left: 6px;
    }

    .dpad .cross-h,
    .dpad .cross-v {
      position: absolute;
      background: linear-gradient(180deg, #2a3442, #131a25);
      border: 4px solid #0c1018;
      box-shadow: 4px 4px 0 rgba(0,0,0,.18);
    }

    .dpad .cross-h { left: 0; right: 0; top: 40px; height: 48px; }
    .dpad .cross-v { top: 0; bottom: 0; left: 40px; width: 48px; }

    .system-strip {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .pixel-pill {
      background: #1f2631;
      border: 4px solid #0e131a;
      padding: 10px 12px;
      color: #dce8ef;
      font-size: 10px;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
    }

    .ab-buttons {
      display: flex;
      gap: 12px;
      justify-content: flex-end;
      align-items: center;
      padding-right: 10px;
    }

    .round-btn {
      width: 74px;
      height: 74px;
      border-radius: 50%;
      border: 6px solid #4e1519;
      background: linear-gradient(180deg, #ffd166, #f2b938);
      color: #2d2410;
      box-shadow: inset 0 0 0 4px rgba(255,255,255,.15), 8px 8px 0 rgba(0,0,0,.18);
      cursor: pointer;
      font-family: 'Press Start 2P', monospace;
      font-size: 11px;
    }

    .round-btn.secondary {
      background: linear-gradient(180deg, #f59e9e, #e46d6d);
      color: #381616;
    }

    .round-btn:active {
      transform: translate(2px, 2px);
      box-shadow: inset 0 0 0 4px rgba(255,255,255,.15), 4px 4px 0 rgba(0,0,0,.18);
    }

    .right-shell {
      display: grid;
      grid-template-rows: auto auto auto auto auto;
      gap: 14px;
      background: linear-gradient(180deg, rgba(125, 24, 36, .22), rgba(55, 9, 16, .15));
      border: 4px solid rgba(91, 17, 24, .5);
      padding: 8px;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.04);
      min-width: 0;
      align-content: start;
    }

    .dex-title,
    .menu-card,
    .player-card,
    .notes-card,
    .footer-card {
      background: #1f2631;
      border: 4px solid #0e131a;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
      padding: 12px;
      min-width: 0;
    }

    .dex-title h1 { margin: 0 0 8px; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.35; color: #fff2b4; }
    .dex-title p { margin: 0; font-family: 'VT323', monospace; font-size: 24px; line-height: 1.1; color: #d7e7f0; }
    .menu-card h2, .player-card h2, .notes-card h2 { margin: 0 0 10px; font-size: 12px; color: #fff2b4; }

    .scene-list {
      display: grid;
      gap: 8px;
      max-height: 280px;
      overflow: auto;
      padding-right: 4px;
    }

    .scene-list::-webkit-scrollbar { width: 10px; }
    .scene-list::-webkit-scrollbar-thumb { background: #516274; border: 2px solid #0e131a; }
    .scene-list::-webkit-scrollbar-track { background: #141b24; }

    .scene-btn {
      width: 100%;
      text-align: left;
      background: linear-gradient(180deg, #394657, #283443);
      color: #dbe8ef;
      border: 4px solid #0f141b;
      padding: 10px 12px;
      cursor: pointer;
      display: grid;
      gap: 6px;
      box-shadow: 4px 4px 0 rgba(0,0,0,.16);
      transition: transform 120ms steps(2), background 120ms steps(2);
    }

    .scene-btn span { font-size: 10px; color: #aac4d3; }
    .scene-btn strong { font-size: 11px; line-height: 1.45; }
    .scene-btn.active {
      background: linear-gradient(180deg, #56708b, #385066);
      border-color: #ffe07b;
      color: #fff8d1;
    }
    .scene-btn:hover { transform: translate(-1px, -1px); }
    .scene-btn:active { transform: translate(2px, 2px); }

    .player-main { display: grid; gap: 10px; }
    .track-display {
      background: #111822;
      border: 4px solid #0a0f15;
      padding: 10px;
      display: grid;
      gap: 6px;
    }

    .track-display small { color: #a7b7c3; font-size: 10px; }
    .track-display .big { font-family: 'VT323', monospace; font-size: 28px; line-height: 1; color: #dff5ae; }

    .player-actions {
      display: grid;
      grid-template-columns: 64px 1fr 64px;
      gap: 10px;
    }

    .mini-btn,
    .play-btn {
      border: 4px solid #0d1118;
      background: linear-gradient(180deg, #4b6077, #2f4152);
      color: #f1f6f8;
      cursor: pointer;
      box-shadow: 4px 4px 0 rgba(0,0,0,.16);
      min-height: 56px;
      font-family: 'Press Start 2P', monospace;
      font-size: 11px;
    }

    .play-btn { background: linear-gradient(180deg, #76de8f, #38a159); color: #0b2c14; }
    .mini-btn:active, .play-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0,0,0,.16); }

    .bar-wrap { display: grid; gap: 6px; }
    .bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: #a9bbc8; }

    input[type='range'] {
      width: 100%;
      -webkit-appearance: none;
      appearance: none;
      background: linear-gradient(180deg, #111822, #18212c);
      border: 4px solid #0a0f15;
      height: 22px;
      margin: 0;
      overflow: hidden;
    }

    input[type='range']::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 22px;
      background: #f4e7b2;
      border: 4px solid #6c5a2a;
      box-shadow: none;
      cursor: pointer;
    }

    input[type='range']::-moz-range-thumb {
      width: 18px;
      height: 22px;
      background: #f4e7b2;
      border: 4px solid #6c5a2a;
      cursor: pointer;
      box-shadow: none;
    }

    input[type='range']::-moz-range-track {
      height: 22px;
      background: linear-gradient(180deg, #111822, #18212c);
      border: 4px solid #0a0f15;
    }

    input[type='range']::-moz-range-progress {
      background: #2a3542;
      height: 22px;
    }

    .notes-card p,
    .footer-card p {
      margin: 0;
      font-family: 'VT323', monospace;
      font-size: 24px;
      line-height: 1.12;
      color: #d7e8ef;
    }

    .footer-card {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .footer-chip {
      background: #111822;
      border: 4px solid #0a0f15;
      padding: 10px 12px;
      color: #dff5ae;
      font-size: 10px;
    }

    .visualizer {
      display: flex;
      align-items: end;
      gap: 4px;
      height: 54px;
      margin-top: 10px;
      background: #111822;
      border: 4px solid #0a0f15;
      padding: 6px;
    }

    .visualizer i {
      flex: 1;
      background: linear-gradient(180deg, #ddff89, #76ad48);
      min-height: 8px;
      opacity: .9;
    }

    .theme-opening .sky {
      background:
        radial-gradient(circle at 74% 18%, rgba(255,214,153,.16), transparent 18%),
        linear-gradient(180deg, #111b3d 0%, #293a68 45%, #b06d68 76%, #e9a66f 100%);
    }

    /* Opening scene · Kanto Night Camp */
    .theme-opening .far::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(5,10,24,.08), transparent 46%, rgba(18,31,37,.14));
      pointer-events: none;
    }

    .scene-kicker,
    .route-plaque {
      position: absolute;
      z-index: 8;
      font-family: 'Press Start 2P', monospace;
      text-transform: uppercase;
      letter-spacing: .06em;
      text-shadow: 2px 2px 0 rgba(0,0,0,.42);
    }

    .scene-kicker {
      top: 6%;
      left: 5%;
      color: #fff4bc;
      font-size: clamp(7px, 1.05vw, 11px);
      line-height: 1.7;
      opacity: .9;
    }

    .scene-kicker small {
      display: block;
      color: #b9d9e7;
      font-size: .72em;
      margin-top: 4px;
    }

    .route-plaque {
      right: 4%;
      bottom: 7%;
      padding: 7px 9px;
      color: #1e2a22;
      background: #d7e5a4;
      border: 4px solid #53663a;
      box-shadow: 4px 4px 0 rgba(0,0,0,.24), inset 0 0 0 2px rgba(255,255,255,.2);
      font-size: clamp(6px, .8vw, 9px);
    }

    .pokeball-moon {
      position: absolute;
      width: clamp(74px, 11vw, 118px);
      aspect-ratio: 1;
      right: 8%;
      top: 7%;
      border-radius: 50%;
      overflow: hidden;
      border: 5px solid #31273b;
      background: linear-gradient(180deg, #c7525c 0 43%, #2b2635 43% 57%, #f5e8cc 57% 100%);
      box-shadow: 0 0 0 4px rgba(255,230,185,.1), 0 0 42px rgba(255,204,145,.35), 5px 5px 0 rgba(0,0,0,.18);
      animation: moonHover 5s steps(10) infinite;
    }

    .pokeball-moon::before {
      content: '';
      position: absolute;
      width: 28%;
      aspect-ratio: 1;
      left: 36%;
      top: 36%;
      border-radius: 50%;
      background: #f7edda;
      border: 5px solid #2b2635;
      box-shadow: inset 0 0 0 4px #b7a999;
    }

    .pokeball-moon::after {
      content: '';
      position: absolute;
      inset: 10% 12% 58%;
      border-radius: 50%;
      background: rgba(255,255,255,.2);
    }

    .pixel-cloud {
      position: absolute;
      height: 16px;
      background: rgba(235,235,226,.24);
      box-shadow: 16px -8px 0 rgba(235,235,226,.18), 30px 0 0 rgba(235,235,226,.14);
      animation: cloudDrift var(--cloud-speed, 24s) steps(18) infinite;
    }

    .kanto-ridge {
      position: absolute;
      left: -4%;
      right: -4%;
      bottom: 31%;
      height: 30%;
      background: linear-gradient(180deg, #27344e, #1e313a);
      clip-path: polygon(0 100%, 0 70%, 9% 48%, 16% 64%, 25% 34%, 34% 68%, 45% 22%, 55% 65%, 67% 38%, 76% 62%, 87% 31%, 100% 68%, 100% 100%);
      filter: drop-shadow(0 -4px 0 rgba(255,194,150,.08));
    }

    .pine-line {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 28%;
      height: 18%;
      opacity: .76;
      background:
        linear-gradient(63deg, transparent 42%, #18352f 43% 57%, transparent 58%) 0 100% / 54px 76px repeat-x,
        linear-gradient(-63deg, transparent 42%, #18352f 43% 57%, transparent 58%) 27px 100% / 54px 76px repeat-x;
    }

    .route-sign {
      position: absolute;
      left: 7%;
      bottom: 24%;
      width: 112px;
      padding: 8px 6px 7px;
      color: #e9f1bf;
      background: #41634b;
      border: 5px solid #263e31;
      box-shadow: 5px 5px 0 rgba(0,0,0,.2), inset 0 0 0 2px rgba(255,255,255,.08);
      text-align: center;
      font-size: 8px;
      line-height: 1.5;
    }

    .route-sign::after {
      content: '';
      position: absolute;
      width: 13px;
      height: 54px;
      left: 45%;
      top: 100%;
      background: #6e5134;
      border: 4px solid #432f20;
      border-top: 0;
    }

    .camp-blanket {
      position: absolute;
      left: 50%;
      bottom: 9%;
      transform: translateX(-50%) skewX(-8deg);
      width: 31%;
      min-width: 150px;
      height: 19%;
      background:
        linear-gradient(90deg, transparent 48%, rgba(255,247,207,.24) 48% 52%, transparent 52%),
        linear-gradient(180deg, transparent 46%, rgba(255,247,207,.24) 46% 54%, transparent 54%),
        #a94e53;
      background-size: 42px 100%, 100% 32px, auto;
      border: 5px solid #653036;
      box-shadow: 7px 7px 0 rgba(0,0,0,.18), inset 0 0 0 3px rgba(255,255,255,.06);
    }

    .poke-radio {
      position: absolute;
      left: 50%;
      bottom: 18%;
      transform: translateX(-50%);
      width: 102px;
      height: 64px;
      background: linear-gradient(180deg, #e3d6aa, #b9a36e);
      border: 5px solid #5c5036;
      box-shadow: 5px 5px 0 rgba(0,0,0,.22), inset 0 0 0 3px rgba(255,255,255,.12);
    }

    .poke-radio::before {
      content: '';
      position: absolute;
      left: 11px;
      top: 16px;
      width: 34px;
      height: 29px;
      border-radius: 50%;
      background: repeating-radial-gradient(circle, #433d32 0 2px, #756949 2px 4px);
      border: 4px solid #554a32;
    }

    .poke-radio::after {
      content: '';
      position: absolute;
      right: 10px;
      top: 14px;
      width: 34px;
      height: 13px;
      background: linear-gradient(180deg, #81c99d, #3e785d);
      border: 4px solid #42533c;
      box-shadow: 0 22px 0 -3px #6b5b3e;
      animation: radioPulse 1.4s steps(3) infinite;
    }

    .trainer-bag {
      position: absolute;
      right: 17%;
      bottom: 16%;
      width: 55px;
      height: 66px;
      border-radius: 10px 10px 4px 4px;
      background: linear-gradient(90deg, #a34448 0 28%, #c65a5e 28% 72%, #a34448 72%);
      border: 5px solid #5b2b31;
      box-shadow: 5px 5px 0 rgba(0,0,0,.18);
    }

    .trainer-bag::before {
      content: '';
      position: absolute;
      left: 10px;
      right: 10px;
      top: -18px;
      height: 22px;
      border: 5px solid #5b2b31;
      border-bottom: 0;
      border-radius: 12px 12px 0 0;
    }

    .trainer-bag::after {
      content: '';
      position: absolute;
      width: 20px;
      height: 20px;
      left: 13px;
      top: 21px;
      border-radius: 50%;
      background: linear-gradient(180deg, #ef6b70 0 42%, #3b3036 42% 58%, #f2e6cf 58%);
      border: 3px solid #4c3034;
    }

    .grass-clump {
      position: absolute;
      width: 52px;
      height: 28px;
      bottom: 25%;
      background:
        linear-gradient(70deg, transparent 46%, #527648 47% 58%, transparent 59%) 0 100% / 16px 30px repeat-x,
        linear-gradient(-70deg, transparent 46%, #688b55 47% 58%, transparent 59%) 8px 100% / 16px 26px repeat-x;
      transform-origin: bottom;
      animation: grassSway 2.4s steps(5) infinite;
    }

    .sprite {
      --sprite-scale: 1;
      --sprite-delay: 0s;
      transform-origin: 50% 100%;
      animation-delay: var(--sprite-delay);
    }

    .sprite::before {
      content: '';
      position: absolute;
      z-index: -1;
      left: 16%;
      right: 16%;
      bottom: 3px;
      height: 14px;
      border-radius: 50%;
      background: rgba(20,25,31,.28);
      filter: blur(1px);
    }

    .sprite img { transform: scale(var(--sprite-scale)); transform-origin: 50% 100%; }

    .sprite.featured::after {
      content: attr(data-name);
      position: absolute;
      left: 50%;
      bottom: -13px;
      transform: translateX(-50%);
      padding: 4px 6px;
      color: #fff3bd;
      background: rgba(21,29,38,.84);
      border: 2px solid rgba(255,239,173,.5);
      font-size: 7px;
      line-height: 1;
      white-space: nowrap;
      text-shadow: 1px 1px 0 #000;
      box-shadow: 2px 2px 0 rgba(0,0,0,.18);
    }



    /* Shared scene toolkit · detailed Kanto dioramas */
    .scene-stamp {
      position: absolute;
      top: 5%;
      left: 5%;
      z-index: 12;
      padding: 7px 9px;
      color: var(--stamp-color, #fff3bd);
      background: var(--stamp-bg, rgba(24,34,45,.82));
      border: 3px solid var(--stamp-border, rgba(255,239,173,.58));
      box-shadow: 4px 4px 0 rgba(0,0,0,.2), inset 0 0 0 2px rgba(255,255,255,.05);
      font-size: clamp(6px, .78vw, 9px);
      line-height: 1.55;
      text-transform: uppercase;
      letter-spacing: .05em;
      text-shadow: 2px 2px 0 rgba(0,0,0,.34);
    }

    .scene-stamp small {
      display: block;
      margin-top: 3px;
      color: var(--stamp-small, #bcd1dc);
      font-size: .72em;
    }

    .sun-disc,
    .lavender-moon,
    .island-moon {
      position: absolute;
      border-radius: 50%;
      box-shadow: 0 0 36px var(--disc-glow, rgba(255,225,161,.38));
      animation: moonHover 6s steps(12) infinite;
    }

    .sun-disc {
      width: clamp(64px, 9vw, 98px);
      aspect-ratio: 1;
      right: 8%;
      top: 10%;
      background: radial-gradient(circle at 38% 35%, #fff8cf 0 14%, #ffd77c 15% 58%, #ef9c61 60% 100%);
      border: 5px solid rgba(145,83,65,.48);
      --disc-glow: rgba(255,202,113,.46);
    }

    .horizon-haze {
      position: absolute;
      left: -5%;
      right: -5%;
      bottom: 26%;
      height: 28%;
      background: linear-gradient(180deg, transparent, rgba(255,244,199,.18) 52%, rgba(255,255,255,.06));
      filter: blur(2px);
    }

    .pallet-hill {
      position: absolute;
      left: -4%;
      right: -4%;
      bottom: 28%;
      height: 25%;
      background: #5e9563;
      clip-path: polygon(0 100%, 0 68%, 18% 34%, 34% 62%, 49% 26%, 66% 57%, 84% 31%, 100% 64%, 100% 100%);
      box-shadow: inset 0 7px 0 rgba(255,255,255,.08);
    }

    .pallet-house {
      --house: #eee5d3;
      --roof: #d85f58;
      --trim: #705044;
      position: absolute;
      width: clamp(92px, 16vw, 154px);
      height: clamp(70px, 11vw, 105px);
      bottom: 26%;
      background: var(--house);
      border: 5px solid var(--trim);
      box-shadow: 6px 6px 0 rgba(0,0,0,.17), inset 0 0 0 3px rgba(255,255,255,.16);
    }

    .pallet-house::before {
      content: '';
      position: absolute;
      left: -10%;
      right: -10%;
      bottom: 92%;
      height: 54%;
      background: var(--roof);
      clip-path: polygon(50% 0, 100% 100%, 0 100%);
      filter: drop-shadow(0 5px 0 var(--trim));
    }

    .pallet-house::after {
      content: '';
      position: absolute;
      left: 13%;
      bottom: 10%;
      width: 24%;
      height: 42%;
      background: #8c624f;
      border: 4px solid var(--trim);
      box-shadow: 64px -8px 0 -4px #8dc7e3, 64px -8px 0 0 var(--trim);
    }

    .oak-lab-building {
      position: absolute;
      left: 50%;
      bottom: 27%;
      transform: translateX(-50%);
      width: clamp(140px, 25vw, 230px);
      height: clamp(82px, 13vw, 126px);
      background: #e5e6d4;
      border: 5px solid #66705a;
      box-shadow: 7px 7px 0 rgba(0,0,0,.16), inset 0 0 0 3px rgba(255,255,255,.14);
    }

    .oak-lab-building::before {
      content: 'OAK LAB';
      position: absolute;
      left: 10%;
      right: 10%;
      top: -25%;
      height: 32%;
      display: grid;
      place-items: center;
      color: #f2f6d0;
      background: #6c9d62;
      border: 5px solid #52624b;
      font-size: clamp(6px, .75vw, 9px);
      box-shadow: 4px 4px 0 rgba(0,0,0,.15);
    }

    .oak-lab-building::after {
      content: '';
      position: absolute;
      left: 11%;
      right: 11%;
      top: 22%;
      height: 28%;
      background: repeating-linear-gradient(90deg, #82bfd7 0 24px, #526f76 24px 29px);
      border: 4px solid #66705a;
      box-shadow: 0 42px 0 -10px #9c7858;
    }

    .fence-line {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 25%;
      height: 30px;
      opacity: .88;
      background:
        linear-gradient(180deg, transparent 8px, #906d45 8px 14px, transparent 14px 20px, #765637 20px 26px, transparent 26px),
        repeating-linear-gradient(90deg, transparent 0 34px, #7d5c3a 34px 42px, transparent 42px 62px);
    }

    .flower-strip {
      position: absolute;
      left: 5%;
      right: 5%;
      bottom: 18%;
      height: 28px;
      background:
        radial-gradient(circle, #fff09d 0 3px, transparent 4px) 0 4px / 42px 22px repeat-x,
        radial-gradient(circle, #e8879e 0 3px, transparent 4px) 20px 12px / 48px 24px repeat-x;
      opacity: .9;
    }

    .mailbox {
      position: absolute;
      left: 8%;
      bottom: 23%;
      width: 42px;
      height: 32px;
      background: #537798;
      border: 4px solid #354c60;
      border-radius: 16px 16px 3px 3px;
      box-shadow: 4px 4px 0 rgba(0,0,0,.15);
    }

    .mailbox::after {
      content: '';
      position: absolute;
      width: 8px;
      height: 52px;
      left: 13px;
      top: 100%;
      background: #705039;
      border: 3px solid #493322;
      border-top: 0;
    }

    .lab-wall {
      position: absolute;
      inset: 0 0 28%;
      background:
        linear-gradient(90deg, transparent 49%, rgba(67,97,114,.35) 49% 51%, transparent 51%),
        linear-gradient(180deg, #d8eaf2, #c0d2dc);
      background-size: 160px 100%, auto;
      border-bottom: 6px solid #778997;
    }

    .lab-window {
      position: absolute;
      top: 10%;
      width: 23%;
      height: 24%;
      background:
        linear-gradient(90deg, transparent 48%, #5b7484 48% 53%, transparent 53%),
        linear-gradient(180deg, transparent 48%, #5b7484 48% 53%, transparent 53%),
        linear-gradient(180deg,#82c9ec,#dff4ff);
      border: 5px solid #687f8d;
      box-shadow: inset 0 0 0 3px rgba(255,255,255,.2), 5px 5px 0 rgba(0,0,0,.1);
    }

    .ceiling-light {
      position: absolute;
      top: 4%;
      left: 50%;
      transform: translateX(-50%);
      width: 24%;
      height: 18px;
      background: #f7fff0;
      border: 4px solid #8ca1a9;
      box-shadow: 0 12px 32px rgba(245,255,225,.5);
      animation: radioPulse 2.2s steps(3) infinite;
    }

    .monitor-bank {
      position: absolute;
      width: 22%;
      min-width: 112px;
      height: 21%;
      bottom: 32%;
      background: #778892;
      border: 5px solid #4b5d68;
      box-shadow: 6px 6px 0 rgba(0,0,0,.14), inset 0 0 0 3px rgba(255,255,255,.08);
    }

    .monitor-bank::before {
      content: '';
      position: absolute;
      inset: 10px 10px 28px;
      background:
        linear-gradient(90deg, transparent 0 47%, #28455a 47% 53%, transparent 53%),
        linear-gradient(180deg,#70d1d2,#316f8b);
      border: 4px solid #304b5c;
      animation: monitorScan 2.4s steps(6) infinite;
    }

    .monitor-bank::after {
      content: '';
      position: absolute;
      left: 15%;
      right: 15%;
      bottom: 10px;
      height: 8px;
      background: repeating-linear-gradient(90deg,#f1d66e 0 8px,transparent 8px 15px);
    }

    .starter-console {
      position: absolute;
      left: 50%;
      bottom: 13%;
      transform: translateX(-50%);
      width: 39%;
      min-width: 210px;
      height: 20%;
      background: linear-gradient(180deg,#d9e4c8,#a9b88e);
      border: 6px solid #61704f;
      box-shadow: 7px 7px 0 rgba(0,0,0,.17), inset 0 0 0 3px rgba(255,255,255,.15);
    }

    .starter-console::before {
      content: '';
      position: absolute;
      left: 8%;
      right: 8%;
      top: -26px;
      height: 30px;
      background:
        radial-gradient(circle at 17% 50%, #fff 0 6px, #31363a 7px 10px, #e34d52 11px 18px, transparent 19px),
        radial-gradient(circle at 50% 50%, #fff 0 6px, #31363a 7px 10px, #e34d52 11px 18px, transparent 19px),
        radial-gradient(circle at 83% 50%, #fff 0 6px, #31363a 7px 10px, #e34d52 11px 18px, transparent 19px);
    }

    .starter-console::after {
      content: '001   004   007';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 8px;
      color: #42533d;
      text-align: center;
      word-spacing: 24px;
      font-size: clamp(6px, .72vw, 8px);
    }

    .route-hills {
      position: absolute;
      left: -5%;
      right: -5%;
      bottom: 29%;
      height: 32%;
      background: linear-gradient(180deg,#72b576,#4f8e5a);
      clip-path: polygon(0 100%,0 72%,14% 43%,29% 62%,44% 29%,58% 61%,73% 39%,88% 63%,100% 49%,100% 100%);
      box-shadow: inset 0 7px 0 rgba(255,255,255,.08);
    }

    .viridian-gate {
      position: absolute;
      left: 50%;
      bottom: 29%;
      transform: translateX(-50%);
      width: 15%;
      min-width: 95px;
      height: 18%;
      background: #d8d1ba;
      border: 5px solid #65715a;
      box-shadow: 5px 5px 0 rgba(0,0,0,.14);
    }

    .viridian-gate::before {
      content: 'VIRIDIAN';
      position: absolute;
      left: -12%;
      right: -12%;
      top: -28px;
      padding: 6px 2px;
      color: #eef2ce;
      background: #4f8a5c;
      border: 4px solid #3e6147;
      text-align: center;
      font-size: clamp(5px, .62vw, 7px);
    }

    .viridian-gate::after {
      content: '';
      position: absolute;
      left: 31%;
      right: 31%;
      bottom: 0;
      height: 68%;
      background: #5d765f;
      border: 4px solid #465947;
      border-bottom: 0;
    }

    .route-path {
      position: absolute;
      left: 50%;
      bottom: -2%;
      transform: translateX(-50%);
      width: 48%;
      height: 47%;
      background: repeating-linear-gradient(0deg,#d4bd82 0 10px,#c3a86f 10px 20px);
      clip-path: polygon(41% 0,59% 0,88% 100%,12% 100%);
      filter: drop-shadow(0 -4px 0 rgba(109,83,49,.35));
    }

    .tall-grass-field {
      position: absolute;
      width: 28%;
      height: 18%;
      bottom: 18%;
      background:
        linear-gradient(68deg,transparent 45%,#387842 46% 56%,transparent 57%) 0 100% / 18px 33px repeat,
        linear-gradient(-68deg,transparent 45%,#589856 46% 56%,transparent 57%) 9px 100% / 18px 29px repeat;
      animation: grassSway 2.8s steps(5) infinite;
      transform-origin: bottom;
    }

    .route-marker {
      position: absolute;
      right: 7%;
      bottom: 27%;
      padding: 8px 7px;
      color: #f4efc7;
      background: #4e7250;
      border: 4px solid #344d36;
      box-shadow: 4px 4px 0 rgba(0,0,0,.18);
      font-size: 7px;
      line-height: 1.5;
      text-align: center;
    }

    .route-marker::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 45%;
      width: 9px;
      height: 44px;
      background: #6b4b31;
      border: 3px solid #47321f;
      border-top: 0;
    }

    .stone-ridge {
      position: absolute;
      left: -4%;
      right: -4%;
      bottom: 30%;
      height: 36%;
      background: linear-gradient(180deg,#777d86,#555b64);
      clip-path: polygon(0 100%,0 73%,12% 50%,22% 66%,35% 27%,48% 64%,60% 35%,73% 69%,86% 42%,100% 70%,100% 100%);
      box-shadow: inset 0 7px 0 rgba(255,255,255,.07);
    }

    .museum-building {
      position: absolute;
      left: 8%;
      bottom: 24%;
      width: 34%;
      height: 26%;
      background: #bcb8ae;
      border: 6px solid #66645e;
      box-shadow: 7px 7px 0 rgba(0,0,0,.18), inset 0 0 0 3px rgba(255,255,255,.08);
    }

    .museum-building::before {
      content: 'MUSEUM';
      position: absolute;
      left: -5%;
      right: -5%;
      top: -29px;
      height: 25px;
      display: grid;
      place-items: center;
      color: #ece8d2;
      background: #73716a;
      border: 5px solid #56544f;
      font-size: clamp(5px, .65vw, 8px);
    }

    .museum-building::after {
      content: '';
      position: absolute;
      inset: 15% 8% 10%;
      background: repeating-linear-gradient(90deg,#77746e 0 10%,transparent 10% 22%);
      border-top: 6px solid #77746e;
      border-bottom: 6px solid #77746e;
    }

    .pewter-gym {
      position: absolute;
      right: 9%;
      bottom: 23%;
      width: 25%;
      height: 22%;
      background: #a6a39c;
      border: 6px solid #5f5d58;
      box-shadow: 7px 7px 0 rgba(0,0,0,.16);
    }

    .pewter-gym::before {
      content: 'GYM';
      position: absolute;
      left: 17%;
      right: 17%;
      top: -26px;
      padding: 6px 0;
      color: #eee9d4;
      background: #77746e;
      border: 4px solid #56544f;
      text-align: center;
      font-size: 7px;
    }

    .pewter-gym::after {
      content: '◆';
      position: absolute;
      left: 50%;
      top: 45%;
      transform: translate(-50%,-50%);
      color: #65635e;
      font-size: clamp(24px,4vw,44px);
      text-shadow: 3px 3px 0 rgba(255,255,255,.12);
    }

    .rock-garden {
      position: absolute;
      left: 43%;
      bottom: 18%;
      width: 18%;
      height: 16%;
      background:
        radial-gradient(ellipse at 18% 72%,#77736c 0 18%,transparent 19%),
        radial-gradient(ellipse at 55% 38%,#8c8880 0 24%,transparent 25%),
        radial-gradient(ellipse at 84% 75%,#69665f 0 18%,transparent 19%);
    }

    .city-lamp {
      position: absolute;
      bottom: 23%;
      width: 12px;
      height: 74px;
      background: #4f5051;
      border: 3px solid #353638;
    }

    .city-lamp::before {
      content: '';
      position: absolute;
      width: 34px;
      height: 28px;
      left: 50%;
      top: -18px;
      transform: translateX(-50%);
      background: #f3d28b;
      border: 4px solid #4a4a48;
      box-shadow: 0 0 26px rgba(255,205,119,.32);
      animation: lampFlicker 3.2s steps(3) infinite;
    }

    .center-wall {
      position: absolute;
      inset: 0 0 28%;
      background:
        linear-gradient(90deg, transparent 49%, rgba(65,86,107,.45) 49% 51%, transparent 51%),
        linear-gradient(180deg,#263c5e,#172840);
      background-size: 170px 100%,auto;
      border-bottom: 6px solid #607993;
    }

    .center-logo {
      position: absolute;
      left: 50%;
      top: 7%;
      transform: translateX(-50%);
      width: 92px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: linear-gradient(180deg,#f45f6f 0 43%,#273444 43% 57%,#f1f5e8 57% 100%);
      border: 6px solid #7c9bb8;
      box-shadow: 0 0 36px rgba(103,190,255,.42), 5px 5px 0 rgba(0,0,0,.18);
      animation: centerGlow 2.8s steps(5) infinite;
    }

    .center-logo::after {
      content: '';
      position: absolute;
      left: 35%;
      top: 35%;
      width: 22%;
      aspect-ratio: 1;
      border-radius: 50%;
      background: #edf4ee;
      border: 5px solid #273444;
    }

    .healing-counter {
      position: absolute;
      left: 50%;
      bottom: 13%;
      transform: translateX(-50%);
      width: 47%;
      min-width: 235px;
      height: 22%;
      background: linear-gradient(180deg,#d8e4ea,#9fb4c4);
      border: 6px solid #607487;
      box-shadow: 8px 8px 0 rgba(0,0,0,.18), inset 0 0 0 3px rgba(255,255,255,.11);
    }

    .healing-counter::before {
      content: '';
      position: absolute;
      left: 12%;
      right: 12%;
      top: -23px;
      height: 25px;
      background:
        radial-gradient(circle at 18% 50%,#fff 0 5px,#2f3b48 6px 9px,#f26472 10px 16px,transparent 17px),
        radial-gradient(circle at 50% 50%,#fff 0 5px,#2f3b48 6px 9px,#f26472 10px 16px,transparent 17px),
        radial-gradient(circle at 82% 50%,#fff 0 5px,#2f3b48 6px 9px,#f26472 10px 16px,transparent 17px);
      filter: drop-shadow(0 0 9px rgba(255,116,130,.4));
    }

    .healing-counter::after {
      content: 'HEALING COMPLETE';
      position: absolute;
      left: 20%;
      right: 20%;
      bottom: 9px;
      padding: 5px 2px;
      color: #b9f4d4;
      background: #17354c;
      border: 3px solid #516b7d;
      text-align: center;
      font-size: clamp(5px,.62vw,7px);
      animation: monitorScan 2.2s steps(5) infinite;
    }

    .center-window {
      position: absolute;
      top: 12%;
      width: 22%;
      height: 22%;
      background:
        linear-gradient(90deg,transparent 47%,#4b6580 47% 53%,transparent 53%),
        linear-gradient(180deg,rgba(110,168,220,.5),rgba(24,52,83,.8));
      border: 5px solid #607d99;
      box-shadow: inset 0 0 0 3px rgba(255,255,255,.06);
    }

    .waiting-bench {
      position: absolute;
      bottom: 17%;
      width: 20%;
      height: 10%;
      background: #8c6685;
      border: 5px solid #574458;
      box-shadow: 5px 5px 0 rgba(0,0,0,.15);
    }

    .waiting-bench::after {
      content: '';
      position: absolute;
      left: 8%;
      right: 8%;
      bottom: -17px;
      height: 17px;
      background: linear-gradient(90deg,#574458 0 10%,transparent 10% 90%,#574458 90%);
    }

    .potted-plant {
      position: absolute;
      bottom: 22%;
      width: 45px;
      height: 58px;
      background:
        radial-gradient(circle at 50% 18%,#65a66e 0 25%,transparent 26%),
        radial-gradient(circle at 24% 36%,#4a8b5a 0 20%,transparent 21%),
        radial-gradient(circle at 76% 36%,#5e9b63 0 20%,transparent 21%);
    }

    .potted-plant::after {
      content: '';
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 0;
      height: 25px;
      background: #b86c55;
      border: 4px solid #744335;
    }

    .cave-ridge {
      position: absolute;
      left: -3%;
      right: -3%;
      bottom: 27%;
      height: 42%;
      background: linear-gradient(180deg,#77767b,#4f5058);
      clip-path: polygon(0 100%,0 66%,10% 43%,21% 58%,33% 25%,45% 57%,57% 33%,69% 64%,82% 39%,92% 60%,100% 47%,100% 100%);
      box-shadow: inset 0 8px 0 rgba(255,255,255,.06);
    }

    .cave-mouth {
      position: absolute;
      left: 8%;
      bottom: 23%;
      width: 29%;
      height: 35%;
      border-radius: 50% 50% 10% 10%;
      background: radial-gradient(ellipse at 50% 70%,#17212d 0 42%,#383b43 44% 65%,#62636a 67% 100%);
      border: 6px solid #4c4e55;
      box-shadow: 8px 8px 0 rgba(0,0,0,.2), inset 0 0 30px rgba(122,173,220,.1);
    }

    .cave-mouth::after {
      content: 'MT. MOON';
      position: absolute;
      left: 12%;
      right: 12%;
      top: 16%;
      color: #a9c4db;
      text-align: center;
      font-size: clamp(5px,.66vw,8px);
      text-shadow: 2px 2px 0 #1b2028;
    }

    .moon-stone {
      position: absolute;
      width: 44px;
      height: 58px;
      bottom: 20%;
      background: linear-gradient(135deg,#d2e7f2,#859bad);
      clip-path: polygon(50% 0,86% 22%,100% 68%,62% 100%,13% 80%,0 31%);
      filter: drop-shadow(5px 5px 0 rgba(0,0,0,.18)) drop-shadow(0 0 12px rgba(171,218,255,.45));
      animation: moonHover 4s steps(8) infinite;
    }

    .route-stairs {
      position: absolute;
      left: 44%;
      bottom: 18%;
      width: 32%;
      height: 33%;
      background: repeating-linear-gradient(180deg,#b8aa83 0 9px,#776e58 9px 13px);
      clip-path: polygon(25% 0,75% 0,100% 100%,0 100%);
      box-shadow: 0 -5px 0 rgba(79,74,65,.4);
    }

    .route-puddle {
      position: absolute;
      right: 6%;
      bottom: 15%;
      width: 25%;
      height: 10%;
      border-radius: 50%;
      background: repeating-linear-gradient(180deg,#8bcde5 0 5px,#6eacc7 5px 10px);
      border: 4px solid #5d899b;
      box-shadow: inset 0 0 0 3px rgba(255,255,255,.1);
      animation: waterFlow 2.5s steps(8) infinite;
    }

    .cerulean-skyline {
      position: absolute;
      left: 3%;
      right: 3%;
      bottom: 32%;
      height: 27%;
      background:
        linear-gradient(90deg,#dbe9e9 0 15%,transparent 15% 19%,#d7e4e7 19% 38%,transparent 38% 43%,#e5eded 43% 62%,transparent 62% 68%,#d2e2e7 68% 87%,transparent 87%);
      border-bottom: 5px solid rgba(78,126,147,.45);
      filter: drop-shadow(6px 6px 0 rgba(48,88,108,.14));
    }

    .cerulean-gym {
      position: absolute;
      right: 8%;
      bottom: 27%;
      width: 24%;
      height: 25%;
      border-radius: 50% 50% 8px 8px;
      background: linear-gradient(180deg,#9ce8ed,#5dafcd 58%,#e6f0ec 59%);
      border: 6px solid #4f829c;
      box-shadow: 7px 7px 0 rgba(0,0,0,.15), inset 0 0 0 3px rgba(255,255,255,.12);
    }

    .cerulean-gym::after {
      content: 'GYM';
      position: absolute;
      left: 25%;
      right: 25%;
      bottom: 12%;
      padding: 5px 0;
      color: #e8ffff;
      background: #3d84a5;
      border: 3px solid #315f75;
      text-align: center;
      font-size: 7px;
    }

    .water-canal {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 12%;
      height: 17%;
      background: repeating-linear-gradient(180deg,#75c7e8 0 7px,#58afd4 7px 14px);
      border-top: 5px solid #498dad;
      border-bottom: 5px solid #498dad;
      animation: waterFlow 3s steps(10) infinite;
    }

    .nugget-bridge {
      position: absolute;
      left: 34%;
      bottom: 21%;
      width: 32%;
      height: 11%;
      background: repeating-linear-gradient(90deg,#d1ad72 0 14px,#9b7546 14px 18px);
      border: 5px solid #765534;
      box-shadow: 6px 6px 0 rgba(0,0,0,.16);
    }

    .nugget-bridge::before,
    .nugget-bridge::after {
      content: '';
      position: absolute;
      top: -20px;
      width: 7px;
      height: 22px;
      background: #765534;
      border: 2px solid #563b24;
    }
    .nugget-bridge::before { left: 9%; }
    .nugget-bridge::after { right: 9%; }

    .city-fountain {
      position: absolute;
      left: 8%;
      bottom: 19%;
      width: 86px;
      height: 62px;
      border-radius: 50% 50% 10px 10px;
      background: #9ed6dd;
      border: 5px solid #4f8fa1;
      box-shadow: 5px 5px 0 rgba(0,0,0,.14);
    }

    .city-fountain::before {
      content: '';
      position: absolute;
      left: 34px;
      bottom: 38px;
      width: 12px;
      height: 45px;
      background: linear-gradient(90deg,#c8eff2,#73bdd0,#c8eff2);
      border-radius: 50%;
      animation: fountainJet 1.8s steps(7) infinite;
    }

    .lavender-moon {
      width: clamp(66px, 9vw, 100px);
      aspect-ratio: 1;
      right: 9%;
      top: 9%;
      background: radial-gradient(circle at 35% 30%,#fff3db,#d3c4e7 68%,#9d87ba);
      border: 5px solid rgba(72,57,91,.65);
      --disc-glow: rgba(205,181,241,.45);
    }

    .lavender-hills {
      position: absolute;
      left: -3%;
      right: -3%;
      bottom: 29%;
      height: 29%;
      background: #4a3d62;
      clip-path: polygon(0 100%,0 73%,13% 55%,26% 67%,39% 36%,52% 69%,66% 49%,79% 72%,91% 42%,100% 65%,100% 100%);
      box-shadow: inset 0 6px 0 rgba(255,255,255,.05);
    }

    .pokemon-tower {
      position: absolute;
      left: 50%;
      bottom: 23%;
      transform: translateX(-50%);
      width: 24%;
      min-width: 126px;
      height: 48%;
      background: linear-gradient(90deg,#6b5a78,#83708f 48%,#675673 52%);
      border: 6px solid #40344d;
      box-shadow: 9px 9px 0 rgba(0,0,0,.22), inset 0 0 0 3px rgba(255,255,255,.05);
      clip-path: polygon(12% 100%,12% 27%,25% 27%,25% 13%,39% 13%,39% 0,61% 0,61% 13%,75% 13%,75% 27%,88% 27%,88% 100%);
    }

    .pokemon-tower::before {
      content: '';
      position: absolute;
      left: 28%;
      right: 28%;
      top: 16%;
      bottom: 14%;
      background: repeating-linear-gradient(180deg,#d2b1dc 0 13px,#40344d 13px 20px);
      opacity: .75;
      animation: towerGlow 3.4s steps(4) infinite;
    }

    .pokemon-tower::after {
      content: 'POKÉMON TOWER';
      position: absolute;
      left: -16%;
      right: -16%;
      bottom: 5%;
      padding: 6px 0;
      color: #e3c9eb;
      background: #43354f;
      border: 4px solid #2f2538;
      text-align: center;
      font-size: clamp(5px,.62vw,7px);
    }

    .gravestone {
      position: absolute;
      bottom: 18%;
      width: 48px;
      height: 58px;
      border-radius: 22px 22px 3px 3px;
      background: #7b7081;
      border: 5px solid #4a4050;
      box-shadow: 5px 5px 0 rgba(0,0,0,.18);
    }

    .gravestone::after {
      content: '+';
      position: absolute;
      left: 0;
      right: 0;
      top: 12px;
      color: #55495e;
      text-align: center;
      font-size: 18px;
    }

    .pixel-candle {
      position: absolute;
      bottom: 20%;
      width: 13px;
      height: 28px;
      background: #eee3c7;
      border: 3px solid #8b795e;
      box-shadow: 0 0 18px rgba(255,188,100,.34);
    }

    .pixel-candle::before {
      content: '';
      position: absolute;
      width: 9px;
      height: 14px;
      left: -1px;
      bottom: 100%;
      background: #ffc06a;
      clip-path: polygon(50% 0,100% 68%,50% 100%,0 68%);
      animation: lampFlicker 1.7s steps(3) infinite;
    }

    .fog-bank {
      position: absolute;
      left: -20%;
      width: 140%;
      height: 48px;
      border-radius: 50%;
      background: rgba(224,213,239,.15);
      filter: blur(8px);
      animation: fogDrift 16s linear infinite;
    }

    .celadon-skyline {
      position: absolute;
      left: 2%;
      right: 2%;
      bottom: 31%;
      height: 35%;
      background:
        linear-gradient(90deg,#7e9a86 0 14%,transparent 14% 17%,#728d7a 17% 34%,transparent 34% 38%,#82998a 38% 57%,transparent 57% 62%,#687e70 62% 82%,transparent 82% 86%,#758b7a 86% 100%);
      border-bottom: 6px solid rgba(62,87,69,.48);
      filter: drop-shadow(6px 6px 0 rgba(30,55,39,.16));
    }

    .department-store {
      position: absolute;
      left: 8%;
      bottom: 24%;
      width: 31%;
      height: 38%;
      background:
        repeating-linear-gradient(180deg,#b8c9bd 0 23px,#789488 23px 29px);
      border: 6px solid #526a5d;
      box-shadow: 8px 8px 0 rgba(0,0,0,.17);
    }

    .department-store::after {
      content: 'CELADON DEPT.';
      position: absolute;
      left: -5%;
      right: -5%;
      top: -27px;
      padding: 6px 0;
      color: #dff6c5;
      background: #4b7455;
      border: 4px solid #38533e;
      text-align: center;
      font-size: clamp(5px,.62vw,7px);
    }

    .neon-cafe {
      position: absolute;
      right: 8%;
      bottom: 24%;
      width: 25%;
      height: 25%;
      background: #b9cbbb;
      border: 6px solid #536a5d;
      box-shadow: 7px 7px 0 rgba(0,0,0,.16);
    }

    .neon-cafe::before {
      content: 'ROOFTOP GARDEN';
      position: absolute;
      left: -6%;
      right: -6%;
      top: -27px;
      padding: 6px 0;
      color: #d3ffd1;
      background: #4a8060;
      border: 4px solid #355940;
      text-align: center;
      font-size: clamp(4px,.54vw,6px);
      box-shadow: 0 0 20px rgba(116,255,161,.24);
      animation: neonFlicker 3.4s steps(4) infinite;
    }

    .neon-cafe::after {
      content: '';
      position: absolute;
      left: 12%;
      right: 12%;
      top: 18%;
      height: 35%;
      background: repeating-linear-gradient(90deg,#78bace 0 28px,#486b6f 28px 34px);
      border: 4px solid #547272;
    }

    .rooftop-green {
      position: absolute;
      bottom: 29%;
      width: 27%;
      height: 17%;
      background:
        radial-gradient(circle at 12% 70%,#4b955c 0 16%,transparent 17%),
        radial-gradient(circle at 31% 52%,#62a968 0 18%,transparent 19%),
        radial-gradient(circle at 52% 69%,#4e8e56 0 18%,transparent 19%),
        radial-gradient(circle at 74% 48%,#68ad71 0 20%,transparent 21%),
        radial-gradient(circle at 92% 70%,#4a8a54 0 17%,transparent 18%);
      animation: grassSway 3.2s steps(5) infinite;
      transform-origin: bottom;
    }

    .city-crossing {
      position: absolute;
      left: 29%;
      right: 29%;
      bottom: 8%;
      height: 23%;
      background: repeating-linear-gradient(90deg,transparent 0 18px,rgba(247,243,212,.55) 18px 37px,transparent 37px 55px);
      transform: perspective(130px) rotateX(36deg);
      transform-origin: bottom;
      opacity: .72;
    }

    .island-horizon {
      position: absolute;
      left: -3%;
      right: -3%;
      bottom: 29%;
      height: 23%;
      background: #4aa4a4;
      clip-path: polygon(0 100%,0 73%,12% 65%,22% 32%,36% 66%,50% 45%,64% 68%,78% 27%,89% 61%,100% 48%,100% 100%);
      box-shadow: inset 0 7px 0 rgba(255,255,255,.09);
    }

    .sea-band {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 12%;
      height: 23%;
      background: repeating-linear-gradient(180deg,#6ec8dc 0 8px,#4da9c0 8px 16px);
      border-top: 5px solid #438d9c;
      border-bottom: 5px solid #438d9c;
      animation: waterFlow 3.4s steps(10) infinite;
    }

    .palm-tree {
      position: absolute;
      bottom: 25%;
      width: 18px;
      height: 105px;
      background: repeating-linear-gradient(180deg,#8b643d 0 14px,#69482d 14px 22px);
      border: 3px solid #543821;
      transform-origin: bottom;
      animation: palmSway 4.6s steps(8) infinite;
    }

    .palm-tree::before {
      content: '';
      position: absolute;
      left: 50%;
      top: -37px;
      width: 106px;
      height: 68px;
      transform: translateX(-50%);
      background:
        radial-gradient(ellipse at 18% 50%,#4d9d66 0 18%,transparent 19%),
        radial-gradient(ellipse at 38% 25%,#5daa71 0 21%,transparent 22%),
        radial-gradient(ellipse at 62% 25%,#4c9360 0 21%,transparent 22%),
        radial-gradient(ellipse at 82% 50%,#62aa6f 0 18%,transparent 19%),
        radial-gradient(ellipse at 50% 70%,#478b5b 0 22%,transparent 23%);
    }

    .island-dock {
      position: absolute;
      left: 34%;
      bottom: 19%;
      width: 33%;
      height: 12%;
      background: repeating-linear-gradient(90deg,#c79a5d 0 18px,#805b36 18px 23px);
      border: 5px solid #684828;
      box-shadow: 7px 7px 0 rgba(0,0,0,.16);
    }

    .island-dock::before,
    .island-dock::after {
      content: '';
      position: absolute;
      bottom: -31px;
      width: 9px;
      height: 33px;
      background: #6c4b2d;
      border: 3px solid #49321e;
    }
    .island-dock::before { left: 10%; }
    .island-dock::after { right: 10%; }

    .lighthouse {
      position: absolute;
      right: 10%;
      bottom: 28%;
      width: 54px;
      height: 122px;
      background: repeating-linear-gradient(180deg,#f2eee0 0 24px,#d9635d 24px 43px);
      border: 5px solid #75413e;
      box-shadow: 7px 7px 0 rgba(0,0,0,.17);
      clip-path: polygon(20% 100%,8% 10%,22% 10%,22% 0,78% 0,78% 10%,92% 10%,80% 100%);
    }

    .lighthouse::before {
      content: '';
      position: absolute;
      left: 18%;
      right: 18%;
      top: 10px;
      height: 18px;
      background: #fff0ab;
      border: 3px solid #69433c;
      box-shadow: -50px 4px 38px rgba(255,233,137,.4);
      animation: lighthouseBeam 4.8s steps(10) infinite;
    }

    .sailboat {
      position: absolute;
      left: 16%;
      bottom: 27%;
      width: 74px;
      height: 54px;
      animation: boatBob 3.2s steps(7) infinite;
    }

    .sailboat::before {
      content: '';
      position: absolute;
      left: 30px;
      bottom: 15px;
      width: 5px;
      height: 50px;
      background: #6a4c33;
    }

    .sailboat::after {
      content: '';
      position: absolute;
      left: 0;
      bottom: 0;
      width: 74px;
      height: 23px;
      background: #efe0be;
      border: 4px solid #77563a;
      clip-path: polygon(8% 0,100% 0,84% 100%,21% 100%);
      box-shadow: 30px -47px 0 -12px #f3d98c;
    }

    .island-moon {
      width: clamp(62px,8vw,94px);
      aspect-ratio: 1;
      right: 10%;
      top: 9%;
      background: radial-gradient(circle at 35% 30%,#fff8db,#bddce9 65%,#6ca3bb);
      border: 5px solid rgba(40,74,91,.7);
      --disc-glow: rgba(157,219,242,.4);
    }

    .deep-island-ridge {
      position: absolute;
      left: -3%;
      right: -3%;
      bottom: 29%;
      height: 35%;
      background: linear-gradient(180deg,#214f54,#17383e);
      clip-path: polygon(0 100%,0 64%,12% 48%,25% 62%,37% 29%,49% 66%,62% 38%,75% 69%,87% 43%,100% 60%,100% 100%);
      box-shadow: inset 0 7px 0 rgba(124,217,207,.06);
    }

    .ruins-arch {
      position: absolute;
      left: 9%;
      bottom: 21%;
      width: 28%;
      height: 34%;
      border: 15px solid #55786e;
      border-bottom-width: 8px;
      border-radius: 50% 50% 5px 5px;
      box-shadow: 8px 8px 0 rgba(0,0,0,.2), inset 0 0 0 5px #2d504a;
    }

    .ruins-arch::before {
      content: 'ANCIENT RUINS';
      position: absolute;
      left: -18%;
      right: -18%;
      top: -34px;
      padding: 6px 0;
      color: #a8d5c8;
      background: #284b45;
      border: 4px solid #18332f;
      text-align: center;
      font-size: clamp(4px,.55vw,7px);
    }

    .ruins-arch::after {
      content: '';
      position: absolute;
      inset: 20% 20% 8%;
      background: radial-gradient(ellipse at 50% 80%,#10232c,#173947 62%,transparent 64%);
    }

    .rune-stone {
      position: absolute;
      bottom: 20%;
      width: 48px;
      height: 74px;
      background: #4f7169;
      border: 5px solid #294a44;
      clip-path: polygon(50% 0,88% 15%,100% 82%,70% 100%,17% 91%,0 24%);
      filter: drop-shadow(5px 5px 0 rgba(0,0,0,.17));
    }

    .rune-stone::after {
      content: '◇';
      position: absolute;
      left: 0;
      right: 0;
      top: 22px;
      color: #8fe1d1;
      text-align: center;
      font-size: 23px;
      text-shadow: 0 0 12px rgba(101,255,224,.7);
      animation: towerGlow 2.8s steps(4) infinite;
    }

    .deep-sea {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 11%;
      height: 24%;
      background: repeating-linear-gradient(180deg,#286f83 0 8px,#20586b 8px 16px);
      border-top: 5px solid #194553;
      border-bottom: 5px solid #194553;
      animation: waterFlow 4s steps(10) infinite;
    }

    .lantern-post {
      position: absolute;
      bottom: 22%;
      width: 13px;
      height: 92px;
      background: #67503a;
      border: 3px solid #3c2c20;
    }

    .lantern-post::before {
      content: '';
      position: absolute;
      left: 50%;
      top: -12px;
      transform: translateX(-50%);
      width: 38px;
      height: 42px;
      background: #ffc979;
      border: 5px solid #60462f;
      box-shadow: 0 0 30px rgba(255,191,97,.5);
      animation: lampFlicker 2.4s steps(3) infinite;
    }

    .star-field {
      position: absolute;
      inset: 0;
      background-image:
        radial-gradient(circle,#d9ffff 0 1px,transparent 2px),
        radial-gradient(circle,#8bd8db 0 1px,transparent 2px);
      background-size: 73px 73px, 119px 119px;
      background-position: 10px 12px, 42px 31px;
      opacity: .48;
      animation: twinkle 5s steps(4) infinite;
    }

    @keyframes monitorScan {
      0%,100% { filter: brightness(.88); }
      50% { filter: brightness(1.3) saturate(1.2); }
    }
    @keyframes lampFlicker {
      0%,18%,22%,100% { filter: brightness(1); }
      20%,60% { filter: brightness(.72); }
      62% { filter: brightness(1.28); }
    }
    @keyframes centerGlow {
      0%,100% { filter: brightness(.9); transform: translateX(-50%) scale(1); }
      50% { filter: brightness(1.22); transform: translateX(-50%) scale(1.03); }
    }
    @keyframes waterFlow {
      0% { background-position: 0 0; }
      100% { background-position: 24px 16px; }
    }
    @keyframes fountainJet {
      0%,100% { transform: scaleY(.75); opacity: .65; }
      50% { transform: scaleY(1.18); opacity: 1; }
    }
    @keyframes towerGlow {
      0%,100% { filter: brightness(.78); opacity: .72; }
      50% { filter: brightness(1.35); opacity: 1; }
    }
    @keyframes fogDrift {
      0% { transform: translateX(-8%); opacity: .08; }
      50% { opacity: .24; }
      100% { transform: translateX(8%); opacity: .08; }
    }
    @keyframes neonFlicker {
      0%,14%,18%,100% { filter: brightness(1); }
      16%,72% { filter: brightness(.62); }
      74% { filter: brightness(1.35); }
    }
    @keyframes palmSway {
      0%,100% { rotate: -2deg; }
      50% { rotate: 3deg; }
    }
    @keyframes lighthouseBeam {
      0%,100% { filter: brightness(.85); box-shadow: -50px 4px 38px rgba(255,233,137,.25); }
      50% { filter: brightness(1.3); box-shadow: -100px 4px 70px rgba(255,233,137,.56); }
    }
    @keyframes boatBob {
      0%,100% { transform: translateY(0) rotate(-1deg); }
      50% { transform: translateY(-5px) rotate(1deg); }
    }

    @media (max-width: 700px) {
      .scene-stamp { top: 4%; left: 3%; padding: 5px 6px; border-width: 2px; }
      .pallet-house { transform: scale(.76); transform-origin: bottom; }
      .oak-lab-building { transform: translateX(-50%) scale(.78); transform-origin: bottom center; }
      .mailbox, .city-lamp, .potted-plant, .pixel-candle, .rune-stone { transform: scale(.76); transform-origin: bottom; }
      .monitor-bank { transform: scale(.78); transform-origin: bottom; }
      .starter-console { transform: translateX(-50%) scale(.79); transform-origin: bottom center; }
      .viridian-gate { transform: translateX(-50%) scale(.8); transform-origin: bottom center; }
      .museum-building, .pewter-gym, .center-window, .waiting-bench, .cerulean-gym, .department-store, .neon-cafe { transform: scale(.78); transform-origin: bottom; }
      .healing-counter { transform: translateX(-50%) scale(.78); transform-origin: bottom center; }
      .cave-mouth, .pokemon-tower, .ruins-arch { transform: scale(.78); transform-origin: bottom; }
      .pokemon-tower { transform: translateX(-50%) scale(.78); transform-origin: bottom center; }
      .city-fountain, .palm-tree, .lighthouse, .sailboat, .lantern-post { transform: scale(.75); transform-origin: bottom; }
      .nugget-bridge, .island-dock { transform: scale(.84); transform-origin: bottom center; }
    }

    .theme-pallet .sky { background: radial-gradient(circle at 82% 18%,rgba(255,239,169,.35),transparent 18%),linear-gradient(180deg,#5d83bd 0%,#ed9b82 48%,#f6d998 74%,#b6d983 100%); }
    .theme-lab .sky { background: linear-gradient(180deg,#d9edf7 0%,#c3dce8 56%,#a8bac7 100%); }
    .theme-viridian-road .sky { background: radial-gradient(circle at 76% 17%,rgba(255,246,177,.34),transparent 17%),linear-gradient(180deg,#72b9e9 0%,#9ed7d2 52%,#cbe39a 100%); }
    .theme-pewter .sky { background: radial-gradient(circle at 78% 18%,rgba(255,218,158,.22),transparent 18%),linear-gradient(180deg,#69788f 0%,#9d9b9d 52%,#c9ad8d 100%); }
    .theme-center .sky { background: radial-gradient(circle at 50% 30%,rgba(93,184,255,.14),transparent 32%),linear-gradient(180deg,#263d62 0%,#172942 55%,#0b1423 100%); }
    .theme-mtmoon-road .sky { background: radial-gradient(circle at 75% 18%,rgba(255,255,225,.4),transparent 18%),linear-gradient(180deg,#78b9de 0%,#b7dbe8 52%,#c8d79c 100%); }
    .theme-cerulean .sky { background: radial-gradient(circle at 77% 17%,rgba(255,250,192,.38),transparent 17%),linear-gradient(180deg,#69bce8 0%,#93d9ea 52%,#bce9d8 100%); }
    .theme-lavender .sky { background: radial-gradient(circle at 76% 18%,rgba(223,200,246,.14),transparent 19%),linear-gradient(180deg,#302947 0%,#5a466e 52%,#81617e 100%); }
    .theme-celadon .sky { background: radial-gradient(circle at 80% 17%,rgba(255,229,153,.24),transparent 18%),linear-gradient(180deg,#497a78 0%,#69a885 53%,#b3ce7f 100%); }
    .theme-sevii45 .sky { background: radial-gradient(circle at 78% 16%,rgba(255,245,178,.45),transparent 17%),linear-gradient(180deg,#55b8dc 0%,#89d4cc 55%,#f0d490 100%); }
    .theme-sevii67 .sky { background: radial-gradient(circle at 79% 18%,rgba(181,230,242,.13),transparent 18%),linear-gradient(180deg,#172b4d 0%,#22555e 54%,#17363b 100%); }

    @media (max-width: 1100px) {
      .app {
        place-items: start center;
        padding: 12px;
      }

      .device {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
      }

      .left-shell { order: 1; }
      .right-shell { order: 2; }

      .device-controls {
        grid-template-columns: 1fr;
        justify-items: center;
      }

      .ab-buttons {
        justify-content: center;
        padding-right: 0;
      }

      .ambient-hide-mobile { display: none; }
      .scene-list { max-height: 220px; }
    }

    @media (max-width: 700px) {
      .app { padding: 8px; }

      .device {
        border-width: 4px;
        padding: 10px;
        gap: 10px;
      }

      .device::before {
        top: 10px;
        left: 10px;
        width: 28px;
        height: 28px;
        border-width: 3px;
      }

      .device::after {
        top: 12px;
        left: 48px;
        width: 64px;
        height: 10px;
        border-width: 3px;
      }

      .screen-shell {
        padding: 8px;
        border-width: 4px;
      }

      .screen {
        border-width: 6px;
        box-shadow: inset 0 0 0 3px rgba(255,255,255,.05), inset 0 0 0 6px #2a3645;
      }

      .screen-topbar {
        margin-bottom: 8px;
        gap: 6px;
      }

      .screen-label {
        padding: 6px 8px;
        border-width: 3px;
        font-size: 8px;
      }

      .dot-led {
        width: 9px;
        height: 9px;
        border-width: 2px;
      }

      .screen-bottom {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .status-box,
      .meter-box,
      .dex-title,
      .menu-card,
      .player-card,
      .notes-card,
      .footer-card {
        border-width: 3px;
        padding: 10px;
      }

      .status-big,
      .track-display .big,
      .notes-card p,
      .footer-card p,
      .dex-title p {
        font-size: 20px;
      }

      .dex-title h1 {
        font-size: 16px;
      }

      .scene-list {
        max-height: 180px;
      }

      .scene-btn {
        padding: 8px 10px;
        border-width: 3px;
      }

      .scene-btn strong,
      .mini-btn,
      .play-btn,
      .footer-chip,
      .pixel-pill,
      .status-small,
      .bar-label,
      .track-display small,
      .menu-card h2,
      .player-card h2,
      .notes-card h2 {
        font-size: 9px;
      }

      .player-actions {
        grid-template-columns: 52px 1fr 52px;
        gap: 8px;
      }

      .mini-btn,
      .play-btn {
        min-height: 48px;
        border-width: 3px;
      }

      input[type='range'] {
        height: 18px;
        border-width: 3px;
      }

      input[type='range']::-webkit-slider-thumb {
        width: 16px;
        height: 18px;
        border-width: 3px;
      }

      input[type='range']::-moz-range-thumb {
        width: 16px;
        height: 18px;
        border-width: 3px;
      }

      .visualizer {
        height: 42px;
        border-width: 3px;
        padding: 4px;
      }

      .round-btn {
        width: 58px;
        height: 58px;
        font-size: 9px;
        border-width: 4px;
      }

      .footer-card {
        justify-content: flex-start;
      }

      .scene-kicker { top: 5%; left: 4%; }
      .pokeball-moon { right: 5%; top: 8%; border-width: 4px; }
      .route-sign { left: 4%; transform: scale(.72); transform-origin: left bottom; }
      .trainer-bag { right: 10%; transform: scale(.72); transform-origin: bottom right; }
      .poke-radio { transform: translateX(-50%) scale(.78); transform-origin: bottom center; }
      .route-plaque { right: 2%; bottom: 5%; border-width: 3px; padding: 5px 6px; }
      .sprite.featured::after { display: none; }
    }

    @keyframes twinkle { 0%,100% { opacity: .18; } 50% { opacity: .28; } }
    @keyframes blinkLed { 0%,49%,100% { opacity: 1; } 50%,70% { opacity: .45; } }
    @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
    @keyframes ghostFloat {
      0%,100% { transform: translate(0,0); }
      25% { transform: translate(2px,-4px); }
      50% { transform: translate(0,-6px); }
      75% { transform: translate(-2px,-4px); }
    }
    @keyframes fall {
      0% { transform: translateY(-30px) translateX(0); opacity: 0; }
      10% { opacity: .7; }
      100% { transform: translateY(460px) translateX(-10px); opacity: 0; }
    }
    @keyframes steamRise {
      0% { transform: translateY(0) scale(.7); opacity: 0; }
      15% { opacity: .55; }
      100% { transform: translateY(-120px) translateX(var(--sx, 18px)) scale(1.6); opacity: 0; }
    }
    @keyframes firefly {
      0%,100% { transform: translate(0,0); opacity: .35; }
      25% { transform: translate(16px,-12px); opacity: 1; }
      50% { transform: translate(-4px,-22px); opacity: .55; }
      75% { transform: translate(10px,-6px); opacity: 1; }
    }
    @keyframes runeFloat {
      0% { transform: translateY(40px) rotate(45deg); opacity: 0; }
      20% { opacity: .55; }
      100% { transform: translateY(-180px) translateX(var(--rx, 20px)) rotate(405deg); opacity: 0; }
    }
    @keyframes sparkDrift {
      0% { transform: translate(0,0); opacity: 0; }
      10% { opacity: .7; }
      100% { transform: translate(var(--dx, 22px), var(--dy, -54px)); opacity: 0; }
    }
    @keyframes moonHover {
      0%,100% { transform: translateY(0) rotate(-2deg); }
      50% { transform: translateY(-6px) rotate(2deg); }
    }
    @keyframes cloudDrift {
      0% { transform: translateX(-90px); opacity: 0; }
      12%,78% { opacity: .7; }
      100% { transform: translateX(720px); opacity: 0; }
    }
    @keyframes radioPulse {
      0%,100% { filter: brightness(.92); }
      50% { filter: brightness(1.25); }
    }
    @keyframes grassSway {
      0%,100% { rotate: -2deg; }
      50% { rotate: 3deg; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
      }
    }

/* =========================================================
   LoFIDex Pro · audio-reactive, world engine and accessibility
   ========================================================= */
:root {
  --audio-energy: 0;
  --audio-bass: 0;
  --audio-mid: 0;
  --audio-treble: 0;
  --audio-beat: 0;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

button, input { touch-action: manipulation; }
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid #fff2a8;
  outline-offset: 4px;
  box-shadow: 0 0 0 3px #25374a, 0 0 0 7px rgba(255,226,115,.35);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.experience-card {
  background: #1f2631;
  border: 4px solid #0e131a;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
  padding: 12px;
  min-width: 0;
}
.experience-card h2 { margin: 0 0 10px; font-size: 12px; color: #fff2b4; }
.world-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.engine-btn {
  border: 4px solid #0d1118;
  background: linear-gradient(180deg, #455b72, #293b4d);
  color: #eaf3f4;
  min-height: 42px;
  padding: 7px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,.18);
}
.engine-btn[aria-pressed='true'], .engine-btn.is-active {
  color: #15331e;
  background: linear-gradient(180deg, #b7f39a, #69bd71);
  border-color: #173f2a;
}
.engine-btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 rgba(0,0,0,.18); }
.ambience-wrap { margin-top: 10px; }
.engine-readout {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  color: #bcd1d9;
  font-size: 7px;
  line-height: 1.45;
}

.spectrum-labels {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin: 2px 6px -7px;
  color: #718899;
  font-size: 6px;
  letter-spacing: .08em;
}
.spectrum-labels span:nth-child(2) { text-align:center; }
.spectrum-labels span:last-child { text-align:right; }
.audio-status {
  min-height: 20px;
  padding: 5px 7px;
  background: #101720;
  border: 3px solid #0a0e14;
  color: #91a9b6;
  font-size: 7px;
  line-height: 1.4;
}
.audio-status.is-ready { color:#caff9f; }
.audio-status.is-error { color:#ffaaa5; border-color:#5f2228; }

.visualizer { position: relative; isolation: isolate; }
.visualizer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 100%, rgba(211,255,128,calc(.04 + var(--audio-energy) * .22)), transparent 72%);
}
.visualizer i {
  height: 8px;
  transform-origin: bottom;
  transition: height 55ms linear, opacity 80ms linear, filter 80ms linear;
  filter: brightness(calc(.8 + var(--audio-energy) * .7));
}

.screen {
  --audio-energy: 0;
  --audio-bass: 0;
  --audio-mid: 0;
  --audio-treble: 0;
  --audio-beat: 0;
  cursor: crosshair;
}
.screen-fullscreen {
  position: absolute;
  z-index: 60;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 32px;
  border: 3px solid rgba(8,14,22,.82);
  background: rgba(29,42,55,.82);
  color: #eef7e0;
  font: 16px/1 monospace;
  cursor: pointer;
  opacity: .55;
  transition: opacity 120ms linear, transform 120ms steps(2);
}
.screen:hover .screen-fullscreen,
.screen-fullscreen:focus-visible { opacity:1; }
.screen-fullscreen:active { transform: translate(2px,2px); }

.scene-layer {
  --time-brightness: 1;
  --time-saturation: 1;
  filter: brightness(var(--time-brightness)) saturate(var(--time-saturation));
}
.scene-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  transition: background 650ms ease, opacity 650ms ease;
  background: transparent;
}
.scene-layer[data-time='day'] { --time-brightness:1.06; --time-saturation:1.08; }
.scene-layer[data-time='day']::after {
  background: linear-gradient(180deg, rgba(255,244,195,.09), transparent 48%, rgba(255,232,169,.04));
}
.scene-layer[data-time='dusk'] { --time-brightness:.91; --time-saturation:1.12; }
.scene-layer[data-time='dusk']::after {
  background: linear-gradient(180deg, rgba(255,142,105,.2), rgba(120,65,126,.08) 48%, rgba(38,32,70,.14));
  mix-blend-mode: color;
}
.scene-layer[data-time='night'] { --time-brightness:.68; --time-saturation:.87; }
.scene-layer[data-time='night']::after {
  background: linear-gradient(180deg, rgba(21,35,87,.38), rgba(15,27,64,.22) 48%, rgba(4,11,30,.24));
  mix-blend-mode: multiply;
}
.scene-layer[data-time='night'] .window,
.scene-layer[data-time='night'] .lab-window,
.scene-layer[data-time='night'] .neon-glow,
.scene-layer[data-time='night'] .lantern-post {
  filter: brightness(calc(1.15 + var(--audio-mid) * .75)) drop-shadow(0 0 calc(3px + var(--audio-mid) * 10px) rgba(255,218,121,.42));
}

/* Actual audio energy reaches the scene through CSS custom properties. */
.scene-layer .soft-glow,
.scene-layer .neon-glow,
.scene-layer .lamp-glow,
.scene-layer .moon-glow,
.scene-layer .lantern-glow,
.scene-layer .pokeball-moon,
.scene-layer .sun-disc,
.scene-layer .ceiling-light,
.scene-layer .healing-emblem {
  filter: brightness(calc(1 + var(--audio-mid) * .7)) saturate(calc(1 + var(--audio-treble) * .35));
  opacity: calc(.72 + var(--audio-energy) * .28);
}
.scene-layer .window,
.scene-layer .lab-window,
.scene-layer .monitor-bank,
.scene-layer .department-store,
.scene-layer .gym-building,
.scene-layer .pokemon-tower,
.scene-layer .lantern-post {
  transition: filter 90ms linear, opacity 180ms linear, background 180ms linear;
  filter: brightness(calc(.88 + var(--audio-mid) * .46));
}
.scene-layer .window.is-lit,
.scene-layer .lab-window.is-lit {
  filter: brightness(1.55) drop-shadow(0 0 10px rgba(255,224,138,.7));
}
.scene-layer .deep-sea,
.scene-layer .cerulean-canal,
.scene-layer .sea-water,
.scene-layer .pixel-floor {
  filter: brightness(calc(.88 + var(--audio-bass) * .32)) saturate(calc(.92 + var(--audio-treble) * .45));
}
.pixel-firefly,
.pixel-rune,
.pixel-spark {
  filter: brightness(calc(.8 + var(--audio-treble) * 1.5));
  opacity: calc(.25 + var(--audio-treble) * .75) !important;
}
.pixel-drop { opacity: calc(.28 + var(--audio-treble) * .62) !important; }
.screen.beat-hit .pixel-firefly,
.screen.beat-hit .pixel-rune,
.screen.beat-hit .pixel-spark { filter: brightness(2.2) drop-shadow(0 0 7px currentColor); }

.sprites { pointer-events: auto; }
.sprite {
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
  --look-x: 0px;
  --look-y: 0px;
  --reactive-lift: 0px;
  transition: filter 140ms linear;
}
.sprite img:not(.sprite-reflection) {
  transform: translate(var(--look-x), calc(var(--look-y) + var(--reactive-lift))) scale(var(--sprite-scale));
  transition: transform 90ms steps(2), filter 160ms linear;
  will-change: transform;
}
.sprite.is-curious img:not(.sprite-reflection) { filter: brightness(1.14) saturate(1.12); }
.sprite.is-sleeping:not(.ghost) img:not(.sprite-reflection) {
  transform: translate(var(--look-x), 5px) rotate(5deg) scale(var(--sprite-scale));
  filter: saturate(.68) brightness(.86);
}
.sprite.is-sleeping:not(.ghost)::after { content:'Z z'; color:#dff1ff; }
.sprite.idle-hop { animation-name: spriteHop; animation-duration:1.8s; }
.sprite.idle-sway { animation-name: spriteSway; animation-duration:2.4s; }
.sprite.idle-breathe { animation-name: spriteBreathe; animation-duration:2.1s; }
.sprite.idle-float { animation-name: ghostFloat; animation-duration:2.5s; }
.sprite-reflection {
  position: absolute;
  left: 0;
  top: 70%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: scaleY(-.48) scale(var(--sprite-scale));
  transform-origin: 50% 0;
  opacity: calc(.1 + var(--audio-bass) * .14);
  filter: blur(.5px) saturate(.55);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 68%);
  pointer-events: none;
}
.sprite-cover {
  position:absolute;
  z-index:5;
  left:0;
  right:0;
  bottom:8%;
  height:14%;
  pointer-events:none;
  background: linear-gradient(70deg, transparent 47%, rgba(65,105,55,.95) 48% 56%, transparent 57%) 0 100% / 24px 45px repeat-x;
  opacity:.74;
}

.weather-layer {
  position: absolute;
  inset: 0;
  z-index: 17;
  overflow: hidden;
  pointer-events: none;
}
.weather-drop,
.weather-leaf,
.weather-mist {
  position:absolute;
  display:block;
  image-rendering:pixelated;
}
.weather-drop {
  width:2px;
  height:18px;
  background:linear-gradient(180deg,transparent,rgba(212,235,255,.88));
  animation: weatherRain var(--speed,1.1s) linear infinite;
  animation-delay:var(--delay,0s);
}
.weather-leaf {
  width:8px;
  height:5px;
  background:#bcd76a;
  border:1px solid rgba(37,74,44,.6);
  animation: weatherWind var(--speed,5s) linear infinite;
  animation-delay:var(--delay,0s);
}
.weather-mist {
  width:44%;
  height:22%;
  background:radial-gradient(ellipse,rgba(220,232,238,.24),transparent 70%);
  filter:blur(3px);
  animation: weatherMist var(--speed,14s) ease-in-out infinite alternate;
  animation-delay:var(--delay,0s);
}

.scene-transition {
  position:absolute;
  inset:0;
  z-index:55;
  display:grid;
  place-items:center;
  background:#08111d;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity 240ms steps(5), visibility 0s linear 250ms;
}
.scene-transition.is-visible {
  opacity:1;
  visibility:visible;
  transition:opacity 220ms steps(5), visibility 0s;
}
.transition-grid {
  position:absolute;
  inset:0;
  background:
    linear-gradient(rgba(112,159,184,.12) 2px,transparent 2px),
    linear-gradient(90deg,rgba(112,159,184,.12) 2px,transparent 2px);
  background-size:24px 24px;
  transform:perspective(250px) rotateX(55deg) scale(1.7) translateY(24%);
  animation: transitionScan 1.1s steps(10) infinite;
}
.location-card {
  position:relative;
  min-width:min(72%,420px);
  padding:18px 20px;
  border:5px solid #d9f08d;
  background:#182737;
  color:#eff8d0;
  box-shadow:7px 7px 0 rgba(0,0,0,.35),inset 0 0 0 3px rgba(255,255,255,.06);
  display:grid;
  gap:9px;
  text-align:center;
  transform:translateY(10px);
}
.scene-transition.is-visible .location-card { animation: locationReveal .9s steps(7) both; }
.location-card small,.location-card span { color:#9db5c3;font-size:8px;line-height:1.4; }
.location-card strong { font-size:clamp(11px,2vw,18px);line-height:1.55; }

.interaction-toast {
  position:absolute;
  z-index:64;
  left:50%;
  bottom:8%;
  transform:translate(-50%,10px);
  width:max-content;
  max-width:84%;
  padding:9px 11px;
  border:4px solid #0b1119;
  background:rgba(30,43,55,.94);
  color:#fff1b0;
  font-size:8px;
  line-height:1.5;
  text-align:center;
  opacity:0;
  visibility:hidden;
  transition:opacity 130ms steps(3),transform 130ms steps(3),visibility 0s linear 140ms;
}
.interaction-toast.is-visible { opacity:1;visibility:visible;transform:translate(-50%,0);transition-delay:0s; }
.particle-burst {
  position:absolute;
  z-index:30;
  width:6px;
  height:6px;
  background:#fff2a6;
  box-shadow:0 0 8px rgba(255,220,112,.8);
  animation:burstOut 700ms steps(7) forwards;
  pointer-events:none;
}

.mobile-player {
  display:none;
  position:fixed;
  z-index:100;
  left:8px;
  right:8px;
  bottom:calc(8px + var(--safe-bottom));
  grid-template-columns:48px 58px 1fr 48px;
  gap:7px;
  align-items:center;
  padding:8px;
  background:rgba(23,31,42,.96);
  border:4px solid #090d13;
  box-shadow:5px 5px 0 rgba(0,0,0,.28);
}
.mobile-player button {
  min-height:44px;
  border:3px solid #0b1017;
  background:#3f566c;
  color:#eef6ef;
  font-family:'Press Start 2P',monospace;
  font-size:8px;
}
.mobile-player #mobile-play { background:#68bd75;color:#102c18; }
.mobile-track { min-width:0;display:grid;gap:4px; }
.mobile-track small { color:#8fa7b4;font-size:6px; }
.mobile-track strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e9f4bd;font-family:'VT323',monospace;font-size:20px; }

.offline-banner {
  position:fixed;
  z-index:120;
  left:50%;
  top:10px;
  transform:translate(-50%,-150%);
  max-width:min(92vw,760px);
  padding:10px 13px;
  border:4px solid #6a2b29;
  background:#b74d42;
  color:#fff4d7;
  font-size:8px;
  line-height:1.5;
  text-align:center;
  transition:transform 180ms steps(4);
}
.offline-banner.is-visible { transform:translate(-50%,0); }

body.cinema-mode { overflow:hidden; }
body.cinema-mode .screen-shell {
  position:fixed;
  inset:0;
  z-index:200;
  padding:10px;
  background:#131a23;
  display:grid;
  grid-template-rows:auto 1fr auto;
}
body.cinema-mode .screen { width:min(100%,1600px);height:auto;max-height:calc(100vh - 125px);margin:auto;aspect-ratio:16/10; }
body.cinema-mode .screen-fullscreen { opacity:1; }

@keyframes spriteHop { 0%,100%{transform:translateY(0)} 46%{transform:translateY(-3px)} 52%{transform:translateY(-7px)} 60%{transform:translateY(-3px)} }
@keyframes spriteSway { 0%,100%{transform:translateX(0) rotate(0)} 33%{transform:translateX(2px) rotate(1deg)} 66%{transform:translateX(-2px) rotate(-1deg)} }
@keyframes spriteBreathe { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-2px) scale(1.025)} }
@keyframes weatherRain { from{transform:translate3d(0,-30px,0)} to{transform:translate3d(-24px,520px,0)} }
@keyframes weatherWind { from{transform:translate3d(-40px,0,0) rotate(0)} to{transform:translate3d(760px,80px,0) rotate(540deg)} }
@keyframes weatherMist { from{transform:translateX(-18%);opacity:.25} to{transform:translateX(130%);opacity:.62} }
@keyframes transitionScan { from{background-position:0 0,0 0} to{background-position:0 48px,48px 0} }
@keyframes locationReveal { 0%{opacity:0;transform:translateY(18px) scale(.96)} 25%{opacity:1} 100%{opacity:1;transform:translateY(0) scale(1)} }
@keyframes burstOut { from{transform:translate(0,0) scale(1);opacity:1} to{transform:translate(var(--bx),var(--by)) scale(0);opacity:0} }

@media (max-width:1100px) {
  .right-shell { grid-template-rows:auto; }
}

@media (max-width:700px) {
  body { padding-bottom:calc(84px + var(--safe-bottom)); }
  .experience-card { border-width:3px;padding:10px; }
  .experience-card h2 { font-size:9px; }
  .engine-btn { border-width:3px;min-height:40px;font-size:7px; }
  .mobile-player { display:grid; }
  .screen-fullscreen { opacity:.88; }
  .scene-list { scroll-snap-type:y proximity; }
  .scene-btn { scroll-snap-align:start; }
  .location-card { min-width:82%;padding:13px 10px;border-width:4px; }
  .interaction-toast { font-size:7px;bottom:11%; }
}

@media (max-width:900px) and (orientation:landscape) {
  body { padding-bottom:0; }
  .app { padding:5px; }
  .device { grid-template-columns:minmax(0,1.45fr) minmax(270px,.7fr);padding:8px;gap:8px; }
  .device-controls,.notes-card,.footer-card,.dex-title p { display:none; }
  .screen-shell { padding:7px; }
  .screen-topbar { margin-bottom:5px; }
  .scene-list { max-height:120px; }
  .right-shell { gap:6px;padding:5px; }
  .menu-card,.player-card,.experience-card,.dex-title { padding:7px;border-width:3px; }
  .visualizer { height:36px;margin-top:5px; }
  .world-controls { grid-template-columns:1fr 1fr 1fr 1fr; }
  .engine-btn { min-height:32px;font-size:6px;padding:4px; }
  .ambience-wrap,.engine-readout,.audio-status,.spectrum-labels { display:none; }
  .mobile-player { display:none; }
}

@media (prefers-reduced-motion:reduce) {
  .visualizer i { transition:none; }
  .scene-transition,.location-card,.interaction-toast,.weather-drop,.weather-leaf,.weather-mist,.particle-burst { animation:none !important;transition:none !important; }
  .weather-layer { display:none; }
  .sprite img:not(.sprite-reflection) { transition:none;--reactive-lift:0px !important;--look-x:0px !important;--look-y:0px !important; }
}

@media (min-width:1101px) {
  .device { align-items:start; }
  .left-shell { align-content:start; align-self:start; position:sticky; top:18px; }
}

#screen:fullscreen {
  width:100vw;
  height:100vh;
  max-width:none;
  aspect-ratio:auto;
  border:0;
  background:#09111c;
}
#screen:fullscreen .scene-layer,
#screen:fullscreen .weather-layer,
#screen:fullscreen .scene-transition { inset:0; }

/* Keep the full-screen sprite layer transparent to clicks; only each sprite
   itself is interactive, so radios, windows and lanterns remain reachable. */
.sprites { pointer-events:none; }
.sprite { pointer-events:auto; }

.sprite { --facing:1; }
.sprite img:not(.sprite-reflection) {
  transform: translate(var(--look-x), calc(var(--look-y) + var(--reactive-lift))) scaleX(var(--facing)) scale(var(--sprite-scale));
}
.sprite.is-sleeping:not(.ghost) img:not(.sprite-reflection) {
  transform: translate(var(--look-x), 5px) rotate(5deg) scaleX(var(--facing)) scale(var(--sprite-scale));
}

/* Pixel-art image backgrounds and language selector */
.screen { aspect-ratio: 16 / 9; }
.scene-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  transform: scale(calc(1 + var(--audio-bass) * .008));
  transform-origin: center;
  transition: transform 90ms linear, filter 650ms ease;
  pointer-events: none;
  user-select: none;
}

.dex-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.language-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 156px;
  color: #9fb3c0;
  font-size: 7px;
  line-height: 1.4;
}

.language-picker select {
  width: 100%;
  min-height: 38px;
  appearance: none;
  -webkit-appearance: none;
  border: 4px solid #0a0f15;
  border-radius: 0;
  padding: 7px 30px 7px 9px;
  background:
    linear-gradient(45deg, transparent 50%, #e9f4bd 50%) calc(100% - 14px) 15px / 6px 6px no-repeat,
    linear-gradient(135deg, #e9f4bd 50%, transparent 50%) calc(100% - 8px) 15px / 6px 6px no-repeat,
    linear-gradient(180deg, #455a70, #293a4b);
  color: #f1f6f8;
  box-shadow: 4px 4px 0 rgba(0,0,0,.18), inset 0 0 0 2px rgba(255,255,255,.04);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
}

.language-picker select:hover,
.language-picker select:focus-visible {
  border-color: #ffe07b;
  outline: none;
}

.language-picker select:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0,0,0,.18);
}

.language-picker option {
  background: #283443;
  color: #f1f6f8;
}

@media (max-width: 700px) {
  .dex-heading { align-items: stretch; flex-direction: column; }
  .language-picker { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-background { transform: none !important; transition: none !important; }
}


/* =========================================================
   Full interface fullscreen layout
   Reflows the interface to the viewport without scaling it.
   ========================================================= */
html.fullscreen-ui-mode,
body.fullscreen-ui-mode {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.fullscreen-ui-mode {
  padding: 0 !important;
}

body.fullscreen-ui-mode .app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
  display: block;
}

body.fullscreen-ui-mode .device {
  position: relative !important;
  inset: auto !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 10px !important;
  gap: 10px !important;
  border-width: 4px !important;
  grid-template-columns: minmax(0, 1.62fr) minmax(390px, .88fr) !important;
  align-items: stretch !important;
  transform: none !important;
  overflow: hidden !important;
}

body.fullscreen-ui-mode .left-shell,
body.fullscreen-ui-mode .right-shell {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  order: initial !important;
}

body.fullscreen-ui-mode .left-shell {
  position: static !important;
  top: auto !important;
  align-self: stretch !important;
  align-content: stretch !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 8px !important;
}

body.fullscreen-ui-mode .screen-shell {
  min-height: 0 !important;
  height: 100% !important;
  padding: 10px !important;
  border-width: 4px !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
}

body.fullscreen-ui-mode .screen-topbar {
  margin-bottom: 7px !important;
  flex-wrap: nowrap !important;
}

body.fullscreen-ui-mode .screen-label {
  padding: 6px 8px !important;
  border-width: 3px !important;
  font-size: 9px !important;
}

body.fullscreen-ui-mode .screen {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  border-width: 6px !important;
}

body.fullscreen-ui-mode .screen-bottom {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 7px !important;
  margin-top: 7px !important;
}

body.fullscreen-ui-mode .status-box,
body.fullscreen-ui-mode .meter-box {
  padding: 7px 9px !important;
  border-width: 3px !important;
}

body.fullscreen-ui-mode .status-box {
  gap: 4px !important;
}

body.fullscreen-ui-mode .status-big {
  font-size: 24px !important;
}

body.fullscreen-ui-mode .meter {
  width: 120px !important;
  height: 20px !important;
  border-width: 3px !important;
}

body.fullscreen-ui-mode .device-controls {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) 142px !important;
  gap: 8px !important;
  align-items: center !important;
  justify-items: stretch !important;
  min-height: 82px !important;
}

body.fullscreen-ui-mode .ambient-hide-mobile {
  display: block !important;
}

body.fullscreen-ui-mode .dpad {
  width: 82px !important;
  height: 82px !important;
  margin-left: 4px !important;
}

body.fullscreen-ui-mode .dpad .cross-h {
  top: 25px !important;
  height: 32px !important;
}

body.fullscreen-ui-mode .dpad .cross-v {
  left: 25px !important;
  width: 32px !important;
}

body.fullscreen-ui-mode .system-strip {
  gap: 6px !important;
  flex-wrap: nowrap !important;
}

body.fullscreen-ui-mode .pixel-pill {
  padding: 8px 9px !important;
  border-width: 3px !important;
  font-size: 8px !important;
  white-space: nowrap !important;
}

body.fullscreen-ui-mode .ab-buttons {
  gap: 8px !important;
  padding-right: 4px !important;
}

body.fullscreen-ui-mode .round-btn {
  width: 60px !important;
  height: 60px !important;
  border-width: 4px !important;
  font-size: 9px !important;
}

body.fullscreen-ui-mode .right-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  gap: 7px !important;
  padding: 6px !important;
  border-width: 3px !important;
  align-content: stretch !important;
}

body.fullscreen-ui-mode .dex-title,
body.fullscreen-ui-mode .menu-card,
body.fullscreen-ui-mode .player-card,
body.fullscreen-ui-mode .experience-card,
body.fullscreen-ui-mode .notes-card,
body.fullscreen-ui-mode .footer-card {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 8px !important;
  border-width: 3px !important;
  overflow: hidden !important;
}

body.fullscreen-ui-mode .dex-title {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

body.fullscreen-ui-mode .menu-card {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

body.fullscreen-ui-mode .player-card {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

body.fullscreen-ui-mode .experience-card {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
}

body.fullscreen-ui-mode .notes-card {
  grid-column: 1 !important;
  grid-row: 4 !important;
  display: block !important;
}

body.fullscreen-ui-mode .footer-card {
  grid-column: 2 !important;
  grid-row: 4 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
}

body.fullscreen-ui-mode .dex-heading {
  align-items: center !important;
  flex-direction: row !important;
}

body.fullscreen-ui-mode .dex-title h1 {
  margin-bottom: 4px !important;
  font-size: 18px !important;
}

body.fullscreen-ui-mode .dex-title p {
  display: block !important;
  font-size: 19px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.fullscreen-ui-mode .language-picker {
  width: auto !important;
}

body.fullscreen-ui-mode .language-picker select {
  min-height: 30px !important;
  padding: 5px 7px !important;
  border-width: 3px !important;
}

body.fullscreen-ui-mode .menu-card h2,
body.fullscreen-ui-mode .player-card h2,
body.fullscreen-ui-mode .notes-card h2,
body.fullscreen-ui-mode .experience-card h2 {
  margin-bottom: 6px !important;
  font-size: 9px !important;
}

body.fullscreen-ui-mode .scene-list {
  min-height: 0 !important;
  height: 100% !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-flow: column !important;
  gap: 5px !important;
  max-height: none !important;
  overflow: hidden !important;
  padding-right: 0 !important;
  scroll-snap-type: none !important;
}

body.fullscreen-ui-mode .scene-btn {
  min-height: 0 !important;
  padding: 5px 7px !important;
  border-width: 3px !important;
  gap: 3px !important;
  box-shadow: 2px 2px 0 rgba(0,0,0,.16) !important;
}

body.fullscreen-ui-mode .scene-btn span {
  font-size: 7px !important;
}

body.fullscreen-ui-mode .scene-btn strong {
  font-size: 8px !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.fullscreen-ui-mode .player-main {
  min-height: 0 !important;
  height: 100% !important;
  gap: 6px !important;
  grid-template-rows: auto auto auto auto auto minmax(34px, 1fr) auto !important;
}

body.fullscreen-ui-mode .track-display {
  padding: 7px !important;
  border-width: 3px !important;
  gap: 3px !important;
}

body.fullscreen-ui-mode .track-display small {
  font-size: 8px !important;
}

body.fullscreen-ui-mode .track-display .big {
  font-size: 23px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.fullscreen-ui-mode .player-actions {
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  gap: 6px !important;
}

body.fullscreen-ui-mode .mini-btn,
body.fullscreen-ui-mode .play-btn {
  min-height: 42px !important;
  border-width: 3px !important;
  font-size: 9px !important;
}

body.fullscreen-ui-mode .bar-wrap {
  gap: 3px !important;
}

body.fullscreen-ui-mode .bar-label {
  font-size: 8px !important;
}

body.fullscreen-ui-mode input[type='range'] {
  height: 18px !important;
  border-width: 3px !important;
}

body.fullscreen-ui-mode .visualizer {
  min-height: 34px !important;
  height: auto !important;
  margin-top: 0 !important;
  padding: 4px !important;
  border-width: 3px !important;
}

body.fullscreen-ui-mode .spectrum-labels,
body.fullscreen-ui-mode .audio-status {
  display: grid !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .world-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

body.fullscreen-ui-mode .engine-btn {
  min-height: 34px !important;
  padding: 4px !important;
  border-width: 3px !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .ambience-wrap {
  display: grid !important;
  margin-top: 6px !important;
}

body.fullscreen-ui-mode .engine-readout {
  display: flex !important;
  margin-top: 5px !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .notes-card p {
  font-size: 17px !important;
  line-height: 1 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

body.fullscreen-ui-mode .footer-chip {
  min-width: 0 !important;
  padding: 7px 6px !important;
  border-width: 3px !important;
  font-size: 7px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.fullscreen-ui-mode .mobile-player {
  display: none !important;
}

/* Short landscape screens: keep readable controls and remove only decorative
   information rather than reducing the whole interface with transform: scale. */
@media (max-height: 760px) and (orientation: landscape) {
  body.fullscreen-ui-mode .device {
    padding: 7px !important;
    gap: 7px !important;
  }

  body.fullscreen-ui-mode .left-shell {
    grid-template-rows: minmax(0, 1fr) 62px !important;
    gap: 6px !important;
  }

  body.fullscreen-ui-mode .device-controls {
    min-height: 62px !important;
    grid-template-columns: minmax(0, 1fr) 126px !important;
  }

  body.fullscreen-ui-mode .dpad {
    display: none !important;
  }

  body.fullscreen-ui-mode .round-btn {
    width: 52px !important;
    height: 52px !important;
  }

  body.fullscreen-ui-mode .right-shell {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  body.fullscreen-ui-mode .notes-card,
  body.fullscreen-ui-mode .footer-card {
    display: none !important;
  }

  body.fullscreen-ui-mode .experience-card {
    grid-row: 3 !important;
  }

  body.fullscreen-ui-mode .ambience-wrap,
  body.fullscreen-ui-mode .engine-readout,
  body.fullscreen-ui-mode .spectrum-labels,
  body.fullscreen-ui-mode .audio-status {
    display: none !important;
  }

  body.fullscreen-ui-mode .player-main {
    grid-template-rows: auto auto auto auto minmax(28px, 1fr) !important;
  }
}

/* Narrow or portrait screens are reorganized into two viewport rows. The
   scene keeps its natural size; lower controls reflow instead of being scaled. */
@media (max-width: 900px), (orientation: portrait) {
  body.fullscreen-ui-mode .device {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 56%) minmax(0, 44%) !important;
    padding: 6px !important;
    gap: 6px !important;
  }

  body.fullscreen-ui-mode .left-shell {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  body.fullscreen-ui-mode .device-controls {
    display: none !important;
  }

  body.fullscreen-ui-mode .right-shell {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    gap: 5px !important;
    padding: 4px !important;
  }

  body.fullscreen-ui-mode .dex-title {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  body.fullscreen-ui-mode .menu-card {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
  }

  body.fullscreen-ui-mode .player-card {
    grid-column: 3 / 5 !important;
    grid-row: 2 !important;
  }

  body.fullscreen-ui-mode .experience-card {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
  }

  body.fullscreen-ui-mode .notes-card,
  body.fullscreen-ui-mode .footer-card {
    display: none !important;
  }

  body.fullscreen-ui-mode .screen-bottom {
    display: none !important;
  }

  body.fullscreen-ui-mode .scene-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  }

  body.fullscreen-ui-mode .scene-btn span {
    display: none !important;
  }

  body.fullscreen-ui-mode .ambience-wrap,
  body.fullscreen-ui-mode .engine-readout,
  body.fullscreen-ui-mode .spectrum-labels,
  body.fullscreen-ui-mode .audio-status {
    display: none !important;
  }

  body.fullscreen-ui-mode .player-main {
    grid-template-rows: auto auto auto auto minmax(26px, 1fr) !important;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  body.fullscreen-ui-mode .device {
    grid-template-rows: minmax(0, 50%) minmax(0, 50%) !important;
  }

  body.fullscreen-ui-mode .dex-title p,
  body.fullscreen-ui-mode .language-picker span,
  body.fullscreen-ui-mode .track-display small,
  body.fullscreen-ui-mode .bar-label,
  body.fullscreen-ui-mode .visualizer {
    display: none !important;
  }

  body.fullscreen-ui-mode .dex-title h1 {
    margin: 0 !important;
    font-size: 15px !important;
  }

  body.fullscreen-ui-mode .language-picker select {
    min-height: 26px !important;
    font-size: 7px !important;
  }

  body.fullscreen-ui-mode .player-main {
    grid-template-rows: auto auto auto auto !important;
  }
}

/* Legacy CSS-only fallback uses the same no-scroll reflow mode. */
body.cinema-mode {
  overflow: hidden !important;
}

/* =========================================================
   Readable fullscreen panels
   Keep the original typography and let long panels scroll.
   ========================================================= */
body.fullscreen-ui-mode .right-shell {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: none !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  gap: 14px !important;
  padding: 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.fullscreen-ui-mode .right-shell::-webkit-scrollbar,
body.fullscreen-ui-mode .scene-list::-webkit-scrollbar,
body.fullscreen-ui-mode .player-main::-webkit-scrollbar {
  width: 10px;
}

body.fullscreen-ui-mode .right-shell::-webkit-scrollbar-thumb,
body.fullscreen-ui-mode .scene-list::-webkit-scrollbar-thumb,
body.fullscreen-ui-mode .player-main::-webkit-scrollbar-thumb {
  background: #516274;
  border: 2px solid #0e131a;
}

body.fullscreen-ui-mode .right-shell::-webkit-scrollbar-track,
body.fullscreen-ui-mode .scene-list::-webkit-scrollbar-track,
body.fullscreen-ui-mode .player-main::-webkit-scrollbar-track {
  background: #141b24;
}

body.fullscreen-ui-mode .dex-title,
body.fullscreen-ui-mode .menu-card,
body.fullscreen-ui-mode .player-card,
body.fullscreen-ui-mode .experience-card,
body.fullscreen-ui-mode .notes-card,
body.fullscreen-ui-mode .footer-card {
  grid-column: auto !important;
  grid-row: auto !important;
  min-height: auto !important;
  padding: 12px !important;
  border-width: 4px !important;
  overflow: visible !important;
}

body.fullscreen-ui-mode .menu-card,
body.fullscreen-ui-mode .player-card {
  display: block !important;
}

body.fullscreen-ui-mode .dex-title h1 {
  margin: 0 0 8px !important;
  font-size: clamp(18px, 1.7vw, 24px) !important;
  line-height: 1.35 !important;
}

body.fullscreen-ui-mode .dex-title p {
  display: block !important;
  margin: 0 !important;
  font-size: 24px !important;
  line-height: 1.1 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.fullscreen-ui-mode .language-picker {
  width: auto !important;
  min-width: 156px !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .language-picker select {
  min-height: 38px !important;
  padding: 7px 30px 7px 9px !important;
  border-width: 4px !important;
  font-size: 8px !important;
}

body.fullscreen-ui-mode .menu-card h2,
body.fullscreen-ui-mode .player-card h2,
body.fullscreen-ui-mode .notes-card h2,
body.fullscreen-ui-mode .experience-card h2 {
  margin-bottom: 10px !important;
  font-size: 12px !important;
}

body.fullscreen-ui-mode .scene-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  grid-auto-rows: max-content !important;
  gap: 8px !important;
  height: auto !important;
  max-height: 280px !important;
  padding-right: 4px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scroll-snap-type: y proximity !important;
}

body.fullscreen-ui-mode .scene-btn {
  min-height: auto !important;
  padding: 10px 12px !important;
  border-width: 4px !important;
  gap: 6px !important;
  box-shadow: 4px 4px 0 rgba(0,0,0,.16) !important;
}

body.fullscreen-ui-mode .scene-btn span {
  display: block !important;
  font-size: 10px !important;
}

body.fullscreen-ui-mode .scene-btn strong {
  font-size: 11px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.fullscreen-ui-mode .player-main {
  display: grid !important;
  grid-template-rows: none !important;
  gap: 10px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.fullscreen-ui-mode .track-display {
  padding: 10px !important;
  border-width: 4px !important;
  gap: 6px !important;
}

body.fullscreen-ui-mode .track-display small {
  display: block !important;
  font-size: 10px !important;
}

body.fullscreen-ui-mode .track-display .big {
  font-size: 28px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.fullscreen-ui-mode .player-actions {
  grid-template-columns: 64px minmax(0, 1fr) 64px !important;
  gap: 10px !important;
}

body.fullscreen-ui-mode .mini-btn,
body.fullscreen-ui-mode .play-btn {
  min-height: 56px !important;
  border-width: 4px !important;
  font-size: 11px !important;
}

body.fullscreen-ui-mode .bar-wrap {
  gap: 6px !important;
}

body.fullscreen-ui-mode .bar-label {
  display: flex !important;
  font-size: 10px !important;
}

body.fullscreen-ui-mode input[type='range'] {
  height: 22px !important;
  border-width: 4px !important;
}

body.fullscreen-ui-mode .visualizer {
  display: flex !important;
  height: 54px !important;
  min-height: 54px !important;
  margin-top: 10px !important;
  padding: 6px !important;
  border-width: 4px !important;
}

body.fullscreen-ui-mode .spectrum-labels {
  display: grid !important;
  font-size: 6px !important;
}

body.fullscreen-ui-mode .audio-status {
  display: block !important;
  min-height: 20px !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .world-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

body.fullscreen-ui-mode .engine-btn {
  min-height: 42px !important;
  padding: 7px 8px !important;
  border-width: 4px !important;
  font-size: 8px !important;
  line-height: 1.45 !important;
}

body.fullscreen-ui-mode .ambience-wrap {
  display: grid !important;
  margin-top: 10px !important;
}

body.fullscreen-ui-mode .engine-readout {
  display: flex !important;
  margin-top: 9px !important;
  font-size: 7px !important;
}

body.fullscreen-ui-mode .notes-card {
  display: block !important;
}

body.fullscreen-ui-mode .notes-card p {
  display: block !important;
  font-size: 24px !important;
  line-height: 1.12 !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

body.fullscreen-ui-mode .footer-card {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
}

body.fullscreen-ui-mode .footer-chip {
  padding: 10px 12px !important;
  border-width: 4px !important;
  font-size: 10px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.fullscreen-ui-mode .screen-label {
  font-size: 10px !important;
}

body.fullscreen-ui-mode .status-small {
  font-size: 10px !important;
}

body.fullscreen-ui-mode .status-big {
  font-size: 28px !important;
}

body.fullscreen-ui-mode .pixel-pill {
  font-size: 10px !important;
}

body.fullscreen-ui-mode .round-btn {
  font-size: 11px !important;
}

/* On short screens, the right panel scrolls instead of hiding or shrinking text. */
@media (max-height: 760px) and (orientation: landscape) {
  body.fullscreen-ui-mode .right-shell {
    grid-template-rows: none !important;
  }

  body.fullscreen-ui-mode .notes-card,
  body.fullscreen-ui-mode .footer-card,
  body.fullscreen-ui-mode .ambience-wrap,
  body.fullscreen-ui-mode .engine-readout,
  body.fullscreen-ui-mode .spectrum-labels,
  body.fullscreen-ui-mode .audio-status {
    display: initial !important;
  }

  body.fullscreen-ui-mode .notes-card { display: block !important; }
  body.fullscreen-ui-mode .footer-card { display: flex !important; }
  body.fullscreen-ui-mode .ambience-wrap { display: grid !important; }
  body.fullscreen-ui-mode .engine-readout { display: flex !important; }
  body.fullscreen-ui-mode .spectrum-labels { display: grid !important; }
  body.fullscreen-ui-mode .audio-status { display: block !important; }
}

/* In portrait, keep the scene above and use the lower half as a readable,
   vertically scrollable control panel. */
@media (max-width: 900px), (orientation: portrait) {
  body.fullscreen-ui-mode .right-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    grid-auto-rows: max-content !important;
    gap: 12px !important;
    padding: 6px !important;
    overflow-y: auto !important;
  }

  body.fullscreen-ui-mode .dex-title,
  body.fullscreen-ui-mode .menu-card,
  body.fullscreen-ui-mode .player-card,
  body.fullscreen-ui-mode .experience-card,
  body.fullscreen-ui-mode .notes-card,
  body.fullscreen-ui-mode .footer-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  body.fullscreen-ui-mode .notes-card { display: block !important; }
  body.fullscreen-ui-mode .footer-card { display: flex !important; }
  body.fullscreen-ui-mode .screen-bottom { display: grid !important; }
  body.fullscreen-ui-mode .scene-btn span { display: block !important; }
  body.fullscreen-ui-mode .ambience-wrap { display: grid !important; }
  body.fullscreen-ui-mode .engine-readout { display: flex !important; }
  body.fullscreen-ui-mode .spectrum-labels { display: grid !important; }
  body.fullscreen-ui-mode .audio-status { display: block !important; }
  body.fullscreen-ui-mode .visualizer { display: flex !important; }
}

@media (max-width: 560px) and (orientation: portrait) {
  body.fullscreen-ui-mode .dex-title p,
  body.fullscreen-ui-mode .language-picker span,
  body.fullscreen-ui-mode .track-display small,
  body.fullscreen-ui-mode .bar-label,
  body.fullscreen-ui-mode .visualizer {
    display: revert !important;
  }

  body.fullscreen-ui-mode .dex-title p { display: block !important; }
  body.fullscreen-ui-mode .language-picker span { display: inline !important; }
  body.fullscreen-ui-mode .track-display small { display: block !important; }
  body.fullscreen-ui-mode .bar-label { display: flex !important; }
  body.fullscreen-ui-mode .visualizer { display: flex !important; }

  body.fullscreen-ui-mode .dex-title h1 {
    margin: 0 0 8px !important;
    font-size: 18px !important;
  }

  body.fullscreen-ui-mode .language-picker select {
    min-height: 38px !important;
    font-size: 8px !important;
  }
}
