:root {
      color-scheme: dark;
      --bg: #111418;
      --hud: rgba(14, 17, 20, 0.76);
      --hud-line: rgba(220, 225, 220, 0.18);
      --text: #f4f5ef;
      --muted: #aeb6ad;
      --accent: #a8d4ff;
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: "Segoe UI", Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      touch-action: none;
    }

    #game {
      width: 100%;
      height: 100%;
      display: block;
    }

    .hud {
      position: fixed;
      top: max(12px, env(safe-area-inset-top));
      right: max(12px, env(safe-area-inset-right));
      left: max(12px, env(safe-area-inset-left));
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(92px, 136px));
      justify-content: space-between;
      gap: 8px;
      pointer-events: none;
      z-index: 2;
    }

    .panel {
      min-width: 0;
      padding: 10px 12px;
      border: 1px solid var(--hud-line);
      border-radius: 8px;
      background: var(--hud);
      backdrop-filter: blur(10px);
    }

    .label {
      font-size: 10px;
      text-transform: uppercase;
      color: var(--muted);
    }

    .value {
      margin-top: 5px;
      font-size: 20px;
      font-weight: 700;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tools {
      position: fixed;
      right: max(12px, env(safe-area-inset-right));
      bottom: max(12px, env(safe-area-inset-bottom));
      display: flex;
      gap: 8px;
      z-index: 2;
    }

    .tool-button,
    button {
      border: 0;
      border-radius: 8px;
      padding: 12px 16px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      color: #071018;
      background: var(--accent);
    }

    .tool-button {
      min-width: 54px;
      padding-inline: 12px;
    }

    .overlay {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(8, 10, 12, 0.56);
      z-index: 3;
    }

    .card {
      width: min(420px, 100%);
      padding: 24px;
      border: 1px solid var(--hud-line);
      border-radius: 8px;
      background: rgba(14, 17, 20, 0.9);
      text-align: center;
      box-shadow: 0 16px 52px rgba(0, 0, 0, 0.3);
    }

    .eyebrow {
      font-size: 11px;
      text-transform: uppercase;
      color: var(--accent);
    }

    h1 {
      margin: 10px 0;
      font-size: clamp(26px, 6vw, 40px);
    }

    p {
      margin: 8px 0;
      color: var(--muted);
      line-height: 1.5;
    }

    .hidden { display: none; }

    @media (max-width: 560px), (max-height: 620px) {
      .hud {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        left: max(8px, env(safe-area-inset-left));
        grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
        gap: 6px;
      }

      .panel {
        min-height: 34px;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .label {
        font-size: 8px;
        line-height: 1;
      }

      .value {
        margin-top: 0;
        font-size: 15px;
        line-height: 1;
        text-align: right;
        white-space: nowrap;
      }

      .tool-button {
        min-width: 48px;
        padding: 10px 12px;
      }
    }

