:root {
      --bg: #120f2e;
      --sf: #1c1845;
      --sf-dark: #120e33;
      --ink: #f2eeff;
      --mute: #a29acf;
      --a: #ff3c96;
      --b: #2be4f8;
      --hi: #ffd027;
      --grn: #20e070;
      --crt-opacity: 0.28;
      --font-pixel: 'Press Start 2P', monospace;
      --font-body: 'VT323', monospace;
      --font-sub: 'DotGothic16', monospace;
      --font-mono: 'Silkscreen', monospace;
      box-sizing: border-box;
      padding-top: env(safe-area-inset-top, 0px);
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    :root[data-pal="neon"] {
      --bg: #0f0a28;
      --sf: #1b1344;
      --sf-dark: #100b2e;
      --ink: #f9f5ff;
      --mute: #9e93d8;
      --a: #ff2a85;
      --b: #00f0ff;
      --hi: #ffe600;
      --grn: #00ff73;
    }

    :root[data-pal="day"] {
      --bg: #e6ebfa;
      --sf: #ffffff;
      --sf-dark: #d8def2;
      --ink: #16113a;
      --mute: #58557e;
      --a: #d91c78;
      --b: #0087a8;
      --hi: #e69d00;
      --grn: #0f9b4c;
    }

    :root[data-pal="cab"] {
      --bg: #160a06;
      --sf: #29140c;
      --sf-dark: #1d0e08;
      --ink: #ffeed6;
      --mute: #c49c7b;
      --a: #ff382e;
      --b: #ff9d00;
      --hi: #ffd83b;
      --grn: #4cd964;
    }

    :root[data-pal="amber"] {
      --bg: #0d0800;
      --sf: #1a1000;
      --sf-dark: #110b00;
      --ink: #ffb700;
      --mute: #b88300;
      --a: #ffd769;
      --b: #ff8c00;
      --hi: #fff2bf;
      --grn: #d4a017;
    }

    :root[data-pal="gameboy"] {
      --bg: #8bac0f;
      --sf: #9bbc0f;
      --sf-dark: #819f0e;
      --ink: #0f380f;
      --mute: #306230;
      --a: #0f380f;
      --b: #306230;
      --hi: #0f380f;
      --grn: #306230;
    }

    * { box-sizing: border-box; }
    html {
      scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 76px);
      scroll-behavior: smooth;
      overflow-x: hidden;
      overflow-x: clip;
    }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font: 25px/1.3 var(--font-body);
      transition: background 0.3s ease, color 0.3s ease;
      overflow-x: hidden;
      overflow-x: clip;
      min-height: 100vh;
      position: relative;
    }

    /* CRT scanline, curved screen simulation, & phosphor bloom */
    body.crt-active::before {
      content: " ";
      display: block;
      position: fixed;
      inset: 0;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
      z-index: 999;
      background-size: 100% 3px, 6px 100%;
      pointer-events: none;
      opacity: var(--crt-opacity);
    }
    body.crt-active::after {
      content: " ";
      display: block;
      position: fixed;
      inset: 0;
      box-shadow: inset 0 0 110px rgba(0, 0, 0, 0.65), inset 0 0 45px rgba(0, 0, 0, 0.85);
      z-index: 1000;
      pointer-events: none;
    }

    /* Screen shake for arcade hits */
    @keyframes cabinet-shake {
      0% { transform: translate(0, 0); }
      20% { transform: translate(-6px, 4px); }
      40% { transform: translate(6px, -4px); }
      60% { transform: translate(-4px, -2px); }
      80% { transform: translate(4px, 2px); }
      100% { transform: translate(0, 0); }
    }
    .screen-shake {
      animation: cabinet-shake 0.35s ease-out;
    }

    /* Scroll reveal */
    .reveal {
      opacity: 0;
      transform: translateY(26px);
      transition: opacity 0.55s ease-out, transform 0.55s ease-out;
      will-change: opacity, transform;
    }
    .reveal.visible {
      opacity: 1;
      transform: none;
    }

    /* Starfield background */
    #sky {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      pointer-events: none;
    }

    .hud {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      padding: calc(env(safe-area-inset-top, 0px) + 8px) 18px 8px;
      background: var(--bg);
      border-bottom: 4px solid var(--ink);
      box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
      font: 400 10px var(--font-pixel);
      user-select: none;
    }
    .hud-stat {
      display: flex;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
    }
    .hud b { color: var(--hi); }
    .hud-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .hud-btn {
      background: var(--sf);
      color: var(--ink);
      border: 2px solid var(--ink);
      padding: 5px 8px;
      font: 400 9px var(--font-pixel);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      box-shadow: 2px 2px 0 var(--ink);
      transition: transform 0.1s;
    }
    .hud-btn:active {
      transform: translate(2px, 2px);
      box-shadow: none;
    }
    .hud-btn.active {
      background: var(--b);
      color: var(--bg);
    }

    .pal-group {
      display: flex;
      gap: 5px;
      align-items: center;
      margin-left: 4px;
    }
    .pal-btn {
      width: 18px;
      height: 18px;
      border: 2px solid var(--ink);
      cursor: pointer;
      padding: 0;
      box-shadow: 1px 1px 0 var(--ink);
    }
    .pal-btn[aria-pressed="true"] {
      outline: 2px solid var(--hi);
      outline-offset: 2px;
      transform: scale(1.1);
    }

    /* Main Container */
    .main-wrap {
      position: relative;
      z-index: 1;
      max-width: 980px;
      margin: 0 auto;
      padding: 100px 18px 80px;
    }

    /* Hero Banner */
    .hero-sec {
      min-height: 72vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 22px;
      padding: 30px 10px;
    }
    .hero-sprite-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    #heroSprite {
      width: 96px;
      height: 112px;
      image-rendering: pixelated;
      image-rendering: crisp-edges;
    }
    .hero-sprite-label {
      font: 400 9px var(--font-pixel);
      color: var(--hi);
      letter-spacing: 2px;
    }
    .arcade-title-box {
      border: 4px solid var(--ink);
      background: var(--sf);
      box-shadow: 8px 8px 0 var(--ink);
      padding: 24px 28px;
      position: relative;
      max-width: 860px;
      width: 100%;
    }
    .arcade-badge {
      position: absolute;
      top: -14px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--a);
      color: #fff;
      font: 400 10px var(--font-pixel);
      padding: 4px 12px;
      border: 2px solid var(--ink);
      letter-spacing: 1px;
      white-space: nowrap;
    }
    h1 {
      font: 400 clamp(22px, 5.2vw, 46px)/1.25 var(--font-pixel);
      margin: 10px 0 0;
      text-shadow: 4px 4px 0 var(--a);
      letter-spacing: 2px;
    }
    h1::after {
      content: "";
      display: inline-block;
      width: 0.5em;
      height: 0.9em;
      background: var(--b);
      margin-left: 6px;
      vertical-align: -0.05em;
      animation: blink 0.8s steps(2) infinite;
    }
    .hero-sub {
      color: var(--mute);
      font-family: var(--font-sub);
      font-size: 26px;
      line-height: 1.45;
      max-width: 32em;
      margin: 12px auto 0;
      min-height: 2.7em;
    }
    .hero-stats {
      display: flex;
      justify-content: center;
      gap: 16px;
      flex-wrap: wrap;
      margin-top: 14px;
      font: 400 11px var(--font-pixel);
    }
    .hero-stat-chip {
      background: var(--sf-dark);
      border: 2px solid var(--ink);
      padding: 6px 12px;
      color: var(--b);
    }

    .hero-buttons {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      justify-content: center;
    }
    .arcade-btn {
      font: 400 13px var(--font-pixel);
      background: var(--a);
      color: #fff;
      border: 3px solid var(--ink);
      padding: 14px 20px;
      cursor: pointer;
      box-shadow: 5px 5px 0 var(--ink);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.1s;
    }
    .arcade-btn:hover {
      transform: translate(-2px, -2px);
      box-shadow: 7px 7px 0 var(--ink);
    }
    .arcade-btn:active {
      transform: translate(3px, 3px);
      box-shadow: 1px 1px 0 var(--ink);
    }
    .arcade-btn.sec {
      background: var(--b);
      color: var(--bg);
    }
    .arcade-btn.alt {
      background: var(--hi);
      color: #000;
    }
    .arcade-btn.pulse {
      animation: pulse-coin 1.3s steps(2) infinite;
    }

    @keyframes pulse-coin {
      50% { opacity: 0.55; }
    }
    @keyframes blink {
      50% { opacity: 0; }
    }

    /* Floating Score popups */
    .float-text {
      position: fixed;
      z-index: 1100;
      font: 400 15px var(--font-pixel);
      color: var(--hi);
      text-shadow: 2px 2px 0 #000;
      pointer-events: none;
      animation: float-rise 1.1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    }
    @keyframes float-rise {
      0% { transform: translateY(0) scale(0.8); opacity: 1; }
      50% { transform: translateY(-45px) scale(1.2); }
      100% { transform: translateY(-80px) scale(1); opacity: 0; }
    }

    /* Coin toss FX */
    .fx-coin {
      position: fixed;
      z-index: 1050;
      width: 28px;
      height: 28px;
      margin: -14px 0 0 -14px;
      background: var(--hi);
      border: 3px solid var(--ink);
      border-radius: 50%;
      pointer-events: none;
      box-shadow: 0 0 10px var(--hi);
      animation: coin-flight 0.9s ease-out forwards;
    }
    @keyframes coin-flight {
      0% { transform: translateY(0) rotateY(0deg); }
      40% { transform: translateY(-110px) rotateY(720deg) scale(1.2); }
      100% { transform: translateY(50px) rotateY(1440deg) scale(0.6); opacity: 0; }
    }

    /* Headings */
    h2 {
      font: 400 17px/1.4 var(--font-pixel);
      margin: 68px 0 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    h2 .section-tag {
      font-size: 10px;
      background: var(--a);
      color: #fff;
      padding: 3px 8px;
      border: 2px solid var(--ink);
    }

    .filter-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 20px;
    }
    .filter-btn {
      font: 400 10px var(--font-pixel);
      background: var(--sf);
      color: var(--mute);
      border: 2px solid var(--ink);
      box-shadow: 3px 3px 0 var(--ink);
      padding: 8px 12px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .filter-btn.active, .filter-btn:hover {
      background: var(--hi);
      color: var(--bg);
      transform: translate(-1px, -1px);
      box-shadow: 4px 4px 0 var(--ink);
    }

    .lv-grid {
      display: grid;
      gap: 16px;
    }
    .lv-card {
      display: grid;
      grid-template-columns: 24px 64px 1fr;
      gap: 14px;
      align-items: center;
      background: var(--sf);
      border: 3px solid var(--ink);
      box-shadow: 6px 6px 0 var(--ink);
      padding: 14px 16px;
      color: inherit;
      text-decoration: none;
      position: relative;
      cursor: pointer;
      transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    }
    .lv-card:hover, .lv-card:focus-visible {
      transform: translate(-3px, -3px);
      box-shadow: 9px 9px 0 var(--a);
      outline: none;
    }
    .lv-card:hover .cur, .lv-card:focus-visible .cur {
      visibility: visible;
    }
    .cur {
      visibility: hidden;
      font: 400 16px var(--font-pixel);
      color: var(--a);
      animation: blink 0.5s steps(2) infinite;
    }
    .lv-icon {
      width: 64px;
      height: 64px;
      display: grid;
      place-items: center;
      background: var(--tag-col, var(--b));
      border: 3px solid var(--ink);
      font-size: 30px;
      box-shadow: 2px 2px 0 var(--ink);
      line-height: 1;
    }
    .lv-info b {
      font-family: var(--font-sub);
      font-size: 30px;
      font-weight: 400;
      display: block;
      line-height: 1.15;
    }
    .lv-info i {
      font-family: var(--font-sub);
      font-style: normal;
      color: var(--mute);
      display: block;
      font-size: 21px;
    }
    .lv-tech {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 6px;
    }
    .tech-chip {
      font: 400 9px var(--font-pixel);
      background: var(--sf-dark);
      border: 1px solid var(--ink);
      color: var(--b);
      padding: 2px 6px;
    }

    /* Modal Architecture */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(8, 6, 22, 0.88);
      z-index: 1200;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      backdrop-filter: blur(3px);
    }
    .modal-overlay.open {
      display: flex;
    }
    .modal-box {
      background: var(--sf);
      border: 4px solid var(--ink);
      box-shadow: 10px 10px 0 var(--ink);
      max-width: 680px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      padding: 24px;
      position: relative;
      animation: modal-pop 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }
    @keyframes modal-pop {
      from { transform: scale(0.92); opacity: 0; }
      to { transform: scale(1); opacity: 1; }
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 16px;
      border-bottom: 3px solid var(--ink);
      padding-bottom: 12px;
      gap: 12px;
    }
    .modal-header h3 {
      font: 400 20px var(--font-pixel);
      margin: 0;
      color: var(--hi);
      line-height: 1.4;
    }
    .modal-close {
      background: var(--a);
      color: #fff;
      border: 2px solid var(--ink);
      font: 400 12px var(--font-pixel);
      cursor: pointer;
      padding: 4px 8px;
      flex-shrink: 0;
    }
    .modal-img-frame {
      width: 100%;
      height: 180px;
      background: var(--sf-dark);
      border: 3px solid var(--ink);
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 10px;
      position: relative;
      overflow: hidden;
    }
    .modal-img-frame canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      opacity: 0.95;
    }
    .modal-img-frame .modal-badge {
      position: relative;
      z-index: 2;
      font: 400 13px var(--font-pixel);
      color: var(--hi);
      text-shadow: 2px 2px 0 #000;
      text-align: center;
      padding: 0 12px;
      line-height: 1.6;
    }
    .modal-body p {
      font-size: 26px;
      line-height: 1.35;
      margin: 0 0 14px;
    }
    .modal-footer {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 20px;
      padding-top: 14px;
      border-top: 2px dashed var(--ink);
    }

    /* Arcade Machine Section */
    .arcade-machine {
      background: var(--sf);
      border: 4px solid var(--ink);
      box-shadow: 8px 8px 0 var(--ink);
      padding: 20px;
      text-align: center;
      margin-top: 24px;
      position: relative;
    }
    .mini-stats-hud {
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;
      gap: 10px;
      background: var(--sf-dark);
      border: 3px solid var(--ink);
      padding: 10px 14px;
      margin-bottom: 14px;
      font: 400 11px var(--font-pixel);
    }
    .mini-stat-item {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .mini-stat-item span {
      color: var(--mute);
    }
    .mini-stat-item b {
      color: var(--hi);
    }
    .arcade-bezel {
      background: #05050d;
      border: 4px solid var(--ink);
      padding: 12px;
      position: relative;
      margin: 0 auto 16px;
      max-width: 640px;
      box-shadow: inset 0 0 24px rgba(0,0,0,0.85);
    }
    #miniGameCanvas {
      width: 100%;
      height: 280px;
      background: #090915;
      display: block;
      border: 2px solid #2a2655;
      image-rendering: pixelated;
      image-rendering: crisp-edges;
    }
    .mini-controls {
      display: flex;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 14px;
    }
    .mini-controls .arcade-btn {
      font-size: 11px;
      padding: 12px 14px;
    }
    .control-hint {
      font: 400 10px var(--font-pixel);
      color: var(--mute);
      margin-top: 10px;
    }

    /* Quest Log Section */
    .quest-card {
      background: var(--sf);
      border: 3px solid var(--ink);
      box-shadow: 6px 6px 0 var(--ink);
      padding: 18px 20px;
      margin-bottom: 16px;
      position: relative;
    }
    .quest-badge {
      font: 400 9px var(--font-pixel);
      padding: 3px 8px;
      background: var(--grn);
      color: #000;
      display: inline-block;
      margin-bottom: 8px;
      border: 1px solid var(--ink);
    }
    .quest-card b {
      font-size: 32px;
      font-weight: 400;
      display: block;
    }
    .quest-card .quest-org {
      color: var(--b);
      font-size: 24px;
    }
    .quest-card p {
      color: var(--mute);
      margin: 8px 0 12px;
      font-size: 24px;
      line-height: 1.3;
    }

    /* Terminal RPG Quest Dialogue Box */
    .terminal-box {
      background: #080614;
      border: 3px solid var(--ink);
      box-shadow: 6px 6px 0 var(--ink);
      padding: 16px;
      color: #4df9a4;
      font: 400 22px/1.3 var(--font-body);
      margin-top: 18px;
    }
    .terminal-header {
      font: 400 10px var(--font-pixel);
      color: var(--hi);
      border-bottom: 2px dashed #20e070;
      padding-bottom: 6px;
      margin-bottom: 10px;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .terminal-log {
      max-height: 140px;
      overflow-y: auto;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .terminal-log li {
      margin-bottom: 4px;
    }
    .terminal-log li::before {
      content: "> ";
      color: var(--hi);
    }

    /* Inventory & Skills */
    .inv-category-title {
      font: 400 11px var(--font-pixel);
      color: var(--hi);
      margin: 22px 0 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .inv-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .inv-btn {
      background: var(--sf);
      border: 3px solid var(--ink);
      box-shadow: 3px 3px 0 var(--ink);
      padding: 6px 14px;
      font: 400 24px var(--font-body);
      color: var(--ink);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s;
    }
    .inv-btn:hover {
      transform: translateY(-2px) rotate(-1deg);
      box-shadow: 5px 5px 0 var(--ink);
    }
    .inv-btn.got {
      background: var(--b);
      color: var(--bg);
      border-color: var(--ink);
    }
    .inv-btn.got::after {
      content: "★";
      font-size: 14px;
      color: var(--hi);
    }
    .inv-btn.pop {
      animation: pop-bounce 0.35s steps(4);
    }
    @keyframes pop-bounce {
      50% { transform: scale(1.22); }
    }

    /* Achievements Bar & Tooltips */
    .achieve-bar {
      margin-top: 24px;
      background: var(--sf-dark);
      border: 3px solid var(--ink);
      padding: 14px;
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
    }
    .achieve-chip {
      font: 400 10px var(--font-pixel);
      border: 2px solid var(--ink);
      background: var(--sf);
      padding: 6px 10px;
      opacity: 0.45;
      display: flex;
      align-items: center;
      gap: 6px;
      position: relative;
      cursor: help;
      transition: opacity 0.2s, transform 0.15s;
    }
    .achieve-chip.unlocked {
      opacity: 1;
      background: var(--hi);
      color: #000;
      box-shadow: 3px 3px 0 var(--ink);
    }
    .achieve-chip:hover, .achieve-chip:focus-visible {
      opacity: 1;
      transform: translateY(-2px);
    }
    .achieve-chip[data-hint]::after {
      content: attr(data-hint);
      position: absolute;
      bottom: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%);
      background: #09071c;
      color: var(--hi);
      border: 2px solid var(--ink);
      box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
      padding: 6px 10px;
      font: 400 8px/1.4 var(--font-pixel);
      white-space: nowrap;
      pointer-events: none;
      z-index: 500;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.15s, visibility 0.15s;
    }
    .achieve-chip:hover::after, .achieve-chip:focus-visible::after {
      opacity: 1;
      visibility: visible;
    }

    .contact-link-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 12px;
      margin: 16px 0;
    }
    .contact-card-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--sf-dark);
      border: 3px solid var(--ink);
      box-shadow: 4px 4px 0 var(--ink);
      padding: 12px;
      color: inherit;
      text-decoration: none;
      font: 400 24px var(--font-body);
      cursor: pointer;
      transition: transform 0.15s, box-shadow 0.15s;
      text-align: left;
      width: 100%;
    }
    .contact-card-btn:hover {
      transform: translate(-2px, -2px);
      box-shadow: 6px 6px 0 var(--a);
      color: var(--hi);
    }
    .contact-card-btn .btn-icon {
      font-size: 28px;
    }
    .copy-toast {
      display: none;
      font: 400 10px var(--font-pixel);
      color: var(--grn);
      margin-top: 8px;
    }

    /* Floating Quick Contact Beacon */
    .beacon-contact {
      position: fixed;
      bottom: 22px;
      right: 22px;
      z-index: 950;
      background: var(--a);
      color: #fff;
      border: 3px solid var(--ink);
      box-shadow: 4px 4px 0 var(--ink);
      padding: 10px 14px;
      font: 400 11px var(--font-pixel);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s;
    }
    .beacon-contact:hover {
      transform: translate(-2px, -2px);
      box-shadow: 6px 6px 0 var(--hi);
    }
    .beacon-contact:active {
      transform: translate(2px, 2px);
      box-shadow: none;
    }

    /* Footer */
    footer {
      margin-top: 80px;
      text-align: center;
      color: var(--mute);
      padding: 30px 10px;
      border-top: 3px solid var(--ink);
    }
    /* iOS Safari's floating bottom toolbar can cover footer content.
       -webkit-touch-callout only exists on iOS, so Android/desktop are unaffected. */
    @supports (-webkit-touch-callout: none) {
      footer {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
      }
    }
    footer a {
      color: var(--a);
      text-decoration: underline;
    }
    footer a:hover {
      color: var(--hi);
    }
    .footer-konami-hint {
      font: 400 10px var(--font-pixel);
      margin-top: 14px;
      color: var(--mute);
      opacity: 0.8;
    }
    /* arrows aren't in the pixel font, so pin them to system symbol fonts
       and size them up for consistent rendering across devices */
    .footer-konami-hint .k-arrow {
      font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", sans-serif;
      font-size: 1.5em;
      line-height: 1;
    }

    /* Reduced Motion */
    @media (prefers-reduced-motion: reduce) {
      *, body.crt-active::before, body.crt-active::after {
        animation: none !important;
        transition: none !important;
      }
      .reveal {
        opacity: 1 !important;
        transform: none !important;
      }
      .lv-card { opacity: 1 !important; transform: none !important; }
      html { scroll-behavior: auto !important; }
    }

    /* Mobile adjustments */
    @media (max-width: 640px) {
      .hud { font-size: 8px; }
      .hud-actions { gap: 4px; }
      .lv-card {
        grid-template-columns: 56px 1fr;
        padding: 10px 12px;
      }
      .cur { display: none; }
      .arcade-title-box { padding: 18px 12px; }
      .hero-sub { font-size: 22px; min-height: 3.2em; }
      .beacon-contact { bottom: 12px; right: 12px; padding: 8px 10px; font-size: 9px; }
      .mini-controls .arcade-btn { font-size: 9px; padding: 10px 10px; }
      /* keep achievement tooltips inside the viewport */
      .achieve-chip[data-hint]:hover::after,
      .achieve-chip[data-hint]:focus-visible::after { white-space: normal; width: 200px; }
      /* let the footer email wrap instead of clipping off-screen */
      footer a { overflow-wrap: anywhere; }
    }
