
  @font-face {
    font-family: "Pixel";
    src: url("/static/fonts/fusion-pixel-10px-proportional-ko.ttf") format("truetype");
    font-display: swap;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    font-family: "Pixel", monospace;
    background: var(--background);
    color: var(--text-primary);
    -webkit-font-smoothing: none;
    font-smooth: never;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .rig {
    position: relative;
    display: block;
    width: 100%;
    max-width: 532px;
    transition: opacity .18s ease, transform .18s ease;
  }
  .stage {
    position: relative;
    width: 100%;
    /* The controls begin at y=44 in the 266-unit character illustration. */
    padding-top: 16.541354%;
  }
  .character-hair {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    image-rendering: pixelated;
    shape-rendering: crispEdges;
  }
  .hair-base { fill: var(--text-primary); }
  .hair-shadow { fill: var(--text-secondary); }
  .headband { fill: var(--secondary); }
  ::selection { background: var(--accent-yellow); color: var(--background); }
  a { color: inherit; text-decoration: none; }

  .deck {
    /* 210/266 keeps the frame aligned with the headband at every width. */
    width: 78.947368%;
    margin: 0 auto;
    border: 2px solid var(--primary-light);
    padding: 14px 16px;
    background: var(--primary);
    position: relative;
    z-index: 1;
  }
  .deck::after {
    content: "";
    position: absolute;
    right: 6px;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent-yellow);
  }


  .label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
  }
  .label .brand { display: flex; align-items: center; gap: 8px; }
  .label .title { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
  .label .side { letter-spacing: 1px; text-align: right; line-height: 1.4; font-size: 10px; }
  .label .side .tape-id { display: block; color: var(--accent); font-size: 9px; letter-spacing: 2px; }

  .window {
    border: 2px solid var(--primary);
    background: var(--surface);
    padding: 22px 18px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 22px;
  }
  .reel {
    width: 64px; height: 64px;
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    background:
      radial-gradient(circle, var(--accent) 0 6px, var(--background) 7px 12px, transparent 13px),
      conic-gradient(var(--primary-light) 0 25%, transparent 25% 50%, var(--primary-light) 50% 75%, transparent 75% 100%);
    animation: spin 6s linear infinite;
  }
  .tape-line {
    flex: 1;
    height: 4px;
    margin: 0 14px;
    background: var(--primary-light);
    position: relative;
  }
  .tape-line::before, .tape-line::after {
    content: "";
    position: absolute;
    top: -3px;
    width: 4px; height: 10px;
    background: var(--primary-light);
  }
  .tape-line::before { left: 0; }
  .tape-line::after { right: 0; }

  @keyframes spin { to { transform: rotate(360deg); } }

  .transport {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .btn {
    display: block;
    border: 2px solid var(--primary-light);
    padding: 12px 6px;
    text-align: center;
    background: var(--surface);
    transition: background 0.06s linear, color 0.06s linear;
    cursor: pointer;
  }
  .btn:hover, .btn:focus-visible {
    background: var(--primary-light);
    color: var(--background);
    border-color: var(--primary-light);
    outline: none;
  }
  .btn:focus-visible {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 3px;
  }
  .btn .glyph {
    display: block;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
  }
  .btn .name {
    display: block;
    font-size: 13px;
    letter-spacing: 1px;
  }
  /* Keep WIKI distinct at rest and readable on the lighter active surface. */
  .btn.wiki .glyph { color: var(--accent); }
  .btn.wiki:hover .glyph, .btn.wiki:focus-visible .glyph { color: var(--background); }

  /* hover stops reels — a tiny detail */
  .deck:hover .reel { animation-play-state: paused; }

  .is-departing .rig { opacity: 0; transform: translateY(-6px); }
  .departure[hidden] { display: none; }
  .departure {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    background: var(--background);
    animation: departure-in .18s ease both;
  }
  .departure-message { font-size: 24px; line-height: 1.5; color: var(--text-primary); }
  .departure-address { font-size: 14px; letter-spacing: 1px; color: var(--text-secondary); }
  .departure-equalizer { display: flex; align-items: center; justify-content: center; gap: 4px; height: 28px; margin-bottom: 8px; }
  .departure-equalizer i { width: 4px; height: 20px; background: var(--primary-light); animation: departure-pulse .6s ease-in-out infinite alternate; }
  .departure-equalizer i:nth-child(2), .departure-equalizer i:nth-child(4) { height: 28px; animation-delay: -.2s; }
  .departure-equalizer i:nth-child(3) { background: var(--accent); animation-delay: -.4s; }
  @keyframes departure-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes departure-pulse { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
  @media (prefers-reduced-motion: reduce) {
    .rig { transition: none; }
    .is-departing .rig { transform: none; }
    .departure, .departure-equalizer i { animation: none; }
  }

  @media (max-width: 480px) {
    body { padding: 16px; }
    .deck { padding: 16px 12px 14px; }
    .transport { gap: 6px; }
    .window { padding: 16px 12px; }
    .reel { width: 48px; height: 48px; }
    .btn { padding: 14px 8px; }
    .btn .glyph { font-size: 22px; }
    .btn .name { font-size: 13px; letter-spacing: 1px; }
    .label .title { font-size: 16px; }
    .label .side { font-size: 12px; }
    .label .side .tape-id { font-size: 10px; }
  }

  @media (max-width: 380px) {
    .deck { padding-left: 8px; padding-right: 8px; }
    .btn { padding-left: 4px; padding-right: 4px; }
    .reel { width: 40px; height: 40px; }
    .btn .glyph { font-size: 20px; margin-bottom: 6px; }
    .btn .name { font-size: 12px; letter-spacing: .5px; }
  }
