:root {
      --box: 256px;
      --gap: 10px;
      --label-h: 24px;
      --bg: #303030;
      --yellow: #fff200;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      margin: 0;
      min-height: 100%;
      background: var(--bg);
    }

    body {
      min-height: 100vh;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: #eee;
      user-select: none;
      overflow: auto;
    }

    #app {
      width: 100%;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 28px;
      padding: 24px;
    }

    #stage {
      position: relative;
      width: var(--box);
      flex: 0 0 var(--box);
      display: grid;
      grid-template-rows:
        var(--box)
        var(--label-h)
        var(--label-h)
        var(--box);
      row-gap: var(--gap);
      justify-items: center;
      align-items: center;
    }

    #gl {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      pointer-events: none;
      image-rendering: pixelated;
      image-rendering: crisp-edges;
    }

    .slot {
      position: relative;
      z-index: 1;
      width: var(--box);
      height: var(--box);
      outline: 1px solid rgba(255, 255, 255, 0.22);
      pointer-events: auto;
      touch-action: none;
    }

    .slot:hover {
      outline-color: rgba(255, 242, 0, 0.65);
    }

    .slot:active {
      outline-color: rgba(255, 242, 0, 0.95);
    }

    #topSlot {
      cursor: crosshair;
    }

    #bottomSlot {
      cursor: ns-resize;
    }

    .marker {
      position: absolute;
      z-index: 5;
      left: 0;
      top: 0;
      width: 11px;
      height: 11px;
      border: 2px solid var(--yellow);
      border-radius: 999px;
      transform: translate(-50%, -50%);
      box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.85),
        0 0 10px rgba(255, 242, 0, 0.85);
      pointer-events: none;
      display: none;
    }

    .marker::before,
    .marker::after {
      content: "";
      position: absolute;
      background: var(--yellow);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
    }

    .marker::before {
      width: 1px;
      height: 19px;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }

    .marker::after {
      width: 19px;
      height: 1px;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }

    .label {
      position: relative;
      z-index: 1;
      height: var(--label-h);
      line-height: var(--label-h);
      text-align: center;
      font-size: 16px;
      font-weight: 600;
      white-space: nowrap;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
      pointer-events: none;
    }

    .hot {
      color: var(--yellow);
      font-weight: 800;
    }

    #hud {
      width: 390px;
      max-width: calc(100vw - 48px);
      background: rgba(15, 15, 15, 0.84);
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 16px;
      padding: 14px 16px 16px;
      box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(10px);
      font-size: 12px;
      line-height: 1.35;
    }

    .hud-title {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }

    .hud-title strong {
      color: var(--yellow);
      font-size: 19px;
      letter-spacing: 0.02em;
    }

    .hud-title span {
      color: #aaa;
      font-size: 11px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

    .hud-help {
      color: #bdbdbd;
      margin-bottom: 10px;
    }

    .hud-section {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.13);
    }

    .section-title {
      margin-bottom: 6px;
      color: #fff;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 11px;
    }

    .kv {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: 4px 0;
    }

    .kv span {
      color: #aaa;
    }

    .kv b {
      color: #fff;
      font-weight: 700;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      text-align: right;
    }

    .bar {
      height: 8px;
      background: rgba(0, 0, 0, 0.55);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 999px;
      overflow: hidden;
      margin: 7px 0 5px;
    }

    .bar i {
      display: block;
      height: 100%;
      width: 50%;
      background: var(--yellow);
    }

    .formula,
    #hudPick {
      margin: 0;
      padding: 8px 9px;
      background: rgba(0, 0, 0, 0.42);
      border: 1px solid rgba(255, 255, 255, 0.11);
      border-radius: 10px;
      color: #ddd;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      white-space: pre-wrap;
      tab-size: 2;
    }

    .formula .y {
      color: var(--yellow);
    }

    .swatch {
      display: inline-block;
      width: 11px;
      height: 11px;
      margin-right: 6px;
      vertical-align: -1px;
      border: 1px solid rgba(255, 255, 255, 0.5);
      background: transparent;
    }

    @media (max-width: 760px) {
      #app {
        flex-direction: column;
        min-height: auto;
      }

      #hud {
        width: min(390px, 100%);
      }
    }

/* BEGIN PROFESSIONAL HILBERT INTERFACE */

body {
  min-width: 320px;
  user-select: text;
  background:
    radial-gradient(
      circle at 12% -10%,
      rgba(255, 242, 0, 0.09),
      transparent 34rem
    ),
    var(--bg);
}

.site-header,
#app,
.site-footer {
  width: min(980px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.site-header > div {
  max-width: 700px;
}

.site-kicker {
  margin: 0 0 9px;
  color: var(--yellow);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.site-introduction {
  max-width: 640px;
  margin: 15px 0 0;
  color: #bdbdbd;
  font-size: 16px;
  line-height: 1.55;
}

.source-link {
  flex: 0 0 auto;
  padding: 9px 0 6px;
  border-bottom: 2px solid var(--yellow);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.source-link:hover {
  color: var(--yellow);
}

.source-link:focus-visible,
.site-footer a:focus-visible,
.control-button:focus-visible,
.slot:focus-visible {
  outline: 3px solid rgba(255, 242, 0, 0.48);
  outline-offset: 4px;
}

#app {
  min-height: auto;
  padding: 30px 0 38px;
}

#stage {
  align-self: center;
}

.slot,
.visual-controls {
  user-select: none;
}

.slot:focus-visible {
  outline-color: var(--yellow);
}

.visual-controls {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: var(--box);
  margin-top: 14px;
}

.control-button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: rgba(20, 20, 20, 0.92);
  color: #eee;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  cursor: pointer;
}

.control-button:hover {
  border-color: rgba(255, 242, 0, 0.72);
  color: var(--yellow);
}

.control-button-primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.control-button-primary:hover {
  background: #fff86a;
  color: #111;
}

#hud {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #999;
  font-size: 11px;
  line-height: 1.55;
}

.site-footer p {
  max-width: 440px;
  margin: 0;
}

.site-footer a {
  color: #eee;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 34px;
  }

  #app {
    padding-top: 26px;
  }

  .site-footer {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .site-header,
  #app,
  .site-footer {
    width: min(100% - 24px, 980px);
  }

  .site-header h1 {
    font-size: clamp(30px, 12vw, 44px);
  }

  #hud {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* END PROFESSIONAL HILBERT INTERFACE */
