@font-face {
  font-family: "Inter Tight";
  src: url("fonts/of-inter-tight-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/of-inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --field: #151513;
  --lime: #faff69;
  --grey: #414141;
  --panel: #1c1c19;
  --panel-2: #242420;
  --paper: #f4f4ef;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--field);
  color: var(--paper);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.deck {
  min-height: 100dvh;
  max-width: 1800px;
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 36px) clamp(16px, 2.8vw, 44px) clamp(14px, 1.6vw, 26px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: clamp(12px, 2vh, 24px);
}

/* header */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(14px, 3vw, 40px);
}

h1 {
  margin: 0;
  max-width: 44ch;
  font-weight: 400;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.45;
  letter-spacing: -0.008em;
  color: var(--paper);
}

h1 em {
  font-style: normal;
  color: var(--lime);
}

.status {
  flex: none;
  margin: 2px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s ease;
}

.status-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--grey);
  transition: background-color 0.25s ease;
}

.deck.running .status {
  opacity: 0.9;
}

.deck.running .status-dot {
  background: var(--lime);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(250, 255, 105, 0.35);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 0 5px rgba(250, 255, 105, 0);
  }
}

/* cluster wall */

.cluster {
  position: relative;
  display: grid;
  min-height: 0;
}

.wall {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(3px, 0.42vw, 6px);
  width: 100%;
  height: 100%;
}

.b {
  display: block;
  background: var(--panel);
  border: 1px solid var(--panel-2);
  border-radius: 3px;
  transition: background-color 0.12s linear, border-color 0.12s linear, box-shadow 0.25s ease;
}

.b.on {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 10px rgba(250, 255, 105, 0.14);
}

.overflow {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  display: flex;
  align-items: baseline;
  padding: 3px 8px 4px;
  border: 1px solid var(--panel-2);
  border-radius: 5px;
  background: var(--field);
  color: var(--lime);
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

[hidden] {
  display: none;
}

/* readout */

.readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--panel-2);
  border-bottom: 1px solid var(--panel-2);
}

.cell {
  min-width: 0;
  padding: clamp(8px, 1.2vh, 16px) clamp(12px, 1.5vw, 26px);
}

.cell + .cell {
  border-left: 1px solid var(--panel-2);
}

.cell:first-child {
  padding-left: 0;
}

.k {
  margin: 0 0 clamp(4px, 0.8vh, 10px);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.42;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v {
  margin: 0;
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 6.15vw, 5.85rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--paper);
  transition: color 0.5s ease;
}

.v.money {
  color: var(--lime);
}

.readout.locked .v {
  color: var(--lime);
  transition: color 0.1s linear;
}

/* console */

.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(14px, 2.4vw, 30px);
  row-gap: 14px;
}

.slider {
  position: relative;
  min-width: 0;
  padding-top: 30px;
}

.track {
  position: relative;
  height: clamp(46px, 6.2vh, 60px);
  border: 1px solid var(--panel-2);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(244, 244, 239, 0.03);
}

.fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 999px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.tick {
  position: absolute;
  top: 12px;
  bottom: 12px;
  z-index: 2;
  width: 1px;
  background: var(--grey);
  pointer-events: none;
}

.t8 {
  left: 25%;
}

.t64 {
  left: 50%;
}

.t256 {
  left: 75%;
}

.range {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 3;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
  outline: none;
  touch-action: none;
}

.range::-webkit-slider-runnable-track {
  height: 44px;
  background: transparent;
  border: 0;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border: 8px solid var(--field);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(21, 21, 19, 0.55);
  cursor: grab;
}

.range::-moz-range-track {
  height: 44px;
  background: transparent;
  border: 0;
}

.range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 8px solid var(--field);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(21, 21, 19, 0.55);
  cursor: grab;
}

.deck.dragging .range,
.deck.dragging .range::-webkit-slider-thumb,
.deck.dragging .range::-moz-range-thumb {
  cursor: grabbing;
}

.range:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 8px;
  border-radius: 999px;
}

.bubble {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  padding: 4px 8px 5px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--field);
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.06s linear;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--paper);
  transform: translateX(-50%) rotate(45deg);
}

.deck.dragging .bubble {
  transition: none;
}

.scale {
  position: relative;
  height: 14px;
  margin-top: 9px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--paper);
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
}

.scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.s8 {
  left: 25%;
}

.s64 {
  left: 50%;
}

.s256 {
  left: 75%;
}

.launch {
  appearance: none;
  border: 0;
  cursor: pointer;
  height: clamp(44px, 5.4vh, 54px);
  padding: 0 clamp(20px, 2.2vw, 30px);
  border-radius: 999px;
  background: var(--lime);
  color: var(--field);
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 0.12s ease, background-color 0.18s ease, color 0.18s ease;
}

.launch:hover {
  background: var(--paper);
}

.launch:active {
  transform: translateY(1px);
}

.launch:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.deck.launching .launch {
  background: var(--panel-2);
  color: var(--lime);
  pointer-events: none;
}

/* foot */

.foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.foot a {
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.foot a:hover {
  color: var(--lime);
  border-color: var(--lime);
  opacity: 1;
}

.foot a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* phone */

@media (max-width: 760px) {
  .deck {
    gap: 12px;
  }

  .top {
    flex-direction: column;
    gap: 8px;
  }

  h1 {
    font-size: 14px;
    line-height: 1.4;
    max-width: 30ch;
  }

  .status {
    margin-top: 0;
    font-size: 9.5px;
    letter-spacing: 0.16em;
  }

  .status-dot {
    margin-top: 4px;
  }

  .wall {
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 3px;
  }

  .b {
    border-radius: 2px;
  }

  .readout {
    grid-template-columns: 1fr 1fr;
  }

  .cell {
    padding: 10px 0 12px;
  }

  .cell + .cell {
    padding-left: 14px;
  }

  .cell:nth-child(3),
  .cell:nth-child(4) {
    border-top: 1px solid var(--panel-2);
  }

  .v {
    font-size: clamp(2rem, 10.5vw, 2.9rem);
  }

  .console {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 14px;
  }

  .track {
    height: 52px;
  }

  .bubble {
    font-size: 11px;
  }

  .launch {
    justify-self: end;
    height: 46px;
  }

  .foot a {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b {
    transition: none;
  }

  .deck.running .status-dot {
    animation: none;
  }

  .readout.locked .v,
  .v {
    transition: none;
  }
}
