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

:root {
  --bg:         #04020a;
  --surface:    #0a0618;
  --border:     #1a0d2e;
  --teal:       #00e5c8;
  --teal-dim:   #00b09a;
  --purple:     #7c3aed;
  --purple-dim: #4c1d95;
  --red:        #ff4060;
  --yellow:     #ffd700;
  --text:       #c8b8e8;
  --text-dim:   #6b5580;
  --glow-teal:  0 0 12px #00e5c840, 0 0 30px #00e5c820;
  --glow-purple:0 0 12px #7c3aed40, 0 0 30px #7c3aed20;
}

html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Lobby ────────────────────────────────────────────────────────────────── */
.lobby-body {
  overflow-y: auto;
  height: 100%;
  background-image: url('/covenant.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Dark overlay so UI text stays readable */
.lobby-body::before {
  content: '';
  position: fixed; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(4, 2, 10, 0.38) 0%,
    rgba(4, 2, 10, 0.55) 60%,
    rgba(4, 2, 10, 0.80) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
  animation: twinkle 3s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.2; }
  to   { opacity: 0.9; }
}

.lobby-container {
  position: fixed;
  top: 70%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 360px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Logo */
.logo-section { text-align: center; padding-top: 20px; }

.planet-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1a0050, #06001a);
  border: 2px solid #2a0060;
  box-shadow: 0 0 30px #7c3aed60, inset 0 0 20px #7c3aed20;
  margin: 0 auto 16px;
  position: relative;
  animation: planetPulse 4s ease-in-out infinite;
}
.planet-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotateX(75deg);
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 3px solid #00e5c840;
  box-shadow: 0 0 15px #00e5c830;
}
@keyframes planetPulse {
  0%, 100% { box-shadow: 0 0 30px #7c3aed60, inset 0 0 20px #7c3aed20; }
  50%       { box-shadow: 0 0 50px #7c3aed80, inset 0 0 30px #7c3aed30; }
}

.game-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 12px;
  color: #fff;
  text-shadow: 0 0 20px #7c3aed, 0 0 40px #7c3aed60;
}
.game-subtitle {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--teal);
  text-transform: uppercase;
  margin-top: 6px;
  opacity: 0.8;
}

/* Lore — fixed bottom-left, out of the image centre */
.lore-text {
  position: fixed;
  bottom: 32px; left: 32px;
  z-index: 2;
  max-width: 320px;
  border-left: 2px solid var(--purple-dim);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lore-text p { line-height: 1.6; color: whitesmoke; font-size: 12px; }
.lore-text strong { color: var(--teal); }
.lore-warning {
  color: var(--red) !important;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 13px;
}

/* Card */
.lobby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 0 40px #7c3aed15;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-group label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
}

input[type="text"] {
  background: #07031210;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: var(--teal-dim);
  box-shadow: 0 0 0 3px #00e5c815;
}
input[type="text"]::placeholder { color: var(--text-dim); opacity: 0.5; }

.action-section { display: flex; flex-direction: column; gap: 12px; }

.btn-primary, .btn-secondary {
  border: none; border-radius: 8px;
  font-family: inherit;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: white;
  padding: 14px 24px;
  font-size: 13px;
  width: 100%;
  box-shadow: 0 4px 20px #7c3aed40;
}
.btn-primary:hover { box-shadow: 0 4px 30px #7c3aed70; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-icon { margin-right: 8px; font-size: 16px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 11px; letter-spacing: 2px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.join-row { display: flex; gap: 8px; }
.room-input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  padding: 12px 20px;
  font-size: 12px;
  white-space: nowrap;
}
.btn-secondary:hover { background: #00e5c810; }

.error-msg {
  display: none;
  background: #ff406020;
  border: 1px solid #ff406040;
  border-radius: 6px;
  color: var(--red);
  padding: 10px 14px;
  font-size: 12px;
  text-align: center;
}

/* Covenant intro */
.covenant-intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0.8;
}
.covenant-row {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.cov-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 2px; color: whitesmoke;
}
.cov-icon {
  width: 28px; height: 28px; border-radius: 50%;
  animation: iconPulse 2s ease-in-out infinite alternate;
}
.hunger-icon  { background: radial-gradient(circle, #ff8c00, #ff4000); box-shadow: 0 0 10px #ff800060; }
.warmth-icon  { background: radial-gradient(circle, #ffd700, #ff8c00); box-shadow: 0 0 10px #ffd70060; }
.morale-icon  { background: radial-gradient(circle, #00e5ff, #7c3aed); box-shadow: 0 0 10px #00e5ff60; }
@keyframes iconPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}
.cov-note { font-size: 11px; color: whitesmoke; line-height: 1.5; }

/* ── Game page ────────────────────────────────────────────────────────────── */
#gameCanvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ── World loading screen ─────────────────────────────────────────────────── */
#worldLoading {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #12080a 0%, #060308 100%);
  transition: opacity 0.6s ease;
}
#worldLoading.fade-out {
  opacity: 0;
  pointer-events: none;
}
#worldLoading.hidden { display: none; }

.wl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.wl-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #a855f7;
  border-right-color: #00e5c8;
  animation: wlSpin 1.2s linear infinite;
  box-shadow: 0 0 24px #a855f740, 0 0 48px #00e5c820;
}
@keyframes wlSpin {
  to { transform: rotate(360deg); }
}

.wl-title {
  font-size: 13px;
  letter-spacing: 8px;
  color: #c8b8e8;
  animation: wlPulse 2s ease-in-out infinite;
}
@keyframes wlPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.wl-sub {
  font-size: 10px;
  letter-spacing: 2px;
  color: #6b5580;
}

.wl-retry {
  margin-top: 8px;
  background: none;
  border: 1px solid #ff406040;
  color: #ff4060;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.wl-retry:hover { background: #ff406018; }

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

/* ── Left column: survival bars + inventory stacked ─────────────────────── */
#leftPanel {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}

/* Inventory panel */
#inventoryPanel {
  width: 178px;
  background: rgba(4, 2, 14, 0.78);
  border: 1px solid #1a0d2e;
  border-radius: 7px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.inv-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 9px;
  border-bottom: 1px solid #1a0d2e;
  padding-bottom: 6px;
}

.inv-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  transition: opacity 0.3s;
}
.inv-row.empty { opacity: 0.3; }

.inv-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }

.inv-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  flex: 1;
}

.inv-count {
  font-size: 16px;
  color: var(--text);
  font-weight: bold;
  min-width: 26px;
  text-align: right;
}

/* Crystal: count + gate bar stacked */
.inv-crystal-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
}
.inv-gate-bar {
  width: 100%;
  height: 4px;
  background: #1a0d2e;
  border-radius: 2px;
  overflow: hidden;
}
.inv-gate-fill {
  height: 100%;
  width: 0%;
  background: #44aaff;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}
.inv-gate-fill.full { background: #00e5c8; box-shadow: 0 0 8px #00e5c880; }

/* Keys section */
.inv-keys {
  margin-top: 10px;
  border-top: 1px solid #1a0d2e;
  padding-top: 8px;
}
.inv-keys-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.inv-keys-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.inv-key-badge {
  font-size: 10px;
  letter-spacing: 1px;
  background: #1a0820;
  border: 1px solid #a855f760;
  color: #c084fc;
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
}

/* Flash when a new key is added */
@keyframes keyFlash {
  0%   { box-shadow: 0 0 0px #a855f700; border-color: #1a0d2e; }
  30%  { box-shadow: 0 0 18px #a855f7cc; border-color: #a855f7; }
  100% { box-shadow: 0 0 0px #a855f700; border-color: #1a0d2e; }
}
#inventoryPanel.key-flash { animation: keyFlash 1.2s ease-out forwards; }

/* Survival bars — inside #leftPanel, no absolute positioning needed */
#survivalBars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: whitesmoke;
  width: 56px;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.bar-track {
  width: 120px; height: 6px;
  background: #ffffff10;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #ffffff08;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.bar-fill.hunger  { background: linear-gradient(90deg, #ff4000, #ff8c00); box-shadow: 0 0 6px #ff800060; }
.bar-fill.warmth  { background: linear-gradient(90deg, #ffd700, #fff176); box-shadow: 0 0 6px #ffd70060; }
.bar-fill.morale  { background: linear-gradient(90deg, #7c3aed, #00e5ff); box-shadow: 0 0 6px #00e5ff60; }
.bar-fill.low { animation: barPulse 0.8s ease-in-out infinite alternate; }
@keyframes barPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* Covenant score — top right */
#covenantPanel {
  position: absolute;
  top: 16px; right: 16px;
  background: #0a061888;
  border: 1px solid #1a0d2e;
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(8px);
  text-align: center;
  min-width: 100px;
}
#covenantPanel .cov-label {
  font-size: 11px; letter-spacing: 2px; color: whitesmoke;
}
#covenantScore {
  font-size: 22px; font-weight: bold;
  color: var(--teal);
  text-shadow: var(--glow-teal);
  margin: 2px 0;
}
#covenantBand {
  font-size: 11px; letter-spacing: 1px; color: whitesmoke;
}

/* Room code — top center */
#roomCodeDisplay {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  background: #0a061899;
  border: 1px solid #2a1a4a;
  border-radius: 8px;
  padding: 6px 14px;
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 3px;
  color: whitesmoke;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#roomCodeDisplay span { color: var(--teal); font-weight: bold; }

/* Day/night indicator */
#dayIndicator {
  position: absolute;
  top: 56px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 2px; color: whitesmoke;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Players list — below covenant */
#playersList {
  position: absolute;
  top: 90px; right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 160px;
}
.player-entry {
  display: flex; align-items: center; gap: 8px;
  background: #0a061866;
  border: 1px solid #1a0d2e;
  border-radius: 8px;
  padding: 6px 10px;
  backdrop-filter: blur(4px);
  font-size: 11px;
}
.player-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.player-name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-score { color: var(--teal); font-size: 10px; }

/* Signal bar — upper right column, below players list */
#signalBar {
  position: absolute;
  top: 260px; right: 16px;
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: all;
  background: rgba(10, 6, 24, 0.72);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 6px 8px;
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
.signal-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100px; height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  position: relative;
  padding: 0;
}
.signal-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

/* Per-button accent colors via CSS custom property */
.signal-btn { --accent: #7c3aed; }
.signal-btn[data-signal="🆘"] { --accent: #ff4060; }
.signal-btn[data-signal="✅"] { --accent: #00e5c8; }
.signal-btn[data-signal="⚠️"] { --accent: #ff8c00; }
.signal-btn[data-signal="🤝"] { --accent: #a855f7; }
.signal-btn[data-signal="🔥"] { --accent: #ffd700; }

.signal-btn .signal-icon { color: var(--accent); opacity: 0.9; transition: opacity 0.18s, transform 0.18s ease; }
.signal-btn .signal-label { color: whitesmoke; opacity: 0.9; transition: opacity 0.18s; }
.signal-label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: whitesmoke;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  transition: color 0.18s ease;
  text-transform: uppercase;
}
.signal-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.signal-btn:hover .signal-icon { transform: scale(1.18) translateY(-1px); opacity: 1; }
.signal-btn:hover .signal-label { opacity: 0.85; }
.signal-btn:active { transform: scale(0.92); }
.signal-btn:active .signal-icon { transform: scale(1.0); }

/* Active flash on click */
.signal-btn.fired {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  animation: signalFire 0.4s ease forwards;
}
@keyframes signalFire {
  0%   { box-shadow: 0 0 0   color-mix(in srgb, var(--accent) 80%, transparent); }
  40%  { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { box-shadow: none; }
}

/* ── Crosshair ────────────────────────────────────────────────────────────── */
#crosshair {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  pointer-events: none;
  z-index: 60;
}
#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.75);
  border-radius: 1px;
}
#crosshair::before { width: 14px; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
#crosshair::after  { width: 1.5px; height: 14px; left: 50%; top: 0; transform: translateX(-50%); }

/* ── Click-to-play overlay ────────────────────────────────────────────────── */
#clickToPlay {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ctp-card {
  text-align: center;
  padding: 22px 36px;
  background: rgba(4, 2, 10, 0.78);
  border: 1px solid rgba(0, 229, 200, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 30px rgba(0,229,200,0.08);
  animation: ctpPulse 2.5s ease-in-out infinite;
}
@keyframes ctpPulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1; }
}
.ctp-title {
  font-size: 13px; letter-spacing: 5px; font-weight: bold;
  color: var(--teal); margin-bottom: 8px;
  text-shadow: 0 0 12px var(--teal);
}
.ctp-sub {
  font-size: 11px; letter-spacing: 2px;
  color: rgba(200, 184, 232, 0.55);
}

/* Interact prompt — centered near crosshair */
#interactPrompt {
  position: fixed;
  top: calc(50% + 36px); left: 50%; transform: translateX(-50%);
  background: rgba(10, 6, 24, 0.75);
  border: 1px solid var(--teal-dim);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--teal);
  backdrop-filter: blur(8px);
  display: none;
  white-space: nowrap;
  box-shadow: var(--glow-teal);
  pointer-events: none;
}

/* ── Mobile collect button ───────────────────────────────────────────────── */
#collectBtn {
  position: absolute;
  bottom: 170px; right: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 72px; height: 72px;
  border-radius: 18px;
  background: rgba(0, 229, 200, 0.12);
  border: 1.5px solid var(--teal-dim);
  color: var(--teal);
  font-family: inherit; font-size: 9px; font-weight: bold; letter-spacing: 1.5px;
  cursor: pointer;
  pointer-events: all;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 18px rgba(0,229,200,0.18);
  /* hidden by default — JS adds .visible */
  opacity: 0; transform: scale(0.8) translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
#collectBtn svg { width: 26px; height: 26px; }
#collectBtn.visible {
  opacity: 1; transform: scale(1) translateY(0);
  pointer-events: all;
  animation: collectPop 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes collectPop {
  from { transform: scale(0.75) translateY(8px); }
  to   { transform: scale(1) translateY(0); }
}
#collectBtn:active { transform: scale(0.93); }

/* ── Mobile joystick ──────────────────────────────────────────────────────── */
#joystickZone {
  position: absolute;
  bottom: 0; left: 0;
  width: 50%; height: 220px;
  pointer-events: all;
  /* debug: border: 1px solid red; */
}
#joystickBase {
  position: absolute;
  bottom: 40px; left: 50px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: #ffffff08;
  border: 2px solid #ffffff20;
  display: none;
}
#joystickThumb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c3aed, #4c1d95);
  box-shadow: 0 0 12px #7c3aed80;
  pointer-events: none;
}

/* ── Mobile action pad ────────────────────────────────────────────────────── */
#actionPad {
  position: absolute;
  bottom: 24px; right: 16px;
  display: none;           /* shown via @media touch */
  flex-direction: column;
  gap: 10px;
  pointer-events: all;
  z-index: 50;
}
#actionPadTop {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
#actionPadMain {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Small utility pad buttons */
.pad-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  width: 58px; height: 58px;
  border-radius: 14px;
  background: rgba(8, 4, 20, 0.72);
  border: 1.5px solid rgba(124, 58, 237, 0.45);
  color: rgba(200, 160, 255, 0.9);
  font-family: inherit;
  cursor: pointer;
  pointer-events: all;
  backdrop-filter: blur(14px);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.pad-btn:active { background: rgba(124,58,237,0.25); transform: scale(0.92); }
.pad-icon  { font-size: 20px; line-height: 1; }
.pad-label { font-size: 8px; letter-spacing: 1.5px; font-weight: bold; }

/* Turn buttons — slightly wider */
.turn-btn { width: 54px; border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.5); }
.turn-btn:active { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); color: #fff; }

/* Main action button — larger, teal */
#actionBtn {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,200,0.22), rgba(0,229,200,0.08));
  border: 2px solid var(--teal);
  color: var(--teal);
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  pointer-events: all;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(0,229,200,0.3);
  backdrop-filter: blur(8px);
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
#actionBtn svg { width: 24px; height: 24px; }
#actionBtnLabel { font-size: 8px; letter-spacing: 1.5px; font-weight: bold; }
#actionBtn:active { background: rgba(0,229,200,0.35); transform: scale(0.92); }

/* ── Overlay panels ───────────────────────────────────────────────────────── */
.overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04020aee;
  backdrop-filter: blur(8px);
}
.overlay-panel.hidden { display: none; }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 60px #7c3aed30;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.panel-title {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 4px;
  color: #fff;
  text-align: center;
}
.panel-subtitle { text-align: center; color: var(--text-dim); font-size: 12px; line-height: 1.6; }

/* Temptation panel */
#temptationPanel .resource-preview {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  padding: 16px;
  background: #0a061888;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.resource-icon { font-size: 32px; }
.resource-info { text-align: left; }
.resource-info .res-type { font-size: 10px; letter-spacing: 2px; color: var(--text-dim); }
.resource-info .res-amount { font-size: 20px; font-weight: bold; color: var(--teal); }

#temptationPanel .choice-note {
  font-size: 11px; color: var(--text-dim); text-align: center; line-height: 1.6;
  padding: 0 8px;
}
.choice-btns { display: flex; gap: 12px; }
.choice-btns button {
  flex: 1; padding: 14px;
  border-radius: 10px; border: none;
  font-family: inherit; font-size: 12px;
  font-weight: bold; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s;
}
#keepBtn {
  background: #ff406020; color: var(--red);
  border: 1px solid #ff406040;
}
#keepBtn:hover { background: #ff406040; }
#shareBtn {
  background: #00e5c820; color: var(--teal);
  border: 1px solid var(--teal-dim);
}
#shareBtn:hover { background: #00e5c840; }
#shareGlobalBtn {
  background: #ffd70015; color: var(--yellow);
  border: 1px solid #ffd70040;
}
#shareGlobalBtn:hover { background: #ffd70030; }

/* Promise panel */
#promisePanel .promise-form {
  display: flex; flex-direction: column; gap: 12px;
}
#promisePanel select,
#promisePanel input {
  background: #07031210;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
}
#promisePanel select option { background: var(--surface); }

.active-promises {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.promise-item {
  background: #07031210;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  display: flex; align-items: center; gap: 10px;
}
.promise-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.promise-status.pending  { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.promise-status.kept     { background: var(--teal);   box-shadow: 0 0 6px var(--teal); }
.promise-status.broken   { background: var(--red);    box-shadow: 0 0 6px var(--red); }
.promise-text { flex: 1; color: var(--text-dim); line-height: 1.4; }

/* ── Status dashboard (bottom center) ───────────────────────────── */
#statusDash {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 92vw;
  background: rgba(10, 6, 24, 0.90);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 24px rgba(0,229,200,0.06);
  padding: 8px 20px 10px;
  z-index: 200;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

#statusDashLabel {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--teal);
  opacity: 0.85;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

#toast {
  flex: 1;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(245,245,245,0.45);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: color 0.25s;
}
#toast.show { color: whitesmoke; }

/* Promise button */
#promiseOpenBtn {
  position: absolute;
  bottom: 160px; right: 16px;
  pointer-events: all;
  background: rgba(10, 6, 24, 0.82);
  border: 1px solid #2a1a4a;
  border-radius: 10px;
  padding: 10px 16px;
  color: whitesmoke;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#promiseOpenBtn:hover { border-color: var(--purple); color: #fff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lobby-container { padding: 24px 16px 40px; }
  .game-title { font-size: 32px; letter-spacing: 8px; }
}

@media (pointer: coarse) {
  #joystickBase { display: flex; }
  #actionPad    { display: flex; }
  #clickToPlay  { display: none; }
  /* Hide the old floating collect button — action pad handles it */
  #collectBtn   { display: none !important; }
}

/* ── Group safety indicator ──────────────────────────────────────────────── */
#groupIndicator {
  position: absolute;
  bottom: 90px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 3px; font-weight: bold;
  padding: 6px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.4s ease;
}
.group-indicator.safe {
  background: rgba(0, 200, 80, 0.12);
  border: 1px solid rgba(0, 200, 80, 0.35);
  color: #00c850;
  box-shadow: 0 0 14px rgba(0,200,80,0.2);
}
.group-indicator.warn {
  background: rgba(255, 180, 0, 0.12);
  border: 1px solid rgba(255, 180, 0, 0.35);
  color: #ffb400;
  box-shadow: 0 0 14px rgba(255,180,0,0.2);
  animation: warnPulse 2s ease-in-out infinite;
}
.group-indicator.danger {
  background: rgba(255, 40, 40, 0.12);
  border: 1px solid rgba(255, 40, 40, 0.4);
  color: #ff3030;
  box-shadow: 0 0 14px rgba(255,40,40,0.25);
  animation: warnPulse 1s ease-in-out infinite;
}
@keyframes warnPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ── Danger vignette ─────────────────────────────────────────────────────── */
#vignette {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 50;
  border-radius: 0;
  transition: opacity 0.3s;
  opacity: 0;
}
#vignette.attack {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(220,20,20,0.7) 100%);
  animation: attackFlash 0.6s ease-out forwards;
}
#vignette.roar {
  background: radial-gradient(ellipse at center, transparent 50%, rgba(180,10,10,0.35) 100%);
  animation: roarPulse 0.9s ease-out forwards;
}
@keyframes attackFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes roarPulse {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Floating signals ─────────────────────────────────────────────────────── */
.float-signal {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 300;
  animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-60px); }
}

/* ── Rally controls ──────────────────────────────────────────────────────── */
#rallyControls {
  position: absolute;
  bottom: 210px; right: 16px;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: all;
}

#rallyBtn {
  background: rgba(10, 6, 24, 0.88);
  border: 1px solid #3a2a5a;
  border-radius: 10px;
  padding: 11px 16px;
  color: whitesmoke;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#rallyBtn:hover { border-color: #a855f7; color: #fff; }
#rallyBtn.in-rally {
  border-color: #a855f770;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
}

#waveBtn {
  background: rgba(0, 229, 200, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 10px;
  padding: 11px 16px;
  color: whitesmoke;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  white-space: nowrap;
  align-items: center; justify-content: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#waveBtn:hover:not(:disabled) {
  background: rgba(0, 229, 200, 0.22);
  box-shadow: 0 0 16px rgba(0,229,200,0.3);
}
#waveBtn:disabled { opacity: 0.45; cursor: not-allowed; }

#rallyInfo {
  position: fixed;
  bottom: 48px; left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: 2px;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 20px;
  padding: 5px 16px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  pointer-events: none;
  z-index: 199;
}

/* ── Death overlay ───────────────────────────────────────────────────────── */
#deathOverlay {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 2, 10, 0.92);
  backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
}
#deathOverlay.visible {
  opacity: 1; pointer-events: all;
}
.death-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
  padding: 48px 40px;
  border: 1px solid rgba(255, 40, 40, 0.3);
  border-radius: 18px;
  background: rgba(20, 0, 0, 0.7);
  box-shadow: 0 0 60px rgba(255, 40, 40, 0.15), inset 0 0 40px rgba(255, 0, 0, 0.05);
  max-width: 380px;
  animation: deathCardIn 0.4s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}
@keyframes deathCardIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.death-title {
  font-size: 28px; font-weight: 900;
  letter-spacing: 8px;
  color: #ff3030;
  text-shadow: 0 0 20px #ff303080, 0 0 40px #ff303040;
}
.death-cause {
  font-size: 13px; letter-spacing: 2px;
  color: rgba(255, 100, 100, 0.85);
}
.death-countdown {
  font-size: 16px; letter-spacing: 3px;
  color: rgba(200, 180, 220, 0.7);
  animation: countBlink 1s ease-in-out infinite;
}
@keyframes countBlink {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}
.death-tip {
  font-size: 10px; letter-spacing: 1.5px;
  color: rgba(107, 85, 128, 0.6);
}

/* ── Rally invite ─────────────────────────────────────────────────────────── */
#rallyInvitePanel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -40%);
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#rallyInvitePanel.visible {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%);
}
.rally-invite-card {
  background: rgba(8, 4, 20, 0.96);
  border: 1px solid rgba(168, 85, 247, 0.6);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex; flex-direction: column; gap: 16px;
  min-width: 320px; max-width: 400px;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.35), 0 0 120px rgba(168, 85, 247, 0.1);
  backdrop-filter: blur(20px);
  animation: rallyPulse 2s ease-in-out infinite;
}
@keyframes rallyPulse {
  0%, 100% { box-shadow: 0 0 60px rgba(168,85,247,0.35), 0 0 120px rgba(168,85,247,0.1); }
  50%       { box-shadow: 0 0 80px rgba(168,85,247,0.55), 0 0 160px rgba(168,85,247,0.2); }
}
.rally-invite-title {
  font-size: 14px; letter-spacing: 4px; font-weight: bold;
  color: #c084fc;
  text-align: center;
  text-shadow: 0 0 16px #a855f780;
}
.rally-invite-body {
  font-size: 13px; color: whitesmoke; line-height: 1.6;
  text-align: center;
}
.rally-invite-btns {
  display: flex; gap: 10px; margin-top: 4px;
}
.rally-invite-btns button {
  flex: 1; padding: 13px 8px;
  border-radius: 10px;
  font-family: inherit; font-size: 12px; letter-spacing: 2px; font-weight: bold;
  cursor: pointer; transition: all 0.18s;
}
#rallyAcceptBtn {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.7);
  color: #e2c9ff;
}
#rallyAcceptBtn:hover { background: rgba(168, 85, 247, 0.4); color: #fff; }
#rallyDeclineBtn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
}
#rallyDeclineBtn:hover { border-color: rgba(255,255,255,0.4); color: whitesmoke; }

/* Rally roster — team inventory snapshot inside invite panel */
.rally-roster {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid rgba(168,85,247,0.25);
  border-bottom: 1px solid rgba(168,85,247,0.25);
  padding: 8px 0;
  font-size: 11px;
}
.rir-header {
  font-size: 9px; letter-spacing: 2px; color: rgba(200,160,255,0.5);
  margin-bottom: 3px;
}
.rir-row {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 4px; border-radius: 6px;
}
.rir-leader {
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
}
.rir-name {
  flex: 1; color: #e2d9f3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 120px;
  font-size: 11px;
}
.rir-leader .rir-name { color: #c084fc; font-weight: bold; }
.rir-score {
  font-size: 10px; color: rgba(255,220,100,0.7);
  min-width: 48px; text-align: right;
}
.rir-res {
  font-size: 11px; min-width: 34px; text-align: right;
  color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
}
.rir-total {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 4px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 2px;
}
.rir-total-label {
  flex: 1; font-size: 9px; letter-spacing: 2px;
  color: rgba(200,160,255,0.55);
}
.rir-total .rir-res { color: rgba(255,255,255,0.9); }

/* Queue counter badge */
.rally-invite-counter {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(168,85,247,0.3);
  border: 1px solid rgba(168,85,247,0.5);
  font-size: 10px; letter-spacing: 1px;
  vertical-align: middle;
}

/* Skip button (when queue > 1) */
.rally-skip-btn {
  background: transparent;
  border: none;
  color: rgba(200,160,255,0.5);
  font-family: inherit; font-size: 10px; letter-spacing: 2px;
  cursor: pointer; padding: 4px 8px;
  transition: color 0.15s;
}
.rally-skip-btn:hover { color: #c084fc; }

/* Available rallies panel — reuses .rally-invite-card, positioned below invite */
#availableRalliesPanel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -40%);
  z-index: 399;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#availableRalliesPanel.visible {
  transform: translate(-50%, -50%);
}
.rally-join-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  margin-bottom: 6px;
  gap: 12px;
}
.rally-join-info { font-size: 12px; color: whitesmoke; }
.rally-join-info small { display: block; font-size: 10px; color: rgba(200,160,255,0.6); letter-spacing: 1px; margin-top: 2px; }
.rally-join-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(168,85,247,0.2);
  border: 1px solid rgba(168,85,247,0.6);
  color: #e2c9ff;
  font-family: inherit; font-size: 10px; letter-spacing: 2px; font-weight: bold;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.rally-join-btn:hover { background: rgba(168,85,247,0.4); color: #fff; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */
#adminPanel {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
#adminPanel.visible { opacity: 1; pointer-events: all; }
.admin-card {
  background: rgba(4,2,14,0.97);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 14px; padding: 20px 24px;
  min-width: 360px; max-width: 520px; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 0 60px rgba(124,58,237,0.25);
}
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.admin-title { font-size: 13px; letter-spacing: 4px; color: #a855f7; font-weight: bold; }
.admin-close { background: none; border: none; color: rgba(255,255,255,0.4); font-size: 16px; cursor: pointer; }
.admin-close:hover { color: #fff; }
.admin-body { font-size: 11px; color: whitesmoke; }
.adm-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.adm-table th { color: rgba(200,160,255,0.6); text-align: left; padding: 3px 6px; font-weight: normal; letter-spacing: 1px; }
.adm-table td { padding: 3px 6px; color: whitesmoke; border-bottom: 1px solid rgba(255,255,255,0.05); }
.adm-section { color: #a855f7; letter-spacing: 3px; font-size: 10px; margin: 12px 0 6px; }
.adm-hint { color: rgba(255,255,255,0.25); font-size: 9px; margin-top: 12px; text-align: center; letter-spacing: 2px; }

/* ── Win overlay ─────────────────────────────────────────────────────────── */
#winOverlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); pointer-events: none;
  transition: background 1.2s ease;
}
#winOverlay.visible {
  background: rgba(4,10,4,0.92); pointer-events: all;
}
.win-card {
  text-align: center; padding: 48px 56px;
  background: rgba(8,20,8,0.97);
  border: 1px solid rgba(0,229,100,0.4);
  border-radius: 20px;
  box-shadow: 0 0 80px rgba(0,229,100,0.25), 0 0 160px rgba(0,229,100,0.1);
  animation: winGlow 2.5s ease-in-out infinite;
}
@keyframes winGlow {
  0%,100% { box-shadow: 0 0 80px rgba(0,229,100,0.25), 0 0 160px rgba(0,229,100,0.1); }
  50%      { box-shadow: 0 0 120px rgba(0,229,100,0.45), 0 0 240px rgba(0,229,100,0.2); }
}
.win-title    { font-size: 72px; margin-bottom: 8px; }
.win-subtitle { font-size: 22px; letter-spacing: 8px; color: #00e564; margin-bottom: 24px; }
.win-body     { font-size: 14px; color: rgba(200,240,200,0.8); line-height: 1.7; margin-bottom: 24px; }
.win-score    { font-size: 13px; letter-spacing: 3px; color: #00e5c8; margin-bottom: 28px; }
.win-btn {
  padding: 14px 36px; border-radius: 10px;
  background: rgba(0,229,100,0.15); border: 1px solid rgba(0,229,100,0.6);
  color: #00e564; font-family: inherit; font-size: 13px; letter-spacing: 3px;
  cursor: pointer; transition: background 0.15s;
}
.win-btn:hover { background: rgba(0,229,100,0.3); color: #fff; }

/* ── btn-secondary utility ───────────────────────────────────────────────── */
.btn-secondary {
  background: transparent;
  border: 1px solid #1a0d2e;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-secondary:hover { border-color: var(--purple-dim); color: var(--text); }

/* ── Invite button (in room code chip) ───────────────────────────────────── */
#roomCodeDisplay {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
#inviteBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #7c3aed40, #00e5c830);
  border: 1px solid #7c3aed80;
  color: whitesmoke;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.18s;
}
#inviteBtn:hover { background: linear-gradient(135deg, #7c3aed70, #00e5c850); border-color: #00e5c8; }
#inviteBtn svg { width: 12px; height: 12px; }

/* ── Invite modal ────────────────────────────────────────────────────────── */
.invite-card { max-width: 420px; }
.invite-link-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 12px;
}
.invite-link-row input {
  flex: 1;
  background: #0a0618;
  border: 1px solid #2a1a4a;
  color: var(--teal);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.invite-share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.invite-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.invite-share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.invite-share-icon { font-size: 18px; }
.invite-wa { background: #25d366; color: #06281a; }
.invite-mail { background: linear-gradient(135deg, #7c3aed, #5a2bb8); color: whitesmoke; }
