/* ─── RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:      #0b0f19;
  --bg-panel:     #0f1623;
  --bg-card:      #141e30;
  --bg-card2:     #1a2540;
  --border:       #1e2d45;
  --border-light: #253550;
  --text:         #e8eef8;
  --text-muted:   #6b8099;
  --text-dim:     #3d5270;
  --indigo:       #6366f1;
  --indigo-dark:  #4f52cc;
  --indigo-glow:  rgba(99,102,241,0.35);
  --purple:       #8b5cf6;
  --emerald:      #10b981;
  --emerald-glow: rgba(16,185,129,0.3);
  --rose:         #ef4444;
  --rose-glow:    rgba(239,68,68,0.3);
  --amber:        #f59e0b;
  --pink:         #ec4899;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
}

html, body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 900; margin-bottom: 14px; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.pixel-font { font-family: 'Press Start 2P', monospace; }

a:link, a:visited {
    color: var(--text-muted);
    text-decoration:none;
}
a:hover {
    color: var(--rose);
    text-decoration: underline;
}
/* ─── LAYOUT ────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 12px;
}

main { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.hidden { display: none !important; }

/* ─── ANIMATED MENU BACKDROP ─────────────────────────── */
#menu-bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: none;          /* toggled on only while the menu is showing */
  pointer-events: none;
}
body.menu-active #menu-bg-canvas { display: block; }
/* Keep the app content above the backdrop */
#app { position: relative; z-index: 1; }
/* While the backdrop is live, make the chrome glassy so the tiles show through it */
body.menu-active header {
  background: rgba(13,19,32,0.62);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  border-color: var(--border-light);
}
body.menu-active footer { background: transparent; border-top-color: transparent; }

/* ─── HEADER ────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.header-icon {
  background: var(--indigo);
  border-radius: var(--radius-sm);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 0 16px var(--indigo-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }

.header-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #818cf8, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.header-controls { display: flex; align-items: center; gap: 8px; }

#sound-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
#sound-btn:hover { border-color: var(--border-light); color: var(--text); }

/* Top-bar placeholder nav links (Contact Form, About) */
.header-nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

a.header-nav-btn{
    text-decoration:none !important;

}
.header-nav-btn:hover {
    border-color: var(--border-light);
    color: var(--text);
}
@media (max-width: 640px) { .header-nav-btn { display: none; } }

#lobby-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  color: var(--emerald);
  font-size: 11px;
  font-weight: 600;
}

.lobby-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald);
  animation: ping 1.5s ease-in-out infinite;
}

@keyframes ping { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }

/* ─── MENU SCREEN ───────────────────────────────────── */
#menu-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  /* Glassy panel so the animated map-tile backdrop + patrolling hunter show through */
  background: rgba(13,19,32,0.68);
  backdrop-filter: blur(11px) saturate(1.1);
  -webkit-backdrop-filter: blur(11px) saturate(1.1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 0 40px var(--indigo-glow), inset 0 0 40px rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
  #menu-screen { grid-template-columns: 1fr; padding: 16px; }
}

.menu-left { display: flex; flex-direction: column; gap: 20px; }

.menu-eyebrow {
  display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 3px;
  padding: 4px 10px;
  background: rgba(99,102,241,0.1);
  color: var(--indigo);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  margin-bottom: 8px;
}

.menu-headline {
  font-size: 28px; font-weight: 900; line-height: 1.2;
  color: var(--text);
}

.menu-headline em { color: var(--indigo); font-style: normal;
  text-decoration: underline wavy rgba(99,102,241,0.6); }

.menu-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* MAP PICKER */
.section-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--indigo);
  margin-bottom: 12px;
}

.section-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(99,102,241,0.15);
  color: var(--indigo);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.map-cards { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }

.map-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 6px;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}
.map-card:hover { border-color: var(--border-light); color: var(--text); }
.map-card.active { background: rgba(99,102,241,0.12); border-color: var(--indigo); color: #fff; }

.map-card-icon { font-size: 22px; margin-bottom: 4px; }
.map-card-name { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.map-card-sub  { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

#menu-map-desc {
  font-size: 12px; color: rgba(129,140,248,0.85);
  font-style: italic; text-align: center; margin-top: 10px;
  line-height: 1.6;
}

/* GAMEPLAY MODES */
.modes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 480px) { .modes-grid { grid-template-columns: 1fr; } }

.mode-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s;
}
.mode-card:hover { border-color: var(--border-light); }

.mode-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.mode-title .ico-indigo { color: var(--indigo); }
.mode-title .ico-emerald { color: var(--emerald); }

.mode-desc { font-size: 12px; color: var(--text-muted); flex: 1; }

.mode-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }

.multi-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 4px; }
.multi-join { display: flex; gap: 8px; }

/* ─── BUTTONS ───────────────────────────────────────── */
button { cursor: pointer; border: none; font-family: inherit; transition: all 0.15s; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary   { background: var(--indigo); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
.btn-primary:hover   { background: var(--indigo-dark); }
.btn-secondary { background: var(--purple); color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,0.3); }
.btn-secondary:hover { background: #7c50e0; }
.btn-success   { background: var(--emerald); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,0.3); }
.btn-success:hover   { background: #0da673; }
.btn-ghost     { background: var(--bg-card2); color: var(--text-muted); }
.btn-ghost:hover     { background: var(--bg-card); color: var(--text); }
.btn-danger    { background: var(--rose); color: #fff; }
.btn-danger:hover    { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-full { width: 100%; }
.btn-xs { padding: 4px 8px; font-size: 10px; border-radius: 6px; }

/* ─── INPUTS ────────────────────────────────────────── */
input[type=text],
input[type=email],
textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
textarea { line-height: 1.55; resize: vertical; min-height: 110px; }
input[type=text]:focus,
input[type=email]:focus,
textarea:focus { border-color: var(--indigo); }
input[type=text]::placeholder,
input[type=email]::placeholder,
textarea::placeholder { color: var(--text-dim); }

.input-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 5px; display: block; }

/* ─── CONTACT FORM VALIDATION POPUP ────────────────── */
.cf-popup {
  position: fixed; inset: 0; z-index: 4000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 13, 0.72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.cf-popup.show { display: flex; }
.cf-popup-card {
  width: 100%; max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 26px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: cfPopIn 0.18s ease-out;
}
@keyframes cfPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.cf-popup-icon {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.cf-popup-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.cf-popup-msg { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.cf-popup-card .btn { min-width: 130px; }

/* ─── RIGHT PANEL (INSTRUCTIONS) ───────────────────── */
.menu-right {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

.manual-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px; color: var(--indigo);
  letter-spacing: 2px;
  display: flex; align-items: center; gap: 8px;
}

.manual-items { display: flex; flex-direction: column; gap: 14px; }

.manual-item { display: flex; gap: 12px; }

.manual-num {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.mn-1 { background: rgba(99,102,241,0.15); color: var(--indigo); }
.mn-2 { background: rgba(139,92,246,0.15); color: var(--purple); }
.mn-3 { background: rgba(236,72,153,0.15); color: var(--pink); }
.mn-4 { background: rgba(245,158,11,0.15); color: var(--amber); }

.manual-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.manual-text strong { color: var(--text); display: block; margin-bottom: 2px; }

.controls-tip {
  padding: 10px 14px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  font-size: 11px; color: rgba(165,180,252,0.85);
  display: flex; align-items: center; gap: 10px;
}

/* ─── LOBBY SCREEN ──────────────────────────────────── */
#lobby-screen {
  display: flex; flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid rgba(16,185,129,0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 0 30px var(--emerald-glow);
}

.lobby-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px; margin-bottom: 16px;
}

.lobby-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lobby-title i { color: var(--emerald); }
.lobby-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.lobby-code-wrap { text-align: right; }
.lobby-code-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); }

.lobby-code-box {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
}

#lobby-code-display {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px; color: var(--emerald);
  background: var(--bg-card2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  letter-spacing: 4px;
}

.lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 600px) { .lobby-grid { grid-template-columns: 1fr; } }

.lobby-panel {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.lobby-panel-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.lobby-panel-title i { color: var(--indigo); }

#lobby-active-map-label {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}

#lobby-map-picker .lobby-map-sub { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }

.lobby-map-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.lmap-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 12px 4px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.lmap-emoji { font-size: 24px; line-height: 1; }
.lmap-name { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.lmap-btn:hover { border-color: var(--border-light); color: var(--text); transform: translateY(-1px); }
.lmap-btn.active { background: rgba(99,102,241,0.14); border-color: var(--indigo); color: #fff; box-shadow: 0 0 0 1px rgba(99,102,241,0.35), 0 4px 12px rgba(99,102,241,0.25); }
.lmap-btn.active .lmap-emoji { filter: drop-shadow(0 0 6px rgba(99,102,241,0.5)); }

.lobby-env-info {
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}
.lobby-env-info-label { font-size: 10px; font-weight: 700; color: var(--indigo); margin-bottom: 4px; }
#map-desc-text { font-size: 12px; color: var(--text-muted); }

#lobby-players-container { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }

.player-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
}

.player-row-left { display: flex; align-items: center; gap: 8px; }
.player-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.player-name { font-weight: 700; color: var(--text); }
.badge-host { font-size: 9px; background: rgba(245,158,11,0.15); color: var(--amber); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(245,158,11,0.25); font-weight: 600; }
.badge-kick { font-size: 9px; background: rgba(239,68,68,0.15); color: var(--rose); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(239,68,68,0.25); font-weight: 600; cursor: pointer; }
.badge-kick:hover { background: rgba(239,68,68,0.3); }
.player-row-right { display: flex; align-items: center; gap: 8px; }
.player-role { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.player-ready-yes { font-size: 10px; font-weight: 700; color: var(--emerald); }
.player-ready-no  { font-size: 10px; font-weight: 700; color: var(--amber); }

.lobby-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }

/* ─── GAME ARENA ─────────────────────────────────────── */
#game-arena {
  display: flex; flex-direction: column;
  background: rgba(15,22,35,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  gap: 8px;
}

/* HUD BAR */
.hud-bar {
  display: flex; align-items: stretch; gap: 10px;
  background: linear-gradient(180deg, rgba(30,41,71,0.96), rgba(13,19,32,0.96));
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 9px 11px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Role chip ── */
.hud-role {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 12px 5px 6px;
}
.hud-role-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  font-size: 19px; color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.hud-role-icon-hunter { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.45); color: var(--rose); box-shadow: 0 0 14px rgba(239,68,68,0.25), inset 0 1px 0 rgba(255,255,255,0.06); }
.hud-role-icon-hider  { background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.45); color: var(--indigo); box-shadow: 0 0 14px rgba(99,102,241,0.25), inset 0 1px 0 rgba(255,255,255,0.06); }

.hud-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(100,116,139,0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100,116,139,0.25);
}
.hud-badge-hunter { background: rgba(239,68,68,0.12); color: var(--rose); border-color: rgba(239,68,68,0.3); }
.hud-badge-hider  { background: rgba(99,102,241,0.12); color: var(--indigo); border-color: rgba(99,102,241,0.3); }

.hud-role-name { font-weight: 800; font-size: 13px; color: var(--text); margin-top: 3px; }

/* ── Center timer capsule ── */
.hud-timer-wrap {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(245,158,11,0.14), transparent 65%),
    var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 6px 18px;
}
.hud-phase {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.hud-phase::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px var(--amber);
}
.hud-timer {
  font-family: 'Press Start 2P', monospace;
  font-size: 22px; color: var(--amber); font-weight: 700; line-height: 1;
  text-shadow: 0 0 16px rgba(245,158,11,0.55);
  letter-spacing: 1px;
}

/* ── Right-side stat cards + actions ── */
.hud-right { display: flex; align-items: stretch; gap: 8px; flex-shrink: 0; }

.hud-stat {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 12px 5px 6px;
}
.hud-stat-ico {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.hud-stat-lives .hud-stat-ico { background: rgba(239,68,68,0.14); color: var(--rose); border: 1px solid rgba(239,68,68,0.35); }
.hud-stat-props .hud-stat-ico { background: rgba(99,102,241,0.14); color: var(--indigo); border: 1px solid rgba(99,102,241,0.35); }
.hud-stat-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hud-stat-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); white-space: nowrap; }
.hud-hearts { display: flex; gap: 3px; color: var(--rose); font-size: 13px; line-height: 1; }
.hud-hearts .fa-solid { filter: drop-shadow(0 0 4px rgba(239,68,68,0.45)); }
/* spent hearts (set by JS as .opacity-20) fade out so remaining lives read at a glance */
.opacity-20 { opacity: 0.22; }
.hud-props-count { font-size: 18px; font-weight: 900; color: var(--text); line-height: 1; }

.hud-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12px; font-weight: 800;
  border: none; cursor: pointer;
  transition: all 0.15s;
}
.hud-btn-lock { background: rgba(139,92,246,0.2); color: var(--purple); border: 1px solid rgba(139,92,246,0.4); }
.hud-btn-lock:hover, .hud-btn-lock.locked { background: rgba(16,185,129,0.2); color: var(--emerald); border-color: rgba(16,185,129,0.4); }
.hud-btn-quit { background: var(--bg-panel); color: var(--text-muted); border: 1px solid var(--border); font-size: 15px; }
.hud-btn-quit:hover { background: rgba(239,68,68,0.15); color: var(--rose); border-color: rgba(239,68,68,0.35); }
.hud-btn-done { background: rgba(16,185,129,0.18); color: var(--emerald); border: 1px solid rgba(16,185,129,0.4); }
.hud-btn-done:hover { background: rgba(16,185,129,0.32); }
.hud-btn-done:disabled { opacity: 0.5; cursor: default; }
.hud-btn-label { display: none; }

@media (min-width: 600px) { .hud-btn-label { display: inline; } }

/* ARENA PANELS */
.arena-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }

.arena-panel { display: flex; flex-direction: column; min-width: 0; }

.panel-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; padding: 0 2px;
}

.panel-label-text {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  display: flex; align-items: center; gap: 6px;
}

.panel-label-live { color: var(--indigo); }
.panel-label-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--indigo); animation: ping 1.5s ease-in-out infinite; }
.panel-label-blue { color: var(--emerald); }

.canvas-wrap {
  position: relative;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card2);
  overflow: hidden;
}

#live-canvas {
  display: block; width: 100%; height: auto;
  aspect-ratio: 800/600;
  cursor: crosshair;
  border-radius: calc(var(--radius) - 2px);
  outline: none;
}

#blueprint-canvas {
  display: block; width: 100%; height: auto;
  aspect-ratio: 800/600;
  opacity: 0.9;
  border-radius: calc(var(--radius) - 2px);
}

/* ─── DISGUISE PICKER (hider right panel) ─────────────── */
#prop-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  padding: 4px;
  max-height: 460px;
  overflow-y: auto;
}
.prop-pick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.prop-pick:hover { border-color: var(--border-light); }
.prop-pick.active { border-color: var(--purple); background: rgba(139,92,246,0.12); box-shadow: 0 0 10px rgba(139,92,246,0.3); }
.prop-pick canvas { width: 128px; height: 128px; display: block; }
.prop-pick-name { font-size: 12px; font-weight: 700; color: var(--text-muted); text-align: center; line-height: 1.25; }
.prop-pick.active .prop-pick-name { color: var(--text); }

/* ── DISGUISE PICKER - phones/small tablets (incl. landscape, which can be up to ~930px
   wide, so the breakpoint must be well above 768px or it never triggers on a real device). ── */
@media (max-width: 950px) {
  /* Fixed compact tiles packed many-per-row and centred, in a container that's SHORTER than
     the game view beside it. All 8 props land in ~2 rows - nothing scrolls off the bottom. */
  #prop-picker {
    grid-template-columns: repeat(4, 1fr);   /* exactly 4 props per row */
    align-content: start;
    gap: 6px;
    padding: 4px;
    max-height: 210px;
    overflow-y: auto;
  }
  .prop-pick {
    padding: 4px 2px; gap: 2px;
    border-width: 1.5px; border-radius: 8px;
  }
  .prop-pick canvas { width: 66px; height: 66px; }   /* scaled up to fill the wider tiles */
  .prop-pick-name {
    font-size: 9px; font-weight: 700; line-height: 1.1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
}

#cam-follow-btn {
  position: absolute; top: 10px; right: 10px; z-index: 8;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 20px;
  background: rgba(15,22,35,0.82); border: 1px solid rgba(129,140,248,0.55);
  color: #e2e8f0; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all 0.12s;
}
#cam-follow-btn:hover { border-color: #818cf8; background: rgba(30,41,59,0.92); }
#cam-follow-btn i { color: #818cf8; }
@media (max-width: 600px) { #cam-follow-btn { top: 7px; right: 7px; padding: 5px 9px; font-size: 10px; } }

#hunter-blind-overlay {
  position: absolute; inset: 0;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  border-radius: calc(var(--radius) - 2px);
  z-index: 10;
}

.blind-icon { font-size: 48px; color: var(--indigo); margin-bottom: 16px; animation: pulse 2s ease-in-out infinite; }
.blind-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.blind-desc { font-size: 12px; color: var(--text-muted); max-width: 320px; line-height: 1.7; }

/* ─── DESKTOP ACTION BAR ────────────────────────────── */
.arena-actions {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 4px;
}

#hider-toolbar { display: flex; flex-direction: column; gap: 8px; }
.hider-toolbar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hider-toolbar-label i { color: var(--purple); }

#prop-selection-container, #prop-selection-container-mobile { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── GAME LOGS ─────────────────────────────────────── */
.arena-logs {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 4px;
}
.arena-logs-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 6px; }
#game-logs-container { font-size: 11px; max-height: 80px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; word-break: break-word; }
#game-logs-container > * { color: var(--text-muted); }

/* ─── GAME OVER MODAL ────────────────────────────────── */
#gameover-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11,15,25,0.85);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

.gameover-card {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 20px;
}

.gameover-corner { position: absolute; width: 24px; height: 24px; border-color: var(--indigo); border-style: solid; }
.gameover-corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.gameover-corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.gameover-tag {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 3px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(16,185,129,0.1); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3);
  display: inline-block;
}

.gameover-title { font-size: 22px; font-weight: 900; color: var(--text); line-height: 1.2; }
.gameover-sub { font-size: 13px; color: var(--text-muted); }

.gameover-scores {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.score-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.score-row:last-child { border-bottom: none; padding-bottom: 0; }
.score-label { color: var(--text-muted); }
.score-value { font-weight: 700; color: var(--text); }

.gameover-btns { display: flex; gap: 10px; }

/* ─── FOOTER ─────────────────────────────────────────── */
footer {
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  font-size: 11px; color: var(--text-dim);
}

/* ─── MOBILE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  #app { padding: 6px; gap: 6px; }
  header { padding: 8px 12px; }
  .header-title { font-size: 15px; }
  .hud-timer { font-size: 16px; }
  .hud-bar { border-radius: 13px; padding: 6px 7px; gap: 6px; }
  .hud-role { display: none; }
  .hud-timer-wrap { padding: 4px 10px; }
  .hud-stat { padding: 4px 9px; gap: 7px; }
  .hud-stat-ico { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
  .hud-props-count { font-size: 16px; }
  .hud-hearts { font-size: 11px; }
  .arena-actions, .arena-logs { display: none; }
  .gameover-card { padding: 20px; }
}

@media (max-width: 900px) {
  #menu-screen { grid-template-columns: 1fr; }
}

/* ─── LOBBY VISIBILITY TOGGLE ───────────────────── */
.visibility-toggle {
  display: flex; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px; gap: 2px; cursor: pointer;
}
.vis-opt {
  padding: 4px 10px; border-radius: 18px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  transition: all 0.15s; user-select: none;
}
.vis-opt.vis-active { background: var(--indigo); color: #fff; }

/* ─── PUBLIC LOBBY BROWSER ───────────────────────── */
.lobby-browser-empty { font-size: 11px; color: var(--text-dim); text-align: center; padding: 10px 0; }

.lobby-browser-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  gap: 8px;
}
.lobby-browser-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lobby-browser-map  { font-size: 20px; flex-shrink: 0; }
.lobby-browser-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-browser-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ─── VIRTUAL JOYSTICK ──────────────────────────── */
#joystick-wrap {
  position: absolute;
  bottom: 14px; left: 14px;
  z-index: 7;
  pointer-events: none; /* touch events are caught by the canvas listener */
}
#joystick-base {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.14);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
#joystick-knob {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.32);
  position: absolute;
  /* knob offset set via JS transform */
  will-change: transform;
}

/* ─── PROP OVERLAP WARNING BANNER ───────────────── */
#prop-overlap-warning {
  position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  z-index: 8;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(239,68,68,0.6);
  animation: warnPulse 0.7s ease-in-out infinite;
}
@keyframes warnPulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

/* ─── PORTRAIT WARNING ───────────────────────────── */
#portrait-warning {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-base);
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
@keyframes spinonce { 0%,100%{transform:rotate(0deg)} 45%,55%{transform:rotate(-90deg)} }
@media (orientation: portrait) and (max-width: 900px) {
  body.gameplay-active:not(.menu-open) #portrait-warning { display: flex; }
}

/* ─── MODAL OVERLAY ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11,15,25,0.88);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* ─── MP SUMMARY CARD ────────────────────────────── */
.summary-card {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow);
}

.summary-stats {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.summary-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.summary-stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.summary-label { color: var(--text-muted); }
.summary-value { font-weight: 700; color: var(--text); }

/* ─── MENU FLOW ──────────────────────────────────────── */
.menu-flow { display: flex; flex-direction: column; gap: 14px; }
.menu-step { display: none; flex-direction: column; gap: 14px; }
.menu-step.active { display: flex; }

.mode-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 600px) { .mode-hero { grid-template-columns: 1fr; } }

.mode-hero-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px 24px;
  background: var(--bg-card2); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.18s; text-align: center;
}
.mode-hero-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.mode-hero-card.solo:hover { border-color: var(--indigo); background: rgba(99,102,241,0.08); }
.mode-hero-card.multi:hover { border-color: var(--emerald); background: rgba(16,185,129,0.08); }
.mode-hero-icon { font-size: 36px; }
.mode-hero-title { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.mode-hero-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.flow-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-muted); cursor: pointer;
  padding: 4px 0; width: fit-content; background: none; border: none;
  transition: color 0.12s;
}
.flow-back:hover { color: var(--text); }

.solo-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.solo-role-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card2); cursor: pointer; transition: all 0.15s; color: var(--text-muted);
  font-size: 11px; font-weight: 700;
}
.solo-role-btn:hover { border-color: var(--border-light); color: var(--text); }
.solo-role-btn i { font-size: 22px; }

.multi-actions { display: flex; flex-direction: column; gap: 8px; }
.multi-action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
  font-size: 13px; font-weight: 700; color: var(--text); width: 100%; text-align: left;
}
.multi-action-btn i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.multi-action-btn .action-sub { display: block; font-size: 10px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.multi-action-btn:hover { border-color: var(--border-light); background: var(--bg-card); }
.multi-action-btn.host-btn:hover { border-color: var(--emerald); }
.multi-action-btn.join-btn:hover { border-color: var(--indigo); }
.multi-action-btn.browse-btn:hover { border-color: var(--amber); }

.multi-sub-panel { display: none; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.multi-sub-panel.visible { display: flex; }

.solo-settings-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 480px) { .solo-settings-compact { grid-template-columns: 1fr; } }
.solo-setting { display: flex; flex-direction: column; gap: 3px; }
.solo-setting label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); }

/* ─── HOST GAME SETTINGS ─────────────────────────────── */
.host-settings { margin-top: 14px; }
.host-settings-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setting-row {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.setting-row.full-width { grid-column: 1 / -1; }
.setting-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.setting-control { display: flex; align-items: center; gap: 6px; }
.setting-select {
  flex: 1; background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text); font-size: 13px;
  font-family: inherit; outline: none; cursor: pointer;
}
.setting-select:focus { border-color: var(--indigo); }
.setting-toggle {
  display: flex; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px; cursor: pointer; flex: 1;
}
.stog-opt {
  flex: 1; text-align: center; padding: 3px 6px;
  border-radius: 18px; font-size: 10px; font-weight: 700; color: var(--text-muted);
  transition: all 0.12s; user-select: none;
}
.stog-opt.active { background: var(--indigo); color: #fff; }
.hunter-player-select { display: none; }
.hunter-player-select.visible { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.hunter-pick-btn {
  padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 700;
  background: var(--bg-card2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
}
.hunter-pick-btn.chosen { background: var(--rose); border-color: var(--rose); color: #fff; }
/* ═══════════════════════════════════════════════════════════════════════
   UI FACELIFT - logo, hero, flow, responsiveness (desktop / portrait / landscape)
   Appended last so it wins the cascade over the base styles above.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── LOGO ── */
.logo-svg { height: 44px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5)); }
.beta-badge {
  align-self: flex-start; margin-top: 4px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; line-height: 1;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  text-transform: uppercase;
}
.logo-hero { height: 86px; margin: 0 auto; }
header { padding: 10px 16px; }
.header-sub { display: none; }

/* ── HERO (menu step 0) ── */
.hero-brand { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hero-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 15px; color: var(--amber);
  text-shadow: 0 0 12px rgba(245,158,11,0.45);
  letter-spacing: 1px;
}
/* rotating word inside the hero tagline */
.hero-rotate {
  display: inline-block; min-width: 3.8em; text-align: center;
  color: var(--emerald); text-shadow: 0 0 12px rgba(16,185,129,0.5);
}
.hero-rotate #hero-rotate-word {
  display: inline-block;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.hero-rotate.swap #hero-rotate-word { opacity: 0; transform: translateY(-40%); }
.hero-desc { font-size: 13px; color: var(--text-muted); line-height: 1.75; max-width: 480px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--text-muted);
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 4px 10px; border-radius: 20px;
}
.chip i { color: var(--indigo); font-size: 10px; }

/* ── MODE CARDS ── */
.mode-hero { gap: 24px; }
.mode-hero-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 7px;
  cursor: pointer; overflow: hidden;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.mode-hero-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120px 60px at 20% 0%, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}
.mode-hero-card.solo  { background: linear-gradient(160deg, rgba(99,102,241,0.14), rgba(99,102,241,0.02)); }
.mode-hero-card.multi { background: linear-gradient(160deg, rgba(16,185,129,0.14), rgba(16,185,129,0.02)); }
.mode-hero-card:hover { transform: translateY(-3px); }
.mode-hero-card.solo:hover  { border-color: var(--indigo);  box-shadow: 0 8px 28px rgba(99,102,241,0.28); }
.mode-hero-card.multi:hover { border-color: var(--emerald); box-shadow: 0 8px 28px rgba(16,185,129,0.28); }
/* giant faint icon watermark drifting in the corner */
.mode-watermark {
  position: absolute; right: -8px; bottom: -14px; z-index: 0;
  font-size: 96px; opacity: 0.06; pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}
.mode-hero-card:hover .mode-watermark { transform: rotate(-6deg) scale(1.06); opacity: 0.09; }
.mode-badge, .mode-hero-title, .mode-hero-sub, .mode-pill, .mode-hero-cta { position: relative; z-index: 1; }
/* circular gradient icon badge */
.mode-badge {
  width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  transition: transform 0.18s;
}
.mode-hero-card.solo  .mode-badge { background: linear-gradient(140deg, #818cf8, #4338ca); box-shadow: 0 6px 18px rgba(99,102,241,0.4); }
.mode-hero-card.multi .mode-badge { background: linear-gradient(140deg, #34d399, #0b8a63); box-shadow: 0 6px 18px rgba(16,185,129,0.4); }
.mode-hero-card:hover .mode-badge { transform: scale(1.08) rotate(-4deg); }
.mode-hero-title { font-size: 18px; font-weight: 900; letter-spacing: 0.3px; }
.mode-hero-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.mode-pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px;
}
.mode-hero-card.solo  .mode-pill { color: #a5b4fc; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3); }
.mode-hero-card.multi .mode-pill { color: #6ee7b7; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); }
.mode-pill i { font-size: 9px; }
.mode-hero-cta {
  margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; font-weight: 900; letter-spacing: 1.5px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: #fff;
}
.mode-hero-card.solo  .mode-hero-cta { background: linear-gradient(135deg, var(--indigo), var(--indigo-dark)); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.mode-hero-card.multi .mode-hero-cta { background: linear-gradient(135deg, #14c08d, #0b8a63); box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
.mode-hero-card:hover .mode-hero-cta i { transform: translateX(3px); }
.mode-hero-cta i { transition: transform 0.16s; }

/* ── STEP HEADER + CRUMBS ── */
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flow-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
}
.flow-back:hover { color: var(--text); border-color: var(--border-light); }
.step-crumbs {
  display: flex; align-items: center; gap: 7px;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim);
}
.step-crumbs > i { font-size: 8px; }
.crumb { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 14px; border: 1px solid transparent; }
.crumb.done { color: var(--emerald); background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.25); }
.crumb.now  { color: var(--indigo);  background: rgba(99,102,241,0.1);  border-color: rgba(99,102,241,0.3); }

/* ── SECTION CARDS + MAP GRID ── */
.section-card { background: rgba(255,255,255,0.03); transition: border-color 0.15s; }
.section-card:hover { border-color: var(--border-light); }
/* Map cards - each button IS a snapshot of its map (floor + a couple of props) with the name */
.map-cards { grid-template-columns: repeat(3, 1fr); gap: 9px; }
.map-card {
  position: relative; padding: 0; overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 12px;
  aspect-ratio: 200 / 104;
  background: #0c1018;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.map-card-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-card::after {                       /* readability scrim behind the name */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,5,10,0.82) 0%, rgba(3,5,10,0.25) 45%, rgba(3,5,10,0) 72%);
  pointer-events: none;
}
.map-card .map-card-name {
  position: absolute; left: 0; right: 0; bottom: 7px; z-index: 2;
  text-align: center;
  font-size: 13px; font-weight: 800; letter-spacing: 0.4px;
  color: #f1f5f9;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9);
}
.map-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.map-card.active { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(99,102,241,0.35), 0 6px 18px rgba(99,102,241,0.3); }
.map-card.active .map-card-name { color: #fff; }
.map-card.active::before {                /* corner "selected" check */
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 5px; right: 6px; z-index: 3;
  font-size: 9px; color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--indigo); box-shadow: 0 0 8px rgba(99,102,241,0.7);
  display: flex; align-items: center; justify-content: center;
}

/* ── BUTTONS / INPUTS POLISH ── */
.btn-primary { background: linear-gradient(135deg, #7577f5, var(--indigo-dark)); }
.btn-success { background: linear-gradient(135deg, #16c895, #0b8a63); }
.btn-danger  { background: linear-gradient(135deg, #f26060, #c92626); }
.btn:active { transform: scale(0.97); }
#solo-start-btn { padding: 12px 16px; font-size: 14px; letter-spacing: 1px; }
input[type=text]:focus, input[type=email]:focus, textarea:focus, .setting-select:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

/* ── FEATURES LIST (menu right) ── */
.feat-list { display: flex; flex-direction: column; gap: 10px; }
.feat-item { display: flex; gap: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.55; align-items: flex-start; }
.feat-item i { color: var(--amber); margin-top: 2px; width: 14px; text-align: center; flex-shrink: 0; }
.feat-item strong { color: var(--text); }

/* ── FOOTER ── */
footer { font-size: 12px; }
footer strong { color: var(--text-muted); letter-spacing: 1px; }

/* ═══ RESPONSIVE ══════════════════════════════════════ */
/* Tablets & phones - single column, tighter spacing, bigger touch targets */
@media (max-width: 950px) {
  #app { padding: 8px; }
  #menu-screen { grid-template-columns: 1fr; padding: 18px 14px; gap: 18px; }
  .logo-hero { height: 64px; max-width: 100%; }
  .hero-desc { font-size: 12px; }
  .map-cards { grid-template-columns: repeat(3, 1fr); }
  .map-card { padding: 12px 6px; }
  .mode-hero-card { padding: 16px 14px 12px; }
  .btn, .multi-action-btn, .solo-role-btn { min-height: 42px; }
  .step-crumbs { display: none; }   /* keep step headers clean on small screens */
}
/* Narrow portrait phones */
@media (max-width: 520px) {
  .mode-hero { grid-template-columns: 1fr; }
  .map-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .map-card-icon { font-size: 18px; }
  .hero-chips .chip { font-size: 9px; padding: 3px 8px; }
  header { flex-direction: row; }
  .logo-svg { height: 34px; }
}
/* Short landscape phones - compress vertical chrome so the menu fits with minimal scrolling */
@media (max-height: 560px) and (orientation: landscape) {
  #menu-screen { padding: 14px 16px; gap: 14px; }
  .logo-hero { height: 52px; }
  .hero-desc, .hero-chips { display: none; }   /* logo + tagline carry the hero */
  .hero-tag { font-size: 10px; }
  .mode-hero-card { padding: 12px 12px 10px; gap: 5px; }
  .mode-badge { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .mode-hero-sub { display: none; }
  header { padding: 6px 12px; margin-bottom: 6px; }
  .logo-svg { height: 32px; }
  footer { display: none; }
  /* during a match on a short landscape phone, give the arena every pixel */
  body.gameplay-active:not(.menu-open) header { display: none; }
  /* compress the match HUD so the arena keeps its height */
  .hud-bar { padding: 4px 6px; gap: 6px; border-radius: 11px; }
  .hud-role { padding: 3px 8px 3px 4px; }
  .hud-role-icon { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
  .hud-role-name { font-size: 11px; margin-top: 1px; }
  .hud-timer-wrap { padding: 3px 10px; gap: 1px; }
  .hud-timer { font-size: 15px; }
  .hud-phase { font-size: 8px; letter-spacing: 2px; }
  .hud-stat { padding: 3px 8px 3px 4px; gap: 6px; border-radius: 9px; }
  .hud-stat-ico { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
  .hud-stat-label { font-size: 8px; letter-spacing: 1px; }
  .hud-props-count { font-size: 15px; }
  .hud-hearts { font-size: 10px; }
  .hud-btn { padding: 0 9px; font-size: 11px; }

  /* Fit the entire match in the device height: timer/HUD bar on top, then the map + blueprint
     fill the remaining height with NO page scroll. The live map scrolls internally to follow
     the player (see the render camera), so a short landscape canvas still shows a tall arena. */
  body.gameplay-active:not(.menu-open) #app { height: 100vh; height: 100dvh; overflow: hidden; padding: 4px 6px; gap: 4px; display: flex; flex-direction: column; }
  body.gameplay-active:not(.menu-open) main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 0; padding: 0; }
  body.gameplay-active:not(.menu-open) #game-arena { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
  body.gameplay-active:not(.menu-open) .hud-bar { flex: 0 0 auto; }
  body.gameplay-active:not(.menu-open) .arena-grid { flex: 1 1 auto; min-height: 0; gap: 6px; align-items: stretch; }
  body.gameplay-active:not(.menu-open) .arena-panel { min-height: 0; }
  body.gameplay-active:not(.menu-open) .panel-label { display: none; }
  body.gameplay-active:not(.menu-open) .arena-logs, body.gameplay-active:not(.menu-open) .arena-actions { display: none; }
  body.gameplay-active:not(.menu-open) .canvas-wrap { flex: 1 1 auto; min-height: 0; height: 100%; }
  body.gameplay-active:not(.menu-open) #live-canvas,
  body.gameplay-active:not(.menu-open) #blueprint-canvas { width: 100%; height: 100%; aspect-ratio: auto; }
  body.gameplay-active:not(.menu-open) #prop-picker { max-height: 100%; margin: 0; }
}



/*tables*/

/* Table List*/
.table-list {
    width: 100%;
    padding: 0px;
    margin: 0px 0px 0px 0px;
    border-spacing: 0px;
    border-collapse: separate !important;
    border-left: 1px solid var(--border-light);
}



    .table-list th {
        padding: 9px 10px 7px 10px;
        border-bottom: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
        color: var(--clr-BodyTextColor);
        font-weight: bold;
        font-size: 13px;
        vertical-align: bottom;
        background: var(--bg-card);
    }

        .table-list th a:link, .table-list th a:visited {
             font-weight: bold;
            margin: 0px;
        }

        .table-list th a:hover {
            text-decoration: underline;
            font-weight: bold;
            margin: 0px;
        }

    .table-list td {
        padding: 9px 10px 7px 10px;
        border-bottom: 1px solid var(--border-light);
        border-right: 1px solid var(--border-light);
    }

.table-list-stickyheader th {
    position: sticky;
    top: 0px;
}

.table-list-container {
    border-top: 2px solid var(--border);
}

.table-list-scrollcontainer {
    overflow-y: scroll;
    max-height: 300px;
    border-bottom: 1px solid var(--border-light);
    border-top: 2px solid var(--border);
}

.table-list-td-last {
    padding-right: 0px !important;
}


.table-list a:link, .table-list a:visited {
    text-decoration: none;
}

.table-list a:hover {
    text-decoration: underline;
}

.table-list-row {
    
}

    .table-list-row:hover {
        /* background: #EFEFEF;*/
    }



.table-list-row-header {
    background: var(--bg-card);
    font-weight: bold;
}

.table-list-row-alternate {
    background: var(--bg-card);
}

    .table-list-row-alternate:hover {
        /* background: #EFEFEF;*/
    }





.table-list-row-empty {
  
}

.table-list-footer td {
    border-bottom: 1px solid var(--border-light);
    padding: 10px 0px 10px 16px;
    background: var(--bg-card);
}

.table-list-pager td {
    padding: 4px 10px 3px 10px;
    border-bottom: 1px solid var(--border-light);
    background: #F6F6F6;
}

.table-list-pager table {
    margin: 0px;
    padding: 0px;
}

    .table-list-pager table td {
        border: none;
        padding: 0px 8px 0px 0px;
    }

        .table-list-pager table td span {
            text-decoration: underline;
            font-weight: bold;
        }

        .table-list-pager table td a:link, .table-list-pager table td a:visited {
        }

        .table-list-pager table td a:hover {
            text-decoration: underline;
        }

a.table-list-button {
    margin-left: 10px;
}

a:hover.table-list-button {
    margin-left: 10px;
}

a.table-list-button:active {
    margin-left: 10px;
}

.table-list-section {
    width: 50%;
    float: left;
}

.table-list-profilephoto img {
    object-fit: cover;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    box-sizing: border-box;
    display: block;
    margin: 0px auto;
}

.table-pager {
    padding-right: 14px !important;
    padding-left: 8px !important;
    padding-top: 8px;
    padding-bottom: 8px;
    margin: 0px;
    border-spacing: 0px;
    border-collapse: separate;
}

    .table-pager td {
        padding: 5px 0px 5px 5px;
        margin: 0px;
        border: none !important;
    }
