/* ==================== NORDIC WINTER ELEGANCE ==================== */
/* A sophisticated Christmas theme with deep blues, warm golds, and frosted glass */

/* ==================== CUSTOM FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

/* ==================== CSS VARIABLES ==================== */
:root {
  /* Core palette - Nordic Winter (brightened) */
  --midnight: #0f1a2e;
  --midnight-light: #162440;
  --midnight-soft: #1c2d4a;
  --frost: #2a4a70;
  --frost-light: #3a5a80;

  /* Snow and ice */
  --snow: #f1f5f9;
  --snow-soft: #e2e8f0;
  --ice: #cbd5e1;
  --ice-blue: #7dd3fc;

  /* Warm accents */
  --gold: #e5c048;
  --gold-light: #f5d565;
  --gold-soft: rgba(229, 192, 72, 0.18);
  --gold-glow: rgba(229, 192, 72, 0.5);

  /* Christmas colors */
  --burgundy: #a33550;
  --burgundy-light: #c44060;
  --burgundy-soft: rgba(163, 53, 80, 0.25);
  --pine: #2a6b50;
  --pine-light: #3a8b68;
  --pine-soft: rgba(42, 107, 80, 0.35);

  /* UI colors */
  --text-primary: var(--snow);
  --text-secondary: var(--ice);
  --text-muted: #7a8a9e;
  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.15);

  /* Glass effect */
  --glass-bg: rgba(22, 36, 64, 0.9);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Cell colors */
  --cell-unrevealed: #243a54;
  --cell-revealed: #3a5068;
  --cell-missile: var(--burgundy-light);
  --cell-vsat: var(--ice-blue);
  --cell-uav: var(--pine-light);
  --cell-character: var(--gold);

  /* Fonts - Lexend everywhere */
  --font-display: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ==================== RESET ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--midnight);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== BACKGROUND EFFECTS ==================== */
.background-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(30, 77, 58, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 41, 66, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, var(--midnight) 0%, var(--midnight-light) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Snowfall animation */
.snowfall {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
  animation: snowfall linear infinite;
  will-change: transform;
}

.snowflake:nth-child(1) {
  left: 3%;
  animation-duration: 15s;
  animation-delay: 0s;
  font-size: 0.6rem;
}
.snowflake:nth-child(2) {
  left: 10%;
  animation-duration: 12s;
  animation-delay: 1s;
  font-size: 0.9rem;
}
.snowflake:nth-child(3) {
  left: 20%;
  animation-duration: 18s;
  animation-delay: 3s;
  font-size: 0.7rem;
}
.snowflake:nth-child(4) {
  left: 30%;
  animation-duration: 14s;
  animation-delay: 2s;
  font-size: 0.5rem;
}
.snowflake:nth-child(5) {
  left: 40%;
  animation-duration: 16s;
  animation-delay: 4s;
  font-size: 0.8rem;
}
.snowflake:nth-child(6) {
  left: 50%;
  animation-duration: 11s;
  animation-delay: 1.5s;
  font-size: 0.6rem;
}
.snowflake:nth-child(7) {
  left: 60%;
  animation-duration: 17s;
  animation-delay: 0.5s;
  font-size: 0.9rem;
}
.snowflake:nth-child(8) {
  left: 70%;
  animation-duration: 13s;
  animation-delay: 3.5s;
  font-size: 0.7rem;
}
.snowflake:nth-child(9) {
  left: 80%;
  animation-duration: 19s;
  animation-delay: 2.5s;
  font-size: 0.5rem;
}
.snowflake:nth-child(10) {
  left: 90%;
  animation-duration: 15s;
  animation-delay: 4.5s;
  font-size: 0.8rem;
}
.snowflake:nth-child(11) {
  left: 95%;
  animation-duration: 14s;
  animation-delay: 1.2s;
  font-size: 0.6rem;
}
.snowflake:nth-child(12) {
  left: 5%;
  animation-duration: 16s;
  animation-delay: 2.8s;
  font-size: 0.7rem;
}

@keyframes snowfall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

.login-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  z-index: 10;
}

.login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

/* Gold accent line at top */
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Subtle corner decoration */
.login-box::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-top: 2px solid var(--gold-soft);
  border-right: 2px solid var(--gold-soft);
  border-radius: 0 var(--radius-md) 0 0;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.login-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.25s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-light) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 41, 66, 0.4);
}

.login-btn:hover::before {
  left: 100%;
}

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

.error-message {
  color: var(--burgundy-light);
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 24px;
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 1.5rem;
  opacity: 0.4;
}

.login-footer span {
  margin: 0 8px;
}

/* ==================== GAME PAGE ==================== */
.game-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==================== GAME HEADER ==================== */
.game-header {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 100;
  position: relative;
}

/* Subtle gold underline */
.game-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

.code-display {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 12px;
  min-height: 2em;
}

.code-char {
  display: inline-block;
  width: 1.2em;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.code-char.found {
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  animation: charReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.code-char.empty {
  color: var(--text-muted);
  opacity: 0.4;
}

.code-separator {
  color: var(--text-muted);
  margin: 0 4px;
  opacity: 0.3;
}

@keyframes charReveal {
  0% {
    transform: scale(2.5) translateY(-10px);
    opacity: 0;
    color: white;
    text-shadow: 0 0 30px white;
  }
  50% {
    transform: scale(1.2) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Progress bar */
.progress-container {
  margin-bottom: 14px;
}

.progress-bar-outer {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pine) 0%, var(--pine-light) 50%, var(--gold) 100%);
  transition: width 0.4s ease;
  border-radius: 6px;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Stats row */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  gap: 16px;
}

.stats-left {
  display: flex;
  gap: 20px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.stat-icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Powerups */
.powerups {
  display: flex;
  gap: 8px;
}

.powerup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  font-weight: 600;
}

.powerup:hover:not(.disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.powerup.active {
  border-color: currentColor;
  box-shadow:
    0 0 20px currentColor,
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.powerup.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.powerup-icon {
  font-size: 1.2rem;
}

.powerup-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.powerup.missile {
  color: var(--cell-missile);
}
.powerup.missile:hover:not(.disabled) {
  background: var(--burgundy-soft);
}

.powerup.vsat {
  color: var(--cell-vsat);
}
.powerup.vsat:hover:not(.disabled) {
  background: rgba(125, 211, 252, 0.1);
}

.powerup.uav {
  color: var(--cell-uav);
}
.powerup.uav:hover:not(.disabled) {
  background: var(--pine-soft);
}

/* ==================== GRID CONTAINER ==================== */
.grid-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(ellipse at center, var(--midnight-soft) 0%, var(--midnight) 100%);
}

#grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 22, 40, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 480px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.visible .modal {
  transform: translateY(0) scale(1);
}

/* Custom scrollbar for modal */
.modal::-webkit-scrollbar {
  width: 6px;
}

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

.modal::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px var(--gold-glow));
  animation: gentleBounce 3s ease-in-out infinite;
}

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

.modal h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.modal-intro {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 1rem;
  line-height: 1.7;
}

.modal-intro strong {
  color: var(--gold);
}

.modal-section {
  margin-bottom: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.modal-section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.modal-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.modal-section p strong {
  color: var(--text-primary);
}

/* Powerups section in modal */
.powerups-section {
  background: linear-gradient(135deg, var(--pine-soft) 0%, var(--burgundy-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.powerups-section h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--snow);
  text-align: center;
}

.powerups-intro {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.powerup-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.powerup-item:last-child {
  margin-bottom: 0;
}

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

.powerup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

.powerup-badge.missile {
  background: var(--burgundy-soft);
  color: var(--cell-missile);
}

.powerup-badge.vsat {
  background: rgba(125, 211, 252, 0.15);
  color: var(--cell-vsat);
}

.powerup-badge.uav {
  background: var(--pine-soft);
  color: var(--cell-uav);
}

.spawn-rate {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  margin-left: auto;
}

.powerup-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.powerup-item p strong {
  color: var(--text-primary);
}

/* Tips section */
.modal-tips {
  background: var(--gold-soft);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.modal-tips p {
  color: var(--gold);
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

.modal-tips strong {
  color: var(--gold-light);
}

/* Modal button */
.modal-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--pine) 0%, var(--pine-light) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.modal-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 77, 58, 0.5);
}

.modal-btn:hover::before {
  left: 100%;
}

/* ==================== ADMIN CONTROLS ==================== */
.admin-controls {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-badge {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.admin-controls input {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 80px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.admin-controls input:focus {
  outline: none;
  border-color: var(--gold);
}

.admin-controls button {
  padding: 8px 16px;
  background: rgba(124, 58, 237, 0.3);
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: var(--radius-sm);
  color: #c4b5fd;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.admin-controls button:hover {
  background: rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.logout-btn {
  background: var(--burgundy-soft) !important;
  border-color: var(--burgundy) !important;
  color: var(--burgundy-light) !important;
  margin-left: auto;
}

.logout-btn:hover {
  background: var(--burgundy) !important;
  color: white !important;
}

/* Player logout button */
.logout-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.logout-btn-small {
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logout-btn-small:hover {
  background: var(--burgundy);
  color: white;
  border-color: var(--burgundy);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 41, 66, 0.4);
}

/* ==================== VICTORY MODAL ==================== */
.victory-modal .modal-icon {
  font-size: 4rem;
  animation: victoryBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryBounce {
  0% {
    transform: scale(0) rotate(-20deg);
  }
  50% {
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.victory-code {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  color: var(--gold);
  letter-spacing: 3px;
  padding: 20px;
  background: var(--gold-soft);
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  margin: 20px 0;
  text-shadow: 0 0 20px var(--gold-glow);
}

/* ==================== MOBILE HEADER COLLAPSE ==================== */
.header-collapsible {
  /* Desktop: visible by default */
}

.mobile-expand-btn {
  display: none; /* Hidden on desktop */
}

/* ==================== DESKTOP ZOOM CONTROLS ==================== */
.zoom-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  z-index: 100;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

.zoom-slider {
  width: 100px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.zoom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.zoom-fit-btn {
  width: 32px;
  height: 32px;
  background: var(--pine-soft);
  border: 1px solid var(--pine);
  border-radius: var(--radius-sm);
  color: var(--pine-light);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

.zoom-fit-btn:hover {
  background: var(--pine);
  color: white;
  transform: translateY(-1px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
  .login-box {
    padding: 36px 28px;
  }

  .login-title {
    font-size: 1.8rem;
  }

  /* Mobile header - collapsed by default */
  .game-header {
    padding: 8px 12px;
  }

  .header-collapsible {
    display: none;
    padding-bottom: 8px;
  }

  .game-header.expanded .header-collapsible {
    display: block;
  }

  .game-header.expanded .code-display {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  .game-header.expanded .stats-left {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
  }

  /* Mobile expand button */
  .mobile-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-expand-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
  }

  .expand-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
  }

  .game-header.expanded .expand-icon {
    transform: rotate(180deg);
  }

  /* Mobile stats row - horizontal with mini powerups */
  .stats-row {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }

  /* Mini powerups on mobile (collapsed state) */
  .powerups {
    gap: 6px;
  }

  .powerup {
    padding: 6px 10px;
    gap: 5px;
  }

  .powerup-icon {
    font-size: 1rem;
  }

  .powerup-count {
    font-size: 0.8rem;
  }

  /* Hide zoom controls on mobile - use pinch instead */
  .zoom-controls {
    display: none;
  }

  .modal {
    padding: 28px 24px;
    width: 95%;
  }

  .modal h2 {
    font-size: 1.6rem;
  }

  .powerups-section {
    padding: 18px;
  }

  .admin-controls {
    padding: 10px 16px;
    gap: 10px;
  }

  .admin-controls label {
    font-size: 0.8rem;
  }

  .admin-controls input {
    width: 60px;
    padding: 6px 10px;
  }
}

/* ==================== LOADING STATE ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  .snowflake,
  .progress-bar::after,
  .login-btn::before,
  .modal-btn::before {
    animation: none;
  }

  .modal,
  .code-char.found {
    transition-duration: 0.1s;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
