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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #030306;
  color: #f3e8d8;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#game-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* Vignette & Danger Pulse */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.78) 100%);
  z-index: 5;
}

#danger-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(165, 18, 12, 0.75) 100%);
  transition: opacity 0.12s ease-out;
  z-index: 6;
}

/* Hiding Slats Effect */
#hiding-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 20%, rgba(0, 0, 0, 0.92) 78%);
}

#hiding-overlay .slat {
  position: absolute;
  left: 0;
  right: 0;
  height: 11vh;
  background: linear-gradient(180deg, #060405, #120b09, #050304);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.95);
}
#hiding-overlay .slat-1 { top: 0; height: 15vh; }
#hiding-overlay .slat-2 { top: 28vh; height: 8vh; opacity: 0.92; }
#hiding-overlay .slat-3 { bottom: 26vh; height: 8vh; opacity: 0.92; }
#hiding-overlay .slat-4 { bottom: 0; height: 16vh; }

/* HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#top-bar {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

#objective-box {
  background: rgba(8, 6, 10, 0.68);
  border: 1px solid rgba(255, 145, 48, 0.28);
  border-left: 3px solid #ff8c2b;
  padding: 10px 14px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.hud-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 180, 110, 0.78);
  margin-bottom: 4px;
  font-weight: 700;
}

#objective-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff3e4;
}

#zone-text {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(230, 210, 190, 0.65);
}

#status-pills {
  display: flex;
  gap: 8px;
}

.pill {
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12, 10, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
}

.pill.active {
  border-color: rgba(255, 160, 66, 0.55);
  color: #ffbe78;
}

#center-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 224, 185, 0.65);
  box-shadow: 0 0 8px rgba(255, 150, 50, 0.6);
}

#interact-prompt {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 7, 12, 0.82);
  border: 1px solid rgba(255, 150, 55, 0.55);
  color: #ffdfb8;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

#proximity-alert {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(18, 6, 8, 0.78);
  border: 1px solid rgba(255, 130, 50, 0.5);
  color: #ffbd73;
  box-shadow: 0 0 22px rgba(255, 60, 20, 0.35);
}

#proximity-alert.urgent {
  background: rgba(85, 8, 10, 0.86);
  border-color: rgba(255, 65, 45, 0.85);
  color: #ffcdc4;
  box-shadow: 0 0 32px rgba(255, 25, 15, 0.75);
  animation: pulseText 0.55s infinite ease-in-out;
}

#whisper-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff6b4a;
  text-shadow: 0 0 18px rgba(255, 50, 20, 0.85);
  text-align: center;
  animation: pulseText 1.1s infinite ease-in-out;
}

@keyframes pulseText {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.98); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}

/* Hiding Dread HUD */
#hiding-hud {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  text-align: center;
  background: rgba(10, 5, 8, 0.8);
  border: 1px solid rgba(255, 72, 48, 0.45);
  padding: 12px 16px;
  border-radius: 8px;
}

.hiding-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #ff8a6b;
  margin-bottom: 8px;
}

.hiding-hint {
  margin-top: 7px;
  font-size: 11px;
  color: rgba(255, 220, 200, 0.72);
}

/* Bottom Bar */
#bottom-bar {
  position: absolute;
  bottom: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.stamina-wrap {
  width: 240px;
}

.meter-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  transition: width 0.06s linear;
}

.stamina-fill {
  background: linear-gradient(90deg, #ff7b1c, #ffd07a);
  box-shadow: 0 0 10px rgba(255, 145, 45, 0.65);
}

.dread-track {
  height: 10px;
  background: rgba(255, 60, 40, 0.18);
}

.dread-fill {
  width: 0%;
  background: linear-gradient(90deg, #ff9933, #ff3322, #ff0022);
  box-shadow: 0 0 12px rgba(255, 40, 25, 0.8);
}

#controls-mini {
  font-size: 12px;
  color: rgba(240, 225, 210, 0.58);
  background: rgba(8, 6, 10, 0.55);
  padding: 6px 12px;
  border-radius: 6px;
}

#controls-mini span {
  color: #ffba73;
  font-weight: 700;
}

/* Fullscreen Overlays */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(20, 10, 6, 0.72), rgba(3, 2, 5, 0.94));
  backdrop-filter: blur(6px);
  padding: 20px;
}

.menu-card {
  max-width: 620px;
  width: 100%;
  background: rgba(12, 9, 14, 0.9);
  border: 1px solid rgba(255, 140, 45, 0.32);
  border-radius: 14px;
  padding: 36px 38px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 110, 25, 0.12);
}

.menu-card.compact {
  max-width: 440px;
}

.danger-card {
  border-color: rgba(255, 55, 35, 0.45);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(220, 30, 20, 0.22);
}

.victory-card {
  border-color: rgba(120, 230, 160, 0.42);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(80, 210, 130, 0.18);
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #ff9c42;
  margin-bottom: 10px;
}

.danger-text { color: #ff5544; }
.victory-text { color: #7ef0a8; }

h1 {
  font-size: 48px;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: #fff2e2;
  text-shadow: 0 0 28px rgba(255, 125, 25, 0.5);
  margin-bottom: 14px;
}

h2 {
  font-size: 30px;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(242, 228, 212, 0.8);
  margin-bottom: 24px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}

.rule-item {
  background: rgba(255, 145, 50, 0.06);
  border: 1px solid rgba(255, 145, 50, 0.18);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule-item strong {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #ffae5c;
}

.rule-item span {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(240, 226, 210, 0.78);
}

.primary-btn, .secondary-btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 14px 30px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #ff7a18, #e64a19);
  color: #fff8f0;
  box-shadow: 0 8px 28px rgba(255, 100, 20, 0.4);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(255, 115, 25, 0.6);
}

.danger-btn {
  background: linear-gradient(135deg, #d92b2b, #8f1414);
  box-shadow: 0 8px 28px rgba(220, 35, 35, 0.45);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.09);
  color: #f3e8d8;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.online-btn {
  background: linear-gradient(135deg, #2d6cdf, #1a4396);
  box-shadow: 0 8px 28px rgba(45, 108, 223, 0.42);
}

.online-btn:hover {
  box-shadow: 0 12px 34px rgba(65, 130, 245, 0.62);
}

.small-btn {
  padding: 8px 16px;
  font-size: 11px;
}

.primary-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

/* Chaser Live Zoo Map */
#chaser-map-wrap {
  position: absolute;
  top: 64px;
  right: 24px;
  background: rgba(7, 8, 14, 0.88);
  border: 1px solid rgba(155, 190, 240, 0.38);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.78);
}

.map-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #b7d2f8;
  margin-bottom: 6px;
}

.map-key {
  color: rgba(183, 210, 248, 0.6);
}

#chaser-map {
  display: block;
  width: 224px;
  height: 224px;
  border-radius: 6px;
  transition: width 0.15s ease, height 0.15s ease;
}

#chaser-map.expanded {
  width: 420px;
  height: 420px;
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(220, 232, 248, 0.75);
}

.map-legend .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-you { background: #d8eaff; }
.dot-runner { background: #ff8c2b; }
.dot-sw { background: #44ff88; }

/* 2-Player Online Lobby */
.mp-join-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.mp-or {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.45);
}

#mp-code-input {
  width: 132px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 165, 80, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #fff3e4;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

.room-code-box {
  background: rgba(255, 145, 50, 0.07);
  border: 1px solid rgba(255, 145, 50, 0.28);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.room-code-big {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.28em;
  color: #ffcf8c;
  margin: 4px 0 10px;
}

.role-box {
  background: rgba(110, 155, 235, 0.09);
  border: 1px solid rgba(130, 175, 245, 0.28);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 18px;
}

.role-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #cde2ff;
  margin-bottom: 4px;
}

.role-sub {
  font-size: 13px;
  color: rgba(235, 226, 215, 0.78);
}

.mp-error {
  margin-top: 12px;
  font-size: 13px;
  color: #ff6b5c;
}

/* Maze Selector Pills */
.map-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.map-pill {
  cursor: pointer;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(240, 228, 215, 0.72);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.map-pill strong {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #f3e8d8;
}

.map-pill span {
  font-size: 11px;
  color: rgba(235, 220, 205, 0.6);
}

.map-pill.active {
  background: rgba(255, 130, 35, 0.14);
  border-color: rgba(255, 155, 65, 0.75);
  box-shadow: 0 0 18px rgba(255, 120, 30, 0.22);
}

.map-pill.active strong {
  color: #ffcb8a;
}

.small-note {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(235, 215, 195, 0.5);
}

.stats-line {
  font-size: 13px;
  color: #ffbe78;
  margin-bottom: 22px;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .rules-grid { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}
