/* NovaChess Active Game Board, Player Bars, Clocks & Post-Game Modal */
.nc-view-game .arena,
.nc-view-study .arena {
  background: radial-gradient(circle at 18% 8%, rgba(46, 31, 71, 0.42), transparent 55%),
              linear-gradient(180deg, rgba(11, 17, 32, 0.96), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(3, 7, 18, 0.55);
}

html.ui-theme-light .nc-view-game .arena,
html.ui-theme-light .nc-view-study .arena,
body.ui-theme-light .nc-view-game .arena,
body.ui-theme-light .nc-view-study .arena {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 246, 251, 0.95));
  border-color: rgba(15, 23, 42, 0.12);
}

.game-context-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.game-context-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0b1120;
  background: linear-gradient(135deg, #e7c967, #d4af37);
}

.player-bar {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-bar.is-turn,
.player-bar.turn-active {
  border-color: rgba(212, 175, 55, 0.48);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.16), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.player-turn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.player-bar.is-turn .player-turn-dot,
.player-bar.turn-active .player-turn-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}

.clock-box {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(11, 17, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5f2eb;
  border-radius: 11px;
  padding: 6px 14px;
}

.player-bar.is-turn .clock-box,
.player-bar.turn-active .clock-box {
  border-color: rgba(212, 175, 55, 0.55);
  color: #f6dc88;
}

.clock-box.low-time {
  border-color: rgba(239, 68, 68, 0.72) !important;
  background: rgba(127, 29, 29, 0.52) !important;
  color: #fecaca !important;
  animation: ncLowTimePulse 1s ease-in-out infinite;
}

@keyframes ncLowTimePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.board-box {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(212, 175, 55, 0.22);
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.6);
}

.eval-bar-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #141824;
}

.eval-white-fill {
  background: linear-gradient(180deg, #f5f2eb, #e2ddd0);
  transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.board-toolbar {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.board-toolbar .toolbar-actions .btn {
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.85);
}

.board-toolbar .toolbar-actions .btn:hover {
  border-color: rgba(212, 175, 55, 0.45);
}

/* Puzzle Rush HUD Banner */
.nc-puzzle-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(46, 31, 71, 0.88), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(212, 175, 55, 0.38);
  color: #f5f2eb;
}

.nc-puzzle-hud-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  font-weight: 700;
}

.nc-puzzle-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-variant-numeric: tabular-nums;
}

.nc-puzzle-hud-pill.is-gold {
  color: #f6dc88;
  border-color: rgba(212, 175, 55, 0.45);
}

/* Move History & Post-Game Modal Polish */
.move-history-wrap {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 16px;
  padding: 12px;
}

.move-history-box {
  background: rgba(11, 17, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

#gameOverModal .modal-card {
  background: radial-gradient(circle at top center, rgba(46, 31, 71, 0.55), transparent 58%), #0f172a;
  border: 1px solid rgba(212, 175, 55, 0.36);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.75);
  padding: 24px;
}

#gameOverModal #modalTitle {
  font-weight: 800;
  color: #f5f2eb;
  letter-spacing: -0.02em;
}

#gameOverModal #postGameReportBox {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(11, 17, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 767px) {
  .nc-view-game .arena,
  .nc-view-study .arena {
    padding: 8px;
    border-radius: 16px;
  }
  .player-bar {
    padding: 8px 10px;
  }
  .board-toolbar {
    padding: 8px 10px;
  }
}
