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

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

body {
  font-family: "Orbitron", monospace;
  background: #000000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 0, 100, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(0, 255, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(138, 43, 226, 0.1) 0%,
      transparent 50%
    );
  animation: bgPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bgPulse {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1;
  width: 100%;
  max-width: 600px;
}

.title {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, #00ffff, #ff00ff, #00ffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8))
    drop-shadow(0 0 40px rgba(255, 0, 255, 0.6));
  animation: pulse 2s ease-in-out infinite alternate,
    gradientShift 3s linear infinite;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 8px;
}

@keyframes gradientShift {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.status {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff,
    0 0 30px rgba(255, 0, 255, 0.5);
  margin-bottom: 10px;
  text-align: center;
  padding: 8px 20px;
  background: rgba(255, 0, 255, 0.1);
  border: 1px solid rgba(255, 0, 255, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  animation: statusGlow 2s ease-in-out infinite alternate;
}

@keyframes statusGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6),
      inset 0 0 20px rgba(255, 0, 255, 0.1);
  }
}

.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 540px;
}

.board-with-coords {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.coords-row {
  display: flex;
  justify-content: space-around;
  width: calc(100% - 40px);
  margin-left: 20px;
  padding: 0 15px;
}

.coords-row span {
  width: calc(100% / 8);
  text-align: center;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.4);
  font-family: 'Orbitron', monospace;
  text-transform: lowercase;
}

.coords-top {
  margin-bottom: 2px;
}

.coords-bottom {
  margin-top: 2px;
}

.coords-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 15px 0;
  width: 20px;
}

.coords-col span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100% / 8);
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.4);
  font-family: 'Orbitron', monospace;
}

.coords-left {
  padding-right: 4px;
}

.coords-right {
  padding-left: 4px;
}

.game-header {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  width: 100%;
  max-width: 540px;
}

.player-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
}

.player-flag-small {
  font-size: 1.2rem;
}

.player-name-small {
  font-size: 0.9rem;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
}

.player-wins-small,
.player-stats-small {
  font-size: 0.8rem;
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  padding: 15px;
  background: linear-gradient(145deg, #0a0a0a, #1a1a2a);
  border: 3px solid #00ffff;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3),
    inset 0 0 30px rgba(0, 255, 255, 0.05);
  flex: 1;
  aspect-ratio: 1;
  position: relative;
}

.chess-board::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
  border-radius: 15px;
  z-index: -1;
  opacity: 0.3;
  filter: blur(10px);
  animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
  0% {
    filter: blur(10px) hue-rotate(0deg);
  }
  100% {
    filter: blur(10px) hue-rotate(360deg);
  }
}

.square {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  aspect-ratio: 1;
  overflow: hidden;
}

.square::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.square:hover::before {
  opacity: 1;
}

.square.light {
  background: linear-gradient(135deg, #2a2a3a, #3a3a4a);
  box-shadow: inset 0 0 10px rgba(138, 43, 226, 0.1);
}

.square.dark {
  background: linear-gradient(135deg, #0a0a1a, #1a1a2a);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.square:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
    inset 0 0 20px rgba(0, 255, 255, 0.2);
  z-index: 10;
}

.square.selected {
  background: linear-gradient(135deg, #ff00ff, #ff1493, #ff00ff) !important;
  box-shadow: 0 0 30px rgba(255, 0, 255, 1),
    inset 0 0 30px rgba(255, 0, 255, 0.4);
  animation: selectedPulse 1s ease-in-out infinite;
  transform: scale(1.05);
  z-index: 15;
}

@keyframes selectedPulse {
  0%,
  100% {
    box-shadow: 0 0 30px rgba(255, 0, 255, 1),
      inset 0 0 30px rgba(255, 0, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 0, 255, 1),
      inset 0 0 40px rgba(255, 0, 255, 0.6);
  }
}

.square.possible-move {
  background: linear-gradient(135deg, #00ff00, #00ff88, #00ff00) !important;
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.8), inset 0 0 25px rgba(0, 255, 0, 0.3);
  animation: possibleMovePulse 1.5s ease-in-out infinite;
}

.square.possible-move::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  background: rgba(0, 255, 0, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

@keyframes possibleMovePulse {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8),
      inset 0 0 25px rgba(0, 255, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 255, 0, 1), inset 0 0 35px rgba(0, 255, 0, 0.5);
  }
}

.piece {
  text-shadow: 0 0 15px currentColor, 0 0 30px currentColor,
    0 0 45px currentColor;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  z-index: 5;
}

.piece.white {
  color: #00ffff;
  animation: pieceGlowWhite 3s ease-in-out infinite;
}

.piece.black {
  color: #ff00ff;
  animation: pieceGlowBlack 3s ease-in-out infinite;
}

@keyframes pieceGlowWhite {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 1));
  }
}

@keyframes pieceGlowBlack {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 0, 255, 1));
  }
}

.piece:hover {
  transform: scale(1.3) rotate(5deg);
  filter: drop-shadow(0 0 20px currentColor);
}

.controls {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 10px 25px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 8px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  position: relative;
  overflow: hidden;
}

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

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

.btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
  border-color: #00ffff;
}

.btn:active {
  transform: translateY(-1px) scale(1.02);
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 255, 0.02) 2px,
    rgba(0, 255, 255, 0.02) 4px
  );
  pointer-events: none;
  z-index: 10;
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(20px);
  }
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(
      rgba(0, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 1;
}

.move-history {
  position: fixed;
  right: 10px;
  top: 20px;
  width: 180px;
  max-height: 250px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #00ffff;
  border-radius: 15px;
  padding: 12px;
  color: #00ffff;
  font-size: 0.8rem;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4),
    inset 0 0 20px rgba(0, 255, 255, 0.05);
}

.move-history h3 {
  margin-bottom: 10px;
  text-align: center;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

.captured-pieces {
  position: fixed;
  right: 10px;
  top: 290px;
  width: 180px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #ff00ff;
  border-radius: 15px;
  padding: 12px;
  color: #ff00ff;
  font-size: 0.8rem;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4),
    inset 0 0 20px rgba(255, 0, 255, 0.05);
}

.captured-pieces h3 {
  margin-bottom: 10px;
  text-align: center;
  color: #ff00ff;
  font-size: 0.9rem;
  text-shadow: 0 0 10px #ff00ff;
}

.captured-section {
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(255, 0, 255, 0.05);
  border-radius: 8px;
}

.captured-section h4 {
  font-size: 0.7rem;
  margin-bottom: 5px;
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
}

.captured-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 25px;
}

.captured-piece {
  font-size: 1.1rem;
  opacity: 0.9;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 5px currentColor);
}

.captured-piece:hover {
  transform: scale(1.3);
  opacity: 1;
}

.chat-container {
  position: fixed;
  left: 10px;
  bottom: 10px;
  width: 250px;
  height: 300px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #00ff00;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.4),
    inset 0 0 20px rgba(0, 255, 0, 0.05);
}

.chat-header {
  padding: 12px;
  background: linear-gradient(135deg, #001a00, #003300);
  border-radius: 13px 13px 0 0;
  color: #00ff00;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  border-bottom: 2px solid #00ff00;
  text-shadow: 0 0 10px #00ff00;
}

.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 0.75rem;
  color: #00ff00;
}

.chat-input-container {
  display: flex;
  padding: 10px;
  gap: 8px;
  border-top: 2px solid #00ff00;
  background: rgba(0, 255, 0, 0.05);
}

.chat-input {
  flex: 1;
  padding: 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 5px;
  color: #00ff00;
  font-family: "Orbitron", monospace;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.chat-input:focus {
  outline: none;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
  background: rgba(0, 50, 0, 0.3);
}

.chat-send {
  padding: 8px 12px;
  background: linear-gradient(135deg, #003300, #001a00);
  color: #00ff00;
  border: 2px solid #00ff00;
  border-radius: 5px;
  font-family: "Orbitron", monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.chat-send:hover {
  background: linear-gradient(135deg, #00ff00, #00aa00);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
  transform: scale(1.05);
}

.chat-message {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 255, 0, 0.1);
  border-left: 3px solid #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-message .timestamp {
  color: #00aa00;
  font-size: 0.65rem;
  text-shadow: 0 0 5px #00ff00;
}

.chat-message .player {
  color: #00ffff;
  font-weight: bold;
  text-shadow: 0 0 5px #00ffff;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #00ff00;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.promotion-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.promotion-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

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

.promotion-content {
  background: linear-gradient(145deg, #1a1a2a, #0a0a1a);
  border: 3px solid #ff00ff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 0 40px rgba(255, 0, 255, 0.6),
    inset 0 0 30px rgba(255, 0, 255, 0.1);
  animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.promotion-content h2 {
  color: #ff00ff;
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
  text-shadow: 0 0 20px #ff00ff;
}

.promotion-pieces {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.promotion-piece {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
  border: 2px solid #00ffff;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.promotion-piece:hover {
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
  border-color: #ff00ff;
}

.promotion-piece .piece {
  filter: drop-shadow(0 0 10px currentColor);
}

.game-mode-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(10px);
}

.game-mode-modal.hidden {
  display: none;
}

.game-mode-content {
  background: linear-gradient(145deg, #1a1a2a, #0a0a1a);
  border: 3px solid #00ffff;
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.6),
    inset 0 0 30px rgba(0, 255, 255, 0.1);
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.game-mode-content h2 {
  color: #00ffff;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  text-shadow: 0 0 20px #00ffff;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.mode-btn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 10px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.mode-btn.online {
  background: linear-gradient(135deg, #1a2a1a, #0a1a0a);
  color: #00ff00;
  border-color: #00ff00;
}

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

.mode-btn:hover::before {
  width: 400px;
  height: 400px;
}

.mode-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
}

.mode-btn.online:hover {
  background: linear-gradient(135deg, #00ff00, #00aa00);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.8), 0 0 50px rgba(0, 255, 0, 0.4);
}

.firebase-notice {
  background: rgba(255, 100, 0, 0.1);
  border: 2px solid #ff6400;
  border-radius: 10px;
  padding: 15px;
  margin-top: 20px;
  color: #ff6400;
  font-size: 0.85rem;
  text-align: center;
}

.firebase-notice a {
  color: #00ffff;
  text-decoration: underline;
}

.difficulty-section {
  display: none;
  margin-top: 20px;
}

.difficulty-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.difficulty-section h3 {
  color: #ff00ff;
  text-align: center;
  margin-bottom: 15px;
  font-size: 1.3rem;
  text-shadow: 0 0 15px #ff00ff;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.difficulty-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #2a1a2a, #1a0a1a);
  color: #ff00ff;
  border: 2px solid #ff00ff;
  border-radius: 8px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.difficulty-btn:hover {
  background: linear-gradient(135deg, #ff00ff, #aa00aa);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
  transform: scale(1.05);
}

.difficulty-btn.easy {
  border-color: #00ff00;
  color: #00ff00;
}
.difficulty-btn.easy:hover {
  background: linear-gradient(135deg, #00ff00, #00aa00);
}

.difficulty-btn.medium {
  border-color: #ffff00;
  color: #ffff00;
}
.difficulty-btn.medium:hover {
  background: linear-gradient(135deg, #ffff00, #aaaa00);
}

.difficulty-btn.hard {
  border-color: #ff8800;
  color: #ff8800;
}
.difficulty-btn.hard:hover {
  background: linear-gradient(135deg, #ff8800, #aa5500);
}

.difficulty-btn.extreme {
  border-color: #ff0000;
  color: #ff0000;
}
.difficulty-btn.extreme:hover {
  background: linear-gradient(135deg, #ff0000, #aa0000);
}

.back-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background: transparent;
  color: #888;
  border: 2px solid #444;
  border-radius: 8px;
  font-family: "Orbitron", monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.back-btn:hover {
  color: #fff;
  border-color: #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.lobby-bottom-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
}

.lobby-bottom-actions .back-btn {
  flex: 1;
  margin-top: 0;
}

.lobby-bottom-actions .logout-btn {
  border-color: #ff4444;
  color: #ff4444;
}

.lobby-bottom-actions .logout-btn:hover {
  border-color: #ff6666;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.checkmate-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  backdrop-filter: blur(15px);
  animation: fadeIn 0.5s ease-out;
}

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

.checkmate-content {
  background: linear-gradient(145deg, #1a0a1a, #2a1a2a, #1a0a1a);
  border: 4px solid #ff00ff;
  border-radius: 25px;
  padding: 50px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 0, 255, 0.8), 0 0 100px rgba(255, 0, 255, 0.4),
    inset 0 0 50px rgba(255, 0, 255, 0.1);
  animation: checkmateEnter 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.checkmate-content::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 0, 255, 0.1),
    transparent
  );
  animation: shimmer 3s linear infinite;
}

@keyframes checkmateEnter {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.checkmate-content h2 {
  color: #ff00ff;
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff, 0 0 60px #ff00ff;
  animation: textPulse 1.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes textPulse {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff, 0 0 60px #ff00ff;
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 30px #ff00ff, 0 0 60px #ff00ff, 0 0 90px #ff00ff;
  }
}

.checkmate-winner {
  font-size: 2rem;
  color: #00ffff;
  margin-bottom: 30px;
  text-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff;
  position: relative;
  z-index: 1;
}

.checkmate-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: iconBounce 1s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

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

.checkmate-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  position: relative;
  z-index: 1;
}

.checkmate-btn {
  padding: 15px 35px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 3px solid #00ffff;
  border-radius: 12px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

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

.checkmate-btn:hover::before {
  width: 400px;
  height: 400px;
}

.checkmate-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(0, 255, 255, 0.4);
  transform: translateY(-5px) scale(1.05);
}

.checkmate-btn.secondary {
  background: linear-gradient(135deg, #2a1a2a, #1a0a1a);
  color: #ff00ff;
  border-color: #ff00ff;
}

.checkmate-btn.secondary::before {
  background: rgba(255, 0, 255, 0.3);
}

.checkmate-btn.secondary:hover {
  background: linear-gradient(135deg, #ff00ff, #aa00aa);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.8), 0 0 60px rgba(255, 0, 255, 0.4);
}

.fireworks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: fireworkFall 2s ease-out infinite;
}

@keyframes fireworkFall {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) scale(0);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .move-history {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 480px;
    margin-top: 15px;
    max-height: 150px;
  }

  .captured-pieces {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 480px;
    margin-top: 15px;
  }

  .chat-container {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 480px;
    margin-top: 15px;
    height: 250px;
  }
}

.move-history h3 {
  margin-bottom: 10px;
  text-align: center;
  color: #ff00ff;
}

.move-history::-webkit-scrollbar {
  width: 8px;
}

.move-history::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.move-history::-webkit-scrollbar-thumb {
  background: #00ffff;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

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

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

body {
  font-family: "Orbitron", monospace;
  background: #000000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(255, 0, 100, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(0, 255, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(138, 43, 226, 0.1) 0%,
      transparent 50%
    );
  animation: bgPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bgPulse {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1;
  width: 100%;
  max-width: 600px;
}

.title {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, #00ffff, #ff00ff, #00ffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8))
    drop-shadow(0 0 40px rgba(255, 0, 255, 0.6));
  animation: pulse 2s ease-in-out infinite alternate,
    gradientShift 3s linear infinite;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 8px;
}

@keyframes gradientShift {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.status {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff,
    0 0 30px rgba(255, 0, 255, 0.5);
  margin-bottom: 10px;
  text-align: center;
  padding: 8px 20px;
  background: rgba(255, 0, 255, 0.1);
  border: 1px solid rgba(255, 0, 255, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  animation: statusGlow 2s ease-in-out infinite alternate;
}

@keyframes statusGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6),
      inset 0 0 20px rgba(255, 0, 255, 0.1);
  }
}

.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 540px;
}

.board-with-coords {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.coords-row {
  display: flex;
  justify-content: space-around;
  width: calc(100% - 40px);
  margin-left: 20px;
  padding: 0 15px;
}

.coords-row span {
  width: calc(100% / 8);
  text-align: center;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.4);
  font-family: 'Orbitron', monospace;
  text-transform: lowercase;
}

.coords-top {
  margin-bottom: 2px;
}

.coords-bottom {
  margin-top: 2px;
}

.coords-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 15px 0;
  width: 20px;
}

.coords-col span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100% / 8);
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.4);
  font-family: 'Orbitron', monospace;
}

.coords-left {
  padding-right: 4px;
}

.coords-right {
  padding-left: 4px;
}

.game-header {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  width: 100%;
  max-width: 540px;
}

.player-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
}

.player-flag-small {
  font-size: 1.2rem;
}

.player-name-small {
  font-size: 0.9rem;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
}

.player-wins-small,
.player-stats-small {
  font-size: 0.8rem;
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  padding: 15px;
  background: linear-gradient(145deg, #0a0a0a, #1a1a2a);
  border: 3px solid #00ffff;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3),
    inset 0 0 30px rgba(0, 255, 255, 0.05);
  flex: 1;
  aspect-ratio: 1;
  position: relative;
}

.chess-board::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
  border-radius: 15px;
  z-index: -1;
  opacity: 0.3;
  filter: blur(10px);
  animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
  0% {
    filter: blur(10px) hue-rotate(0deg);
  }
  100% {
    filter: blur(10px) hue-rotate(360deg);
  }
}

.square {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  aspect-ratio: 1;
  overflow: hidden;
}

.square::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.square:hover::before {
  opacity: 1;
}

.square.light {
  background: linear-gradient(135deg, #2a2a3a, #3a3a4a);
  box-shadow: inset 0 0 10px rgba(138, 43, 226, 0.1);
}

.square.dark {
  background: linear-gradient(135deg, #0a0a1a, #1a1a2a);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.square:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
    inset 0 0 20px rgba(0, 255, 255, 0.2);
  z-index: 10;
}

.square.selected {
  background: linear-gradient(135deg, #ff00ff, #ff1493, #ff00ff) !important;
  box-shadow: 0 0 30px rgba(255, 0, 255, 1),
    inset 0 0 30px rgba(255, 0, 255, 0.4);
  animation: selectedPulse 1s ease-in-out infinite;
  transform: scale(1.05);
  z-index: 15;
}

@keyframes selectedPulse {
  0%,
  100% {
    box-shadow: 0 0 30px rgba(255, 0, 255, 1),
      inset 0 0 30px rgba(255, 0, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 0, 255, 1),
      inset 0 0 40px rgba(255, 0, 255, 0.6);
  }
}

.square.possible-move {
  background: linear-gradient(135deg, #00ff00, #00ff88, #00ff00) !important;
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.8), inset 0 0 25px rgba(0, 255, 0, 0.3);
  animation: possibleMovePulse 1.5s ease-in-out infinite;
}

.square.possible-move::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  background: rgba(0, 255, 0, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

@keyframes possibleMovePulse {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8),
      inset 0 0 25px rgba(0, 255, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 255, 0, 1), inset 0 0 35px rgba(0, 255, 0, 0.5);
  }
}

.piece {
  text-shadow: 0 0 15px currentColor, 0 0 30px currentColor,
    0 0 45px currentColor;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  z-index: 5;
}

.piece.white {
  color: #00ffff;
  animation: pieceGlowWhite 3s ease-in-out infinite;
}

.piece.black {
  color: #ff00ff;
  animation: pieceGlowBlack 3s ease-in-out infinite;
}

@keyframes pieceGlowWhite {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 1));
  }
}

@keyframes pieceGlowBlack {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 0, 255, 1));
  }
}

.piece:hover {
  transform: scale(1.3) rotate(5deg);
  filter: drop-shadow(0 0 20px currentColor);
}

.controls {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 10px 25px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 8px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  position: relative;
  overflow: hidden;
}

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

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

.btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
  border-color: #00ffff;
}

.btn:active {
  transform: translateY(-1px) scale(1.02);
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 255, 0.02) 2px,
    rgba(0, 255, 255, 0.02) 4px
  );
  pointer-events: none;
  z-index: 10;
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(20px);
  }
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(
      rgba(0, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 1;
}

/* Modales */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(15px);
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
}

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

.modal-content {
  background: linear-gradient(145deg, #1a1a2a, #0a0a1a);
  border: 3px solid #00ffff;
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.6),
    inset 0 0 30px rgba(0, 255, 255, 0.1);
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.modal-content h2 {
  color: #00ffff;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  text-shadow: 0 0 20px #00ffff;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mode-btn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 10px;
  font-family: "Orbitron", monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.4s ease;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.mode-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
  transform: translateY(-3px);
}

.mode-btn.online {
  background: linear-gradient(135deg, #1a2a1a, #0a1a0a);
  color: #00ff00;
  border-color: #00ff00;
}

.mode-btn.online:hover {
  background: linear-gradient(135deg, #00ff00, #00aa00);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
}

/* Login Modal */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  color: #00ffff;
  font-size: 0.9rem;
  text-shadow: 0 0 10px #00ffff;
}

.input-group input {
  padding: 12px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ffff;
  border-radius: 8px;
  color: #00ffff;
  font-family: "Orbitron", monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
  background: rgba(0, 50, 50, 0.3);
}

.divider {
  text-align: center;
  color: #666;
  margin: 10px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #333;
}

.divider::before {
  left: 0;
}
.divider::after {
  right: 0;
}

/* Lobby */
.lobby-content {
  max-width: 700px;
}

.player-info {
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #00ffff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.player-info h3 {
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
  margin-bottom: 5px;
}

.player-info p {
  color: #00ffff;
  opacity: 0.8;
}

.player-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar #player-flag {
  font-size: 1.8rem;
}

.player-avatar #player-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.player-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
  padding: 4px 10px;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 20px;
}

.player-stats .stat-item.stat-losses {
  color: #ff6666;
  background: rgba(255, 102, 102, 0.1);
  border-color: rgba(255, 102, 102, 0.3);
  text-shadow: 0 0 8px rgba(255, 102, 102, 0.5);
}

.player-stats .stat-item.stat-draws {
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.3);
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.player-stats .stat-icon {
  font-size: 1rem;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
  width: 100%;
}

.lobby-buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.lobby-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  color: #00ffff;
  border: 2px solid #00ffff;
  border-radius: 10px;
  font-family: "Orbitron", monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.lobby-btn:hover::before {
  width: 400px;
  height: 400px;
}

.lobby-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
}

.lobby-btn:active {
  transform: translateY(0) scale(1);
}

.lobby-btn-primary {
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  border: 2px solid #00ffff;
  padding: 20px 24px;
}

.lobby-btn-primary:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  color: #000;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(0, 255, 255, 0.4);
}

.lobby-btn-secondary {
  flex: 1;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  border: 2px solid #ff00ff;
  color: #ff00ff;
}

.lobby-btn-secondary:hover {
  background: linear-gradient(135deg, #ff00ff, #aa00aa);
  color: #000;
  box-shadow: 0 0 25px rgba(255, 0, 255, 0.8), 0 0 50px rgba(255, 0, 255, 0.4);
}

.lobby-btn-secondary::before {
  background: rgba(255, 0, 255, 0.3);
}

.btn-icon-svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
  filter: drop-shadow(0 0 3px currentColor);
}

.lobby-btn-secondary .btn-icon-svg {
  width: 24px;
  height: 24px;
}

.lobby-btn .btn-text {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px currentColor;
}

.lobby-btn-secondary .btn-text {
  font-size: 0.85rem;
}

.lobby-btn .btn-desc {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 400;
  letter-spacing: 0;
}

.game-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.game-code-display span {
  font-size: 2.5rem;
  font-weight: bold;
  color: #00ffff;
  letter-spacing: 8px;
  padding: 15px 25px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #00ffff;
  border-radius: 10px;
  text-shadow: 0 0 10px #00ffff;
}

.copy-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff00ff, #aa00aa);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #ff44ff, #cc00cc);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

.join-code-input {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.join-code-input input {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 12px;
  padding: 18px 30px 18px 42px;
  width: 280px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #00ffff;
  border-radius: 12px;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.join-code-input input::placeholder {
  color: rgba(0, 255, 255, 0.3);
  letter-spacing: 6px;
  font-size: 1.2rem;
}

.join-code-input input:focus {
  outline: none;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.5), inset 0 0 20px rgba(0, 255, 255, 0.15);
  border-color: #00ffff;
}

.join-actions {
  display: flex;
  justify-content: center;
  margin: 20px 0 15px 0;
}

.join-actions .lobby-btn {
  min-width: 180px;
}

.opponent-found-content {
  text-align: center;
}

.match-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 25px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.match-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.match-flag {
  font-size: 2.5rem;
}

.match-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.match-color {
  font-size: 0.85rem;
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
  padding: 4px 12px;
  background: rgba(255, 0, 255, 0.15);
  border: 1px solid rgba(255, 0, 255, 0.4);
  border-radius: 20px;
}

.vs-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 15px #ff00ff, 0 0 30px rgba(255, 0, 255, 0.5);
}

.history-content {
  max-width: 500px;
  width: 100%;
}

.history-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.5);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.history-item:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.5);
}

.history-info {
  flex: 1;
}

.history-opponent {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.history-flag {
  font-size: 1.2rem;
}

.history-name {
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 600;
}

.history-details {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: #888;
  font-family: 'Orbitron', monospace;
}

.history-color {
  color: #ff00ff;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-result {
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 600;
}

.history-result.result-win {
  background: rgba(0, 255, 0, 0.15);
  color: #00ff00;
  border: 1px solid rgba(0, 255, 0, 0.4);
}

.history-result.result-loss {
  background: rgba(255, 102, 102, 0.15);
  color: #ff6666;
  border: 1px solid rgba(255, 102, 102, 0.4);
}

.history-result.result-draw {
  background: rgba(255, 170, 0, 0.15);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.4);
}

.history-replay-btn {
  width: 36px;
  height: 36px;
  padding: 8px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  border: 2px solid #00ffff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-replay-btn svg {
  width: 16px;
  height: 16px;
  stroke: #00ffff;
}

.history-replay-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.history-replay-btn:hover svg {
  stroke: #000;
}

.history-empty,
.history-loading {
  text-align: center;
  color: #888;
  padding: 30px;
  font-family: 'Orbitron', monospace;
}

/* History Modal Mobile Responsive */
@media (max-width: 768px) {
  .history-content {
    max-width: calc(100vw - 30px);
    margin: 10px;
    padding: 15px;
  }
  
  .history-content h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .history-list {
    max-height: 55vh;
    margin: 15px 0;
    padding: 8px;
  }
  
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
  
  .history-info {
    width: 100%;
  }
  
  .history-opponent {
    gap: 6px;
  }
  
  .history-flag {
    font-size: 1.1rem;
  }
  
  .history-name {
    font-size: 0.9rem;
  }
  
  .history-details {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.7rem;
  }
  
  .history-actions {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  
  .history-result {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  
  .history-replay-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  
  .history-replay-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 400px) {
  .history-content {
    padding: 12px;
  }
  
  .history-content h2 {
    font-size: 1rem;
  }
  
  .history-list {
    max-height: 50vh;
    padding: 6px;
  }
  
  .history-item {
    padding: 10px;
  }
  
  .history-name {
    font-size: 0.85rem;
  }
  
  .history-details {
    font-size: 0.65rem;
  }
  
  .history-result {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

.replay-content {
  max-width: 85vw;
  width: 320px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 15px;
}

.replay-content h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.replay-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  font-family: 'Orbitron', monospace;
}

.replay-vs {
  color: #00ffff;
  font-size: 0.9rem;
}

.replay-result {
  color: #ff00ff;
  font-size: 0.85rem;
  padding: 4px 12px;
  background: rgba(255, 0, 255, 0.15);
  border: 1px solid rgba(255, 0, 255, 0.4);
  border-radius: 20px;
}

.replay-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 0;
  padding: 5px;
  background: linear-gradient(145deg, #0a0a0a, #1a1a2a);
  border: 2px solid #00ffff;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  aspect-ratio: 1;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 10px auto;
}

.replay-square {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  aspect-ratio: 1;
}

.replay-square.white-piece {
  color: #ffffff;
  text-shadow: 
    0 0 8px rgba(0, 255, 255, 0.9),
    0 0 15px rgba(0, 255, 255, 0.7),
    1px 1px 2px rgba(0, 0, 0, 0.8);
}

.replay-square.black-piece {
  color: #ff00ff;
  text-shadow: 
    0 0 8px rgba(255, 0, 255, 0.9),
    0 0 15px rgba(255, 0, 255, 0.7),
    1px 1px 2px rgba(0, 0, 0, 0.8);
}

.replay-square.light {
  background: linear-gradient(135deg, #2a2a4a, #1a1a3a);
}

.replay-square.dark {
  background: linear-gradient(135deg, #0a0a2a, #050515);
}

.replay-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.replay-btn {
  width: 36px;
  height: 36px;
  padding: 8px;
  background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
  border: 2px solid #00ffff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.replay-btn svg {
  width: 16px;
  height: 16px;
  stroke: #00ffff;
  fill: none;
}

.replay-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00aaaa);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.replay-btn:hover svg {
  stroke: #000;
}

.replay-counter {
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

.games-list {
  margin-top: 20px;
}

.games-list h3 {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
  margin-bottom: 15px;
  text-align: center;
}

.game-item {
  background: rgba(255, 0, 255, 0.1);
  border: 2px solid #ff00ff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.game-item:hover {
  background: rgba(255, 0, 255, 0.2);
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.game-info {
  color: #ff00ff;
}

.game-info strong {
  color: #00ffff;
}

.join-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, #2a1a2a, #1a0a1a);
  color: #00ff00;
  border: 2px solid #00ff00;
  border-radius: 8px;
  font-family: "Orbitron", monospace;
  cursor: pointer;
  transition: all 0.3s ease;
}

.join-btn:hover {
  background: linear-gradient(135deg, #00ff00, #00aa00);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

.waiting-screen {
  text-align: center;
  padding: 40px 20px;
}

.waiting-screen h3 {
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.game-code {
  background: rgba(255, 0, 255, 0.2);
  border: 3px solid #ff00ff;
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
}

.game-code p {
  color: #ff00ff;
  margin-bottom: 10px;
}

.game-code .code {
  font-size: 2rem;
  color: #00ffff;
  text-shadow: 0 0 20px #00ffff;
  letter-spacing: 5px;
}

.spinner {
  margin: 30px auto;
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 255, 255, 0.1);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
  .lobby-actions {
    gap: 10px;
  }
  
  .lobby-buttons-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-content {
    margin: 15px;
    padding: 20px;
    max-width: calc(100vw - 30px);
  }
  
  .game-code-display {
    flex-direction: column;
    gap: 12px;
  }
  
  .game-code-display span {
    font-size: 1.5rem;
    letter-spacing: 5px;
    padding: 12px 18px;
  }
  
  .copy-btn {
    width: 100%;
    padding: 12px 20px;
  }
  
  .match-display {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .match-flag {
    font-size: 2rem;
  }
  
  .match-name {
    font-size: 1rem;
  }
  
  .vs-text {
    font-size: 1.2rem;
  }
  
  .join-code-input input {
    font-size: 1.2rem;
    letter-spacing: 4px;
    padding: 12px 15px;
    width: 100%;
  }
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}
.promotion-piece {
  cursor: pointer;
  display: inline-block;
  margin: 10px;
  padding: 10px;
  background: #111;
  border-radius: 10px;
  transition: 0.3s;
}

.promotion-piece:hover {
  transform: scale(1.2);
  background: #222;
}
.possible-move {
  box-shadow: 0 0 20px #0ff inset;
}

/* Country List Styles */
.country-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
}

.country-list::-webkit-scrollbar {
  width: 8px;
}

.country-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.country-list::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.5);
  border-radius: 4px;
}

.country-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  font-family: "Orbitron", monospace;
  font-size: 0.9rem;
  text-align: left;
}

.country-list-item:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.country-list-item.selected {
  background: rgba(0, 255, 255, 0.2);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.country-list-item .country-flag {
  font-size: 1.5rem;
}

.country-list-item .country-name {
  color: #00ffff;
}

.country-list-item.selected .country-name {
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.country-list {
  margin-bottom: 20px;
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
  body::before {
    animation: none;
    opacity: 0.5;
  }
  
  .title {
    animation: gradientShift 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
  }
  
  .status {
    animation: none;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  }
  
  .square {
    transition: none;
  }
  
  .square:hover {
    transform: none;
  }
  
  .piece {
    filter: none;
    text-shadow: 0 0 5px currentColor;
  }
  
  .modal-content {
    backdrop-filter: none;
    background: rgba(10, 0, 20, 0.98);
  }
  
  .mode-btn, .difficulty-btn, .btn {
    transition: background 0.2s;
  }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* AGGRESSIVE Mobile Performance - Remove ALL expensive effects */
@media (max-width: 768px) {
  * {
    animation: none !important;
    transition: none !important;
  }
  
  body::before {
    display: none !important;
  }
  
  .title {
    filter: none !important;
    text-shadow: 0 0 5px #00ffff;
    animation: none !important;
  }
  
  .status {
    box-shadow: none !important;
    border: 1px solid #ff00ff;
  }
  
  .chess-board {
    box-shadow: none !important;
    border: 2px solid #00ffff;
  }
  
  .square {
    box-shadow: none !important;
  }
  
  .square.selected {
    box-shadow: inset 0 0 5px #00ff00 !important;
  }
  
  .square.possible-move::after {
    box-shadow: none !important;
  }
  
  .piece {
    text-shadow: none !important;
    filter: none !important;
  }
  
  .modal {
    backdrop-filter: none !important;
    background: rgba(0, 0, 0, 0.95) !important;
  }
  
  .modal-content {
    backdrop-filter: none !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
  }
  
  .mode-btn, .difficulty-btn, .btn, .lobby-btn {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .mode-btn:hover, .difficulty-btn:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .game-info, .chat-panel {
    backdrop-filter: none !important;
    box-shadow: none !important;
  }
  
  .spinner {
    animation: spin 1s linear infinite !important;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
}

/* Restore fireworks animation on mobile for checkmate modal */
@media (max-width: 768px) {
  .checkmate-modal .firework {
    animation: fireworkFall 2s ease-out infinite !important;
  }
  
  .checkmate-btn {
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}

/* Center checkmate buttons text for all devices */
.checkmate-btn {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Promotion modal - center pieces in buttons */
.promotion-piece {
  display: flex;
  justify-content: center;
  align-items: center;
}

.promotion-piece .piece {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

/* Responsive promotion modal for mobile */
@media (max-width: 768px) {
  .promotion-content {
    padding: 20px;
    margin: 10px;
    max-width: calc(100vw - 40px);
  }
  
  .promotion-content h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }
  
  .promotion-pieces {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: center;
  }
  
  .promotion-piece {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .promotion-piece:hover {
    transform: scale(1.05);
  }
}

@media (max-width: 400px) {
  .promotion-content {
    padding: 15px;
  }
  
  .promotion-content h2 {
    font-size: 1rem;
  }
  
  .promotion-piece {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
  }
}

/* Menu Footer Styles */
.menu-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.donate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(255, 0, 255, 0.1));
  border: 2px solid #ff00ff;
  border-radius: 25px;
  color: #ff00ff;
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.donate-btn svg {
  width: 18px;
  height: 18px;
  fill: #ff00ff;
}

.donate-btn:hover {
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.4), rgba(255, 0, 255, 0.2));
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  transform: translateY(-2px);
}

.menu-links {
  display: flex;
  gap: 15px;
}

.menu-links a {
  color: rgba(0, 255, 255, 0.7);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.menu-links a:hover {
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.made-by {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.made-by .heart-icon {
  color: #ff00ff;
  animation: heartbeat 1.5s ease infinite;
}

.made-by a {
  color: #00ffff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.made-by a:hover {
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

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

/* Donate Modal */
.donate-content {
  max-width: 400px;
  text-align: center;
}

.donate-message {
  margin-bottom: 25px;
}

.donate-message p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.donate-message .donate-thanks {
  color: #00ffff;
  font-style: italic;
}

.donate-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.donate-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 25px;
  border-radius: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.donate-link svg {
  width: 24px;
  height: 24px;
}

.donate-link.paypal {
  background: linear-gradient(135deg, #003087, #001f5c);
  border: 2px solid #0070ba;
  color: #ffffff;
}

.donate-link.paypal svg {
  fill: #00a1df;
}

.donate-link.paypal:hover {
  box-shadow: 0 0 25px rgba(0, 112, 186, 0.6);
  transform: translateY(-2px);
}

.donate-link.patreon {
  background: linear-gradient(135deg, #ff424d, #c9202d);
  border: 2px solid #ff424d;
  color: #ffffff;
}

.donate-link.patreon svg {
  fill: #ffffff;
}

.donate-link.patreon:hover {
  box-shadow: 0 0 25px rgba(255, 66, 77, 0.6);
  transform: translateY(-2px);
}

/* Terms Modal */
.terms-content {
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.terms-text {
  text-align: left;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}

.terms-text h3 {
  color: #00ffff;
  font-size: 0.95rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.terms-text h3:first-child {
  margin-top: 0;
}

.terms-text p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.terms-text::-webkit-scrollbar {
  width: 6px;
}

.terms-text::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.terms-text::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.4);
  border-radius: 3px;
}

.terms-text::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.6);
}
