      :root {
        --shell-bg: #000;
        --shell-ink: #f8fafc;
        --app-edge: rgba(148, 163, 184, 0.25);
        --app-frost: rgba(15, 23, 42, 0.68);
        --hud-frost: rgba(15, 23, 42, 0.82);
        --panel-text: #e2e8f0;
        --muted: #94a3b8;
        --danger: #ef4444;
      }

      * { box-sizing: border-box; }

      html, body {
        margin: 0;
        min-height: 100%;
        font-family: "Avenir Next", "Segoe UI", sans-serif;
        color: var(--shell-ink);
        background: var(--shell-bg);
      }

      body {
        min-height: 100dvh;
        display: grid;
        place-items: center;
        padding:
          max(12px, env(safe-area-inset-top))
          max(12px, env(safe-area-inset-right))
          max(12px, env(safe-area-inset-bottom))
          max(12px, env(safe-area-inset-left));
        overflow-x: hidden;
        overflow-y: auto;
      }

      .game-shell {
        width: min(100%, 980px);
        height: min(100%, 900px);
        display: grid;
        grid-template-rows: auto 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 22px;
        background:
          radial-gradient(circle at 10% 0%, rgba(125, 211, 252, 0.22), transparent 38%),
          radial-gradient(circle at 90% 0%, rgba(250, 204, 21, 0.16), transparent 44%),
          var(--app-frost);
        border: 1px solid var(--app-edge);
        box-shadow:
          0 26px 56px rgba(2, 6, 23, 0.45),
          inset 0 1px 0 rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
      }

      .hud {
        display: flex;
        gap: 10px 16px;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border: 1px solid var(--app-edge);
        border-radius: 14px;
        background: var(--hud-frost);
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .logo-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background: linear-gradient(135deg, #22d3ee, #0ea5e9);
        position: relative;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
      }

      .logo-mark::before {
        content: "";
        position: absolute;
        inset: 8px 10px;
        border: 3px solid #ecfeff;
        border-left: 0;
        border-top: 0;
        transform: skewX(-14deg) rotate(35deg);
      }

      .wordmark {
        display: grid;
        line-height: 1;
      }

      .wordmark strong {
        font-size: clamp(1.12rem, 2vw, 1.45rem);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--panel-text);
      }

      .wordmark span {
        margin-top: 4px;
        font-size: 0.68rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--muted);
      }

      .scoreboard {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
      }

      .stat {
        display: inline-flex;
        gap: 6px;
        align-items: center;
        padding: 6px 10px;
        border-radius: 999px;
        border: 1px solid var(--app-edge);
        color: var(--panel-text);
        font-size: 0.84rem;
        background: rgba(15, 23, 42, 0.06);
      }

      .hud-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }

      .hud-btn {
        border: 1px solid var(--app-edge);
        background: rgba(15, 23, 42, 0.12);
        color: var(--panel-text);
        border-radius: 999px;
        font-size: 0.78rem;
        font-weight: 700;
        padding: 7px 12px;
        cursor: pointer;
      }

      .hud-btn:hover { filter: brightness(1.08); }

      .stage-wrap {
        position: relative;
        display: grid;
        place-items: center;
        min-height: 0;
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid rgba(30, 41, 59, 0.28);
        background: radial-gradient(circle at 20% 10%, #5b7aa5 0%, #314663 45%, #1a2b43 100%);
        box-shadow: 0 16px 34px rgba(2, 6, 23, 0.36);
      }

      .quick-pause {
        display: none;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.45);
        background: rgba(15, 23, 42, 0.3);
        color: #f8fafc;
        font-weight: 800;
        font-size: 1rem;
        line-height: 1;
        display: grid;
        place-items: center;
        cursor: pointer;
        z-index: 4;
        backdrop-filter: blur(4px);
      }

      canvas {
        width: 100%;
        height: auto;
        display: block;
        max-height: 100%;
        min-height: 0;
        aspect-ratio: 16 / 9;
      }

      .stage-wrap,
      canvas,
      .overlay {
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
      }

      .overlay {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        text-align: center;
        padding: 22px;
        background: rgba(8, 18, 30, 0.46);
      }

      .card {
        width: min(92%, 540px);
        padding: 24px;
        border-radius: 18px;
        border: 1px solid rgba(148, 163, 184, 0.34);
        background: rgba(15, 23, 42, 0.92);
      }

      .card h2 {
        margin: 0 0 10px;
        font-size: clamp(1.2rem, 2.6vw, 1.95rem);
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #f8fafc;
      }

      .card p {
        margin: 8px 0;
        color: #cbd5e1;
        line-height: 1.45;
      }

      .tip {
        color: #94a3b8;
        font-size: 0.95rem;
      }

      .world-picker {
        margin-top: 12px;
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
      }

      .world-btn {
        border: 1px solid rgba(148, 163, 184, 0.36);
        background: rgba(30, 41, 59, 0.72);
        color: #e2e8f0;
        border-radius: 999px;
        font-size: 0.82rem;
        font-weight: 700;
        padding: 8px 12px;
        cursor: pointer;
      }

      .world-btn.active {
        background: linear-gradient(135deg, #22d3ee, #0284c7);
        border-color: rgba(125, 211, 252, 0.95);
        color: #ecfeff;
      }

      .start-run {
        margin-top: 10px;
        width: 100%;
        border: 1px solid rgba(125, 211, 252, 0.8);
        background: linear-gradient(135deg, #22d3ee, #0284c7);
        color: #ecfeff;
        border-radius: 999px;
        font-size: 0.92rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        padding: 10px 14px;
        cursor: pointer;
      }

      .danger {
        color: var(--danger);
        font-weight: 700;
      }

      .hidden { display: none; }

      @media (max-width: 680px) {
        body { padding: 0; }
        .game-shell {
          width: calc(100vw - 20px);
          height: 90dvh;
          max-width: none;
          max-height: 90dvh;
          margin: 0 auto;
          border-radius: 16px;
          padding: 8px;
          gap: 8px;
        }
        .hud {
          display: grid;
          grid-template-columns: 1fr;
          border-radius: 12px;
          padding: 9px 10px;
        }
        .scoreboard {
          width: 100%;
          justify-content: flex-start;
          gap: 10px;
        }
        .stat {
          padding: 0;
          border: 0;
          border-radius: 0;
          background: transparent;
          font-size: 0.86rem;
        }
        .hud-actions {
          width: 100%;
          display: grid;
          grid-template-columns: repeat(4, minmax(0, 1fr));
          gap: 8px;
        }
        .logo-mark { width: 30px; height: 30px; }
        .wordmark strong { font-size: 1rem; }
        .wordmark span { font-size: 0.62rem; }
        .hud-btn {
          width: 100%;
          text-align: center;
          font-size: 0.76rem;
          padding: 9px 6px;
          background: rgba(15, 23, 42, 0.58);
          border-color: rgba(148, 163, 184, 0.55);
        }
        .quick-pause {
          display: grid;
          top: 8px;
          right: 8px;
          width: 50px;
          height: 50px;
          font-size: 1.15rem;
          background: rgba(15, 23, 42, 0.25);
        }
        .stage-wrap {
          border-radius: 12px;
        }
        canvas {
          width: auto;
          height: 100%;
          max-height: none;
          max-width: none;
          min-width: 0;
        }
        .card {
          width: min(95%, 520px);
          padding: 18px;
        }
      }

      @media (max-width: 680px) and (orientation: portrait) {
        .stage-wrap {
          overflow: hidden;
        }
        canvas {
          height: 100%;
          width: auto;
          transform: scale(0.76);
          transform-origin: center center;
        }
      }

      @media (max-width: 680px) and (orientation: landscape) {
        body {
          place-items: start center;
          padding: 8px 0;
          overflow-y: auto;
        }
        .game-shell {
          height: auto;
          max-height: none;
          min-height: 560px;
          margin: 8px auto 18px;
        }
        canvas {
          width: 100%;
          height: auto;
          min-width: 100%;
          transform: none;
        }
      }
