@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Press+Start+2P&display=swap');

:root {
  --bg-color: #0b1117;
  --hud-bg: rgba(18, 26, 36, 0.82);
  --hud-border: rgba(255, 255, 255, 0.14);
  --accent-gold: #f3c948;
  --accent-green: #52a447;
  --accent-teal: #1b6b65;
  --accent-blue: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Curated High-Contrast Player Color Palette */
  --player-color-cyan: #38bdf8;
  --player-color-emerald: #4ade80;
  --player-color-amber: #fbbf24;
  --player-color-coral: #fb7185;
  --player-color-violet: #c084fc;
  --player-color-mint: #2dd4bf;
  --player-color-peach: #f97316;
  --player-color-azure: #60a5fa;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #2b4920;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Glassmorphic Top Bar / Room HUD */
#hud-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  pointer-events: none;
  z-index: 20;
}

.hud-panel {
  background: var(--hud-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: calc(100vw - 32px);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.hud-pill-badge {
  background: var(--accent-green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-share {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-share:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
}

.btn-share:active {
  transform: translateY(0);
}

/* Bottom Controls Guidance (Retired bottom toolbar) */
#controls-hint {
  display: none !important;
}

/* Chat Input Bar */
#chat-container {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 30;
}

#chat-input {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 8px 18px;
  color: #fff;
  font-size: 0.95rem;
  width: 340px;
  outline: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-family: inherit;
}

/* Touch Controls Mobile Overlay */
#touch-controls-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  touch-action: none;
}

#touch-joystick-zone {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
  width: 130px;
  height: 130px;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#joystick-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transform: translate(0px, 0px);
  will-change: transform;
}

#touch-action-pad {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 160px;
  justify-content: flex-end;
  pointer-events: auto;
  touch-action: none;
}

.touch-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 26, 36, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
  touch-action: none;
}

.touch-action-btn:active {
  transform: scale(0.92);
  background: rgba(59, 130, 246, 0.6);
}

.touch-action-btn.off-leash {
  background: rgba(217, 119, 6, 0.4);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

/* Customizer Modal & Styling */
#customizer-modal {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 22px;
  color: #f8fafc;
  width: 90%;
  max-width: 360px;
  z-index: 100;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
}

.customizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.customizer-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
}

.customizer-close {
  cursor: pointer;
  opacity: 0.7;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  color: #f8fafc;
  padding: 4px;
  transition: opacity 0.15s ease;
}

.customizer-close:hover {
  opacity: 1;
}

/* Glassmorphic Tab Bar */
.customizer-tabs {
  display: flex;
  gap: 6px;
  background: rgba(30, 41, 59, 0.7);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.customizer-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.customizer-tab-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.customizer-tab-btn:hover:not(.active) {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
}

.customizer-tab-pane {
  display: none;
}

.customizer-tab-pane.active {
  display: block;
}

.cust-form-group {
  margin-bottom: 14px;
}

.cust-label {
  font-size: 0.82rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.cust-input, .cust-select {
  width: 100%;
  padding: 8px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.cust-input:focus, .cust-select:focus {
  border-color: #3b82f6;
}

/* Palette swatches */
.cust-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px #3b82f6, 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Button style selectors (e.g. Hair Style) */
.cust-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cust-style-btn {
  flex: 1;
  min-width: 64px;
  padding: 7px 10px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
}

.cust-style-btn:hover {
  background: #334155;
  color: #fff;
}

.cust-style-btn.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-primary-cust {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary-cust:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
}

.btn-primary-cust:active {
  transform: translateY(0);
}

/* ==========================================================================
   Prominent Glassmorphic Proximity Group Chat HUD & Top-Right Action Buttons
   ========================================================================== */

#btn-customize {
  position: fixed;
  top: 16px;
  right: 66px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f8fafc;
  font-size: 1.2rem;
  z-index: 60;
  pointer-events: auto;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#btn-customize:hover {
  transform: scale(1.05);
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.3);
}

#btn-customize:active {
  transform: scale(0.95);
}

.style-toggle-icon {
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #f8fafc;
  font-size: 1.2rem;
  z-index: 60;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#chat-toggle-btn:hover {
  transform: scale(1.05);
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.3);
}

#chat-toggle-btn:active {
  transform: scale(0.95);
}

#chat-toggle-btn.active {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.95);
}

#chat-toggle-btn.collapsed {
  opacity: 0.85;
}

#proximity-chat-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  user-select: text;
}

#proximity-chat-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#proximity-chat-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.98);
}

/* Header & Participant Pills */
#proximity-chat-header {
  padding: 12px 16px 10px;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.proximity-chat-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.proximity-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.proximity-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.proximity-participants {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.proximity-participants-label {
  font-weight: 600;
  color: #94a3b8;
}

.proximity-pills-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.participant-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

.participant-pill.local {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(74, 222, 128, 0.35);
  color: #dcfce7;
}

/* Conversation Thread */
#proximity-chat-messages {
  flex: 1;
  min-height: 120px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  background: rgba(15, 23, 42, 0.4);
}

#proximity-chat-messages::-webkit-scrollbar {
  width: 5px;
}

#proximity-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.proximity-message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: proximityMessageIn 0.15s ease-out;
}

@keyframes proximityMessageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proximity-message.local {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.85), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

/* Pruning & Expiration Visual Transitions */
.proximity-message.expiring,
.proximity-message.pruning {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.proximity-message.system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2px 6px;
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
}

.proximity-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.proximity-message-sender {
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--player-color-cyan);
  transition: color 0.15s ease;
}

.proximity-message.local .proximity-message-sender {
  /* Inherits or allows custom assigned player color inline styles cleanly */
  color: inherit;
}

.proximity-message-time {
  font-size: 0.68rem;
  color: #64748b;
  margin-left: auto;
}

.proximity-message.local .proximity-message-time {
  color: #94a3b8;
  opacity: 0.8;
}

.proximity-message-text {
  font-size: 0.86rem;
  line-height: 1.35;
  user-select: text;
  word-break: break-word;
  transition: color 0.15s ease;
}

.proximity-message.local .proximity-message-text {
  /* Inherits or allows custom assigned player color inline styles cleanly */
  color: inherit;
}

.proximity-system-text {
  font-size: 0.74rem;
  color: #94a3b8;
}

/* Prominent Input Container & Buttons */
#proximity-chat-input-container {
  padding: 10px 14px 12px;
  background: rgba(15, 23, 42, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proximity-emoji-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.proximity-emoji-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, background 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.proximity-emoji-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.14);
}

.proximity-emoji-btn:active {
  transform: scale(0.95);
}

#proximity-chat-input-bar {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

#proximity-chat-input {
  width: 100%;
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: text;
}

#proximity-chat-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

#proximity-chat-input::placeholder {
  color: #64748b;
  font-size: 0.82rem;
}

.proximity-send-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.proximity-send-btn:hover {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  transform: translateY(-1px);
}

.proximity-send-btn:active {
  transform: translateY(0);
}

/* Canine Personality Editor Styles */
.cust-personality-group {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
  backdrop-filter: blur(8px);
}

.cust-trait-row {
  margin-bottom: 12px;
}

.cust-trait-row:last-child {
  margin-bottom: 2px;
}

.cust-trait-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.cust-trait-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

.cust-trait-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  padding: 2px 8px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* Customized Range Input */
.cust-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 4px 0 2px 0;
}

.cust-range:focus {
  background: #475569;
}

/* WebKit Slider Thumb */
.cust-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cust-range::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  background: #60a5fa;
}

.cust-range::-webkit-slider-thumb:active {
  transform: scale(1.25);
  background: #2563eb;
}

/* Firefox Slider Thumb */
.cust-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.cust-range::-moz-range-thumb:hover {
  transform: scale(1.18);
  background: #60a5fa;
}

.cust-range::-moz-range-thumb:active {
  transform: scale(1.25);
  background: #2563eb;
}

/* Firefox Slider Track */
.cust-range::-moz-range-track {
  background: #334155;
  height: 6px;
  border-radius: 4px;
}

/* Responsive Media Queries for Mobile & Coarse Pointers */
@media (max-width: 768px), (pointer: coarse) {
  #controls-hint {
    display: none !important;
  }

  #hud-overlay {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
  }

  .hud-panel {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 8px;
    max-width: calc(100vw - 20px);
  }

  .hud-pill {
    font-size: 0.8rem;
    gap: 5px;
  }

  .hud-pill-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .btn-share {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  #chat-container {
    bottom: max(96px, env(safe-area-inset-bottom));
    width: 90%;
  }

  #chat-input {
    width: 100%;
    font-size: 0.88rem;
  }

  #customizer-modal {
    max-width: 92vw;
    padding: 18px 16px;
  }

  .color-swatch {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  #btn-customize {
    top: 12px;
    right: 58px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    z-index: 60;
  }

  #chat-toggle-btn {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    z-index: 60;
  }

  #proximity-chat-panel {
    top: 58px;
    right: 12px;
    left: auto;
    bottom: auto;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 100px);
    transform: translateY(-12px) scale(0.98);
  }

  #proximity-chat-panel.active {
    transform: translateY(0) scale(1);
  }

  #proximity-chat-panel.hidden {
    transform: translateY(-12px) scale(0.98);
  }

  #proximity-chat-messages {
    max-height: calc(100vh - 250px);
    padding: 8px 10px;
  }

  .cust-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .cust-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .cust-trait-row {
    margin-bottom: 14px;
  }
}


