:root {
  --gold: #f0b429;
  --gold-bright: #ffd86b;
  --text: #f4f6ff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--text);
  background: #01030c;
  overflow: hidden;
}

/* Full-screen canvas stage */
#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  touch-action: manipulation;
}

/* DOM overlays sit above the canvas */
.topbar {
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 3;
  display: flex;
  gap: 10px;
}
.chip {
  background: rgba(8, 20, 60, 0.72);
  border: 1px solid rgba(120, 170, 255, 0.45);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(3px);
}
.chip:hover { border-color: var(--gold); }

/* Host control bar — hidden unless body.is-host */
.controls {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: none;
  background: rgba(3, 7, 22, 0.9);
  border-top: 1px solid rgba(120, 170, 255, 0.3);
  padding: 12px 18px;
  backdrop-filter: blur(5px);
}
body.is-host.playing .controls { display: block; }

/* master volume slider, top-left */
.vol {
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 20, 60, 0.72);
  border: 1px solid rgba(120, 170, 255, 0.45);
  border-radius: 999px;
  padding: 8px 14px;
  backdrop-filter: blur(3px);
}
.vol-ico { font-size: 14px; }
#volSlider, #peerVol { width: 120px; accent-color: var(--gold); cursor: pointer; }
/* both volume pills stacked in the top-left corner */
#peerVolWrap { top: 62px; }


/* theme field overlaid on the canvas plate the host draws */
.theme-input {
  position: fixed;
  z-index: 3;
  display: none;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  text-align: center;
  font: 600 18px 'Montserrat', system-ui, sans-serif;
}
.theme-input::placeholder { color: #6f86b8; }
.controls .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls .row + .row { margin-top: 10px; }
button.ctl, .controls input, .controls select {
  font-family: inherit;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 16px;
}
.controls input, .controls select { background: #0a1335; color: var(--text); }
.controls input { flex: 1; min-width: 200px; }
button.ctl {
  background: linear-gradient(180deg, #2b4cc4, #14246e);
  color: var(--text);
  cursor: pointer;
  transition: filter 0.15s;
}
button.ctl:hover:not(:disabled) { filter: brightness(1.2); }
button.ctl:disabled { opacity: 0.4; cursor: not-allowed; }
button.ctl.gold { background: linear-gradient(180deg, var(--gold-bright), #b8860b); color: #1a1300; }
button.ctl.danger { background: linear-gradient(180deg, #c0392b, #7d1d12); }
.controls .muted { color: #9fb0d8; font-size: 13px; }

/* Prize-ladder overlay */
.ladder-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(2, 5, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.ladder-overlay[hidden] { display: none; }
.ladder-card {
  background: linear-gradient(180deg, #0a1640, #04081f);
  border: 1px solid rgba(120, 170, 255, 0.4);
  border-radius: 16px;
  padding: 20px 24px;
  width: min(360px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.ladder-card h2 { margin: 0 0 12px; color: var(--gold); font-size: 18px; text-align: center; }
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: flex; justify-content: space-between; padding: 6px 14px; border-radius: 6px; font-size: 15px; color: var(--gold); }
.ladder li.safe { font-weight: 700; }
.ladder li.current { background: linear-gradient(90deg, #ffd05a, #c8860a); color: #1a1300; font-weight: 700; }
.ladder li .amount { font-variant-numeric: tabular-nums; }
.ladder-card .close { margin-top: 14px; width: 100%; }
