/* ── Design Tokens ────────────────────────────────────── */

:root {
  --bg-primary: #080810;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.055);
  --border-card: rgba(255, 255, 255, 0.07);
  --gold: #f7c948;
  --gold-dark: #e8a420;
  --gold-glow: rgba(247, 201, 72, 0.25);
  --green: #22c55e;
  --purple: #a855f7;
  --red: #ef4444;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.25);
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-ui: 'Barlow Condensed', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius-card: 14px;
  --radius-btn: 8px;
}

/* ── Reset + Base ────────────────────────────────────── */

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

body {
  background: var(--bg-primary);
  color: #fff;
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ── Menu / Dashboard Screen ─────────────────────────── */

#menu-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 50% 20%, rgba(247,201,72,0.04) 0%, transparent 60%);
}

/* ── Header Bar ──────────────────────────────────────── */

.arena-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-card);
  background: rgba(8, 8, 16, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-icon { font-size: 1.3rem; }
.header-welcome {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Hero title section */
.hero-title-section {
  text-align: center;
  padding: 18px 24px 4px;
  flex-shrink: 0;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  letter-spacing: 0.14em;
  color: var(--text-primary);
  line-height: 1;
  font-weight: 400;
  text-shadow: 0 0 60px rgba(247,201,72,0.08);
}
.title-accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  letter-spacing: 0.42em;
  color: rgba(247,201,72,0.65);
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
}

.header-right { display: flex; align-items: center; }
.wallet-connect-btn {
  font-family: var(--font-ui);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s;
}
.wallet-connect-btn:hover {
  background: rgba(247, 201, 72, 0.1);
  box-shadow: 0 0 16px var(--gold-glow);
}

/* ── Dashboard Grid ──────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 18px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 24px 24px;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Card Base ───────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 16px;
  transition: border-color 0.2s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.card-action-btn {
  font-family: var(--font-ui);
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-btn);
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}
.card-action-btn:hover { border-color: rgba(255,255,255,0.3); color: var(--text-primary); }

/* ── Live Badge ──────────────────────────────────────── */

.live-badge {
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 10px;
  padding: 3px 10px;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--green); }
  50% { opacity: 0.4; box-shadow: 0 0 8px var(--green); }
}

/* ── Empty State ─────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.empty-state-icon { font-size: 1.6rem; margin-bottom: 6px; opacity: 0.4; }

/* ── Leaderboard ─────────────────────────────────────── */

#leaderboard { display: block; }
#leaderboard-list { min-height: 40px; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem;
}
.lb-rank { width: 22px; text-align: right; color: var(--text-muted); font-size: 0.72rem; font-weight: 700; }
.lb-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-wins { color: var(--gold); font-weight: 700; min-width: 28px; text-align: right; }
.lb-winrate { color: #88ccff; font-size: 0.72rem; min-width: 36px; text-align: right; }
.lb-kd { color: var(--text-muted); font-size: 0.7rem; min-width: 38px; text-align: right; }
.lb-empty { color: var(--text-muted); font-size: 0.8rem; padding: 12px 0; text-align: center; }

/* ── Entry Panel (Center Column) ─────────────────────── */

.card-entry {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#nickname-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-size: 1rem;
  color: #fff;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
#nickname-input:focus { border-color: var(--gold); }
#nickname-input::placeholder { color: var(--text-muted); }

/* ── Cosmetic Picker ─────────────────────────────────── */

#cosmetic-picker { display: flex; flex-direction: column; gap: 10px; }
.cosmetic-row { display: flex; flex-direction: column; gap: 5px; }
.cosmetic-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.2); }
.swatch.selected { border-color: #fff; transform: scale(1.15); }
.hat-choices { display: flex; gap: 5px; flex-wrap: wrap; }
.hat-btn {
  font-family: var(--font-ui);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.hat-btn:hover { border-color: rgba(255,255,255,0.3); color: var(--text-primary); }
.hat-btn.selected { border-color: var(--gold); color: var(--gold); background: rgba(247,201,72,0.06); }

/* ── Bet Selector ────────────────────────────────────── */

.bet-selector { display: flex; flex-direction: column; gap: 5px; }
.bet-row { display: flex; gap: 8px; }
.bet-btn {
  font-family: var(--font-display);
  flex: 1;
  background: transparent;
  border: 1px solid rgba(247,201,72,0.35);
  border-radius: var(--radius-btn);
  padding: 12px 0;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.bet-btn:hover { border-color: var(--gold); transform: scale(1.03); box-shadow: 0 0 12px var(--gold-glow); }
.bet-btn.selected {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  border-color: transparent;
  box-shadow: 0 0 16px var(--gold-glow);
}
.bet-edit-btn {
  flex: 0 0 auto;
  padding: 12px 14px;
  font-size: 1rem;
}
.bet-edit-btn.active {
  border-color: rgba(247,201,72,0.6);
  color: var(--gold);
}
.bet-custom-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(247,201,72,0.35);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  outline: none;
  margin-top: 8px;
  transition: border-color 0.2s;
}
.bet-custom-input:focus { border-color: var(--gold); }
.bet-custom-input::placeholder { color: var(--text-muted); font-family: var(--font-body); font-size: 0.82rem; letter-spacing: 0; }

/* ── CTA Button ──────────────────────────────────────── */

.cta-enter-arena {
  font-family: var(--font-display);
  position: relative;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0808;
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  padding: 16px 0;
  border: none;
  border-radius: var(--radius-btn);
  width: 100%;
  cursor: pointer;
  transition: transform 0.15s;
  animation: ctaPulse 2.5s ease-in-out infinite;
}
.cta-enter-arena:hover { transform: scale(1.02); }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 20px var(--gold-glow); }
  50% { box-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(247,201,72,0.1); }
}

/* ── Cancel matchmaking button ───────────────────────── */

.cta-cancel-btn {
  font-family: var(--font-body);
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: var(--radius-btn);
  width: 100%;
  cursor: pointer;
  margin-top: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.cta-cancel-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── CTA sub-text ────────────────────────────────────── */

.cta-sub {
  font-family: var(--font-body);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: -6px;
}

/* ── OR Divider ──────────────────────────────────────── */

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-card);
}

/* ── Join Existing Room ──────────────────────────────── */

.join-existing { display: flex; flex-direction: column; }

#join-row { display: flex; gap: 8px; }
#room-code-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: #fff;
  outline: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
#room-code-input:focus { border-color: var(--gold); }
#room-code-input::placeholder { color: var(--text-muted); letter-spacing: 0; text-transform: none; }

#join-room-btn {
  font-family: var(--font-ui);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-btn);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
#join-room-btn:hover { border-color: rgba(255,255,255,0.6); color: #fff; }

#join-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #ff7070;
}

/* ── Lobby Section ───────────────────────────────────── */

.card-lobby {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#room-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(247,201,72,0.06);
  border: 1px solid rgba(247,201,72,0.15);
  border-radius: var(--radius-btn);
  padding: 8px 12px;
}
.room-code-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,201,72,0.5);
  white-space: nowrap;
}
#room-code-value {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--gold);
  flex: 1;
}
#copy-link-btn, #leave-room-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
#copy-link-btn:hover { border-color: var(--gold); color: var(--gold); }
#leave-room-btn:hover { border-color: rgba(255,100,100,0.5); color: rgba(255,120,120,0.85); }

/* ── Host Controls ───────────────────────────────────── */

#host-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(247,201,72,0.04);
  border: 1px solid rgba(247,201,72,0.12);
  border-radius: var(--radius-btn);
  padding: 7px 12px;
}
.host-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,201,72,0.5);
}
#limit-control { display: flex; align-items: center; gap: 8px; }
#limit-dec, #limit-inc {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#limit-dec:hover, #limit-inc:hover { background: rgba(255,255,255,0.15); }
#limit-value { font-size: 1.1rem; font-weight: 700; color: var(--gold); min-width: 16px; text-align: center; }

/* ── Lobby Info ──────────────────────────────────────── */

.lobby-info { display: flex; flex-direction: column; gap: 0.25rem; color: var(--text-secondary); font-size: 0.88rem; }
#lobby-countdown { font-size: 1.8rem; font-weight: 700; color: var(--gold); }

#lobby-players { display: flex; flex-wrap: wrap; gap: 6px; }
.lobby-player {
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.lobby-player.is-ready { border-color: var(--green); color: var(--green); }
.lobby-player.is-host { border-color: rgba(247,201,72,0.35); }
.host-crown { color: var(--gold); font-size: 0.75rem; margin-right: 4px; }
.kick-btn {
  background: transparent;
  border: 1px solid rgba(244,67,54,0.4);
  border-radius: 4px;
  color: rgba(244,67,54,0.7);
  font-size: 0.65rem;
  padding: 1px 5px;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.kick-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Ready Button ────────────────────────────────────── */

#ready-btn {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--green), #16a34a);
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 0;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  color: #fff;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
}
#ready-btn:hover { transform: scale(1.02); box-shadow: 0 0 22px rgba(34,197,94,0.3); }
#ready-btn.is-ready { background: linear-gradient(135deg, var(--red), #dc2626); }
#ready-btn.is-ready:hover { box-shadow: 0 0 22px rgba(239,68,68,0.3); }

/* ── Lobby Chat ──────────────────────────────────────── */

#lobby-chat { width: 100%; }
#lobby-chat-messages {
  background: rgba(0,0,0,0.3);
  border-radius: 8px 8px 0 0;
  padding: 8px 10px;
  height: 90px;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}
#lobby-chat-messages::-webkit-scrollbar { width: 3px; }
#lobby-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

#lobby-chat-input-row { display: flex; }
#lobby-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0 0 0 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #fff;
  outline: none;
}
#lobby-chat-input::placeholder { color: var(--text-muted); }
#lobby-chat-send {
  background: var(--gold-dark);
  border: none;
  border-radius: 0 0 8px 0;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000;
  cursor: pointer;
}

/* ── Personal Stats ──────────────────────────────────── */

#personal-stats {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
}
.personal-stats-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.personal-stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2px; }
.personal-stats-row span:nth-child(odd) { color: var(--text-muted); font-size: 0.7rem; }
.personal-stats-row span:nth-child(even) { color: var(--gold); font-weight: 700; }

/* ── Live Stats Bar ──────────────────────────────────── */

.card-live-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  padding: 14px 12px;
}
.stat-counter { display: flex; flex-direction: column; gap: 2px; }
.stat-counter-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.stat-counter-value.stat-gold { color: var(--gold); }
.stat-counter-label {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Wallet Card ─────────────────────────────────────── */

.wallet-status {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}
.wallet-balance { text-align: center; padding: 14px 0 12px; }
.wallet-balance-main {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.wallet-balance-main .bal-unit {
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-cond);
}
.wallet-balance-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.wallet-actions { display: flex; gap: 8px; }
.wallet-action-btn {
  font-family: var(--font-ui);
  flex: 1;
  border-radius: var(--radius-btn);
  padding: 10px 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}
.wallet-action-btn:hover { opacity: 0.85; }
.wallet-add { background: var(--green); color: #fff; }
.wallet-withdraw {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
}
.wallet-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}
.wallet-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.wallet-link:hover { color: var(--text-secondary); }

/* ── Customize / Fighter Preview Card ────────────────── */

.fighter-preview {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}
#preview-canvas {
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
}

/* ── Play Again / Leave Game Buttons ─────────────────── */

#play-again-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  letter-spacing: 0.12em;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
}
#play-again-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 22px var(--gold-glow);
}

/* ── Wallet Modal ────────────────────────────────────── */

#wallet-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wm-card {
  background: #12122a;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  width: 100%; max-width: 420px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,0.65);
}
.wm-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 22px 0;
}
.wm-title {
  font-family: var(--font-ui);
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.04em; color: var(--text-primary);
}
.wm-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: 4px;
  transition: color 0.15s;
}
.wm-close:hover { color: var(--text-primary); }
.wm-tabs {
  display: flex; gap: 4px;
  padding: 16px 22px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.wm-tab {
  font-family: var(--font-ui);
  background: transparent; border: none;
  padding: 8px 16px;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s, background 0.15s;
  position: relative; bottom: -1px;
  border-bottom: 2px solid transparent;
}
.wm-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--gold);
  background: rgba(247,201,72,0.05);
}
.wm-pane {
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px;
}
.wm-qr {
  display: flex; justify-content: center;
}
.wm-qr img {
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}
.wm-qr-placeholder {
  text-align: center; color: var(--text-muted); font-size: 0.82rem;
  padding: 20px;
}
.wm-currency-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 14px;
}
.wm-currency-icon { font-size: 1.4rem; }
.wm-currency-info {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
}
.wm-currency-name {
  font-family: var(--font-ui); font-size: 0.9rem;
  font-weight: 700; color: var(--text-primary);
}
.wm-currency-sub { font-size: 0.72rem; color: var(--text-muted); }
.wm-currency-bal {
  font-family: var(--font-display); font-size: 1.1rem;
  color: var(--text-primary); letter-spacing: 0.04em;
}
.wm-addr-label {
  font-family: var(--font-ui);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.wm-addr-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 10px 12px;
}
.wm-addr-text {
  flex: 1; font-family: monospace; font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wm-copy-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 4px 8px;
  color: var(--text-secondary); font-size: 1rem;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.wm-copy-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.wm-notice {
  font-size: 0.75rem; color: var(--text-muted);
  line-height: 1.5;
}
.wm-bal-display {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 16px 0 8px;
}
.wm-bal-label {
  font-family: var(--font-ui); font-size: 0.7rem;
  font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.wm-bal-amount {
  font-family: var(--font-display); font-size: 2.4rem;
  letter-spacing: 0.04em; color: var(--text-primary);
}
.wm-form { display: flex; flex-direction: column; gap: 6px; }
.wm-field-label {
  font-family: var(--font-ui); font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.wm-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 12px 14px;
  font-family: var(--font-body); font-size: 0.9rem;
  color: #fff; outline: none; transition: border-color 0.2s;
}
.wm-input.mono { font-family: monospace; font-size: 0.78rem; }
.wm-input:focus { border-color: rgba(247,201,72,0.5); }
.wm-input::placeholder { color: var(--text-muted); }
.wm-submit-btn {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none; border-radius: 8px;
  padding: 14px 0; font-size: 1.3rem;
  letter-spacing: 0.18em; color: #000;
  cursor: pointer; margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.wm-submit-btn:hover { transform: scale(1.02); box-shadow: 0 0 20px var(--gold-glow); }
.wm-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Auth Modal ──────────────────────────────────────── */

#auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.auth-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.auth-card {
  position: relative; z-index: 1;
  background: #0f0f1e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 16px;
}
.auth-logo { text-align: center; }
.auth-logo-img {
  width: 140px; height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(247,201,72,0.35));
}
.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--text-primary);
}
.auth-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.auth-tab {
  font-family: var(--font-ui);
  flex: 1; padding: 9px 0;
  background: transparent;
  border: none; cursor: pointer;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
  background: rgba(247,201,72,0.1);
  color: var(--gold);
}
.auth-form {
  display: flex; flex-direction: column; gap: 10px;
}
.auth-form input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem; color: #fff; outline: none;
  transition: border-color 0.2s;
}
.auth-form input:focus { border-color: rgba(247,201,72,0.5); }
.auth-form input::placeholder { color: var(--text-muted); }
.auth-error {
  font-size: 0.78rem; color: #ff7070;
  min-height: 18px;
  font-family: var(--font-body);
}
.auth-submit {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none; border-radius: var(--radius-btn);
  padding: 14px 0; font-size: 1.3rem;
  letter-spacing: 0.18em; color: #000;
  cursor: pointer; margin-top: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.auth-submit:hover { transform: scale(1.02); box-shadow: 0 0 24px var(--gold-glow); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-guest-btn {
  font-family: var(--font-body);
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.78rem;
  cursor: pointer; text-align: center;
  padding: 4px; text-decoration: underline;
  transition: color 0.15s;
}
.auth-guest-btn:hover { color: var(--text-secondary); }

/* ── Header logged-in state ──────────────────────────── */

.header-user-info {
  display: flex; align-items: center; gap: 12px;
}
.header-balance {
  font-family: var(--font-display);
  font-size: 1rem; letter-spacing: 0.06em;
  color: var(--gold);
}
.header-signout {
  font-family: var(--font-ui);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 6px 14px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.header-signout:hover { border-color: rgba(255,100,100,0.4); color: rgba(255,120,120,0.8); }

/* ── Game Screen ──────────────────────────────────────── */

#game-screen { position: relative; width: 100vw; height: 100vh; }
#game-canvas { display: block; width: 100%; height: 100%; background: #0a0a1a; }

/* ── HUD ──────────────────────────────────────────────── */

#hud {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
#hud-left { display: flex; flex-direction: column; gap: 6px; }
#hud-right { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
#alive-count { background: rgba(0,0,0,0.6); border-radius: 8px; padding: 8px 16px; font-size: 1.1rem; font-weight: 600; }
#round-indicator { background: rgba(0,0,0,0.6); border-radius: 8px; padding: 6px 14px; font-size: 0.9rem; font-weight: 600; color: #f7c948; }
#spectate-indicator {
  background: rgba(0,0,0,0.6); border-radius: 8px; padding: 6px 14px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em;
  color: #88ccff; border: 1px solid rgba(136,204,255,0.3);
}
#dash-indicator {
  background: rgba(0,0,0,0.6); border-radius: 8px; padding: 8px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.8rem; color: rgba(255,255,255,0.7);
}
#shock-indicator {
  background: rgba(0,0,0,0.6); border-radius: 8px; padding: 8px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 0.8rem; color: rgba(255,255,255,0.5); border: 1px solid transparent;
  transition: border-color 0.2s;
}
#shock-indicator.shock-ready { border-color: rgba(255,0,255,0.4); color: rgba(255,255,255,0.8); }
#shock-status { font-size: 0.72rem; color: rgba(255,0,255,0.5); }
#shock-indicator.shock-ready #shock-status { color: #ff44ff; font-weight: 700; }
#dash-bar {
  width: 80px; height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px;
  position: relative; overflow: hidden;
}
#dash-bar::after {
  content: ''; position: absolute; left: 0; top: 0; height: 100%;
  width: var(--dash-pct, 100%); background: #f7c948; border-radius: 3px; transition: width 0.1s;
}

/* ── Kill Feed ────────────────────────────────────────── */

#kill-feed { position: absolute; top: 60px; right: 16px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.kill-msg {
  background: rgba(0,0,0,0.6); border-radius: 6px; padding: 6px 12px;
  font-size: 0.85rem; animation: fadeOut 4s forwards; white-space: nowrap;
}
@keyframes fadeOut { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ── Game Chat ────────────────────────────────────────── */

#game-chat {
  position: absolute; bottom: 46px; left: 16px; width: 340px; pointer-events: none; z-index: 40;
}
#game-chat-messages {
  max-height: 150px; overflow-y: hidden; padding: 4px 0; font-size: 0.82rem; line-height: 1.5;
}
.chat-msg {
  background: rgba(0,0,0,0.55); border-radius: 4px; padding: 3px 8px; margin-bottom: 2px;
  animation: chatFade 8s forwards; display: inline-block; max-width: 100%;
}
@keyframes chatFade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.chat-msg .chat-name { font-weight: 700; margin-right: 6px; }

#game-chat-input {
  width: 100%;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: #fff;
  outline: none;
  pointer-events: auto;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
  margin-top: 4px;
}
#game-chat-input.active {
  opacity: 1;
  border-color: rgba(247,201,72,0.55);
}
#game-chat-input::placeholder { color: rgba(255,255,255,0.35); }

/* ── Controls Strip ───────────────────────────────────── */

#controls-strip {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  padding: 5px 16px;
  display: flex;
  gap: 18px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  white-space: nowrap;
  z-index: 30;
}
.ctrl-key {
  color: rgba(255,255,255,0.58);
  font-weight: 700;
}

/* ── Countdown ────────────────────────────────────────── */

#countdown-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#countdown-text { font-size: 8rem; font-weight: 900; color: #f7c948; text-shadow: 0 0 40px rgba(247,201,72,0.5); animation: countPop 0.5s ease-out; }
@keyframes countPop { 0% { transform: scale(2); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }

/* ── Round Overlay ────────────────────────────────────── */

#round-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); pointer-events: none; }
.round-content { text-align: center; }
.round-content h2 { font-size: 2.5rem; margin-bottom: 0.5rem; color: #f7c948; }
#round-scores { font-size: 1.2rem; line-height: 2; }
.round-score { display: inline-block; margin: 0 8px; padding: 2px 10px; border-radius: 4px; }

/* ── Winner ───────────────────────────────────────────── */

@keyframes winFlash {
  0%   { background: rgba(247,201,72,0.45); }
  30%  { background: rgba(247,201,72,0.18); }
  100% { background: rgba(0,0,0,0.78); }
}
@keyframes winSlam {
  0%   { transform: scale(2.2) translateY(-18px); opacity: 0; }
  55%  { transform: scale(0.95) translateY(2px); opacity: 1; }
  75%  { transform: scale(1.06); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes wsSlideUp {
  0%   { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes wsFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

#winner-overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.78);
  z-index: 20;
}
#winner-overlay.win-flash { animation: winFlash 0.7s ease-out forwards; }

#win-particles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.winner-content {
  position: relative; z-index: 1;
  text-align: center; width: min(420px, 92vw);
  display: flex; flex-direction: column; gap: 14px;
}

/* Stage visibility states */
.win-stage { transition: opacity 0.35s; }
.ws-hidden { opacity: 0; pointer-events: none; }
.ws-visible { opacity: 1; pointer-events: auto; }

/* Stage 1 */
#win-s1 h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  margin: 0; color: #f7c948; line-height: 1;
  text-shadow: 0 0 40px rgba(247,201,72,0.6), 0 2px 8px rgba(0,0,0,0.8);
}
#win-s1.ws-slam h2 { animation: winSlam 0.55s cubic-bezier(0.22,1,0.36,1) forwards; }

.win-pot {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: #4aed88; letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(74,237,136,0.5);
  min-height: 1.2em;
}

/* Stage 2 — stat cards */
.win-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wstat-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: 0;
}
.wstat-card.wsc-slide { animation: wsSlideUp 0.38s ease-out forwards; }
.wsc-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem; color: #f7c948; line-height: 1;
}
.wsc-lbl {
  font-size: 0.62rem; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4); font-weight: 700;
}

/* Stage 3 — leaderboard */
#final-scores { margin: 0; font-size: 1rem; line-height: 1.9; }
.score-line { display: flex; justify-content: space-between; gap: 2rem; padding: 2px 0; }
.score-line.winner { color: #f7c948; font-weight: 700; }
.score-line.dead { color: rgba(255,255,255,0.35); }
#match-stats { display: none; }

.ws-fade { animation: wsFadeIn 0.4s ease-out forwards; }

/* Stage 4 — buttons */
.win-btns { display: flex; flex-direction: column; gap: 8px; }
#play-again-btn {
  background: linear-gradient(135deg, #f7c948 0%, #e8a000 100%);
  border: none; border-radius: 10px; padding: 14px 0;
  font-size: 1rem; font-weight: 800; color: #1a1005;
  cursor: pointer; letter-spacing: 0.12em;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 20px rgba(247,201,72,0.35);
}
#play-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(247,201,72,0.55);
}
#play-again-btn:active { transform: translateY(0); }
#leave-game-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  padding: 11px 0; font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.4);
  cursor: pointer; letter-spacing: 0.08em;
  transition: border-color 0.15s, color 0.15s;
}
#leave-game-btn:hover { border-color: rgba(255,255,255,0.5); color: rgba(255,255,255,0.75); }

/* Legacy compat (unused but safe to keep) */
.stat-line { display: flex; justify-content: space-between; gap: 1.5rem; padding: 2px 0; }
.stat-label { color: rgba(255,255,255,0.4); }
.stat-value { color: #f7c948; font-weight: 600; }

/* ── Tutorial ─────────────────────────────────────────── */

#tutorial-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); z-index: 50; cursor: pointer; transition: opacity 0.3s;
}
#tutorial-overlay.hidden { opacity: 0; pointer-events: none; }
.tutorial-content { text-align: center; max-width: 340px; }
.tutorial-title { font-size: 2rem; font-weight: 900; color: #f7c948; margin-bottom: 1.2rem; }
.tutorial-controls { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.tutorial-row { font-size: 1rem; display: flex; align-items: center; gap: 0.8rem; justify-content: center; }
.key {
  display: inline-block; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px; padding: 4px 10px; font-size: 0.85rem; font-weight: 700; min-width: 50px; text-align: center;
}
.tutorial-tip { font-size: 1.1rem; color: #ff6b35; font-weight: 700; margin-bottom: 1rem; }
.tutorial-dismiss { font-size: 0.8rem; color: rgba(255,255,255,0.4); }

/* ── Mobile Controls ──────────────────────────────────── */

#mobile-controls {
  position: absolute; bottom: 0; left: 0; right: 0; height: 220px; pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

#joystick-zone {
  position: absolute; left: 0; bottom: 0; width: 55%; height: 100%;
  background: transparent; border: none; border-radius: 0; pointer-events: auto;
}
#joystick-zone::after {
  content: '';
  position: absolute; left: 65px; bottom: 55px;
  width: 90px; height: 90px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.28);
  pointer-events: none;
}
#joystick-base {
  position: absolute; width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.22);
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
}
#joystick-knob {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.4); border: 2px solid rgba(255,255,255,0.7);
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
}

#dash-btn-mobile {
  position: absolute; right: 28px; bottom: 48px; width: 88px; height: 88px; border-radius: 50%;
  background: rgba(255,107,53,0.55); border: 2px solid rgba(255,107,53,0.85);
  color: #fff; font-weight: 700; font-size: 0.88rem; pointer-events: auto; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 0.08s, background 0.08s;
}
#dash-btn-mobile:active { background: rgba(255,107,53,0.92); transform: scale(0.92); }

#shockwave-btn-mobile {
  position: absolute; right: 128px; bottom: 54px; width: 74px; height: 74px; border-radius: 50%;
  background: rgba(180,0,220,0.45); border: 2px solid rgba(180,0,220,0.75);
  color: #fff; font-weight: 700; font-size: 0.72rem; pointer-events: auto; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 0.08s, background 0.08s;
}
#shockwave-btn-mobile:active { background: rgba(180,0,220,0.88); transform: scale(0.92); }

#mobile-chat-btn {
  display: none;
  position: absolute; bottom: 234px; right: 16px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1.2rem; pointer-events: auto; cursor: pointer; z-index: 45;
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}
#mobile-chat-btn.active { border-color: rgba(247,201,72,0.6); background: rgba(247,201,72,0.15); }
@media (hover: none) and (pointer: coarse) {
  #mobile-chat-btn { display: flex; }
}

/* ── How It Works ────────────────────────────────────── */

/* ── How To Play ─────────────────────────────────────── */

.htp-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border-card);
}
.hiw-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.2em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 28px;
}

/* 3-column card grid */
.htp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.htp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  transition: border-color 0.2s;
}
.htp-card:hover { border-color: rgba(247,201,72,0.2); }
.htp-card-title {
  font-family: var(--font-cond);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.htp-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: rgba(247,201,72,0.35);
  line-height: 1;
}

/* CSS Arena diagram */
.htp-arena-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.htp-arena {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid rgba(247,201,72,0.5);
  background: radial-gradient(circle, rgba(247,201,72,0.05) 0%, rgba(0,0,0,0.3) 100%);
  box-shadow: 0 0 18px rgba(247,201,72,0.15);
}
.htp-player {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.48rem;
  font-family: var(--font-cond);
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 2px solid rgba(255,255,255,0.3);
}
.htp-p1 { background:#FF4136; top:50%; left:50%; transform:translate(-50%,-50%); font-size:0.52rem; border-color:rgba(255,255,255,0.6); box-shadow:0 0 8px rgba(255,65,54,0.6); }
.htp-p2 { background:#0074D9; top:16%; left:60%; }
.htp-p3 { background:#2ECC40; top:60%; left:15%; }
.htp-edge-label {
  position: absolute;
  bottom:-18px; left:50%; transform:translateX(-50%);
  font-size:0.6rem;
  color:rgba(247,201,72,0.5);
  font-family:var(--font-cond);
  letter-spacing:0.1em;
  white-space:nowrap;
}

/* Bullet list */
.htp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.htp-list li {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.htp-list strong { color: var(--gold); }

/* Controls */
.htp-controls { display: flex; flex-direction: column; gap: 10px; }
.htp-key-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.htp-key-cluster { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.htp-key-row2 { display: flex; gap: 3px; }
.htp-key {
  min-width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-bottom: 3px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cond);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  padding: 0 4px;
}
.htp-key-wide { width: 28px; }
.htp-key-space { width: 80px; font-size: 0.62rem; }
.htp-key-shift { width: 52px; font-size: 0.62rem; }
.htp-key-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 4px;
}
.htp-key-desc strong { color: var(--text-primary); }
.htp-tip { font-size: 0.68rem; color: var(--gold); }
.htp-mobile-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-card);
}

/* Power-ups */
.htp-powerups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.htp-powerup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.htp-pu-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.htp-pu-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.htp-pu-desc { font-size: 0.7rem; color: var(--text-muted); }
.htp-hazards { border-top: 1px solid var(--border-card); padding-top: 10px; }
.htp-hazard-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.htp-hazard-row { display: flex; gap: 8px; flex-wrap: wrap; }
.htp-hz {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 2px 8px;
}

/* Wager flow (bottom row) */
.htp-flow-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 16px;
}
.htp-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}
.htp-flow-step {
  flex: 1;
  max-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.2s;
}
.htp-flow-step:hover { border-color: rgba(247,201,72,0.25); }
.htp-flow-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.htp-flow-icon img { border-radius: 50%; }
.htp-flow-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: rgba(247,201,72,0.12);
  line-height: 1;
  margin-bottom: 4px;
}
.htp-flow-label {
  font-family: var(--font-cond);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.htp-flow-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.htp-flow-desc strong { color: var(--text-primary); }
.htp-flow-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 0 10px;
  padding-top: 40px;
  flex-shrink: 0;
}

/* Wallet modal warning variant */
.wm-notice-warn {
  background: rgba(255, 90, 54, 0.08);
  border: 1px solid rgba(255, 90, 54, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 0.76rem;
  color: rgba(255,180,160,0.9);
}

/* ── Responsive: Menu Dashboard ──────────────────────── */

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    padding: 8px 12px 24px;
  }
  .col-center { order: 1; }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .arena-header { padding: 0 12px; }
  .header-welcome { display: none; }
  .hero-title-section { padding: 10px 12px 2px; }
  #lobby-chat-input { font-size: 16px; }
  .htp-grid { grid-template-columns: 1fr; }
  .htp-flow { flex-direction: column; align-items: center; gap: 8px; }
  .htp-flow-arrow { transform: rotate(90deg); padding: 0; padding-left: 0; }
  .htp-flow-step { max-width: 100%; width: 100%; }
  .htp-section { padding: 24px 12px 32px; }
}

/* ── Responsive: Game (preserved) ────────────────────── */

@media (max-width: 680px) {
  #controls-strip { display: none; }
  #game-chat { bottom: 230px; width: 220px; }
  #game-chat-input { font-size: 16px; }
}

@media (orientation: landscape) and (max-height: 450px) {
  #mobile-controls { height: 160px; }
  #joystick-zone::after { left: 50px; bottom: 35px; }
  #dash-btn-mobile { bottom: 26px; right: 20px; width: 70px; height: 70px; font-size: 0.78rem; }
  #shockwave-btn-mobile { bottom: 30px; right: 100px; width: 60px; height: 60px; font-size: 0.66rem; }
  #game-chat { bottom: 170px; width: 200px; }
  #mobile-chat-btn { bottom: 170px; }
}

/* ── Recent Activity ────────────────────────────────── */

.activity-section {
  max-width: 680px; margin: 0 auto 48px; padding: 0 24px;
}
.activity-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.35); margin: 0 0 14px; text-align: center;
}
.activity-feed {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; overflow: hidden;
}
.activity-empty {
  padding: 20px; text-align: center;
  color: rgba(255,255,255,0.25); font-size: 0.85rem;
}
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: rgba(255,255,255,0.04); }
.act-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.act-icon.deposit  { background: rgba(74,237,136,0.12); }
.act-icon.withdraw { background: rgba(255,100,100,0.12); }
.act-icon.win      { background: rgba(247,201,72,0.14); }
.act-icon.loss     { background: rgba(255,255,255,0.06); }
.act-icon.wager    { background: rgba(120,120,255,0.12); }
.act-icon.refund   { background: rgba(74,237,136,0.08); }
.act-body { flex: 1; min-width: 0; }
.act-label {
  font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.82);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-sub {
  font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 1px;
}
.act-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 0.04em; flex-shrink: 0;
}
.act-amount.positive { color: #4aed88; }
.act-amount.negative { color: rgba(255,100,100,0.85); }
.act-amount.neutral  { color: rgba(255,255,255,0.35); }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
  padding: 24px 24px 32px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 16px;
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--gold); }
.footer-sep { color: var(--text-muted); font-size: 0.7rem; }
.footer-text { color: var(--text-muted); font-size: 0.78rem; }
.footer-disclaimer {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.25);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.4;
}

/* ── Toast Notifications ──────────────────────────────── */

#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  font-size: 0.85rem; font-weight: 600;
  max-width: 320px; pointer-events: auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease-out forwards;
  cursor: pointer;
}
.toast.error {
  background: rgba(220, 50, 50, 0.92);
  border: 1px solid rgba(255,80,80,0.5);
  color: #fff;
}
.toast.success {
  background: rgba(30, 180, 100, 0.92);
  border: 1px solid rgba(74,237,136,0.4);
  color: #fff;
}
.toast.info {
  background: rgba(30, 40, 60, 0.95);
  border: 1px solid rgba(247,201,72,0.3);
  color: rgba(255,255,255,0.9);
}
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.3; }
.toast-out { animation: toastOut 0.2s ease-in forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ── Auth logo ────────────────────────────────────────── */
.auth-logo-img {
  width: 120px; height: 120px; object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(247,201,72,0.3));
}
