/* style.css - Base styles only */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  background: #000;
}

canvas {
  display: block;
}

#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  z-index: 1000;
  text-align: center;
}

/* Camera Control Toggle - Only in Normal Mode */
#cameraToggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#cameraToggle.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.toggle-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(145deg, rgba(20, 20, 35, 0.85) 0%, rgba(25, 25, 45, 0.80) 100%);
  backdrop-filter: blur(15px) saturate(150%);
  border: 1.5px solid rgba(94, 231, 223, 0.4);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 15px rgba(94, 231, 223, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-container:hover {
  background: linear-gradient(145deg, rgba(25, 25, 40, 0.90) 0%, rgba(30, 30, 50, 0.85) 100%);
  border-color: rgba(94, 231, 223, 0.6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(94, 231, 223, 0.25);
}

.toggle-label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #5ee7df;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  border: 1.5px solid rgba(94, 231, 223, 0.3);
  flex-shrink: 0;
}

.toggle-switch.active {
  background: rgba(94, 231, 223, 0.3);
  border-color: rgba(94, 231, 223, 0.8);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: linear-gradient(145deg, #ff6b6b, #ff5252);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(20px);
  background: linear-gradient(145deg, #00ff88, #00cc6a);
}

/* Dashboard Buttons - Only in Normal Mode */
#dashboardButtons {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#dashboardButtons.active {
  opacity: 1;
  pointer-events: auto;
}

.dashboard-btn {
  padding: 10px 16px;
  background: linear-gradient(145deg, rgba(20, 20, 35, 0.85) 0%, rgba(25, 25, 45, 0.80) 100%);
  backdrop-filter: blur(15px) saturate(150%);
  border: 1.5px solid rgba(94, 231, 223, 0.4);
  border-radius: 10px;
  color: #5ee7df;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 15px rgba(94, 231, 223, 0.15);
  white-space: nowrap;
  user-select: none;
}

.dashboard-btn:hover {
  background: linear-gradient(145deg, rgba(25, 25, 40, 0.90) 0%, rgba(30, 30, 50, 0.85) 100%);
  border-color: rgba(94, 231, 223, 0.6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(94, 231, 223, 0.25);
  transform: translateY(-2px);
}

.dashboard-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(94, 231, 223, 0.15);
}

/* Loading Screen Styles */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a4d68 0%, #088395 50%, #05bfdb 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

#loadingScreen.hidden {
  opacity: 0;
  transform: scale(1.15);
  pointer-events: none;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

#liquidCanvas {
  display: block;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
  transition: filter 0.8s ease;
}

#loadingScreen.hidden #liquidCanvas {
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6)) blur(2px);
}

/* Stars background */
#starsCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.8s ease-out;
}

#loadingScreen.hidden #starsCanvas {
  opacity: 0;
}

/* Transition overlay */
.transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #0a4d68 0%, #000000 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.8s ease-in-out;
}

.transition-overlay.active {
  opacity: 1;
}
.loading-text {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.85);
  letter-spacing: 2px;
  animation: loadingTextPulse 2s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
  z-index: 200;
}

@keyframes loadingTextPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.9;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .loading-text {
    font-size: 14px;
    bottom: 20px;
    letter-spacing: 1.5px;
  }
}

/* laptop-mode.css - Styles for laptop interaction mode */

/* Custom cursor for laptop screen */
#laptopCustomCursor {
  position: fixed;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 10000;
  display: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

#laptopCustomCursor svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* chess-style.css - COMPLETE REPLACEMENT */
/* Matches the anime glassmorphism theme used throughout the website */

:root {
  --anime-teal: #5ee7df;
  --anime-lavender: #b490ca;
  --anime-pink: #fbc2eb;
  --anime-gold: #f6d365;
  --anime-dark: #1a1a2e;
  --anime-purple: #a18cd1;
  
  --glow-teal: rgba(94, 231, 223, 0.6);
  --glow-purple: rgba(180, 144, 202, 0.6);
  --glow-pink: rgba(251, 194, 235, 0.6);
  
  /* Consistent glass background used throughout site */
  --glass-bg: linear-gradient(145deg, rgba(20, 20, 35, 0.98) 0%, rgba(25, 25, 45, 0.95) 100%);
  --glass-border: linear-gradient(135deg, rgba(94, 231, 223, 0.8), rgba(180, 144, 202, 0.6)) 1;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

canvas {
  display: block;
}

#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  text-align: center;
  font-family: 'Courier New', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#loading .loading-title {
  font-size: 2.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, var(--anime-teal), var(--anime-lavender), var(--anime-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
  animation: anime-glow 3s ease-in-out infinite;
}

#loading .loading-bar {
  width: 300px;
  height: 6px;
  background: rgba(94, 231, 223, 0.1);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(94, 231, 223, 0.3);
  position: relative;
}

#loading .loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--anime-teal), var(--anime-lavender), var(--anime-pink));
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px var(--glow-teal);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

#loading .loading-percent {
  font-size: 1.2rem;
  color: white;
  text-shadow: 0 0 15px var(--glow-teal);
  font-weight: 600;
  letter-spacing: 2px;
}

#loading .loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(94, 231, 223, 0.2);
  border-top-color: var(--anime-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Anime Glow Animation */
@keyframes anime-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px var(--glow-teal)) 
            drop-shadow(0 0 20px var(--glow-purple));
  }
  50% {
    filter: drop-shadow(0 0 15px var(--glow-pink)) 
            drop-shadow(0 0 30px var(--glow-purple));
  }
}

/* Welcome Screen - UPDATED TO MATCH SITE THEME */
#chessWelcome {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 3rem 4rem;
  border-radius: 20px;
  border: 2px solid;
  border-image: var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 
              0 0 60px rgba(94, 231, 223, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chessWelcome.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

#chessWelcome h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, var(--anime-teal), var(--anime-lavender), var(--anime-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
  animation: anime-glow 3s ease-in-out infinite;
  letter-spacing: 2px;
}

#chessWelcome p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
}

/* Buttons - UPDATED */
.chess-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.chess-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid rgba(94, 231, 223, 0.6);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: 1px;
}

.chess-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.chess-btn:hover::before {
  width: 300px;
  height: 300px;
}

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

.chess-btn.primary {
  background: linear-gradient(135deg, rgba(94, 231, 223, 0.25) 0%, rgba(94, 200, 223, 0.2) 100%);
  color: #5ee7df;
  box-shadow: 0 4px 16px rgba(94, 231, 223, 0.3), 0 0 30px rgba(94, 231, 223, 0.15);
}

.chess-btn.primary:hover {
  background: linear-gradient(135deg, rgba(94, 231, 223, 0.4) 0%, rgba(94, 200, 223, 0.35) 100%);
  box-shadow: 0 6px 24px rgba(94, 231, 223, 0.5), 0 0 40px rgba(94, 231, 223, 0.25);
  transform: translateY(-2px);
  border-color: rgba(94, 231, 223, 0.9);
}

.chess-btn.secondary {
  background: rgba(180, 144, 202, 0.15);
  color: #b490ca;
  border-color: rgba(180, 144, 202, 0.6);
  box-shadow: 0 4px 16px rgba(180, 144, 202, 0.2);
}

.chess-btn.secondary:hover {
  background: rgba(180, 144, 202, 0.3);
  box-shadow: 0 6px 24px rgba(180, 144, 202, 0.4);
  transform: translateY(-2px);
  border-color: rgba(180, 144, 202, 0.9);
}

.chess-btn.danger {
  background: linear-gradient(135deg, rgba(245, 87, 108, 0.85) 0%, rgba(220, 70, 90, 0.9) 100%);
  color: white;
  border-color: rgba(245, 87, 108, 0.9);
  box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5), 0 0 20px rgba(245, 87, 108, 0.2);
  backdrop-filter: blur(10px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.chess-btn.danger:hover {
  background: linear-gradient(135deg, rgba(245, 87, 108, 1) 0%, rgba(220, 70, 90, 1) 100%);
  box-shadow: 0 6px 24px rgba(245, 87, 108, 0.7), 0 0 30px rgba(245, 87, 108, 0.4);
  transform: translateY(-2px);
  border-color: rgba(255, 100, 120, 1);
}

.chess-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chess AI Loading Animation - Brand New Design */
.ai-loading-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 0 auto;
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  width: fit-content;
}

.ai-loading-spinner {
  position: relative;
  width: 140px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 0 auto;
}

/* Chess pieces bouncing animation */
.ai-loading-spinner::before {
  content: '♟';
  font-size: 2rem;
  animation: bounce-1 1.4s ease-in-out infinite;
  filter: drop-shadow(0 0 15px var(--glow-teal));
  color: var(--anime-teal);
}

.ai-loading-spinner::after {
  content: '♞';
  font-size: 2rem;
  animation: bounce-2 1.4s ease-in-out infinite 0.2s;
  filter: drop-shadow(0 0 15px var(--glow-lavender));
  color: var(--anime-lavender);
}

.ai-loading-spinner-inner {
  font-size: 2rem;
  animation: bounce-3 1.4s ease-in-out infinite 0.4s;
  filter: drop-shadow(0 0 15px var(--glow-pink));
  color: var(--anime-pink);
}

.ai-loading-spinner-inner::before {
  content: '♚';
}

/* Bouncing animations */
@keyframes bounce-1 {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-25px) scale(1.1);
  }
}

@keyframes bounce-2 {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-25px) scale(1.1);
  }
}

@keyframes bounce-3 {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-25px) scale(1.1);
  }
}

/* Enhanced loading text with wave effect */
.ai-loading-text {
  font-size: 1.15rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  margin: 0;
  background: linear-gradient(90deg, 
    var(--anime-teal) 0%, 
    var(--anime-lavender) 33%,
    var(--anime-pink) 66%, 
    var(--anime-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 100%;
  animation: gradient-wave 3s ease-in-out infinite;
  text-align: center;
  font-weight: 600;
  filter: drop-shadow(0 2px 8px rgba(94, 231, 223, 0.3));
}

@keyframes gradient-wave {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Animated dots */
.ai-loading-text::after {
  content: '';
  animation: loading-dots 1.5s steps(4, end) infinite;
  background: linear-gradient(90deg, var(--anime-teal), var(--anime-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes loading-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* Glowing underline effect */
.ai-loading-container::after {
  content: '';
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--anime-teal) 50%, 
    transparent 100%);
  animation: line-glow 2s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes line-glow {
  0%, 100% {
    opacity: 0.3;
    box-shadow: 0 0 5px var(--glow-teal);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px var(--glow-teal), 0 0 40px var(--glow-purple);
  }
}


/* Status Display - UPDATED TO MATCH THEME */
#chessStatus {
  position: fixed;
  top: 20px;
  left: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 2px solid;
  border-image: var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05),
              0 0 30px rgba(94, 231, 223, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 180px;
  max-width: 220px;
}

#chessStatus.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

#chessStatus h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, var(--anime-teal), var(--anime-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(94, 231, 223, 0.3);
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(94, 231, 223, 0.1);
}

.status-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.status-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-family: 'Segoe UI', sans-serif;
}

.status-value {
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
}

.status-value.turn-white {
  color: var(--anime-teal);
  text-shadow: 0 0 10px var(--glow-teal);
}

.status-value.turn-black {
  color: var(--anime-lavender);
  text-shadow: 0 0 10px var(--glow-purple);
}

/* Control Panel - UPDATED */
#chessControls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chessControls.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* Promotion UI - UPDATED */
#promotionUI {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  border: 2px solid;
  border-image: var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 
              0 0 60px rgba(94, 231, 223, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#promotionUI.show {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

#promotionTitle {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, var(--anime-teal), var(--anime-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.promotion-pieces {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.promo-piece {
  width: 80px;
  height: 80px;
  font-size: 3rem;
  background: rgba(94, 231, 223, 0.1);
  border: 2px solid rgba(94, 231, 223, 0.4);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.promo-piece:hover {
  background: linear-gradient(135deg, rgba(94, 231, 223, 0.3) 0%, rgba(180, 144, 202, 0.25) 100%);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 24px rgba(94, 231, 223, 0.6), 0 0 40px rgba(94, 231, 223, 0.3);
  border-color: rgba(94, 231, 223, 0.9);
}

/* Move Indicator - UPDATED */
.move-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 1.5rem 3rem;
  border-radius: 16px;
  border: 2px solid;
  border-image: var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05),
              0 0 40px rgba(94, 231, 223, 0.2);
  font-size: 1.5rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 2px;
}

.move-indicator.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Game Over Screen - UPDATED */
#gameOverScreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: 3rem 4rem;
  border-radius: 20px;
  border: 2px solid;
  border-image: var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 
              0 0 60px rgba(94, 231, 223, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#gameOverScreen.show {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

#gameOverTitle {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

#gameOverTitle .winner {
  background: linear-gradient(135deg, var(--anime-teal), var(--anime-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: anime-glow 2s ease-in-out infinite;
}

#gameOverTitle .loser {
  background: linear-gradient(135deg, var(--anime-lavender), #f5576c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#gameOverMessage {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  #chessWelcome {
    padding: 2rem 2.5rem;
  }
  
  #chessWelcome h1 {
    font-size: 2.2rem;
  }
  
  #chessStatus {
    display: none !important;
  }
  
  #chessControls {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .promotion-pieces {
    gap: 0.75rem;
  }
  
  .promo-piece {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
  }
}

/* Camera Debug Display - Keep same */
#cameraDebug {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid var(--anime-teal);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 
              0 0 30px rgba(94, 231, 223, 0.3);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: white;
  z-index: 999;
  min-width: 300px;
}

.debug-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.debug-line:last-child {
  margin-bottom: 0;
}

.debug-label {
  color: var(--anime-teal);
  font-weight: 600;
  margin-right: 1rem;
}

.debug-value {
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
  flex: 1;
}

/* css/audio-panel.css */

#radioPanel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 700px;
  height: 500px;
  background: linear-gradient(145deg, 
    rgba(80, 30, 25, 0.98) 0%, 
    rgba(60, 25, 20, 0.98) 50%, 
    rgba(70, 28, 22, 0.98) 100%);
  border: 12px solid;
  border-image: linear-gradient(135deg, 
    rgba(180, 140, 70, 1) 0%,
    rgba(212, 175, 100, 1) 20%,
    rgba(100, 70, 40, 1) 40%,
    rgba(212, 175, 100, 1) 60%,
    rgba(100, 70, 40, 1) 80%,
    rgba(180, 140, 70, 1) 100%) 1;
  border-radius: 15px;
  padding: 40px 50px;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 40px 120px rgba(0, 0, 0, 0.95),
    inset 0 8px 40px rgba(0, 0, 0, 0.8),
    inset 0 0 100px rgba(60, 25, 20, 0.7),
    0 0 80px rgba(212, 175, 100, 0.3);
  user-select: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Corner metal brackets - top left */
#radioPanel::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  top: -12px;
  left: -12px;
  background: linear-gradient(135deg, 
    rgba(212, 175, 100, 1) 0%,
    rgba(180, 140, 70, 1) 50%,
    rgba(100, 70, 40, 1) 100%);
  clip-path: polygon(
    0 0, 100% 0, 100% 25%, 25% 25%, 25% 100%, 0 100%
  );
  z-index: 10;
  box-shadow: 
    inset 2px 2px 5px rgba(255, 255, 255, 0.3),
    inset -2px -2px 5px rgba(0, 0, 0, 0.5);
}

/* Corner metal brackets - top right */
#radioPanel::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  top: -12px;
  right: -12px;
  background: linear-gradient(135deg, 
    rgba(212, 175, 100, 1) 0%,
    rgba(180, 140, 70, 1) 50%,
    rgba(100, 70, 40, 1) 100%);
  clip-path: polygon(
    0 0, 100% 0, 100% 100%, 75% 100%, 75% 25%, 0 25%
  );
  z-index: 10;
  box-shadow: 
    inset 2px 2px 5px rgba(255, 255, 255, 0.3),
    inset -2px -2px 5px rgba(0, 0, 0, 0.5);
}

#radioPanel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.radio-header {
  text-align: center;
  margin-bottom: 25px;
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
  position: relative;
}

/* Diagonal stripes in corners */
.corner-stripe {
  position: absolute;
  width: 60px;
  height: 60px;
  background: repeating-linear-gradient(
    45deg,
    rgba(212, 175, 100, 1) 0px,
    rgba(212, 175, 100, 1) 10px,
    rgba(40, 20, 15, 1) 10px,
    rgba(40, 20, 15, 1) 20px
  );
  z-index: 11;
}

.corner-stripe.top-left { top: 8px; left: 8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.corner-stripe.top-right { top: 8px; right: 8px; clip-path: polygon(100% 0, 100% 100%, 0 0); }
.corner-stripe.bottom-left { bottom: 8px; left: 8px; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.corner-stripe.bottom-right { bottom: 8px; right: 8px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.radio-header h2 {
  margin: 0 0 5px 0;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 12px;
  text-transform: uppercase;
  background: linear-gradient(135deg, 
    rgba(212, 175, 100, 1) 0%,
    rgba(255, 220, 150, 1) 30%,
    rgba(180, 140, 70, 1) 50%,
    rgba(255, 220, 150, 1) 70%,
    rgba(212, 175, 100, 1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.8));
}

.radio-header .subtitle {
  font-size: 13px;
  color: rgba(212, 175, 100, 1);
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 500;
}

.track-display {
  background: linear-gradient(145deg, rgba(15, 12, 10, 1) 0%, rgba(8, 6, 5, 1) 100%);
  border: 8px solid transparent;
  border-image: linear-gradient(135deg, rgba(180, 140, 70, 1) 0%, rgba(212, 175, 100, 1) 50%, rgba(180, 140, 70, 1) 100%) 1;
  border-radius: 25px;
  padding: 20px 30px;
  text-align: center;
  box-shadow: inset 0 6px 20px rgba(0,0,0,0.95), 0 4px 10px rgba(0,0,0,0.8);
  margin-bottom: 35px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.track-display::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.3) 1px, rgba(0,0,0,0.3) 2px),
    repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(0,0,0,0.3) 1px, rgba(0,0,0,0.3) 2px);
  background-size: 3px 3px;
  pointer-events: none;
  opacity: 0.6;
}

.track-display::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 15px;
  right: 15px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(212,175,100,0.3) 10%, rgba(212,175,100,0.3) 90%, transparent 100%);
  transform: translateY(-50%);
  z-index: 0;
}

.track-name {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  background: linear-gradient(90deg, rgba(212,175,100,1) 0%, rgba(255,220,150,1) 50%, rgba(212,175,100,1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
  animation: trackGlow 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(212,175,100,0.6));
  position: relative;
  z-index: 1;
}

@keyframes trackGlow { 0%,100%{opacity:0.85} 50%{opacity:1} }

/* hide only the tune knob if you mark it with .tune-knob */
.knob-container.tune-knob {
  display: none !important;
}

/* ensure the volume knob is visible if marked explicitly */
.knob-container.volume-knob {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}


.radio-controls .knob-container:last-of-type {
  display: none;
}
.radio-controls .knob-container:first-of-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

/* keep knob styles (volume) — styles preserved so nothing breaks when visible */
.knob-label {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  color: rgba(212, 175, 100, 1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.radio-knob {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, 
    rgba(100, 60, 50, 1) 0%, 
    rgba(70, 40, 35, 1) 35%, 
    rgba(50, 30, 25, 1) 70%,
    rgba(30, 18, 15, 1) 100%);
  border: 6px solid rgba(180, 140, 70, 1);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.95),
    inset 0 -6px 18px rgba(0, 0, 0, 0.9),
    inset 0 6px 18px rgba(212, 175, 100, 0.15),
    0 0 25px rgba(212, 175, 100, 0.2);
  cursor: grab;
  position: relative;
  transition: all 0.15s ease;
}

.radio-knob:active { cursor: grabbing; transform: scale(0.97); }

.radio-knob:hover {
  border-color: rgba(212, 175, 100, 1);
  box-shadow: 
    0 12px 35px rgba(212, 175, 100, 0.4),
    inset 0 -6px 18px rgba(0, 0, 0, 0.9),
    inset 0 6px 18px rgba(212, 175, 100, 0.25),
    0 0 35px rgba(212, 175, 100, 0.4);
}

.knob-pointer {
  position: absolute;
  width: 8px;
  height: 50px;
  background: linear-gradient(180deg, rgba(255,220,150,1) 0%, rgba(212,175,100,1) 50%, rgba(180,140,70,1) 100%);
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%);
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(212,175,100,1), 0 0 30px rgba(255,220,150,0.6), inset 0 2px 4px rgba(255,255,255,0.3);
  pointer-events: none;
}

.knob-center {
  position: absolute;
  width: 32px;
  height: 32px;
  background: radial-gradient(circle, rgba(255,200,130,1) 0%, rgba(212,175,100,1) 40%, rgba(180,140,70,1) 100%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.95), inset 0 3px 6px rgba(255,255,255,0.4), 0 0 20px rgba(212,175,100,0.6);
}

/* radio-controls: moved buttons to the right */
.radio-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 40px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Buttons group nudged right */
.button-container {
  display: flex;
  flex-direction: row;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 25px;
  transform: translateX(30px); /* adjust to move more/less */
  transition: transform 0.18s ease;
}

.radio-button {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(80,35,30,1) 0%, rgba(50,25,20,1) 100%);
  border: 4px solid transparent;
  border-image: linear-gradient(135deg, rgba(100,70,40,1) 0%, rgba(180,140,70,1) 50%, rgba(100,70,40,1) 100%) 1;
  box-shadow: 0 8px 20px rgba(0,0,0,0.95), inset 0 -3px 10px rgba(0,0,0,0.9), inset 0 3px 10px rgba(212,175,100,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(212,175,100,1);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.radio-button span {
  display: inline-block;
  line-height: 1;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

.radio-button.power-btn span {
  font-size: 32px;
  position: relative;
  top: -2px;
}

.radio-button:hover {
  border-image: linear-gradient(135deg, rgba(180,140,70,1) 0%, rgba(212,175,100,1) 50%, rgba(180,140,70,1) 100%) 1;
  box-shadow: 0 8px 25px rgba(212,175,100,0.5), inset 0 -3px 10px rgba(0,0,0,0.9), inset 0 3px 10px rgba(212,175,100,0.2), 0 0 30px rgba(212,175,100,0.4);
  transform: translateY(-3px);
  color: rgba(255,220,150,1);
}

.radio-button:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 4px 12px rgba(0,0,0,0.95), inset 0 3px 10px rgba(0,0,0,0.95), inset 0 -3px 10px rgba(212,175,100,0.05);
}

.radio-button.power-btn {
  background: linear-gradient(145deg, rgba(90,40,35,1) 0%, rgba(60,30,25,1) 100%);
}

/* Fix for mobile devices where power symbol doesn't render properly */
@media (max-width: 768px) {
  .radio-button {
    font-size: 24px;
  }
  
  .radio-button.power-btn span {
    font-size: 28px;
  }
}

.radio-button.power-btn.active {
  background: linear-gradient(145deg, rgba(212,175,100,0.4) 0%, rgba(180,140,70,0.3) 50%, rgba(70,35,30,1) 100%);
  border-image: linear-gradient(135deg, rgba(212,175,100,1) 0%, rgba(255,220,150,1) 50%, rgba(212,175,100,1) 100%) 1;
  box-shadow: 0 8px 20px rgba(212,175,100,0.7), inset 0 0 25px rgba(212,175,100,0.4), 0 0 40px rgba(212,175,100,0.5);
  color: rgba(255,230,180,1);
  text-shadow: 0 0 15px rgba(212,175,100,1);
}

.button-container .radio-button.play-btn {
  background: linear-gradient(145deg, rgba(180,140,70,0.5) 0%, rgba(100,70,40,1) 50%, rgba(60,35,25,1) 100%);
  border-image: linear-gradient(135deg, rgba(212,175,100,1) 0%, rgba(255,220,150,1) 50%, rgba(212,175,100,1) 100%) 1;
  box-shadow: 0 8px 20px rgba(0,0,0,0.95), inset 0 -3px 10px rgba(0,0,0,0.8), inset 0 3px 10px rgba(212,175,100,0.3), 0 0 25px rgba(212,175,100,0.4);
}


.volume-indicator {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  color: rgba(212, 175, 100, 1);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  letter-spacing: 2px;
}

#radioPanelClose {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 55px;
  height: 55px;
  border: 5px solid rgba(180, 140, 70, 1);
  background: radial-gradient(circle at 40% 40%, rgba(80,50,45,1) 0%, rgba(40,25,20,1) 100%);
  color: rgba(212,175,100,1);
  font-size: 36px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 0;
  font-weight: bold;
  box-shadow: 0 6px 18px rgba(0,0,0,0.95), inset 0 3px 8px rgba(212,175,100,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
}

#radioPanelClose:hover {
  background: radial-gradient(circle at 40% 40%, rgba(212,175,100,0.5) 0%, rgba(40,25,20,1) 100%);
  border-color: rgba(212,175,100,1);
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 6px 22px rgba(212,175,100,0.6), inset 0 0 18px rgba(212,175,100,0.3), 0 0 35px rgba(212,175,100,0.5);
  color: rgba(255,230,180,1);
  text-shadow: 0 0 15px rgba(212,175,100,1);
}

/* Bottom corner brackets (inside panel) */
.volume-indicator::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  bottom: 12px;
  left: 12px;
  background: linear-gradient(135deg, rgba(212,175,100,1) 0%, rgba(180,140,70,1) 50%, rgba(100,70,40,1) 100%);
  clip-path: polygon(0 0, 25% 0, 25% 75%, 100% 75%, 100% 100%, 0 100%);
  z-index: 10;
  pointer-events: none;
  box-shadow: inset 2px 2px 5px rgba(255,255,255,0.3), inset -2px -2px 5px rgba(0,0,0,0.5);
}
.volume-indicator::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  bottom: 12px;
  right: 12px;
  background: linear-gradient(135deg, rgba(212,175,100,1) 0%, rgba(180,140,70,1) 50%, rgba(100,70,40,1) 100%);
  clip-path: polygon(75% 0, 100% 0, 100% 100%, 0 100%, 0 75%, 75% 75%);
  z-index: 10;
  pointer-events: none;
  box-shadow: inset 2px 2px 5px rgba(255,255,255,0.3), inset -2px -2px 5px rgba(0,0,0,0.5);
}