* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #0a1622;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #eaf6ff;
  user-select: none;
}
#game-canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; }

/* Godzilla round-event intro — a slow (not strobing) red flash plus big
   text, purely decorative (pointer-events: none so it never blocks input),
   auto-hidden again via JS after the animation finishes. See
   triggerGodzillaIntro() in game.js. */
#godzilla-flash {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
#godzilla-flash.gz-flash-anim { animation: gz-flash-bg 1.8s ease-in-out 1; }
@keyframes gz-flash-bg {
  0%   { background: rgba(200,0,0,0); }
  15%  { background: rgba(200,0,0,0.45); }
  35%  { background: rgba(200,0,0,0.08); }
  55%  { background: rgba(200,0,0,0.4); }
  80%  { background: rgba(200,0,0,0.05); }
  100% { background: rgba(200,0,0,0); }
}
#godzilla-flash-text {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 96px; font-weight: 900; letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255,40,40,0.9), 0 0 60px rgba(255,0,0,0.7), 0 4px 0 #7a0000;
  opacity: 0;
}
#godzilla-flash.gz-flash-anim #godzilla-flash-text { animation: gz-text-pop 1.8s ease-in-out 1; }
@keyframes gz-text-pop {
  0%   { opacity: 0; transform: scale(0.7); }
  12%  { opacity: 1; transform: scale(1.08); }
  20%  { opacity: 1; transform: scale(1); }
  75%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
@media (max-width: 700px) {
  #godzilla-flash-text { font-size: 52px; }
}

.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,30,50,0.55) 0%, rgba(5,15,25,0.9) 100%);
  z-index: 50;
}
.hidden { display: none !important; }

.panel {
  position: relative;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: #111f2c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 36px 32px 30px;
  width: 460px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  max-height: 88vh;
  overflow-y: auto;
}
.panel.small { width: 320px; padding: 22px; }
.panel.panel-wide { width: 560px; }

#scoreboard-table, #leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 13px;
}
#scoreboard-table th, #scoreboard-table td, #leaderboard-table th, #leaderboard-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#scoreboard-table th, #leaderboard-table th {
  color: #8fa3b3;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#scoreboard-table td, #leaderboard-table td { color: #eaf6ff; }
#scoreboard-table tr.scoreboard-winner td { color: #ffd23f; font-weight: 700; }
#scoreboard-table td:not(:first-child), #scoreboard-table th:not(:first-child),
#leaderboard-table td:not(:first-child), #leaderboard-table th:not(:first-child) { text-align: center; }

/* Decorative glow blobs behind the menu card only — scoped to #menu-screen
   so the shared .overlay/.panel styling used by the lock/gameover screens
   isn't affected. */
#menu-screen {
  background: radial-gradient(120% 90% at 50% 0%, #16283a 0%, #0c1620 55%, #08111a 100%);
  overflow: hidden;
}
#menu-screen::before, #menu-screen::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
#menu-screen::before {
  top: -10%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, oklch(0.55 0.14 220 / 0.16) 0%, transparent 65%);
}
#menu-screen::after {
  bottom: -30%; left: 10%;
  width: 1100px; height: 1100px;
  background: radial-gradient(circle, oklch(0.5 0.12 210 / 0.10) 0%, transparent 60%);
}

#lock-overlay { cursor: pointer; }

.panel-header { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.wave-icon { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }

h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.02em; color: #eef4f9; }
.subtitle { color: #8fa3b3; font-size: 14px; margin: 0 0 26px; }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: #a9bacb; margin-bottom: 8px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.1);
  background: #0c1720; color: #eef4f9; font-size: 14px;
}
.field input:focus { outline: none; border-color: oklch(0.7 0.13 220 / 0.6); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 16px; margin-top: 10px; box-sizing: border-box;
  border-radius: 9px; border: 1px solid rgba(255,255,255,0.12);
  background: #16273570; color: #e4edf4; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { background: #1c2f42a0; }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, oklch(0.68 0.14 220), oklch(0.58 0.16 225));
  border: none; color: #fff; font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(180deg, oklch(0.72 0.14 220), oklch(0.62 0.16 225)); }
.btn-ghost { background: transparent; }

/* Placeholder for a not-yet-built mode — muted red, visibly inert. Uses the
   native `disabled` attribute (see index.html) so it's actually unclickable/
   unfocusable, not just styled to look that way; the rules below just make
   sure hover/active don't fight that by animating anyway. */
.btn-rumble {
  background: oklch(0.32 0.09 25 / 0.35);
  border: 1px solid oklch(0.45 0.1 25 / 0.35);
  color: oklch(0.62 0.06 25 / 0.75);
  cursor: not-allowed;
}
.btn-rumble:hover { background: oklch(0.32 0.09 25 / 0.35); }
.btn-rumble:active { transform: none; }

.btn-howto {
  background: transparent;
  border: 1px dashed oklch(0.7 0.13 220 / 0.5);
  color: oklch(0.78 0.11 220);
  font-size: 13.5px; font-weight: 600;
  padding: 11px 16px; margin-top: 22px;
}
.btn-howto:hover { background: oklch(0.7 0.13 220 / 0.08); }
.howto-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor;
  font-size: 11px; flex-shrink: 0;
}

.hint { font-size: 11px; color: #6f97b3; margin-top: 16px; line-height: 1.5; }
#version-tag { font-size: 10.5px; color: #567285; text-align: center; margin-top: 14px; letter-spacing: 0.02em; }
.status-text { font-size: 13px; color: #9fc4dd; margin: 12px 0 4px; }

.room-code {
  font-size: 32px; letter-spacing: 6px; font-weight: 700; color: #4fc3ff;
  background: rgba(79,195,255,0.1); border: 1px dashed rgba(79,195,255,0.4);
  border-radius: 8px; padding: 10px; margin: 8px 0 16px;
}

#lobby-players { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; }
#lobby-players li { padding: 6px 10px; background: rgba(255,255,255,0.05); border-radius: 6px; margin-bottom: 4px; font-size: 14px; }

/* ============ HOW TO PLAY / ONBOARDING MODAL ============ */
@keyframes tsModalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes tsScrimIn { from { opacity: 0; } to { opacity: 1; } }

#tutorial-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6,11,16,0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; box-sizing: border-box;
  animation: tsScrimIn 0.2s ease-out;
}

#tutorial-modal {
  width: 100%; max-width: 520px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: #111f2c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7);
  animation: tsModalIn 0.25s ease-out;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.tutorial-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 0; flex-shrink: 0;
}
.tutorial-dots { display: flex; gap: 7px; }
.tutorial-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.tutorial-dot.active { width: 22px; background: oklch(0.75 0.12 220); }
.tutorial-skip {
  background: none; border: none; color: #6b7f92;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px;
  font-family: inherit;
}
.tutorial-skip:hover { color: #a9bacb; }

.tutorial-step { padding: 20px 26px 28px; overflow-y: auto; text-align: left; }

.tutorial-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: oklch(0.75 0.12 220); text-transform: uppercase; margin-bottom: 6px;
}
.tutorial-heading { margin: 0 0 14px; font-size: 21px; font-weight: 800; color: #eef4f9; }

.tutorial-shot-wrap { width: 100%; margin-bottom: 18px; border-radius: 12px; overflow: hidden; }
.tutorial-shot-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tutorial-shot-tall { height: 300px; }
.tutorial-shot-row { display: flex; gap: 10px; margin-bottom: 14px; }
.tutorial-shot-row .tutorial-shot-wrap { margin-bottom: 0; }
.tutorial-shot-half { flex: 1; height: 220px; }

.key-row-list { display: flex; flex-direction: column; gap: 10px; }
.key-row { display: flex; align-items: center; gap: 12px; }
.key-row span:last-child { font-size: 14px; color: #c4d3e0; }
.key-chip-static {
  min-width: 78px; text-align: center; padding: 6px 0;
  border-radius: 7px; background: #0c1720; border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px; font-weight: 700; color: #dbe7f0;
}

.tutorial-tile-row { display: flex; gap: 14px; margin-bottom: 18px; }
.tutorial-tile {
  flex: 1; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: #0c1720; border: 1px solid rgba(255,255,255,0.08);
}
.tutorial-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tutorial-body { margin: 0 0 6px; font-size: 14.5px; line-height: 1.5; color: #c4d3e0; }
.tutorial-body strong { color: #eef4f9; }
.tutorial-body-sm { font-size: 14.5px; color: #95a8b8; margin-bottom: 16px; }

.key-chip-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.key-chip {
  padding: 7px 12px; border-radius: 7px;
  background: #0c1720; border: 1px solid rgba(255,255,255,0.1);
  font-size: 12.5px; font-weight: 800; color: #8fa3b3;
  transition: all 0.15s;
}
.key-chip.active {
  background: oklch(0.75 0.12 220); border-color: oklch(0.75 0.12 220); color: #08111a;
}

.tutorial-footer {
  display: flex; gap: 10px; padding: 0 26px 24px; flex-shrink: 0;
}
.tutorial-btn-back, .tutorial-btn-next { margin-top: 0; width: auto; }
.tutorial-btn-back { flex: 1; background: transparent; }
.tutorial-btn-next { flex: 2; }

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

#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 24px;
}
#round-badge, #alive-count {
  background: rgba(10,25,40,0.75); border: 1px solid rgba(120,200,255,0.25);
  border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600;
}
#phase-banner {
  text-align: center; background: rgba(10,25,40,0.8); border: 1px solid rgba(120,200,255,0.3);
  border-radius: 10px; padding: 8px 26px; min-width: 160px;
}
#phase-label { font-size: 15px; letter-spacing: 2px; font-weight: 700; color: #4fc3ff; }
#phase-timer { font-size: 30px; font-weight: 800; line-height: 1.1; }
#phase-banner.warn #phase-label { color: #ffb84f; }
#phase-banner.warn #phase-timer { color: #ffb84f; }
#phase-banner.danger #phase-label { color: #ff5f5f; }
#phase-banner.danger #phase-timer { color: #ff5f5f; }

/* Sits where the wave compass used to start — pushes the compass itself
   down (see #wave-compass below) on the rounds where both are visible at
   once (BRACE, round 10+). */
#event-shuffle {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.event-shuffle-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 2px; color: #ffb84f;
  margin-bottom: 4px; text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.event-shuffle-reel {
  display: flex; align-items: center; gap: 8px;
  background: rgba(10,25,40,0.85); border: 1px solid rgba(255,184,79,0.4);
  border-radius: 10px; padding: 7px 18px; min-width: 150px; justify-content: center;
  transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
#event-shuffle-emoji { font-size: 20px; line-height: 1; }
#event-shuffle-text { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: #eef4f9; }
.event-shuffle-reel.event-shuffle-settled {
  border-color: rgba(255,95,95,0.85);
  box-shadow: 0 0 18px rgba(255,95,95,0.5);
  animation: event-shuffle-pop 0.35s ease;
}
@keyframes event-shuffle-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

#wave-compass {
  position: absolute; top: 192px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.compass-ring {
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid rgba(255,140,80,0.85); background: rgba(20,8,8,0.55);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: pulse-ring 1s infinite ease-in-out;
  box-shadow: 0 0 16px rgba(255,90,40,0.45);
}
/* CSS-triangle pointer: crisp regardless of rotation, apex points "up" (0deg)
   which is rotated per-frame to bear toward the wave's approach direction. */
#compass-arrow {
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 38px solid #ff5a2e;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.7)) drop-shadow(0 0 6px rgba(255,90,40,0.6));
  transition: transform 0.15s ease-out;
}
.compass-you-dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #eaf6ff; box-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.compass-label { font-size: 11px; letter-spacing: 1px; color: #ff9a6a; margin-top: 4px; font-weight: 700; }
#compass-text { font-size: 12px; font-weight: 700; color: #ffcf9e; margin-top: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.85); }
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 0 rgba(255,80,40,0.4);} 50% { box-shadow: 0 0 0 10px rgba(255,80,40,0);} }

#event-banner {
  position: absolute; top: 180px; left: 50%; transform: translateX(-50%);
  background: rgba(10,25,40,0.85); border: 1px solid rgba(255,180,80,0.4);
  padding: 10px 22px; border-radius: 8px; font-size: 16px; font-weight: 700; text-align:center;
}

/* Separate from #event-banner (own timer/element) so a "can't afford" alert
   never gets stomped by, or stomps, a routine "+N blocks!" style message. */
#warning-banner {
  position: absolute; top: 236px; left: 50%; transform: translateX(-50%);
  background: rgba(60,10,10,0.92); border: 1px solid rgba(255,90,90,0.65);
  padding: 9px 20px; border-radius: 8px; font-size: 14px; font-weight: 700;
  color: #ffd6d6; text-align: center; max-width: 460px;
  box-shadow: 0 0 18px rgba(255,60,60,0.35);
  animation: warning-shake 0.4s ease;
}
@keyframes warning-shake {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(-56%); }
  40% { transform: translateX(-44%); }
  60% { transform: translateX(-53%); }
  80% { transform: translateX(-47%); }
}

#player-list {
  position: absolute; top: 16px; right: 16px; margin-top: 60px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.player-row {
  background: rgba(10,25,40,0.7); border-radius: 6px; padding: 4px 10px; font-size: 12px;
  min-width: 130px; display:flex; justify-content: space-between; gap: 8px;
}
.player-row.dead { opacity: 0.4; text-decoration: line-through; }
.player-row.self { border: 1px solid #4fc3ff; }

#crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 16px; color: rgba(255,255,255,0.8); text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

#hotbar {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center;
  background: rgba(10,25,40,0.75); border: 1px solid rgba(120,200,255,0.25);
  border-radius: 10px; padding: 8px 14px; pointer-events: auto;
}
.hotbar-slot {
  font-size: 11px; text-align: center; padding: 6px 12px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; color: #cfe9fb;
}
.hotbar-slot.active { border-color: #4fc3ff; background: rgba(79,195,255,0.15); }
.hotbar-slot .swatch { display: block; width: 20px; height: 20px; border-radius: 4px; margin: 0 auto 4px; border: 1px solid rgba(255,255,255,0.3); }
.block-budget { font-size: 12px; color: #9fc4dd; padding-left: 10px; border-left: 1px solid rgba(120,200,255,0.2); }

/* Budget-number feedback: red + shuffle while spending, green + shuffle
   while gaining, always settling back to white — see animateNumberShuffle. */
#block-budget-num { font-weight: 700; color: #eaf6ff; transition: color 0.2s ease; }
#block-budget-num.num-spend { color: #ff5f5f; }
#block-budget-num.num-gain { color: #45e08a; }

#status-msg {
  position: absolute; bottom: 16px; left: 16px;
  font-size: 12px; color: #000; text-align: left; max-width: 320px; line-height: 1.5;
  background: rgba(255,255,255,0.78); border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px; padding: 6px 10px;
}

/* ============ HEALTH ============ */
#health-status {
  position: absolute; bottom: 78px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(10,25,40,0.7); border: 1px solid rgba(120,200,255,0.2);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #cfe9fb;
}
#health-icon { font-size: 13px; color: #ff5f7a; }
#health-bar-track {
  width: 140px; height: 10px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,0.12);
}
#health-bar-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #45e08a, #9be045);
  transition: width 0.25s ease, background-color 0.25s ease;
}
#health-bar-fill.warn { background: linear-gradient(90deg, #ffcf4f, #ffb84f); }
#health-bar-fill.danger { background: linear-gradient(90deg, #ff5f5f, #ff3f6a); }

/* ============ WAVE MASH ESCAPE METER ============ */
#wave-mash-meter {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(10,25,45,0.8); border: 2px solid #3d8bff;
  box-shadow: 0 0 14px rgba(61,139,255,0.55);
  border-radius: 10px; padding: 10px 20px; text-align: center;
}
#wave-mash-label {
  font-size: 14px; font-weight: 700; color: #eaf4ff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
#wave-mash-track {
  width: 240px; height: 18px; border-radius: 9px; overflow: hidden;
  background: rgba(10,25,45,0.9); border: 1px solid #3d8bff;
}
#wave-mash-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #2b6fe0, #6fc3ff);
  transition: width 0.06s linear;
}

#gameover-title { font-size: 32px; }
#gameover-sub { color: #9fc4dd; margin-bottom: 18px; font-size: 15px; }

/* ============ VOICE ============ */
#voice-status {
  position: absolute; top: 70px; left: 16px;
  background: rgba(10,25,40,0.7); border: 1px solid rgba(120,200,255,0.2);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #9fc4dd;
  pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
#voice-status.muted #voice-icon { opacity: 0.4; }
#voice-status.muted #voice-label { color: #ff9a6a; }
#voice-status.unavailable { opacity: 0.5; cursor: default; }

/* ============ SPECTATE FREE CAM ============ */
#spectate-cam-toggle {
  position: absolute; top: 112px; left: 16px;
  background: rgba(10,25,40,0.7); border: 1px solid rgba(120,200,255,0.2);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #9fc4dd;
  pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
#spectate-cam-toggle.active { border-color: rgba(69,224,138,0.7); color: #d8ffe8; }
#spectate-cam-toggle.active #spectate-cam-label { color: #7fe3a0; }

/* ============ CHAT ============ */
#chat-log {
  position: absolute; bottom: 130px; left: 16px; width: 340px; max-width: 40vw;
  display: flex; flex-direction: column; gap: 3px;
  max-height: 220px; overflow: hidden;
}
.chat-row {
  background: rgba(10,25,40,0.65); border-radius: 6px; padding: 5px 9px;
  font-size: 13px; color: #eaf6ff; line-height: 1.35;
  transition: opacity 0.6s ease;
  word-break: break-word;
}
.chat-row b { color: #4fc3ff; font-weight: 700; }
.chat-row.mine b { color: #7fe3a0; }
.chat-row.fade { opacity: 0; }

#chat-input-box {
  position: absolute; bottom: 130px; left: 16px; width: 340px; max-width: 40vw;
  pointer-events: auto;
}
#chat-input {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(79,195,255,0.5);
  background: rgba(10,25,40,0.9); color: #eaf6ff; font-size: 13px;
}

/* ============ MOBILE TOUCH CONTROLS ============
   Everything below is hidden unless body has .mobile-mode, which JS adds
   once at load time if isMobileDevice() returns true (see game.js). The
   joystick/buttons sit inside #hud so they share its existing show/hide
   with the rest of the HUD (see ui.showHUD/showGameOver). */
#mc-joystick-base, #mc-actions { display: none; }
body.mobile-mode #game-canvas { touch-action: none; }
body.mobile-mode #mc-joystick-base {
  display: block;
  position: absolute; left: 22px; bottom: 22px;
  width: 116px; height: 116px; border-radius: 50%;
  background: rgba(10,25,40,0.5); border: 2px solid rgba(120,200,255,0.35);
  pointer-events: auto; touch-action: none;
}
#mc-joystick-knob {
  position: absolute; left: 50%; top: 50%; width: 50px; height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%; background: rgba(79,195,255,0.55); border: 2px solid rgba(190,230,255,0.85);
  pointer-events: none;
}
body.mobile-mode #mc-actions {
  display: grid; grid-template-columns: repeat(4, 54px); grid-auto-rows: 54px; gap: 7px;
  position: absolute; right: 14px; bottom: 22px;
}
.mc-btn {
  pointer-events: auto; touch-action: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1px;
  border-radius: 12px; background: rgba(10,25,40,0.62); border: 1px solid rgba(120,200,255,0.3);
  color: #cfe9fb; font-size: 17px; -webkit-user-select: none; user-select: none;
}
.mc-btn small { font-size: 8.5px; font-weight: 600; color: #9fc4dd; }
.mc-btn:active { background: rgba(79,195,255,0.35); }
.mc-btn-primary { background: rgba(69,224,138,0.22); border-color: rgba(69,224,138,0.55); }
.mc-btn-primary:active { background: rgba(69,224,138,0.4); }

/* Desktop-only instructional hint text; touch controls make it redundant
   and it would otherwise sit under the joystick. */
body.mobile-mode #status-msg { display: none; }

#rotate-prompt {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(5,12,20,0.97); color: #cfe9fb;
  align-items: center; justify-content: center; text-align: center;
  font-size: 17px; line-height: 1.6; padding: 24px;
}
@media (orientation: portrait) {
  body.mobile-mode.in-game #rotate-prompt { display: flex; }
}

/* ============ DEV MODE ============
   Only shown when body has .dev-mode (see G.dev.enabled/initDevMode in
   game.js, gated on ?dev=1) — never visible to regular players. */
#dev-panel {
  display: none;
  position: fixed; top: 90px; right: 14px; z-index: 500;
  flex-direction: column; gap: 6px; width: 170px;
  background: rgba(10,25,40,0.88); border: 1px solid rgba(255,180,80,0.5);
  border-radius: 10px; padding: 10px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
body.dev-mode #dev-panel { display: flex; }
.dev-panel-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: #ffb84f;
  text-align: center; margin-bottom: 2px;
}
.dev-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,180,80,0.35);
  color: #ffe3c2; border-radius: 6px; padding: 7px 8px; font-size: 12px;
  cursor: pointer; font-weight: 600;
}
.dev-btn:hover { background: rgba(255,180,80,0.18); }
.dev-btn.active { background: rgba(69,224,138,0.3); border-color: rgba(69,224,138,0.7); color: #d8ffe8; }
.dev-panel-hint { font-size: 10px; color: #9fc4dd; line-height: 1.4; margin-top: 2px; }
#chat-input:focus { outline: none; border-color: #4fc3ff; }
