/* Game info panel */
.game-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-body);
  position: relative;
}

/* Sound mute toggle */
.sound-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity 0.15s;
  padding: 4px;
  line-height: 1;
  z-index: 1;
}

.sound-toggle:hover {
  opacity: 1;
}

/* Player card */
.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.player-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow-30);
}

.player-card__colour {
  flex-shrink: 0;
}

.player-card__piece {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.player-card__piece--white {
  background: var(--piece-white-fill);
  border: 2px solid var(--piece-white-stroke);
}

.player-card__piece--black {
  background: var(--piece-black-fill);
  border: 2px solid var(--piece-black-stroke);
}

.player-card__details {
  flex: 1;
  min-width: 0;
}

.player-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 4px;
}

.player-card__stats {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.player-card__turn-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
  animation: pulse-turn 1.5s ease-in-out infinite;
}

@keyframes pulse-turn {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success-glow-40); }
  50% { opacity: 0.5; box-shadow: 0 0 8px var(--success-glow-80); }
}

/* Timer */
.game-timer {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  padding: 8px;
  font-variant-numeric: tabular-nums;
}

.timer--urgent {
  color: var(--color-error);
  animation: pulse-timer 1s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Paused notice */
.game-paused-notice {
  text-align: center;
  padding: 12px;
  background: var(--border-subtle);
  border-radius: 6px;
  color: var(--color-warning);
  font-size: 0.9rem;
}

.game-paused-notice .btn--primary {
  margin-top: 8px;
  background: var(--accent);
  color: var(--bg-input);
}

.game-paused-notice .btn--primary:hover {
  background: var(--accent-hover);
}

/* Game status */
.game-status {
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--text-status);
}

.game-status__result {
  display: block;
  font-weight: 600;
  color: var(--color-gold);
  font-size: 1rem;
  margin-top: 4px;
}

/* Action buttons */
.game-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn--secondary {
  background: var(--border-subtle);
  color: var(--text-tertiary);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--border-hover);
}

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

/* Game page layout */
.game-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  min-height: 100vh;
  background: var(--bg-body);
}

/* Game sidebar */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .game-page {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    padding: 32px;
  }

  .game-sidebar {
    width: 280px;
    position: sticky;
    top: 32px;
  }
}

@media (min-width: 1024px) {
  .game-sidebar {
    width: 320px;
  }
}

/* Move history */
.move-history {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}

.move-history__collapsible {
  padding: 0;
}

.move-history__title {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
}

.move-history__list {
  max-height: 240px;
  overflow-y: auto;
  padding: 0 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) var(--bg-card);
}

.move-history__entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-input);
}

.move-history__entry:last-child {
  border-bottom: none;
}

.move-history__number {
  color: var(--text-muted);
  min-width: 24px;
  font-variant-numeric: tabular-nums;
}

.move-history__colour {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.move-history__colour--white {
  background: var(--piece-white-fill);
  border: 1px solid var(--piece-white-stroke);
}

.move-history__colour--black {
  background: var(--piece-black-fill);
  border: 1px solid var(--piece-black-stroke);
}

.move-history__text {
  flex: 1;
}

.move-history__empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  padding: 8px 0;
}

@media (max-width: 767px) {
  .move-history__collapsible[open] .move-history__list {
    max-height: 160px;
  }
}

/* Flash messages */
/* Game over */
.game-over {
  text-align: center;
  padding: 16px;
  background: var(--bg-input);
  border-radius: 6px;
}

.game-over__text {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 12px;
}

.game-over .btn-primary,
.game-over .btn--secondary {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

.draw-pending {
  font-size: 0.85rem;
  color: var(--color-draw);
  text-align: center;
  display: block;
  padding: 8px;
}

.draw-response {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-flash__message {
  padding: 8px 12px;
  background: var(--color-error);
  color: white;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 8px;
}
