:root {
  /* Psychedelic Palette */
  --bg-deep: #090514;
  --bg-primary: #0f0a21;
  --bg-secondary: rgba(22, 14, 46, 0.75);
  --bg-card: rgba(33, 20, 68, 0.6);
  --bg-card-hover: rgba(48, 28, 98, 0.8);
  
  --text-main: #ffffff;
  --text-muted: #c4b5fd;
  --text-dim: #8b7cb6;

  /* Vibrant Psychedelic Accents */
  --neon-pink: #ff1389;
  --neon-cyan: #00f7ff;
  --neon-purple: #b339fe;
  --neon-gold: #ffbe0b;
  --neon-lime: #00ff87;
  --neon-orange: #ff5400;

  /* Gradients */
  --grad-psycho: linear-gradient(135deg, #ff007f 0%, #7928ca 35%, #00f2fe 70%, #43e97b 100%);
  --grad-aurora: linear-gradient(45deg, #f72585, #7209b7, #3a0ca3, #4361ee, #4cc9f0);
  --grad-sunset: linear-gradient(135deg, #ff007f, #ffaa00);
  --grad-electric: linear-gradient(135deg, #00f2fe, #4facfe);
  --grad-acid: linear-gradient(135deg, #00ff87, #60efff);
  --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  
  /* Glass & Borders */
  --border-glass: rgba(196, 181, 253, 0.22);
  --border-neon: rgba(255, 19, 137, 0.5);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-psycho: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(179, 57, 254, 0.25);

  /* Chessboard Themes */
  --sq-light: #f7d6ff;
  --sq-dark: #6b21a8;
  --sq-highlight: rgba(255, 240, 31, 0.55);
  --sq-move-dot: rgba(0, 247, 255, 0.85);
  --sq-active: rgba(255, 19, 137, 0.65);
}

/* THEMES */
.theme-psycho {
  --sq-light: #f7d6ff;
  --sq-dark: #6b21a8;
}
.theme-cyber {
  --sq-light: #a5f3fc;
  --sq-dark: #831843;
}
.theme-sunset {
  --sq-light: #fef08a;
  --sq-dark: #4c1d95;
}
.theme-acid-green {
  --sq-light: #bbf7d0;
  --sq-dark: #064e3b;
}

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

/* Background with animated psychedelic mesh */
body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 0% 0%, rgba(247, 37, 133, 0.25) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(0, 247, 255, 0.2) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(114, 9, 183, 0.3) 0px, transparent 65%),
    radial-gradient(at 0% 100%, rgba(0, 255, 135, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 84, 0, 0.25) 0px, transparent 50%);
  background-attachment: fixed;
  background-size: 150% 150%;
  animation: psycho-bg 20s ease infinite alternate;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

@keyframes psycho-bg {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 50% 100%; }
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-psycho);
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-psycho);
  background-size: 200% auto;
  animation: rainbow-shift 4s linear infinite;
}

@keyframes rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  position: relative;
  width: 52px;
  height: 52px;
  background: var(--grad-psycho);
  background-size: 200% 200%;
  animation: rainbow-shift 5s ease infinite;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 25px rgba(255, 19, 137, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.4);
}

.chess-icon {
  color: #fff;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}

.music-note {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 18px;
  color: #fff;
  background: #ff007f;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px #ff007f;
  animation: float-note 2s ease-in-out infinite alternate;
}

@keyframes float-note {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(12deg); }
}

.app-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ff007f, #00f2fe, #ffbe0b, #00ff87, #ff007f);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-shift 6s linear infinite;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card);
  color: var(--text-main);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px) scale(1.02);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.4);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-icon {
  padding: 10px 14px;
  font-size: 1.15rem;
}

.btn.active {
  border-color: var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 19, 137, 0.35), rgba(114, 9, 183, 0.35));
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 19, 137, 0.5);
}

.btn-primary {
  background: var(--grad-psycho);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(255, 19, 137, 0.4);
}

.btn-primary:hover {
  animation: rainbow-shift 3s ease infinite;
  box-shadow: 0 6px 25px rgba(0, 247, 255, 0.6);
}

.btn-secondary {
  background: rgba(45, 27, 89, 0.7);
  border: 1px solid rgba(196, 181, 253, 0.3);
}

.btn-secondary:hover {
  border-color: var(--neon-purple);
  box-shadow: 0 0 15px rgba(179, 57, 254, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #00b4d8, #00f5d4);
  color: #051622;
  border: none;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(0, 245, 212, 0.4);
}

.btn-success:hover {
  box-shadow: 0 6px 22px rgba(0, 245, 212, 0.7);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(247, 37, 133, 0.3));
  border: 1px solid rgba(247, 37, 133, 0.6);
  color: #ffb3c6;
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(247, 37, 133, 0.6));
  box-shadow: 0 0 18px rgba(247, 37, 133, 0.6);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Main Layout */
.main-content {
  display: grid;
  grid-template-columns: minmax(400px, 1.2fr) 460px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Board Section */
.board-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-psycho);
  gap: 20px;
}

.game-status-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
}

.turn-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.turn-dot.white {
  background: #ffffff;
  box-shadow: 0 0 12px #ffffff;
}

.turn-dot.black {
  background: #110c24;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 12px var(--neon-purple);
}

.game-alert {
  font-weight: 800;
  color: var(--neon-gold);
  text-shadow: 0 0 10px rgba(255, 190, 11, 0.6);
}

.game-alert.check {
  color: #ff0055;
  text-shadow: 0 0 15px #ff0055;
  animation: pulse 0.8s infinite;
}

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

/* Board Wrapper */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.file-labels, .rank-labels {
  display: flex;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--neon-cyan);
  font-weight: 800;
  text-shadow: 0 0 8px rgba(0, 247, 255, 0.4);
}

.file-labels {
  width: 100%;
  max-width: 530px;
  justify-content: space-around;
  padding: 6px 20px;
}

.board-middle {
  display: flex;
  align-items: center;
}

.rank-labels {
  flex-direction: column;
  height: 100%;
  justify-content: space-around;
  padding: 0 10px;
}

/* 8x8 Chessboard */
.chessboard {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 530px;
  height: 530px;
  border: 5px solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff007f, #7928ca, #00f2fe) border-box;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(114, 9, 183, 0.4);
  position: relative;
}

@media (max-width: 600px) {
  .chessboard {
    width: 330px;
    height: 330px;
  }
}

.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.square.light {
  background-color: var(--sq-light);
  color: #1a0b2e;
}

.square.dark {
  background-color: var(--sq-dark);
  color: #fff;
}

/* Note Badge Overlay */
.sq-note-label {
  position: absolute;
  top: 3px;
  left: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 800;
  pointer-events: none;
  background: rgba(15, 10, 33, 0.75);
  color: var(--neon-gold);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 190, 11, 0.3);
  letter-spacing: -0.5px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.hide-notes .sq-note-label {
  display: none;
}

/* Square States */
.square.selected {
  background-color: var(--sq-active) !important;
  box-shadow: inset 0 0 20px var(--neon-pink);
}

.square.last-move {
  background-color: var(--sq-highlight) !important;
  box-shadow: inset 0 0 15px rgba(255, 230, 0, 0.7);
}

.square.legal-move::after {
  content: '';
  position: absolute;
  width: 28%;
  height: 28%;
  background: var(--sq-move-dot);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 12px var(--neon-cyan), 0 0 25px var(--neon-cyan);
}

.square.legal-capture::after {
  content: '';
  position: absolute;
  width: 85%;
  height: 85%;
  border: 3px solid var(--neon-pink);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 15px var(--neon-pink);
}

/* Psychedelic Ripple Animation on move */
.square.sound-ripple::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 4px solid var(--neon-cyan);
  border-radius: 8px;
  box-shadow: 0 0 30px var(--neon-pink), 0 0 60px var(--neon-cyan);
  animation: psycho-ripple 0.9s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes psycho-ripple {
  0% { transform: scale(0.85); opacity: 1; filter: hue-rotate(0deg); }
  100% { transform: scale(1.4); opacity: 0; filter: hue-rotate(360deg); }
}

/* Chess Pieces */
.piece {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  user-select: none;
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

@media (max-width: 600px) {
  .piece {
    font-size: 2rem;
  }
}

.piece:hover {
  transform: scale(1.12);
}

.piece:active {
  cursor: grabbing;
}

.piece.white {
  color: #ffffff;
  filter: drop-shadow(0 0 8px rgba(0, 247, 255, 0.8)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.9));
}

.piece.black {
  color: #120924;
  filter: drop-shadow(0 0 10px rgba(255, 19, 137, 0.9)) drop-shadow(0 0 2px #fff);
}

/* Now Playing Card */
.now-playing-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.now-playing-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-psycho);
  background-size: 200% auto;
  animation: rainbow-shift 3s linear infinite;
}

.np-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.note-badge {
  background: var(--grad-sunset);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.5);
  animation: note-glow 2s ease-in-out infinite alternate;
}

@keyframes note-glow {
  0% { box-shadow: 0 0 15px rgba(255, 0, 127, 0.4); }
  100% { box-shadow: 0 0 30px rgba(255, 170, 0, 0.7); }
}

.np-details {
  display: flex;
  flex-direction: column;
}

.np-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
}

.np-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.np-wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}

.np-wave span {
  width: 5px;
  height: 8px;
  background: var(--neon-cyan);
  border-radius: 3px;
  transition: height 0.1s ease;
  box-shadow: 0 0 8px var(--neon-cyan);
}

.np-wave.active span {
  animation: sound-bars 0.5s infinite ease-in-out alternate;
}

.np-wave.active span:nth-child(1) { background: #ff007f; animation-delay: 0.1s; box-shadow: 0 0 8px #ff007f; }
.np-wave.active span:nth-child(2) { background: #7928ca; animation-delay: 0.3s; box-shadow: 0 0 8px #7928ca; }
.np-wave.active span:nth-child(3) { background: #00f2fe; animation-delay: 0.2s; box-shadow: 0 0 8px #00f2fe; }
.np-wave.active span:nth-child(4) { background: #43e97b; animation-delay: 0.4s; box-shadow: 0 0 8px #43e97b; }
.np-wave.active span:nth-child(5) { background: #ffaa00; animation-delay: 0.15s; box-shadow: 0 0 8px #ffaa00; }

@keyframes sound-bars {
  0% { height: 6px; }
  100% { height: 28px; }
}

/* Control Panel / Tabs */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tabs {
  display: flex;
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px;
  gap: 6px;
  box-shadow: var(--shadow-psycho);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: var(--grad-psycho);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.tab-content.active {
  display: flex;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-psycho);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.control-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  gap: 14px;
  transition: all 0.2s ease;
}

.control-toggle-row:hover {
  border-color: rgba(0, 247, 255, 0.4);
  background: var(--bg-card-hover);
}

.control-toggle-row strong {
  font-size: 0.92rem;
  color: #fff;
}

.form-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--neon-pink);
  cursor: pointer;
}

.control-duet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(15, 10, 33, 0.5);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-glass);
}

.hidden {
  display: none !important;
}

/* Forms */
.form-select {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:focus, .form-select:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.form-range {
  accent-color: var(--neon-pink);
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
}

.small-text {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Playback & Timeline */
.playback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.2), rgba(0, 247, 255, 0.2));
  color: #fff;
  border: 1px solid var(--neon-pink);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
}

.playback-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.midi-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-container label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.moves-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.empty-timeline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
  text-align: center;
  padding: 14px;
}

.timeline-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 10, 33, 0.8);
  border: 1px solid var(--border-glass);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeline-note-chip:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 247, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.4);
}

.timeline-note-chip.playing {
  border-color: var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.4), rgba(114, 9, 183, 0.4));
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
  transform: scale(1.05);
}

.chip-note {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: var(--neon-gold);
}

.chip-move {
  color: #fff;
  font-weight: 600;
}

.chip-dur {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Master Games Info Card */
.match-info-card {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.15), rgba(114, 9, 183, 0.2), rgba(0, 247, 255, 0.15));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.match-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-sunset);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.match-meta {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--neon-gold);
}

.match-opening {
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon-cyan);
}

.match-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.master-playback-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.playback-progress-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* PGN Box */
.pgn-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-height: 110px;
  overflow-y: auto;
  line-height: 1.6;
}

/* Rules Table */
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rules-table th, .rules-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.rules-table th {
  color: var(--neon-cyan);
  font-weight: 700;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 5, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 0 50px rgba(255, 19, 137, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 340px;
  width: 90%;
}

.promotion-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-btn:hover {
  background: var(--grad-psycho);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.6);
  transform: scale(1.05);
}
