@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@300;400;700;900&family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --primary-color: #00f5ff;
  --secondary-color: #ff0080;
  --accent-color: #8000ff;
  --success-color: #00ff88;
  --warning-color: #ffaa00;
  --danger-color: #ff4444;
  --dark-bg: #0a0a0a;
  --dark-panel: #1a1a1a;
  --dark-border: #333333;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --glass-bg: rgba(0, 0, 0, 0.85);
  --glass-border: rgba(255, 255, 255, 0.15);
  --neon-glow: 0 0 20px currentColor;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
  --border-radius: 12px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
}

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

body {
  font-family: "Roboto", sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 50%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.loading-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.loading-title {
  font-family: "Orbitron", monospace;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
  margin-bottom: 2rem;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: var(--dark-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px currentColor;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Game Canvas */
.game-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

/* HUD Container */
.hud-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.hud-container > * {
  pointer-events: auto;
}

/* Top HUD */
.hud-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.hud-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.hud-title {
  font-family: "Orbitron", monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
  margin-bottom: 0.5rem;
}

.hud-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.stat-label {
  color: var(--text-secondary);
}

.stat-value {
  color: var(--success-color);
  font-weight: 500;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-primary);
  box-shadow: var(--neon-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px currentColor;
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.1em;
}

.full-width {
  width: 100%;
  justify-content: center;
}

/* Mobile Controls */
.mobile-controls {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 20;
}

.mobile-controls > * {
  pointer-events: auto;
}

.joystick-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.joystick-wrapper:hover,
.joystick-wrapper:active {
  opacity: 1;
}

.joystick-container {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 3px solid var(--primary-color);
  position: relative;
  touch-action: none;
  box-shadow: inset 0 0 30px rgba(0, 245, 255, 0.2), 0 0 20px rgba(0, 245, 255, 0.3);
}

.joystick-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px currentColor;
}

.joystick-knob {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-color) 0%, var(--secondary-color) 100%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.4);
  transition: all 0.1s ease;
}

.joystick-knob:active {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 35px rgba(0, 245, 255, 1), inset 0 0 15px rgba(255, 255, 255, 0.5);
}

.joystick-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.action-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.control-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--accent-color);
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(128, 0, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.control-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 25px var(--accent-color), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.jump-btn {
  border-color: var(--success-color);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.run-btn {
  border-color: var(--warning-color);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.interact-btn {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Shop Panel */
.shop-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shop-panel.active {
  transform: translateX(0);
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.shop-title {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
}

.close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--danger-color);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--danger-color);
}

.shop-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  -webkit-overflow-scrolling: touch;
}

/* Chat Panel */
.chat-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 350px;
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.chat-panel.active {
  transform: translateX(0);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.5);
}

.chat-title {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

.chat-message.own {
  background: rgba(0, 245, 255, 0.1);
  border-color: var(--primary-color);
  margin-left: 2rem;
}

.chat-message.other {
  background: rgba(255, 255, 255, 0.05);
  margin-right: 2rem;
}

.chat-username {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.chat-text {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.chat-input-container {
  display: flex;
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--dark-border);
  border-radius: var(--border-radius);
  background: var(--dark-bg);
  color: var(--text-primary);
  font-family: inherit;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.send-btn {
  padding: 0.75rem;
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: var(--dark-bg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.send-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1030; /* Adjusted z-index */
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--dark-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.modal-title {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
}

/* Forms */
.shop-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--dark-border);
  border-radius: var(--border-radius);
  background: var(--dark-bg);
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

/* Settings */
.settings-content {
  padding: 1.5rem;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--dark-border);
  outline: none;
  -webkit-appearance: none;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 10px currentColor;
}

.setting-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000; /* Ensure notifications are above everything */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.9rem;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-smooth);
  max-width: 300px;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-success {
  border-color: var(--success-color);
  background: rgba(0, 255, 136, 0.1);
}

.notification-error {
  border-color: var(--danger-color);
  background: rgba(255, 68, 68, 0.1);
}

.notification-info {
  border-color: var(--primary-color);
  background: rgba(0, 245, 255, 0.1);
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px currentColor;
  }
  50% {
    box-shadow: 0 0 40px currentColor;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hud-top {
    align-items: stretch;
  }

  .action-buttons {
    justify-content: center;
  }

  .modal-content {
    margin: 0.5rem;
    max-width: none;
  }

  .shop-panel,
  .chat-panel {
    max-width: none;
  }

  .joystick-container {
    width: 120px;
    height: 120px;
  }

  .joystick-knob {
    width: 50px;
    height: 50px;
  }

  .control-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .mobile-controls {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .hud-panel {
    padding: 0.75rem;
  }

  .hud-title {
    font-size: 1rem;
  }

  .stat-item {
    font-size: 0.7rem;
  }

  .joystick-container {
    width: 100px;
    height: 100px;
  }

  .joystick-knob {
    width: 40px;
    height: 40px;
  }

  .control-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .mobile-controls {
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }
}

/* Performance optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Disable text selection on game elements */
.hud-container,
.mobile-controls,
.shop-panel,
.chat-panel {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Improved touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  .control-btn {
    min-width: 60px;
    min-height: 60px;
  }

  .joystick-container {
    min-width: 120px;
    min-height: 120px;
  }
}

/* Asegurarse de que los controles móviles siempre sean visibles en modo móvil */
@media (max-width: 768px) {
  .mobile-controls {
    display: flex !important;
  }
}

/* Añadir clase para forzar la visualización de controles móviles en cualquier dispositivo */
.force-mobile-controls .mobile-controls {
  display: flex !important;
}

/* Shop Popup */
.shop-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1040; /* Adjusted z-index */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.shop-popup.active {
  opacity: 1;
  visibility: visible; /* Becomes visible and interactive */
  transition: opacity 0.3s ease, visibility 0s linear 0s; /* Visibility changes immediately */
}

.popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.popup-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.5);
}

.popup-title {
  font-family: "Orbitron", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--neon-glow);
  margin: 0;
}

.popup-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--danger-color);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--danger-color);
}

.popup-content {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 60vh;
  -webkit-overflow-scrolling: touch;
}

/* Responsive popup */
@media (max-width: 768px) {
  .popup-container {
    width: 95%;
    max-height: 85vh;
  }

  .popup-header {
    padding: 1rem;
  }

  .popup-title {
    font-size: 1.1rem;
  }

  .popup-content {
    padding: 1rem;
    max-height: 65vh;
  }
}

/* Minimap Styles */
.minimap-container {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  width: 150px;
  height: 150px;
  background: rgba(10, 10, 20, 0.75); /* Darker, less transparent */
  backdrop-filter: blur(8px);
  /* border: 2px solid var(--primary-color); */
  border-radius: 50%; /* Circular minimap */
  overflow: hidden;
  box-shadow: 0 0 15px var(--primary-color), inset 0 0 10px rgba(0, 245, 255, 0.2);
  z-index: 20; /* Ensure it's above mobile controls if they overlap */
}

#minimapCanvas {
  width: 100%;
  height: 100%;
  display: block; /* Remove any default canvas spacing */
}

/* Adjust mobile controls if minimap is present */
@media (max-width: 768px) {
  .mobile-controls {
    /* Adjust if minimap overlaps, e.g., more padding-bottom or specific layout */
  }
  .minimap-container {
    width: 120px;
    height: 120px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
  /* If action controls are on the right, ensure no overlap */
  .mobile-controls .action-controls {
    margin-right: calc(120px + 1rem); /* Example: if minimap is 120px wide */
  }
}

@media (max-width: 480px) {
  .minimap-container {
    width: 100px;
    height: 100px;
    bottom: 1rem;
    right: 1rem;
  }
  .mobile-controls .action-controls {
    margin-right: calc(100px + 0.5rem);
  }
}

/* Ensure HUD container allows pointer events for minimap if it's a child */
.hud-container > .minimap-container {
  pointer-events: auto;
}

/* Question Popup Styles */
.question-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050; /* Increased z-index */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.question-popup.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.question-container {
  padding: 0;
}

.question-text {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(0, 245, 255, 0.1);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 245, 255, 0.3);
}

.question-text h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  line-height: 1.4;
  margin: 0;
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--glass-border);
  border-radius: var(--border-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.answer-btn:hover {
  border-color: var(--primary-color);
  background: rgba(0, 245, 255, 0.1);
  transform: translateX(5px);
}

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.answer-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--dark-bg);
  font-weight: bold;
  flex-shrink: 0;
}

.answer-text {
  flex: 1;
  line-height: 1.4;
}

.answer-btn.correct-answer {
  border-color: var(--success-color);
  background: rgba(0, 255, 136, 0.2);
  animation: correct-pulse 0.6s ease;
}

.answer-btn.correct-answer .answer-letter {
  background: var(--success-color);
}

.answer-btn.wrong-answer {
  border-color: var(--danger-color);
  background: rgba(255, 68, 68, 0.2);
  animation: wrong-shake 0.6s ease;
}

.answer-btn.wrong-answer .answer-letter {
  background: var(--danger-color);
}

.question-timer {
  height: 6px;
  background: var(--dark-border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), var(--warning-color), var(--danger-color));
  width: 100%;
  transition: width 30s linear;
}

.loading-question {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Category Bubble Styles - IMPROVED FOR MOBILE */
.category-bubble {
  animation: bubble-appear 0.3s ease;
  z-index: 1000; /* Lowered z-index, removed !important */
  position: fixed !important; /* Keep fixed for positioning */
  min-width: 120px;
  min-height: 60px;
  -webkit-tap-highlight-color: rgba(0, 245, 255, 0.3);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto !important;
}

/* Mobile-specific improvements for category bubbles */
@media (hover: none) and (pointer: coarse) {
  .category-bubble {
    /* Larger touch targets on mobile */
    min-width: 140px;
    min-height: 70px;
    padding: 16px 20px !important;
    font-size: 18px !important;
    /* Better visual feedback */
    border: 3px solid rgba(255, 255, 255, 0.4) !important;
  }
}

/* Celebration Animation */
.popup-container.celebration {
  animation: celebration-bounce 0.6s ease;
}

.popup-container.shake {
  animation: shake 0.6s ease;
}

/* Confetti Animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes bubble-appear {
  0% {
    transform: scale(0) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes correct-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--success-color);
  }
}

@keyframes wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes celebration-bounce {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
  }
  75% {
    transform: translate(-50%, -50%) scale(1.1) rotate(-2deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  25% {
    transform: translate(-52%, -50%);
  }
  75% {
    transform: translate(-48%, -50%);
  }
}

/* Responsive adjustments for question popup */
@media (max-width: 768px) {
  .question-text h3 {
    font-size: 1rem;
  }

  .answer-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .answer-letter {
    width: 25px;
    height: 25px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .answers-container {
    gap: 0.75rem;
  }

  .answer-btn {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .question-text {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
  }
}

/* Chat Bubbles */
.chat-bubble {
  display: none;
  position: fixed;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  max-width: 250px;
  text-align: center;
  z-index: 1500;
  pointer-events: none;
  border: 2px solid rgba(0, 245, 255, 0.6);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.4), 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: bubble-float 0.3s ease-out;
  font-family: "Roboto", sans-serif;
  line-height: 1.3;
}

.chat-bubble .chat-content {
  margin: 0;
  padding: 0;
}

@keyframes bubble-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

/* Ensure chat bubbles are visible above everything */
.chat-bubble {
  z-index: 1500 !important;
}
