:root {
  --bg: #030406;
  --surface: #0e1117;
  --surface-border: #1e2633;
  --text: #f0f4f8;
  --text-dim: #7f8c9d;
  --accent: #ff2a4b; /* Blood red for outbreak & killer */
  --accent-blue: #00e5ff; /* Survivor cyan */
  --accent-yellow: #ffb703; /* Search / Fuse electricity */
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; user-select: none; }
body { margin: 0; background: var(--bg); color: var(--text); overflow: hidden; height: 100vh; }

.topbar {
  position: absolute; top: 0; left: 0; width: 100%; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: rgba(8, 10, 14, 0.85); z-index: 100;
  border-bottom: 1px solid var(--surface-border); backdrop-filter: blur(8px);
}
.brand { font-weight: 900; font-size: 1.1rem; letter-spacing: 0.5px; }
.brand-sub { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.room-tag {
  background: rgba(0, 229, 255, 0.12); color: var(--accent-blue);
  border: 1px solid rgba(0, 229, 255, 0.3); padding: 4px 10px;
  border-radius: 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.icon-btn { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; }

.screen { position: absolute; inset: 0; display: none; padding-top: 48px; }
.screen.show { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Menu */
.menu-card {
  background: var(--surface); padding: 36px 42px; border-radius: 14px;
  max-width: 720px; width: 92%; text-align: center;
  border: 1px solid var(--surface-border); box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}
.menu-badge {
  display: inline-block; padding: 4px 12px; background: rgba(255, 42, 75, 0.15);
  border: 1px solid rgba(255, 42, 75, 0.35); border-radius: 20px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; color: var(--accent);
  margin-bottom: 14px; text-transform: uppercase;
}
.menu-title { font-size: 2.8rem; margin: 0 0 10px; font-weight: 900; letter-spacing: -0.5px; }
.accent { color: var(--accent); }
.menu-sub { color: var(--text-dim); line-height: 1.5; font-size: 0.95rem; margin-bottom: 24px; }

.mode-select-box { margin-bottom: 20px; }
.btn-glow {
  box-shadow: 0 0 24px rgba(255, 42, 75, 0.4);
  font-size: 1.15rem; padding: 16px 36px;
}
.btn-glow:hover {
  box-shadow: 0 0 36px rgba(255, 42, 75, 0.6);
  transform: translateY(-2px);
}

.multiplayer-box {
  display: flex; align-items: center; justify-content: space-between;
  background: #131722; padding: 16px 20px; border-radius: 10px;
  border: 1px solid var(--surface-border); margin-bottom: 24px;
}
.mp-col { flex: 1; display: flex; justify-content: center; }
.mp-divider { font-weight: 800; color: #48546a; padding: 0 16px; font-size: 0.8rem; }
.join-row { display: flex; gap: 8px; width: 100%; }
.join-row input {
  background: #090c12; border: 1px solid var(--surface-border); color: #fff;
  padding: 10px 14px; border-radius: 6px; font-size: 1rem;
  text-transform: uppercase; width: 130px; text-align: center; font-weight: 700;
}

.solo-divider { text-align: center; margin: 20px 0; position: relative; }
.solo-divider::before { content:""; position:absolute; left:0; top:50%; width:100%; height:1px; background:var(--surface-border); z-index:1; }
.solo-divider span { background: var(--surface); position: relative; z-index: 2; padding: 0 12px; color: #64748b; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px; }

.controls-guide {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #090c12; padding: 14px 18px; border-radius: 8px;
  font-size: 0.85rem; color: var(--text-dim); text-align: left;
}
.controls-guide strong { color: #fff; }

.btn {
  padding: 12px 24px; border: none; border-radius: 8px; font-weight: 700;
  cursor: pointer; transition: 0.2s transform, 0.2s background, 0.2s box-shadow;
  font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #e01d3c; }
.btn-secondary { background: #20293a; color: #fff; border: 1px solid #334155; }
.btn-secondary:hover { background: #2a374d; }
.btn-full { width: 100%; }
.btn-large { font-size: 1.05rem; padding: 14px 28px; }

/* Lobby */
.lobby-card {
  background: var(--surface); padding: 36px; border-radius: 14px;
  width: 440px; text-align: center; border: 1px solid var(--surface-border);
}
.player-list { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.player-row {
  background: #131722; padding: 12px 16px; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--surface-border); font-size: 0.9rem; font-weight: 600;
}
.text-dim { color: var(--text-dim); font-size: 0.85rem; }

/* ==================== GAME HUD ==================== */
.game-hud { position: absolute; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }

.hud-top-panel {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}

.hud-objective-box {
  background: rgba(8, 10, 14, 0.85); padding: 8px 24px; border-radius: 30px;
  border: 1px solid rgba(0, 229, 255, 0.4); color: var(--accent-blue);
  font-weight: 800; font-size: 1.05rem; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.hud-gate-status {
  background: rgba(8, 10, 14, 0.8); padding: 4px 16px; border-radius: 20px;
  border: 1px solid rgba(255, 183, 3, 0.35); color: var(--accent-yellow);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.5px;
}

/* Outbreak Flashing Alarm */
.outbreak-banner {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 0, 40, 0.9); color: #fff; padding: 12px 32px;
  border-radius: 10px; text-align: center; border: 2px solid #fff;
  box-shadow: 0 0 40px rgba(255, 0, 40, 0.8);
  display: none; animation: pulse-outbreak 0.8s infinite alternate;
}
.outbreak-title { font-size: 1.4rem; font-weight: 900; letter-spacing: 1px; }
.outbreak-sub { font-size: 0.85rem; font-weight: 700; margin-top: 2px; }

@keyframes pulse-outbreak {
  0% { transform: translateX(-50%) scale(0.96); opacity: 0.9; }
  100% { transform: translateX(-50%) scale(1.04); opacity: 1; box-shadow: 0 0 60px rgba(255, 0, 40, 1); }
}

/* Interaction Prompt */
.interaction-prompt {
  position: absolute; bottom: 22%; left: 50%; transform: translateX(-50%);
  background: rgba(8, 10, 14, 0.9); padding: 8px 18px; border-radius: 8px;
  border: 1px solid #fff; color: #fff; font-weight: 800; font-size: 0.95rem;
  display: none; align-items: center; gap: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.key-pill {
  background: #fff; color: #000; padding: 2px 8px; border-radius: 4px; font-weight: 900;
}

/* Search Progress Bar */
.search-progress-box {
  position: absolute; bottom: 28%; left: 50%; transform: translateX(-50%);
  width: 220px; text-align: center; display: none;
}
.search-label { font-size: 0.75rem; font-weight: 800; color: var(--accent-yellow); margin-bottom: 6px; letter-spacing: 0.5px; }
.search-bar-track {
  width: 100%; height: 8px; background: rgba(0,0,0,0.8);
  border: 1px solid var(--accent-yellow); border-radius: 4px; overflow: hidden;
}
.search-bar-fill {
  width: 0%; height: 100%; background: var(--accent-yellow);
  box-shadow: 0 0 10px var(--accent-yellow);
}

/* Locker Hiding Overlay */
.hiding-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.7);
  display: none; pointer-events: none; z-index: 40;
}
.hiding-slats {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.85) 0px, rgba(0,0,0,0.85) 16px, transparent 16px, transparent 24px);
}
.hiding-notice {
  position: absolute; bottom: 15%; left: 50%; transform: translateX(-50%);
  background: rgba(0, 229, 255, 0.2); border: 1px solid var(--accent-blue);
  color: var(--accent-blue); padding: 8px 20px; border-radius: 20px;
  font-weight: 800; font-size: 0.9rem;
}

/* Inventory Dock */
.inventory-dock {
  position: absolute; bottom: 24px; left: 24px;
  display: flex; gap: 12px;
}
.inv-slot {
  background: rgba(8, 10, 14, 0.85); border: 1px solid var(--surface-border);
  padding: 8px 14px; border-radius: 8px; display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.9rem;
}
.inv-icon { font-size: 1.2rem; }
.inv-count { color: #fff; }

/* Killer Dash Bar */
.hud-charge-bar {
  position: absolute; bottom: 24px; right: 24px;
  background: rgba(8, 10, 14, 0.85); padding: 8px 14px; border-radius: 8px;
  border: 1px solid rgba(255, 42, 75, 0.4); width: 180px;
}
.hud-charge-label { font-size: 0.7rem; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.hud-charge-track { width: 100%; height: 6px; background: rgba(0,0,0,0.8); border-radius: 3px; overflow: hidden; }
.hud-charge-fill { width: 100%; height: 100%; background: var(--accent); }

/* Red Alert Screen Filter */
.red-alert-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 30;
  box-shadow: inset 0 0 100px rgba(255, 0, 40, 0.6);
  opacity: 0; transition: opacity 0.5s ease-in-out;
}
.red-alert-active {
  opacity: 1;
  animation: strobe-red 1.2s infinite ease-in-out;
}
@keyframes strobe-red {
  0% { box-shadow: inset 0 0 80px rgba(255, 0, 40, 0.4); }
  50% { box-shadow: inset 0 0 160px rgba(255, 0, 40, 0.85); }
  100% { box-shadow: inset 0 0 80px rgba(255, 0, 40, 0.4); }
}

/* Overlays */
.full-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.88);
  z-index: 100; backdrop-filter: blur(8px);
}
.overlay-card {
  background: var(--surface); padding: 40px 48px; border-radius: 16px;
  text-align: center; border: 1px solid var(--surface-border); max-width: 500px;
}
.skull-icon, .trophy-icon { font-size: 3.5rem; margin-bottom: 12px; }
.text-red { color: var(--accent); }
.text-cyan { color: var(--accent-blue); }

#gameCanvas { display: block; width: 100%; height: 100%; background: #000; }

/* Map Selector Pills */
.map-select-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 20px;
}
.map-label { font-size: 0.8rem; font-weight: 800; color: var(--text-dim); letter-spacing: 0.5px; }
.map-pills { display: flex; gap: 6px; background: #090c12; padding: 4px; border-radius: 8px; border: 1px solid var(--surface-border); }
.map-pill {
  background: none; border: none; color: var(--text-dim); padding: 6px 12px;
  border-radius: 6px; font-weight: 800; font-size: 0.75rem; cursor: pointer; transition: 0.2s;
}
.map-pill.active { background: var(--accent-blue); color: #000; box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }

.hud-sub-stats {
  display: flex; gap: 8px; align-items: center;
}

.hud-hunt-timer {
  background: rgba(255, 0, 40, 0.85); padding: 4px 16px; border-radius: 20px;
  border: 1px solid #fff; color: #fff; font-size: 0.8rem; font-weight: 900; letter-spacing: 0.5px;
  box-shadow: 0 0 16px rgba(255, 0, 40, 0.8);
  animation: timer-pulse 1s infinite alternate;
}

@keyframes timer-pulse {
  0% { transform: scale(0.98); }
  100% { transform: scale(1.03); }
}

/* ===========================================================================
   OPTIONAL DR. YEET ACCOUNT
   =========================================================================== */
.arcade-acct { margin: 10px 0 6px; text-align: center; }
.acct-signed-in { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.acct-signed-in[hidden], .acct-signed-out[hidden] { display: none; }
.acct-who { font-size: 0.85rem; color: #cfe3ef; }
.acct-who strong { color: #7CFFB2; }
.acct-opt { opacity: 0.6; font-size: 0.78em; }
.link-btn { background: none; border: none; cursor: pointer; color: #8fd8ff; font: inherit; font-size: 0.85rem; text-decoration: underline; }

.acct-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  background: rgba(3,6,9,0.88); backdrop-filter: blur(6px); }
.acct-modal[hidden] { display: none; }
.acct-card { position: relative; width: min(440px, 92vw); text-align: left; padding: 28px 30px;
  border-radius: 18px; border: 1px solid rgba(255,255,255,0.12); background: rgba(12,18,24,0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.85); }
.acct-close { position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: rgba(255,255,255,0.6); font-size: 1.1rem; cursor: pointer; }
.acct-title { margin: 0 0 8px; letter-spacing: 1px; font-size: 1.05rem; }
.acct-blurb { font-size: 0.84rem; color: rgba(255,255,255,0.7); line-height: 1.45; margin: 0 0 10px; }
.acct-warn { font-size: 0.78rem; color: #ffca7a; background: rgba(255,190,90,0.1);
  border: 1px solid rgba(255,190,90,0.3); border-radius: 10px; padding: 8px 11px; margin: 0 0 16px; line-height: 1.4; }
.acct-field { display: block; margin-bottom: 12px; }
.acct-field span { display: block; font-size: 0.74rem; letter-spacing: 0.6px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.acct-field input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05); color: #eaf4ff; font-size: 0.92rem; }
.acct-actions { display: flex; gap: 10px; margin-top: 6px; }
.acct-actions .btn { flex: 1; }
.acct-error { color: #ff8f8f; font-size: 0.8rem; min-height: 1em; margin: 10px 0 0; }
