:root {
  --dark: #07080a;
  --wall: #15191b;
  --floor: #101314;
  --tube: #c9e4dc;
  --glow: #7fe3ff;
  --machine: #1a1d24;
  --machine-edge: #2c313b;
  --glass: rgba(170, 225, 240, 0.07);
  --ink: #e8f4f7;
  --muted: #9db0b6;
  --danger: #ff5a5f;
  --led: #ff4040;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--dark);
  color: var(--ink);
  font: 15px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.hallway {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 700px;
  background: radial-gradient(ellipse at 50% 42%, #2a3232 0%, #0d1012 55%, var(--dark) 100%);
}

.ceiling, .floor {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 42%;
}

.ceiling {
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(#0a0c0d, #20282a);
  clip-path: polygon(0 0, 100% 0, 58% 100%, 42% 100%);
}

.tube {
  width: 24%;
  height: 10px;
  background: var(--tube);
  box-shadow: 0 0 34px 8px rgba(201, 228, 220, 0.4);
}

.tube.dead { background: #333b3b; box-shadow: none; }
.tube.flicker { animation: flicker 7s infinite steps(1); }

@keyframes flicker {
  0%, 60%, 64%, 70%, 100% { opacity: 1; }
  61%, 63%, 66%, 68% { opacity: 0.15; }
}

.floor {
  bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 70px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 46px),
    linear-gradient(#1f2829, var(--floor));
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
}

.wall {
  position: absolute;
  top: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, #07090a, var(--wall));
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 4%;
}

.wall.left { left: 0; clip-path: polygon(0 0, 100% 42%, 100% 58%, 0 100%); }
.wall.right { right: 0; clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%); transform: scaleX(-1); }
.door { width: 18%; height: 24%; background: #0b0e0f; border: 1px solid #242a2c; }
.lockers {
  width: 34%;
  height: 22%;
  background: repeating-linear-gradient(90deg, #1b2527 0 12px, #101617 12px 14px);
}

.far-end {
  position: absolute;
  left: 46%;
  top: 44%;
  width: 8%;
  height: 12%;
  background: #030404;
  box-shadow: 0 0 60px 20px #000;
}

/* The vending machine */
.machine {
  position: relative;
  z-index: 1;
  width: min(1040px, 100% - 32px);
  margin: 32px auto;
  background: linear-gradient(160deg, var(--machine), #101217);
  border: 2px solid var(--machine-edge);
  border-radius: 10px 10px 4px 4px;
  box-shadow:
    0 0 28px rgba(127, 227, 255, 0.35),
    0 0 130px 30px rgba(127, 227, 255, 0.16),
    0 40px 60px rgba(0, 0, 0, 0.8);
}

.marquee {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 16px 20px;
  background: linear-gradient(#a7f0ff, #55c8e6);
  color: #05222b;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 34px rgba(127, 227, 255, 0.7);
}

.marquee h1 { margin: 0; font-size: clamp(24px, 5vw, 38px); letter-spacing: 0.04em; text-transform: uppercase; }
.marquee p { margin: 0; font-size: 13px; }

.machine-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  padding: 16px;
}

.glass {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.09) 0 8%, transparent 20%), var(--glass);
  border: 1px solid rgba(127, 227, 255, 0.4);
  border-radius: 4px;
  box-shadow: inset 0 0 44px rgba(127, 227, 255, 0.1);
}

.shelf {
  margin: 0;
  min-width: 0;
  padding: 10px 12px 14px;
  border: 0;
  border-bottom: 5px solid #5a6470;
  background: rgba(4, 8, 10, 0.55);
}

.shelf.wide { grid-column: 1 / -1; }

legend {
  float: left;
  width: 100%;
  padding: 0 0 8px;
  font-weight: 700;
}

legend + * { clear: both; }

.slot {
  display: inline-block;
  padding: 0 5px;
  margin-right: 6px;
  background: #05070a;
  color: var(--led);
  border: 1px solid #333;
  font-size: 12px;
}

label { display: block; margin-bottom: 10px; }
label small { display: block; color: var(--muted); font-size: 12px; }

input:not([type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 7px 8px;
  background: #05090b;
  color: var(--ink);
  border: 1px solid #47535a;
  border-radius: 2px;
  font: inherit;
}

:is(input, select, textarea, button, a):focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
textarea { resize: vertical; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 10px; }
.columns h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.check { display: flex; gap: 7px; align-items: baseline; margin-bottom: 5px; font-size: 13px; }
.check input { flex: none; accent-color: var(--glow); }
.check.off { color: var(--muted); }
.check em { font-size: 11px; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #23272f;
  border: 1px solid #3a404c;
  border-radius: 4px;
  align-self: start;
  position: sticky;
  top: 16px;
}

.readout {
  min-height: 64px;
  padding: 8px;
  background: #0f1408;
  color: #c2ff6e;
  border: 2px inset #333;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.readout.bad { color: var(--led); }

.vend {
  padding: 14px;
  background: linear-gradient(#ff6a6a, #c41f25);
  color: #fff;
  border: 2px solid #5c0c0f;
  border-radius: 4px;
  font: 700 16px/1 inherit;
  font-family: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.vend:hover { filter: brightness(1.12); }
.vend:disabled { filter: grayscale(0.7); cursor: progress; }
.fineprint { margin: 0; font-size: 12px; color: #c1ccd0; }
.coin-slot { width: 8px; height: 38px; margin: 0 auto; background: #000; border: 2px solid #5c6470; border-radius: 3px; }
.panel h2 { margin: 0; font-size: 13px; }
.past-jobs { margin: 0; padding: 0; list-style: none; font-size: 12px; }
.past-jobs li { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; overflow-wrap: anywhere; }
.past-jobs a { color: var(--glow); }
.past-jobs span { color: var(--muted); }

.flap {
  display: grid;
  place-items: center;
  height: 50px;
  background: linear-gradient(#05070a, #1a1d24);
  border: 2px solid #5c6470;
  color: #5c6470;
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 800px) {
  .machine { margin: 16px auto; }
  .machine-body { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .glass { grid-template-columns: minmax(0, 1fr); }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .tube.flicker { animation: none; }
}
