/* Root variables */
:root {
  --bg: #0a0a1a;
  --cyan: #00ffcc;
  --magenta: #ff6b9d;
  --gold: #ffd93d;
  --blue: #6b8fff;
  --orange: #e89440;
  --white: #fff;
  --dim: #555;
  --font: 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--cyan);
  font-family: var(--font);
  height: 100vh;
  overflow: hidden;
}

/* CRT scanline overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,255,204,0.03) 2px, rgba(0,255,204,0.03) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
#header {
  padding: 1vh 2vw;
  display: flex;
  align-items: center;
}

#title {
  flex: 1;
  text-align: center;
  font-size: 3vw;
  font-weight: bold;
  color: var(--cyan);
  letter-spacing: 0.5vw;
  text-shadow: 0 0 1.5vw rgba(0,255,204,0.3);
  border: 0.2vw solid rgba(0,255,204,0.4);
  padding: 0.8vh 2vw;
  margin-left: 2vw;
  margin-right: 8vw;
}

#logo {
  height: 6vh;
  filter: invert(1) sepia(1) saturate(5) hue-rotate(130deg);
}

/* Stage */
#stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.queue-flanker {
  position: absolute;
  bottom: 30%;
}

#queue-left { left: 3vw; }
#queue-right { right: 3vw; }

#center-stage { text-align: center; z-index: 2; }

.center-label {
  font-size: 1.4vw;
  color: rgba(0,255,204,0.5);
  letter-spacing: 0.3vw;
  margin-bottom: 1vh;
}

#current-name {
  font-size: 6vw;
  font-weight: bold;
  color: var(--orange);
  text-shadow: 0 0 2vw rgba(232,148,64,0.4);
  border: 0.3vw solid rgba(232,148,64,0.5);
  padding: 3vh 5vw;
  cursor: pointer;
  user-select: none;
}

#animation-stage {
  min-height: 15vh;
  position: relative;
}

/* Controls */
#controls {
  display: flex;
  gap: 1vw;
  justify-content: center;
  padding: 1vh 2vw;
  border-top: 1px solid rgba(0,255,204,0.15);
}

#controls button {
  background: none;
  border: 1px solid rgba(0,255,204,0.4);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 1.2vw;
  padding: 0.5vh 1.5vw;
  cursor: pointer;
  letter-spacing: 0.1vw;
}

#controls button:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 1vw rgba(0,255,204,0.2);
}

#controls button.danger {
  border-color: rgba(255,107,157,0.4);
  color: var(--magenta);
}

/* Bench */
#bench {
  padding: 1vh 2vw;
  display: flex;
  align-items: center;
  gap: 1vw;
  border-top: 1px solid rgba(0,255,204,0.1);
  font-size: 1.2vw;
}

/* How to play */
#how-to-play-btn {
  position: fixed;
  bottom: 1vh;
  right: 1vw;
  background: rgba(204,51,51,0.15);
  border: 1px solid rgba(204,51,51,0.5);
  color: #cc3333;
  font-family: var(--font);
  font-size: 1vw;
  padding: 0.4vh 1vw;
  cursor: pointer;
  z-index: 5;
}

/* Overlay */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,26,0.95);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overlay.hidden { display: none; }

.hidden { display: none !important; }

/* Flanker cards */
.flanker-card {
  border: 1px solid rgba(107,143,255,0.5);
  padding: 1vh 2vw;
  color: var(--blue);
  font-weight: bold;
  letter-spacing: 0.15vw;
  background: var(--bg);
  text-align: center;
}

.flanker-card.dim {
  border-color: rgba(107,143,255,0.3);
  color: rgba(107,143,255,0.5);
}

.flanker-name { font-size: 2vw; }
.flanker-label { font-size: 0.8vw; color: rgba(107,143,255,0.4); margin-top: 0.3vh; }

/* Bench */
.bench-label {
  color: rgba(0,255,204,0.3);
  font-size: 1vw;
  letter-spacing: 0.2vw;
  margin-right: 1vw;
}

.bench-item {
  font-size: 1.2vw;
  color: var(--dim);
  border: 1px solid #333;
  padding: 0.3vh 1vw;
  white-space: nowrap;
}

.bench-item.call-doc {
  color: rgba(255,107,157,0.5);
  border-color: rgba(255,107,157,0.3);
}

.bench-time { font-size: 0.8vw; color: #444; }
.bench-empty { font-size: 1vw; color: #333; }

/* Overlay */
.overlay-content {
  text-align: center;
  color: var(--cyan);
  max-width: 50vw;
}

.overlay-content h2 {
  font-size: 3vw;
  margin-bottom: 2vh;
  letter-spacing: 0.3vw;
}

.help-text {
  font-size: 1.4vw;
  line-height: 2;
  text-align: left;
}

.overlay-close, .overlay-btn {
  margin-top: 2vh;
  background: none;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 1.4vw;
  padding: 1vh 3vw;
  cursor: pointer;
  margin-right: 1vw;
}

.list-pick-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8vh 0.8vw;
  justify-content: center;
  max-height: 50vh;
  overflow-y: auto;
  padding: 1vh 1vw;
}

.list-pick-item {
  background: none;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 1.4vw;
  padding: 0.8vh 1.5vw;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.list-pick-item:hover {
  background: var(--cyan);
  color: var(--bg);
}

.prompt-input {
  background: #111;
  border: 1px solid var(--cyan);
  color: var(--white);
  font-family: var(--font);
  font-size: 2vw;
  padding: 1vh 2vw;
  width: 30vw;
  outline: none;
}

.overlay-buttons { margin-top: 2vh; }

/* Reorder modal */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 0.5vh;
  margin: 1vh 0;
}

.reorder-item {
  display: flex;
  align-items: center;
  gap: 1vw;
  padding: 1vh 2vw;
  border: 1px solid rgba(0,255,204,0.3);
  background: rgba(0,255,204,0.05);
  cursor: grab;
  font-size: 1.8vw;
  color: var(--cyan);
}

.reorder-item:active { cursor: grabbing; }
.reorder-item.drag-over { border-color: var(--magenta); background: rgba(255,107,157,0.1); }
.reorder-handle { color: rgba(0,255,204,0.4); font-size: 1.4vw; }
.reorder-name { letter-spacing: 0.1vw; }
