  @font-face {
    font-family: "ChicagoFLF";
    src: url("../fonts/ChicagoFLF.ttf") format("truetype");
    font-display: swap;
  }

  :root {
    --bg: #7c7c80;
    --frame: #d8d8dc;
    --frame-dark: #1f1f22;
    --play-bg: #f2f2f4;
    --hud-bg: #e3e3e6;
    --hud-text: #2b2b2b;
    --oxygen: #13a7f2;
    --oxygen-border: #1b5f7f;
  }
  html, body {
    margin: 0;
    height: 100%;
    background: radial-gradient(circle at 50% 20%, #8a8a90 0%, #6e6e73 55%, #57575c 100%);
    font-family: "ChicagoFLF", "Courier New", Menlo, Consolas, monospace;
    color: #fff;
  }
  .wrap {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 14px;
    box-sizing: border-box;
  }
  .game-shell {
    width: min(1220px, 98vw);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    background: #d8d8dc;
  }
  .mac-header-band {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
    box-sizing: border-box;
    background: #e8e8e8;
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
  }
  .mac-header-title {
    color: #000;
    font-size: 20px;
    letter-spacing: 0;
    line-height: 1;
    transform: translateY(0);
    -webkit-font-smoothing: none;
    image-rendering: pixelated;
    white-space: nowrap;
  }
  .mac-header-rule {
    flex: 1 1 auto;
    min-width: 84px;
    height: 22px;
    border-top: 1px solid #8f9196;
    border-bottom: 1px solid #8f9196;
    background: repeating-linear-gradient(
      to bottom,
      #b4b5ba 0,
      #b4b5ba 1px,
      #f2f2f4 1px,
      #f2f2f4 3px
    );
  }
  .game-stage {
    position: relative;
  }
  canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: 100%;
    height: auto;
    display: block;
    background: var(--frame);
  }
  .ui-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .bonus-banner {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    min-width: 290px;
    padding: 16px 28px 14px;
    text-align: center;
    color: #111;
    font-size: clamp(20px, 3.2vw, 40px);
    background: #fff;
    border: 2px solid #161616;
    box-shadow: inset 0 0 0 2px #fff;
  }
  .bonus-banner.hidden {
    display: none;
  }
  .hud {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 6.258%;
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 0 12px;
    box-sizing: border-box;
    background: #ffffff;
    color: #1a1a1a;
    border-top: 1px solid #fff;
    border-left: 1px solid #f6f6f8;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    font-size: clamp(14px, 2.5vw, 24px);
  }
  .hud.hidden {
    display: none;
  }
  .hud-score {
    white-space: nowrap;
    min-width: 180px;
  }
  .hud-lives,
  .hud-keys {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 46px;
    min-height: 24px;
  }
  .hud-keys {
    justify-self: end;
    justify-content: flex-end;
    min-width: 28px;
  }
  .hud-sprite {
    display: inline-block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  .hud-oxygen-wrap {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 470px;
  }
  .hud-oxygen-label {
    white-space: nowrap;
  }
  .hud-oxygen-bar {
    width: min(318px, 34vw);
    height: clamp(18px, 1.6vw, 14px);
    border: 2px solid #101010;
    background: #fff;
    box-sizing: border-box;
  }
  .hud-oxygen-fill {
    height: 100%;
    width: 0%;
    background: #11a9ea;
  }
  .hud-screen {
    white-space: nowrap;
    justify-self: end;
  }
  .highscore-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    pointer-events: auto;
  }
  .highscore-overlay.visible {
    display: flex;
  }
  .highscore-modal {
    width: min(604px, 88%);
    border: 2px solid #000;
    background: #fff;
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 6px #d7d7ee;
    color: #000;
    text-align: center;
    padding: 46px 44px 34px;
    box-sizing: border-box;
    pointer-events: auto;
  }
  .highscore-title {
    font-size: clamp(16px, 2.1vw, 24px);
    margin: 0 0 28px 0;
  }
  .highscore-subtitle {
    font-size: clamp(14px, 1.9vw, 21px);
    margin: 0 0 12px 0;
  }
  .highscore-input {
    width: 100%;
    height: 56px;
    border: 3px solid #0f0f0f;
    background: #fff;
    font-family: "ChicagoFLF", "Courier New", Menlo, Consolas, monospace;
    font-size: clamp(20px, 3.3vw, 36px);
    padding: 6px 12px;
    box-sizing: border-box;
    outline: none;
    color: #000;
  }
  .highscore-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
  }
  .mac-ok-button {
    pointer-events: auto;
    width: 202px;
    height: 66px;
    border: 0;
    padding: 0;
    background: #000;
    border-radius: 22px;
    color: #000;
    cursor: default;
    font-family: "ChicagoFLF", "Courier New", Menlo, Consolas, monospace;
    font-size: clamp(28px, 3.2vw, 38px);
  }
  .mac-ok-button > span {
    display: block;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    margin: 4px;
    border-radius: 18px;
    background: #fff;
    box-shadow:
      inset 0 0 0 4px #000,
      inset 0 0 0 8px #fff;
    line-height: 58px;
  }
  .mac-ok-button.is-pressed {
    transform: translate(1px, 1px);
  }
  .mac-ok-button:focus-visible {
    outline: 2px dotted #000;
    outline-offset: 2px;
  }
