/* =============================================================================
   KILLER.CSS - Spooky Cute Arcade Theme for Killer Darts
   All styles scoped under body.killer to avoid affecting Demolition
   ============================================================================= */

/* =============================================================================
   BASE STYLES
   ============================================================================= */

body.killer {
  font-family: var(--font-body);
  background: var(--bg-deep);
  background-image: url('./assets/Backgrounds/bg-gradient.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: var(--space-md);
  overflow-x: hidden;
}

body.killer .container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(45, 38, 64, 0.85);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
  border: var(--border-thick) rgba(192, 132, 252, 0.3);
  box-shadow: var(--shadow-lg);
}

/* =============================================================================
   TYPOGRAPHY OVERRIDES
   ============================================================================= */

body.killer h1,
body.killer h2,
body.killer h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: 1px;
}

body.killer h1 {
  font-size: var(--text-3xl);
}

body.killer h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

body.killer h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

/* =============================================================================
   GAME TITLE HEADER
   ============================================================================= */

body.killer .game-title-header {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--accent-primary);
  text-align: center;
  letter-spacing: 6px;
  border: var(--border-chunky) var(--accent-purple);
  padding: var(--space-md) var(--space-xl);
  margin: var(--space-md) auto;
  background: rgba(45, 38, 64, 0.8);
  border-radius: var(--radius-md);
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
  box-shadow: var(--shadow-glow-pink);
}

/* =============================================================================
   TURN INDICATOR - LARGE & READABLE (72px+)
   ============================================================================= */

body.killer .game-header {
  background: var(--bg-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-thick) rgba(192, 132, 252, 0.4);
  text-align: center;
}

body.killer .game-header h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

body.killer #current-player-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
  line-height: 1.1;
  margin-top: var(--space-sm);
}

body.killer .turn-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

body.killer .turn-info p {
  font-size: var(--text-lg);
  margin: 0;
  color: var(--text-secondary);
}

body.killer #killer-status {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--accent-primary);
  text-shadow: var(--shadow-glow-pink);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 107, 157, 0.15);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

body.killer .btn {
  font-family: var(--font-body);
  font-weight: 700;
  padding: var(--space-md) var(--space-xl);
  border: var(--border-thick) transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

body.killer .btn:hover {
  transform: translateY(-2px);
}

body.killer .btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
}

body.killer .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.2);
}

body.killer .btn-primary:hover {
  box-shadow: var(--shadow-glow-pink);
}

body.killer .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

body.killer .btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--accent-secondary);
}

body.killer #add-player-btn {
  background: var(--accent-success);
  color: var(--bg-deep);
  border-color: rgba(0, 0, 0, 0.2);
}

body.killer #add-player-btn:hover {
  background: #9ef5be;
}

/* =============================================================================
   SETUP SECTION
   ============================================================================= */

body.killer #setup-section {
  background: var(--bg-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: var(--border-thick) rgba(192, 132, 252, 0.3);
}

body.killer .saved-players-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: var(--border-thin) rgba(192, 132, 252, 0.2);
}

body.killer .saved-player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: var(--border-thick) var(--accent-purple);
}

body.killer .remove-saved-player-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  opacity: 0.7;
}

body.killer .remove-saved-player-btn:hover {
  opacity: 1;
  background: rgba(252, 165, 165, 0.2);
  transform: scale(1.1);
}

body.killer .remove-saved-player-btn img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

body.killer .player-input-group {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

body.killer .player-input-group input {
  flex: 1;
  padding: var(--space-md);
  border: var(--border-thick) rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  font-family: var(--font-body);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

body.killer .player-input-group input:focus {
  outline: none;
  border-color: var(--accent-secondary);
  background: var(--bg-surface);
}

body.killer .player-input-group input::placeholder {
  color: var(--text-muted);
}

body.killer .remove-player-btn {
  background: var(--accent-danger);
  color: var(--bg-deep);
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition-fast);
}

body.killer .remove-player-btn:hover {
  background: #fdb8b8;
}

/* =============================================================================
   DART BOARD - Responsive Size with Stable Geometry
   ============================================================================= */

/* Single source of truth for board size - responsive via clamp */
body.killer {
  --board-size: clamp(400px, 45vw, 550px);
}

body.killer .game-board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  /* Allow labels to render outside without clipping */
  overflow: visible;
  /* Add padding to accommodate labels outside the board */
  padding: 80px;
  margin: -80px;
}

body.killer .game-board-container {
  width: var(--board-size);
  height: var(--board-size);
  position: relative;
  /* Must allow labels layer to overflow */
  overflow: visible;
}

body.killer #board-player-names {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Larger container to accommodate labels further out */
  width: calc(var(--board-size) * 1.55);
  height: calc(var(--board-size) * 1.55);
  pointer-events: none;
  /* Ensure labels can render at edges */
  overflow: visible;
}

body.killer #dart-board {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  background: var(--bg-board);
  border: var(--border-chunky) var(--accent-purple);
  box-shadow: 
    0 0 40px rgba(192, 132, 252, 0.3),
    inset 0 0 60px rgba(45, 38, 64, 0.5);
  overflow: visible;
}

/* Board number targets - positioned absolutely by JS */
body.killer .board-number {
  position: absolute;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  /* Transform from center point for perfect positioning */
  transform: translate(-50%, -50%);
}

body.killer .board-number:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: var(--shadow-glow-purple);
  z-index: 20;
}

/* Board center - positioned absolutely at center */
body.killer .board-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  height: 18%;
  min-width: 70px;
  min-height: 70px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-primary));
  border: var(--border-thick) var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-pink);
  z-index: 5;
}

/* =============================================================================
   PLAYER NAMES OUTSIDE BOARD - Positioned by JS relative to board center
   ============================================================================= */

body.killer .board-player-name-outer {
  position: absolute;
  /* Base transform - JS adds nudge offsets via inline style */
  transform: translate(-50%, -50%);
  text-align: center;
  /* Wider max-width to accommodate longer names */
  max-width: 110px;
  white-space: nowrap;
  /* No overflow hidden - allow text to render fully */
  overflow: visible;
  z-index: 15;
  pointer-events: none;
  /* Subtle background for readability against any segment */
  background: rgba(26, 22, 37, 0.7);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

body.killer .board-player-name-outer.eliminated {
  opacity: 0.5;
}

body.killer .board-player-name-outer.eliminated .board-player-name-text {
  text-decoration: line-through;
}

body.killer .board-player-name-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
  text-shadow: 
    2px 2px 0 var(--bg-deep),
    -2px -2px 0 var(--bg-deep),
    2px -2px 0 var(--bg-deep),
    -2px 2px 0 var(--bg-deep),
    0 0 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 4px;
}

/* Skull lives row - compact inline display */
body.killer .board-player-lives {
  display: flex;
  justify-content: center;
  gap: 2px;
}

/* Hit dots row - compact inline display */
body.killer .board-player-hits {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-bottom: 2px;
}

/* =============================================================================
   SKULL LIVES - PNG Icons (smaller for compact label cards)
   ============================================================================= */

body.killer .life-skull {
  display: inline-block;
  width: 20px;
  height: 20px;
  font-size: 0;  /* Hide emoji text */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url('./assets/icons/skull-dead.png');
  opacity: 0.4;
  filter: grayscale(100%);
  transition: all var(--transition-fast);
}

body.killer .life-skull.alive {
  background-image: url('./assets/icons/skull-alive.png');
  opacity: 1;
  filter: none;
}

/* =============================================================================
   HIT DOTS - Compact for label cards
   ============================================================================= */

body.killer .hit-dot {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  transition: all var(--transition-fast);
}

body.killer .hit-dot.filled {
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

body.killer .board-player-lives {
  gap: var(--space-sm);
}

body.killer .board-player-hits {
  gap: var(--space-sm);
}

/* =============================================================================
   ROUND INDICATOR
   ============================================================================= */

body.killer .round-indicator {
  background: var(--bg-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-thin) rgba(192, 132, 252, 0.3);
}

body.killer .round-label {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: 2px;
}

body.killer .round-circle {
  width: 24px;
  height: 24px;
  border: 3px solid var(--text-secondary);
  transition: all var(--transition-fast);
}

body.killer .round-circle.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-glow-gold);
  transform: scale(1.2);
}

body.killer .round-circle.completed {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

body.killer .round-multiplier {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--accent-gold);
  text-shadow: none;
  background: rgba(255, 217, 61, 0.15);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

/* =============================================================================
   GAME CONTROLS
   ============================================================================= */

body.killer .game-controls {
  background: var(--bg-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-thin) rgba(192, 132, 252, 0.3);
}

body.killer .instruction-text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

body.killer .instruction-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.8;
}

body.killer #killer-attack-section {
  background: rgba(255, 107, 157, 0.15);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-thick) var(--accent-primary);
}

/* =============================================================================
   GAME OVER SECTION
   ============================================================================= */

body.killer #game-over-section {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: var(--border-thick) var(--accent-gold);
}

body.killer #game-over-section h2 {
  font-size: var(--text-3xl);
  color: var(--accent-gold);
  text-shadow: var(--shadow-glow-gold);
}

body.killer #winner-info {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin: var(--space-xl) 0;
  padding: var(--space-xl);
  background: rgba(255, 217, 61, 0.15);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  border: var(--border-thick) var(--accent-gold);
  box-shadow: var(--shadow-glow-gold);
}

/* =============================================================================
   HIT MESSAGE TOAST
   ============================================================================= */

body.killer .hit-message {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-lg);
  border: var(--border-thick) var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
}

/* =============================================================================
   LAYOUT ADJUSTMENTS FOR LARGER BOARD
   ============================================================================= */

body.killer .game-layout-container {
  gap: var(--space-lg);
  /* Ensure labels can render outside board container */
  overflow: visible;
}

body.killer .game-left-panel {
  flex: 0 0 280px;
  gap: var(--space-md);
}

body.killer .game-right-panel {
  flex: 0 0 120px;
}

/* =============================================================================
   STICKY CONTROL BAR
   ============================================================================= */

body.killer .control-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(to top, var(--bg-deep) 0%, rgba(26, 22, 37, 0.95) 100%);
  border-top: var(--border-thick) rgba(192, 132, 252, 0.3);
  backdrop-filter: blur(10px);
  z-index: 100;
}

body.killer .control-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 100px;
  justify-content: center;
}

body.killer .control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

body.killer .control-icon {
  font-size: var(--text-lg);
}

body.killer .control-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

body.killer .control-btn:hover .control-icon-img {
  opacity: 1;
}

body.killer .btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: var(--border-thick) var(--text-muted);
}

body.killer .btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent-purple);
}

/* =============================================================================
   PAUSE MODAL
   ============================================================================= */

body.killer .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 22, 37, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  animation: fadeIn var(--transition-fast);
}

body.killer .modal-overlay.hidden {
  display: none;
}

body.killer .modal-content {
  background: var(--bg-surface);
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  border: var(--border-chunky) var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
  text-align: center;
  min-width: 320px;
  max-width: 90vw;
  animation: bounceIn var(--transition-bounce);
}

body.killer .modal-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--accent-primary);
  margin-bottom: var(--space-xl);
  text-shadow: var(--shadow-glow-pink);
}

body.killer .modal-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

body.killer .modal-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--text-lg);
}

body.killer .modal-btn .btn-icon {
  font-size: var(--text-xl);
}

body.killer .modal-hint {
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* =============================================================================
   TOAST NOTIFICATION SYSTEM
   ============================================================================= */

body.killer .toast-container {
  position: fixed;
  top: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 300;
  pointer-events: none;
}

body.killer .toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: var(--border-thick) var(--text-muted);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(100%);
  pointer-events: auto;
  max-width: 350px;
}

body.killer .toast-enter {
  animation: toastBounceIn var(--transition-bounce) forwards;
}

body.killer .toast-exit {
  animation: toastFadeOut var(--transition-fast) forwards;
}

body.killer .toast-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

body.killer .toast-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

body.killer .toast-message {
  flex: 1;
}

/* Toast Variants */
body.killer .toast-success {
  border-color: var(--accent-success);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(134, 239, 172, 0.15));
}

body.killer .toast-success .toast-icon {
  color: var(--accent-success);
}

body.killer .toast-danger {
  border-color: var(--accent-danger);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(252, 165, 165, 0.15));
}

body.killer .toast-danger .toast-icon {
  color: var(--accent-danger);
}

body.killer .toast-warning {
  border-color: var(--accent-warning);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(253, 224, 71, 0.15));
}

body.killer .toast-warning .toast-icon {
  color: var(--accent-warning);
}

body.killer .toast-info {
  border-color: var(--accent-secondary);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(125, 211, 252, 0.15));
}

body.killer .toast-info .toast-icon {
  color: var(--accent-secondary);
}

body.killer .toast-killer {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(255, 107, 157, 0.2));
  box-shadow: var(--shadow-glow-pink);
}

body.killer .toast-killer .toast-icon {
  color: var(--accent-primary);
}

/* Toast Animations */
@keyframes toastBounceIn {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  60% {
    opacity: 1;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastFadeOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  body.killer .toast-enter,
  body.killer .toast-exit,
  body.killer .modal-content,
  body.killer .modal-overlay {
    animation: none;
  }
  
  body.killer .toast {
    opacity: 1;
    transform: none;
  }
  
  body.killer .toast-exit {
    opacity: 0;
  }
}

/* =============================================================================
   ROUND INDICATOR - Enhanced with Multiplier Badges
   ============================================================================= */

body.killer #round-circles {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

body.killer .round-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

body.killer .round-pips {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  justify-content: center;
}

body.killer .round-multiplier-badge {
  /* Image-based multiplier badge container */
  width: 56px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 0;
  box-shadow: none;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

body.killer .round-multiplier-badge.active {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(255, 217, 61, 0.35));
}

body.killer .round-multiplier-badge-img {
  display: block;
  width: 56px;
  height: auto;
}

body.killer .round-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--text-muted);
  background: transparent;
  transition: all var(--transition-fast);
}

body.killer .round-circle.active {
  width: 28px;
  height: 28px;
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-glow-gold);
}

body.killer .round-circle.completed {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* =============================================================================
   CELEBRATION OVERLAYS - Win, Killer Achieved, Elimination
   ============================================================================= */

/* Base overlay styles */
body.killer .celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
  background: rgba(26, 22, 37, 0.95);
  backdrop-filter: blur(12px);
}

body.killer .celebration-overlay.hidden {
  display: none;
}

/* ---- WIN CELEBRATION OVERLAY ---- */
body.killer .win-overlay {
  animation: fadeIn var(--transition-normal);
}

body.killer .win-content {
  text-align: center;
  animation: winBounceIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  padding: var(--space-3xl);
}

body.killer .win-crown {
  width: 120px;
  height: auto;
  animation: crownFloat 2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255, 217, 61, 0.8));
  margin-bottom: var(--space-md);
}

body.killer .win-illustration {
  width: 200px;
  height: auto;
  margin-bottom: var(--space-lg);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  animation: winIllustrationPop 500ms ease-out 200ms both;
}

body.killer .win-subtext {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--accent-gold);
  text-shadow: 
    0 0 40px rgba(255, 217, 61, 0.8),
    0 0 80px rgba(255, 217, 61, 0.4);
  letter-spacing: 8px;
  margin-bottom: var(--space-sm);
  animation: winGlow 1.5s ease-in-out infinite alternate;
}

body.killer .win-player-name {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  color: var(--text-primary);
  text-shadow: 
    0 4px 0 rgba(0, 0, 0, 0.3),
    0 0 40px currentColor;
  margin-bottom: var(--space-xl);
  animation: winNamePulse 800ms ease-out 400ms both;
}

body.killer .win-buttons {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}

body.killer .win-btn {
  min-width: 160px;
  font-size: var(--text-lg);
  padding: var(--space-lg) var(--space-xl);
}

/* Win animations */
@keyframes winBounceIn {
  0% { opacity: 0; transform: scale(0.5) translateY(50px); }
  60% { opacity: 1; transform: scale(1.1) translateY(-10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes winGlow {
  0% { text-shadow: 0 0 40px rgba(255, 217, 61, 0.6), 0 0 80px rgba(255, 217, 61, 0.3); }
  100% { text-shadow: 0 0 60px rgba(255, 217, 61, 1), 0 0 120px rgba(255, 217, 61, 0.6); }
}

@keyframes winIllustrationPop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes winNamePulse {
  0% { opacity: 0; transform: scale(0.9); }
  50% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---- KILLER ACHIEVED OVERLAY ---- */
body.killer .killer-achieved-overlay {
  background: radial-gradient(ellipse at center, rgba(255, 107, 157, 0.3) 0%, rgba(26, 22, 37, 0.95) 70%);
  animation: killerFlash 1200ms ease-out forwards;
}

body.killer .killer-achieved-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

body.killer .killer-badge-large {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  color: var(--accent-primary);
  text-shadow: 
    0 0 40px rgba(255, 107, 157, 0.8),
    0 0 80px rgba(255, 107, 157, 0.5),
    0 4px 0 rgba(0, 0, 0, 0.4);
  letter-spacing: 6px;
  animation: killerBadgePop 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

body.killer .killer-player-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-top: var(--space-md);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  animation: fadeInUp 400ms ease-out 200ms both;
}

body.killer .killer-fire {
  width: 80px;
  height: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.6));
  animation: fireFlicker 300ms ease-in-out infinite alternate;
}

body.killer .killer-fire-left {
  left: -100px;
  transform: translateY(-50%) scaleX(-1);
}

body.killer .killer-fire-right {
  right: -100px;
}

@keyframes killerFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes killerBadgePop {
  0% { opacity: 0; transform: scale(0.3) rotate(-10deg); }
  60% { opacity: 1; transform: scale(1.2) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes fireFlicker {
  0% { transform: translateY(-50%) scale(1); filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.6)); }
  100% { transform: translateY(-50%) scale(1.1); filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.9)); }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---- ELIMINATION OVERLAY ---- */
body.killer .elimination-overlay {
  background: radial-gradient(ellipse at center, rgba(252, 165, 165, 0.2) 0%, rgba(26, 22, 37, 0.95) 70%);
  animation: eliminationFlash 900ms ease-out forwards;
}

body.killer .elimination-content {
  text-align: center;
  position: relative;
}

body.killer .elimination-tombstone {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  animation: tombstoneRise 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.killer .elimination-stamp {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--accent-danger);
  text-shadow: 
    0 0 20px rgba(252, 165, 165, 0.6),
    0 3px 0 rgba(0, 0, 0, 0.4);
  letter-spacing: 4px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg) scale(0);
  animation: stampSlam 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms forwards;
}

body.killer .eliminated-player-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-top: var(--space-lg);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  animation: fadeInUp 300ms ease-out 300ms both;
}

@keyframes eliminationFlash {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tombstoneRise {
  0% { opacity: 0; transform: translateY(100px) scale(0.5); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stampSlam {
  0% { transform: translate(-50%, -50%) rotate(-15deg) scale(3); opacity: 0; }
  60% { transform: translate(-50%, -50%) rotate(-15deg) scale(0.9); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-15deg) scale(1); opacity: 1; }
}

/* =============================================================================
   MICRO-ANIMATIONS - Hits, Shakes, Pops
   ============================================================================= */

/* Hit pop animation on board numbers */
body.killer .board-number.hit-pop {
  animation: hitPop 300ms ease-out;
}

@keyframes hitPop {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 30px var(--accent-success); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Shake animation for life loss */
body.killer .board-player-name-outer.shake {
  animation: shake 400ms ease-out;
}

@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  20% { transform: translate(-50%, -50%) translateX(-8px); }
  40% { transform: translate(-50%, -50%) translateX(8px); }
  60% { transform: translate(-50%, -50%) translateX(-6px); }
  80% { transform: translate(-50%, -50%) translateX(6px); }
}

/* Life skull swap fade */
body.killer .life-skull {
  transition: 
    opacity var(--transition-fast),
    filter var(--transition-fast),
    transform var(--transition-fast);
}

body.killer .life-skull.alive {
  transform: scale(1);
}

body.killer .life-skull:not(.alive) {
  transform: scale(0.9);
}

/* =============================================================================
   ACCESSIBILITY - Focus States
   ============================================================================= */

body.killer button:focus-visible,
body.killer a:focus-visible,
body.killer input:focus-visible,
body.killer [tabindex]:focus-visible {
  outline: 3px solid var(--accent-secondary);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(125, 211, 252, 0.3);
}

body.killer .btn:focus-visible {
  outline-color: var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(255, 107, 157, 0.3);
}

body.killer .board-number:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
  z-index: 25;
}

/* =============================================================================
   REDUCED MOTION - Comprehensive Support
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  /* Disable all complex animations */
  body.killer .celebration-overlay,
  body.killer .win-content,
  body.killer .win-crown,
  body.killer .win-illustration,
  body.killer .win-subtext,
  body.killer .win-player-name,
  body.killer .killer-achieved-overlay,
  body.killer .killer-badge-large,
  body.killer .killer-fire,
  body.killer .killer-player-name,
  body.killer .elimination-overlay,
  body.killer .elimination-tombstone,
  body.killer .elimination-stamp,
  body.killer .eliminated-player-name,
  body.killer .board-number.hit-pop,
  body.killer .board-player-name-outer.shake {
    animation: none !important;
  }
  
  /* Simple opacity transitions only */
  body.killer .celebration-overlay {
    transition: opacity var(--transition-fast);
  }
  
  body.killer .celebration-overlay:not(.hidden) {
    opacity: 1;
  }
  
  body.killer .killer-achieved-overlay:not(.hidden),
  body.killer .elimination-overlay:not(.hidden) {
    animation: reducedMotionFade 1000ms ease-out forwards !important;
  }
  
  body.killer .elimination-stamp {
    transform: translate(-50%, -50%) rotate(-15deg) scale(1);
    opacity: 1;
  }
  
  body.killer .killer-fire {
    transform: translateY(-50%);
  }
  
  /* Disable floating/glowing effects */
  body.killer .win-crown {
    transform: none;
  }
  
  body.killer .win-subtext {
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.6);
  }
}

@keyframes reducedMotionFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   Board size is handled by clamp() in --board-size variable.
   JS measures actual rendered size, so no size overrides needed here.
   ============================================================================= */

@media (max-width: 1200px) {
  body.killer #current-player-name {
    font-size: var(--text-4xl);
  }
  
  body.killer .game-left-panel {
    flex: 0 0 240px;
  }
  
  body.killer .board-number {
    width: 50px;
    height: 50px;
    font-size: var(--text-lg);
  }
}

@media (max-width: 900px) {
  body.killer .game-layout-container {
    flex-direction: column;
    align-items: center;
  }
  
  body.killer .game-left-panel,
  body.killer .game-right-panel {
    flex: none;
    width: 100%;
    max-width: 500px;
  }
  
  body.killer .board-number {
    width: 44px;
    height: 44px;
    font-size: var(--text-base);
  }
  
  body.killer .board-player-name-text {
    font-size: var(--text-sm);
  }
  
  /* Control bar adjustments for smaller screens */
  body.killer .control-bar {
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
  }
  
  body.killer .control-btn {
    min-width: 80px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }
  
  /* Toast adjustments */
  body.killer .toast-container {
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
  }
  
  body.killer .toast {
    max-width: 100%;
  }
  
  /* Celebration overlay adjustments */
  body.killer .win-player-name {
    font-size: var(--text-3xl);
  }
  
  body.killer .win-illustration {
    width: 150px;
  }
  
  body.killer .win-crown {
    width: 80px;
  }
  
  body.killer .killer-badge-large {
    font-size: var(--text-3xl);
  }
  
  body.killer .killer-fire {
    width: 50px;
    left: -60px;
    right: -60px;
  }
  
  body.killer .elimination-tombstone {
    width: 100px;
  }
  
  body.killer .elimination-stamp {
    font-size: var(--text-2xl);
  }
}

/* Add bottom padding to game section to account for fixed control bar */
body.killer #game-section {
  padding-bottom: 100px;
}
