#game-board {
  height: 100%;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#game-board.active {
  display: flex;
}

/* ===== Opponents Area ===== */
#opponents-area {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

#opponents-area::-webkit-scrollbar { display: none; }

.opponent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.opponent-chip.active-opponent {
  border-color: #00e5ff;
  border-width: 2px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(124, 77, 255, 0.1));
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4), 0 0 40px rgba(0, 229, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: scale(1.08);
  animation: activeChipPulse 1.5s ease-in-out infinite;
}

@keyframes activeChipPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.4), 0 0 40px rgba(0, 229, 255, 0.1); }
  50% { box-shadow: 0 0 28px rgba(0, 229, 255, 0.6), 0 0 56px rgba(0, 229, 255, 0.2); }
}

.opponent-chip.active-opponent .chip-name {
  color: #00e5ff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  font-weight: 700;
}

.opponent-chip.active-opponent::before {
  content: '🎯 ';
  font-size: 0.75rem;
}

.opponent-chip .chip-name {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.opponent-chip .chip-count {
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.opponent-chip .chip-score {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ===== Center Area ===== */
#center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  position: relative;
}

#game-info-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-full);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
}

.info-segment {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 14px;
  background: var(--bg-glass);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.info-segment:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.info-segment:last-child { border-radius: 0 var(--radius-full) var(--radius-full) 0; }

.direction-indicator {
  font-size: 1rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  line-height: 1;
}

.direction-indicator.reverse {
  transform: scaleX(-1);
}

#current-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

#current-color-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#piles-area {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
}

.pile-label {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pile-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

#draw-pile-card {
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
}

#draw-pile-card::before {
  content: '';
  position: absolute;
  top: 1px; left: 1px; right: -2px; bottom: -2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  z-index: -1;
  box-shadow: 
    1px 1px 0 rgba(255,255,255,0.05),
    2px 2px 0 var(--bg-primary),
    3px 3px 0 rgba(255,255,255,0.05),
    4px 4px 0 var(--bg-secondary),
    5px 5px 8px rgba(0,0,0,0.6);
  transition: all 0.2s ease;
}

#draw-pile-card:active {
  transform: scale(0.95) translate(2px, 2px);
}

#draw-pile-card:active::before {
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

@media (hover: hover) {
  #draw-pile-card:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
  }
}

#draw-pile-card.draw-highlight {
  animation: drawPileGlow 2s ease-in-out infinite;
}

#draw-pile-card.draw-highlight::after {
  content: 'TAP TO DRAW';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(0, 229, 255, 0.9);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--accent-glow);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  animation: tapPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes drawPileGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 229, 255, 0.15); }
  50% { box-shadow: 0 0 22px rgba(0, 229, 255, 0.35), 0 0 44px rgba(0, 229, 255, 0.08); }
}

@keyframes tapPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Center turn indicator — always visible between piles */
.center-turn-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  min-height: 1.6em;
  transition: all 0.3s ease;
}

.center-turn-label.your-turn-label {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  animation: centerLabelPulse 1.5s ease-in-out infinite;
}

.center-turn-label.waiting-label {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes centerLabelPulse {
  0%, 100% { background: rgba(0, 229, 255, 0.12); }
  50% { background: rgba(0, 229, 255, 0.2); }
}

#last-action {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--warning);
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
  padding: var(--space-xs) var(--space-md);
  letter-spacing: 0.02em;
}
#last-action:not(:empty) {
  background: rgba(245, 158, 11, 0.06);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.12);
  animation: actionFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes actionFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Player Area ===== */
#player-area {
  flex-shrink: 0;
  padding: var(--space-sm) 0;
  padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  transition: background 0.4s ease, border-color 0.4s ease;
  border-top: 2px solid transparent;
}

#player-area.your-turn-active {
  background: linear-gradient(to top,
    rgba(0, 229, 255, 0.12) 0%,
    rgba(124, 77, 255, 0.06) 40%,
    transparent 100%
  );
  border-top-color: #00e5ff;
  border-top-width: 3px;
  animation: playerAreaPulse 2s ease-in-out infinite;
}

@keyframes playerAreaPulse {
  0%, 100% { border-top-color: rgba(0, 229, 255, 0.6); }
  50% { border-top-color: rgba(0, 229, 255, 1); }
}

#player-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md) var(--space-sm);
  gap: var(--space-sm);
}

#current-player-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.player-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.player-stats .stat-cards {
  color: var(--text-secondary);
}

.player-stats .stat-score {
  color: var(--accent);
  font-weight: 700;
}

#player-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow: visible;
  min-height: calc(var(--card-h) + 100px);
}

#player-hand::-webkit-scrollbar { display: none; }

/* UNO Button — floating, unmissable call-out */
.btn-uno {
  position: fixed;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  z-index: 40;

  padding: 14px 36px;
  background: linear-gradient(135deg, #ff1a1a 0%, #ff6b00 60%, #ff1a1a 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 50px;
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;

  box-shadow:
    0 0 0 3px rgba(255, 80, 0, 0.3),
    0 0 24px rgba(255, 60, 0, 0.6),
    0 0 60px rgba(255, 60, 0, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.5);

  animation: unoBigPulse 0.75s ease-in-out infinite;
  transition: opacity 0.2s ease;
}

.btn-uno::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 53px;
  background: linear-gradient(135deg, #ff1a1a, #ff6b00, #ff1a1a);
  background-size: 200% 200%;
  animation: unoRingRotate 2s linear infinite;
  z-index: -1;
  opacity: 0.6;
  filter: blur(4px);
}

.btn-uno::after {
  content: '!';
  position: absolute;
  top: -10px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: #fff;
  color: #ef4444;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: unoBadgeBounce 0.75s ease-in-out infinite;
}

.btn-uno:active {
  transform: translateX(-50%) scale(0.93);
  box-shadow: 0 0 12px rgba(255, 60, 0, 0.4), 0 4px 16px rgba(0,0,0,0.4);
}

.btn-uno.called {
  animation: none;
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 0 24px rgba(16, 185, 129, 0.5), 0 8px 32px rgba(0,0,0,0.4);
}

.btn-uno.called::before {
  background: linear-gradient(135deg, #10b981, #34d399);
  animation: none;
}

.btn-uno.called::after {
  content: '';
  display: none;
}

@keyframes unoBigPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 0 3px rgba(255,80,0,0.3), 0 0 24px rgba(255,60,0,0.6), 0 0 60px rgba(255,60,0,0.25), 0 8px 32px rgba(0,0,0,0.5);
  }
  50% {
    transform: translateX(-50%) scale(1.06);
    box-shadow: 0 0 0 6px rgba(255,80,0,0.2), 0 0 40px rgba(255,60,0,0.8), 0 0 80px rgba(255,60,0,0.35), 0 12px 40px rgba(0,0,0,0.5);
  }
}

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

@keyframes unoBadgeBounce {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.2) rotate(5deg); }
}

/* Info button on game-info-bar */
.btn-card-info {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 2px;
  line-height: 1;
}

.btn-card-info:hover,
.btn-card-info:active {
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
  transform: scale(1.1);
}

/* ===== Desktop layout ===== */
@media (min-width: 768px) {
  #opponents-area {
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
  }

  .opponent-chip {
    padding: 8px 18px;
    font-size: 0.85rem;
    gap: var(--space-sm);
  }

  #piles-area {
    gap: var(--space-2xl);
  }

  .pile-label {
    font-size: 0.65rem;
  }

  #player-hand {
    justify-content: center;
    padding: 60px var(--space-2xl);
    min-height: calc(var(--card-h) + 140px);
  }

  .hand-card {
    margin-left: -20px;
  }
}
