body {
  background-color: #f4f6f9;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.app-header {
  background-color: #212529;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.app-title {
  font-weight: 600;
  font-size: 1.75rem;
  margin: 0;
}

.panel-card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.highlight-square {
  box-shadow: inset 0 0 0 4px #ffc107;
}


#pgn-input {
  resize: none;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.chess-board {
  width: 100%;
}

.variation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  z-index: 10;
}

.variation-panel {
  background: #fff;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  max-width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.variation-title {
  font-weight: 600;
  color: #212529;
}

.variation-choice {
  transition: all 0.15s ease-in-out;
  font-weight: 600;
}

.variation-choice.active-focus {
  background-color: #0d6efd !important;
  color: #fff !important;
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.4);
  transform: scale(1.02);
}

.variation-choice.active-focus .badge {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.board-controls {
  width: 100%;
  max-width: 480px;
}

.status-box {
  min-height: 80px;
  padding: 0.75rem;
  background-color: #eef1f5;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: #333;
}

.score-box {
  padding: 0.75rem;
  background-color: #eef1f5;
  border-radius: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #212529;
}

/* Notation panel styles */
.notation-container {
  min-height: 250px;
  max-height: 420px;
}

/* ChessBase-style Game Header */
.game-header-section {
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f6f8 100%);
  padding: 0.5rem 0.6rem;
  border-radius: 0.4rem;
}

.game-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1e21;
  line-height: 1.35;
}

.game-header-players {
  font-size: 0.9rem;
  font-weight: 600;
  color: #343a40;
}

.game-header-players .player-name {
  color: #111827;
}

.game-header-players .elo-tag {
  color: #6c757d;
  font-weight: 400;
  font-size: 0.8rem;
}

.game-header-meta {
  font-size: 0.8rem;
  color: #495057;
}

.annotator-tag {
  color: #0f5132;
  font-style: italic;
  font-weight: 600;
}

.date-tag, .site-tag, .event-tag, .round-tag {
  color: #495057;
}

.notation-content {
  line-height: 1.85;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2c3e50;
  user-select: none;
}

.move-number {
  color: #64748b;
  margin-right: 2px;
  margin-left: 6px;
  display: inline-block;
}

.move-number:first-child {
  margin-left: 0;
}

.move-number.mainline-num {
  font-weight: 700;
  color: #334155;
  font-size: 0.95rem;
}

.move-number.variation-num {
  font-weight: 500;
  color: #64748b;
  font-size: 0.9rem;
}

.move-number.subvariation-num {
  font-weight: 450;
  color: #94a3b8;
  font-size: 0.88rem;
}

.move-token {
  display: inline-block;
  padding: 1px 5px;
  margin: 1px 1.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.move-token.mainline-move {
  font-weight: 700;
  font-size: 0.97rem;
  color: #0f172a;
}

.move-token.variation-move {
  font-weight: 500;
  font-size: 0.93rem;
  color: #334155;
}

.move-token.subvariation-move {
  font-weight: 450;
  font-size: 0.91rem;
  color: #475569;
}

.move-token:hover {
  background-color: #e2e8f0;
  color: #0284c7;
  border-color: #bae6fd;
}

.move-token.active-move {
  background-color: #0d6efd !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(13, 110, 253, 0.4);
}

/* ChessBase-style Variation & Subvariation with Active Path Highlight */
.notation-variation {
  color: #334155;
  display: inline;
  background-color: #f8fafc;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  margin: 0 3px;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.notation-variation.active-variation-path {
  background-color: #fef9c3 !important; /* Soft sunny cream highlight */
  border-color: #fde047 !important;
  box-shadow: 0 1px 3px rgba(202, 138, 4, 0.12);
}

.notation-variation.active-variation-path .notation-variation.active-variation-path {
  background-color: #fef08a !important; /* Deeper subtle yellow for active sub-variation */
  border-color: #facc15 !important;
}

.notation-variation .move-token {
  font-style: normal;
}

.move-comment {
  color: #1e40af;
  font-size: 0.93rem;
  font-weight: 400;
  margin: 0 4px;
  line-height: 1.5;
  display: inline;
}

.move-nag {
  font-weight: 700;
  color: #b45309;
  margin-left: 1px;
}

.game-intro-comment {
  color: #1e40af;
  font-size: 0.92rem;
  font-style: italic;
  padding: 0.35rem 0.6rem;
  background-color: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
}

/* Accuracy review highlighting */
.move-token.move-correct {
  background-color: #d1e7dd !important;
  color: #0f5132 !important;
  border-color: #badbcc !important;
  font-weight: 700;
}

.move-token.move-incorrect {
  background-color: #f8d7da !important;
  color: #842029 !important;
  border-color: #f5c2c7 !important;
  font-weight: 700;
  text-decoration: underline wavy #dc3545;
}

.move-token.move-missed {
  color: #6c757d;
  opacity: 0.75;
  border-style: dashed;
  border-color: #dee2e6;
}

/* Mode setup modal cards */
.mode-option-card {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.mode-option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-option-card.active {
  background-color: #e7f1ff;
}

/* Timer warning animation */
.timer-warning {
  color: #dc3545 !important;
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0.8; }
}
