:root {
  color-scheme: dark;
  --bg: #070911;
  --cabinet: #111827;
  --cabinet-edge: #27324f;
  --text: #d8f3ff;
  --muted: #7f93a8;
  --cyan: #38f8ff;
  --pink: #ff4fd8;
  --yellow: #ffd166;
  --green: #5cff9d;
  --red: #ff5a6a;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background:
    radial-gradient(circle at 50% 10%, rgba(56, 248, 255, 0.12), transparent 34rem),
    linear-gradient(180deg, #090b18 0%, #05060c 100%);
  color: var(--text);
  image-rendering: pixelated;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 22px auto 40px;
}

.marquee {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 4px solid var(--cabinet-edge);
  background: #0c1222;
  box-shadow: 0 0 0 4px #04050a, 0 18px 50px rgba(0, 0, 0, 0.45);
}

.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; }
h1 { margin: 0; font-size: clamp(38px, 8vw, 84px); line-height: 0.9; color: var(--yellow); text-shadow: 4px 4px 0 #482a71, 8px 8px 0 #081018; letter-spacing: 0.08em; }

.coin-slot {
  border: 3px solid var(--yellow);
  color: var(--yellow);
  padding: 10px 14px;
  min-width: 92px;
  text-align: center;
  background: #160f1e;
}
.coin-slot span { display: block; font-size: 11px; color: var(--muted); }
.coin-slot strong { font-size: 28px; }

.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 768px) minmax(260px, 1fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 4px solid var(--cabinet-edge);
  background: linear-gradient(135deg, #111827, #0b0f1c);
  box-shadow: inset 0 0 0 4px #05060d, 0 22px 70px rgba(0, 0, 0, 0.55);
}

canvas {
  width: 100%;
  max-width: 768px;
  aspect-ratio: 6 / 5;
  display: block;
  background: #02030a;
  border: 4px solid #03050b;
  box-shadow: 0 0 0 4px #25324f, inset 0 0 40px rgba(56, 248, 255, 0.08);
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: manipulation;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-block, .lab-note {
  border: 3px solid #25324f;
  background: rgba(4, 8, 18, 0.82);
  padding: 14px;
}

h2, h3 { margin: 0 0 10px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0; color: #c9d8e5; line-height: 1.45; }
.small { color: var(--muted); font-size: 13px; margin-top: 10px; }

.meter-label { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 8px; }
.meter { height: 18px; border: 3px solid #314064; background: #060914; }
#timerBar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); transition: width 0.08s linear; }

button {
  font: inherit;
  font-weight: 900;
  color: #081018;
  background: var(--green);
  border: 0;
  padding: 16px 18px;
  box-shadow: 0 6px 0 #1c7d4a, 0 0 0 4px #07100b;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
button:hover, button:focus { background: var(--yellow); outline: 3px solid var(--cyan); }

button.secondary {
  color: var(--text);
  background: #1b2845;
  box-shadow: 0 6px 0 #0b1020, 0 0 0 4px #07100b;
}

button.secondary:hover, button.secondary:focus {
  color: #081018;
  background: var(--pink);
}

.hold-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hold-button span {
  position: relative;
  z-index: 2;
}

.hold-button .progress-fill {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--red), var(--yellow));
  transform: translateX(-100%);
  transition: transform 0.15s linear;
}

.hold-button.holding .progress-fill {
  transform: translateX(0);
  transition: transform 3s linear;
}

.lab-note { margin-top: 18px; }

@media (max-width: 980px) {
  .cabinet { grid-template-columns: 1fr; }
}
