/* Game UI Global Styles - Flat Minimalist Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Color Variables - Flat Dark with Green */
  --color-background: #1a1a1a;  /* Lighter dark gray instead of pure black */
  --color-background-secondary: #1d1d1d;
  --color-overlay: rgba(26, 26, 26, 0.95);

  --color-primary: #4CAF50;
  --color-primary-hover: #5CBF60;
  --color-primary-active: #3CA040;

  --color-text: #FFFFFF;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.4);

  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-active: #4CAF50;

  --color-success: #4CAF50;
  --color-warning: #FFC107;
  --color-error: #F44336;
  --color-info: #2196F3;

  /* Typography - Clean and Simple */
  --font-family: 'Poppins', 'Segoe UI', 'Arial', sans-serif;
  --font-size-small: 12px;
  --font-size-medium: 14px;
  --font-size-large: 16px;
  --font-size-title: 20px;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Border Radius - Subtle */
  --radius-small: 4px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-round: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Reset for game UI elements */
.game-modal-overlay *,
.game-modal *,
.settings-gear-button * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Custom Scrollbar for modals - Minimal Style */
.game-modal::-webkit-scrollbar {
  width: 6px;
}

.game-modal::-webkit-scrollbar-track {
  background: transparent;
}

.game-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-small);
}

.game-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Custom Slider Styles */
.game-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--color-primary) 0%,
    var(--color-primary) var(--value, 50%),
    rgba(255, 255, 255, 0.1) var(--value, 50%),
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: 3px;
  outline: none;
  transition: all var(--transition-fast);
}

.game-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #4CAF50 0%, #45A045 100%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.game-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

.game-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.game-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #4CAF50 0%, #45A045 100%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.game-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Update slider background based on value */
.game-slider {
  position: relative;
}

.game-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4CAF50 0%, #5CBF60 100%);
  width: var(--slider-value, 50%);
  pointer-events: none;
}

/* Toggle Switch Animations */
.game-toggle {
  position: relative;
  display: block;
  cursor: pointer;
}

.game-toggle:hover {
  filter: brightness(1.1);
}

/* Button Styles - Flat Minimal */
.game-button,
.flat-button {
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.game-button-primary {
  background: var(--color-primary);
  color: white;
}

.game-button-primary:hover {
  background: var(--color-primary-hover);
}

.game-button-primary:active {
  background: var(--color-primary-active);
}

.game-button-secondary {
  background: transparent;
  color: white;
  border: 1px solid var(--color-border);
}

.game-button-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Icon Buttons - Minimal */
.flat-button-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s ease;
  color: var(--color-text-secondary);
}

.flat-button-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.game-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-button-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6), 0 0 30px rgba(76, 175, 80, 0.4);
  }
  100% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.2);
  }
}

/* Game Panel/UI Base Styles - Matching gray background */
.game-panel, .game-ui-footer, .game-footer {
  background: linear-gradient(to bottom, rgba(26, 26, 26, 0.85), rgba(29, 29, 29, 0.9));
  border-top: 1px solid rgba(76, 175, 80, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -2px 10px rgba(76, 175, 80, 0.05);
}

/* HUD and score panels */
.game-hud, .game-score-panel {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(32, 32, 32, 0.75));
  border: 1px solid rgba(76, 175, 80, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Modal Animations - Simple Fade */
.game-modal-overlay {
  animation: fadeIn var(--transition-normal);
}

.game-modal-overlay.closing {
  animation: fadeOut var(--transition-normal);
}

.game-modal.flat-panel {
  animation: fadeInScale var(--transition-normal);
}

.game-modal.closing {
  animation: fadeOutScale var(--transition-normal);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Settings Button Hover Effect */
.settings-gear-button {
  position: relative;
}

.settings-gear-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.settings-gear-button:hover::after {
  opacity: 1;
}

/* Utility Classes */
.game-text-glow {
  text-shadow: 0 0 10px currentColor;
}

.game-bg-pulse {
  animation: pulse 2s infinite;
}

.game-border-glow {
  animation: glow 2s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --font-size-small: 11px;
    --font-size-medium: 13px;
    --font-size-large: 16px;
    --font-size-title: 20px;
  }

  .game-button {
    padding: 10px 18px;
    font-size: 12px;
  }

  .game-slider::-webkit-slider-thumb,
  .game-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  /* Already dark by default */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: rgba(76, 175, 80, 0.5);
    --color-border-light: rgba(255, 255, 255, 0.3);
  }

  .game-button {
    border: 2px solid currentColor;
  }
}

/* Script for dynamic slider values */
/* This should be handled in JavaScript by updating the CSS variable */