/* ===== Buttons ===== */
.btn {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.03em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #000;
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.2), 0 2px 8px rgba(124, 77, 255, 0.15);
}
.btn-primary:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn-primary:hover {
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.3), 0 4px 12px rgba(124, 77, 255, 0.2);
    transform: translateY(-1px);
  }
}
.btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
  }
}
.btn-lg {
  padding: var(--space-md) var(--space-2xl);
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ===== Overlays ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-lg);
  animation: overlayIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overscroll-behavior: contain;
}
.overlay.active { display: flex; }
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-content {
  text-align: center;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  animation: contentIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
@keyframes contentIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.overlay-content h1 { font-size: 1.8rem; }
.overlay-content h2 { font-size: 1.2rem; color: var(--text-secondary); }
.overlay-hint { font-size: 0.82rem; color: var(--text-muted); }
.overlay-buttons { display: flex; gap: var(--space-md); margin-top: var(--space-sm); }

/* Color picker */
.color-picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); width: 210px; }
.color-btn {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  cursor: pointer; background: var(--btn-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3), inset 0 -2px 6px rgba(0,0,0,0.2);
}
.color-btn:active { transform: scale(0.9); }
@media (hover: hover) {
  .color-btn:hover { transform: scale(1.12); border-color: white; box-shadow: 0 0 28px var(--btn-color), 0 4px 18px rgba(0,0,0,0.3); }
}

/* Scores table */
.scores-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  margin: var(--space-sm) 0;
}
.scores-table th, .scores-table td {
  padding: 8px var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.88rem;
}
.scores-table th {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.scores-table td {
  font-variant-numeric: tabular-nums;
}
.scores-table .rank-cell {
  font-size: 1.1rem;
  text-align: center;
  width: 36px;
}
.scores-table .winner-row {
  color: var(--accent);
  font-weight: 700;
  background: rgba(0, 229, 255, 0.04);
}
.scores-table .winner-row td {
  border-bottom-color: rgba(0, 229, 255, 0.12);
}
.penalty-text { color: var(--danger) !important; font-size: 1.6rem !important; }
.winner-title {
  font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--uno-red), var(--uno-yellow), var(--uno-green), var(--uno-blue));
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-wrap: balance;
}

/* Card point reference */
.card-point-ref {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
  margin-top: var(--space-xs);
}
.card-point-ref span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Drawn card */
.drawn-card-preview {
  width: calc(var(--card-w) * 1.6);
  height: calc(var(--card-h) * 1.6);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 28px rgba(0, 229, 255, 0.12);
  margin: var(--space-md) auto;
}
.drawn-card-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* ===== HOME SCREEN ===== */
#home-screen {
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 10;
}
.home-container {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-lg);
}
.setup-logo {
  width: 160px; height: auto;
  filter: drop-shadow(0 0 24px rgba(239, 68, 68, 0.25));
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-6px) rotate(0.5deg); }
}
.home-subtitle {
  font-family: var(--font-heading);
  font-size: 0.78rem; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-top: -8px;
}
.home-input {
  width: 100%; padding: 14px var(--space-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.95rem; text-align: center; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-input::placeholder { color: var(--text-muted); }
.home-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 16px var(--accent-dim);
}
.home-input.code-input {
  letter-spacing: 0.3em; text-transform: uppercase;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem;
}
.home-buttons { display: flex; gap: var(--space-md); width: 100%; }
.home-buttons .btn { flex: 1; }
#join-form, #spectate-form { width: 100%; display: flex; flex-direction: column; gap: var(--space-sm); align-items: center; }
.home-divider {
  color: var(--text-muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.home-error { color: var(--danger); font-size: 0.82rem; min-height: 1.2em; font-weight: 500; }

/* ===== LOBBY SCREEN ===== */
#lobby-screen {
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-lg);
  padding-top: max(var(--space-2xl), env(safe-area-inset-top));
  z-index: 10;
  overflow-y: auto;
}
.lobby-container {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-md);
}
.lobby-code-label {
  font-family: var(--font-heading);
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.lobby-code {
  font-family: var(--font-mono); font-weight: 700; font-size: 2.8rem;
  letter-spacing: 0.25em; color: var(--accent);
  text-shadow: 0 0 22px var(--accent-glow);
  cursor: pointer; transition: transform 0.2s ease;
  user-select: all; -webkit-user-select: all;
}
.lobby-code:active { transform: scale(0.95); }
.lobby-code-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: -6px; }

.lobby-players {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.lobby-player {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}
.lobby-player .player-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
}
.lobby-player .player-dot.disconnected {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.4);
}
.lobby-player .player-name {
  flex: 1; font-weight: 600;
  font-family: var(--font-heading);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lobby-player .host-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem; font-weight: 700; color: var(--warning);
  background: rgba(245, 158, 11, 0.1); padding: 3px 10px;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.lobby-settings {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--space-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}
.lobby-settings label {
  font-size: 0.82rem; color: var(--text-secondary);
  font-family: var(--font-heading);
}
.lobby-settings select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ===== TURN BANNER ===== */
.turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-align: center;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
  z-index: 15;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.turn-banner[aria-live] { /* specificity bump for aria */ }

.turn-banner.your-turn {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22) 0%, rgba(124, 77, 255, 0.14) 100%);
  border-bottom: 3px solid #00e5ff;
  color: #fff;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.8), 0 0 4px rgba(0, 229, 255, 0.4);
  font-size: 1.2rem;
  padding: 14px var(--space-md);
  animation: turnBannerPulse 1.2s ease-in-out infinite;
}

@keyframes turnBannerPulse {
  0%, 100% { background: linear-gradient(135deg, rgba(0, 229, 255, 0.22) 0%, rgba(124, 77, 255, 0.14) 100%); }
  50% { background: linear-gradient(135deg, rgba(0, 229, 255, 0.32) 0%, rgba(124, 77, 255, 0.2) 100%); }
}

/* Animated line sweep */
.turn-banner.your-turn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00e5ff, var(--accent-alt), transparent);
  animation: lineSweep 2s ease-in-out infinite;
}

@media (max-width: 480px) {
  .turn-banner {
    font-size: 0.8rem;
    padding: 8px var(--space-sm);
  }
  .turn-banner.your-turn {
    font-size: 0.95rem;
  }
}

.btn-quit-game {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 50, 50, 0.15);
  border: 1px solid rgba(255, 50, 50, 0.4);
  color: #ff3333;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  z-index: 100;
  pointer-events: auto;
}

.btn-quit-game:active, .btn-quit-game:hover {
  background: rgba(255, 50, 50, 0.4);
  transform: translateY(-50%) scale(1.1);
}

@keyframes lineSweep {
  0% { left: -60%; }
  100% { left: 100%; }
}

.turn-banner.waiting {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.turn-banner.spectating {
  background: rgba(245, 158, 11, 0.05);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
  font-size: 0.85rem;
}
#turn-banner-icon {
  font-size: 1.2em;
  line-height: 1;
}

/* ===== CHAT PANEL ===== */
#chat-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 300px; max-width: 85vw;
  height: 340px;
  background: rgba(8, 9, 15, 0.95);
  border-top: 1px solid var(--border-glass);
  border-left: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) 0 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  z-index: 50;
  transform: translateY(calc(100% - 42px));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overscroll-behavior: contain;
}
#chat-panel.open { transform: translateY(0); }

#chat-toggle {
  padding: 10px var(--space-md);
  cursor: pointer;
  display: flex; align-items: center; gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 600; font-size: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
#chat-toggle .chat-badge {
  background: var(--danger);
  color: white; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px; border-radius: var(--radius-full);
  display: none;
  font-variant-numeric: tabular-nums;
}
#chat-toggle .chat-badge.show { display: inline; }

#chat-messages {
  flex: 1; overflow-y: auto; padding: var(--space-sm);
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.chat-msg {
  padding: 6px 10px;
  background: rgba(255,255,255,0.025);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.4;
}
.chat-msg .msg-sender {
  font-family: var(--font-heading);
  font-weight: 700; color: var(--accent);
  margin-right: 4px;
}
.chat-msg .msg-text { color: var(--text-secondary); }
.chat-msg.system {
  color: var(--warning);
  font-style: italic;
  background: rgba(245, 158, 11, 0.04);
  border-left: 2px solid rgba(245, 158, 11, 0.2);
}

#chat-input-area {
  display: flex; gap: var(--space-xs); padding: var(--space-sm);
  border-top: 1px solid var(--border-glass); flex-shrink: 0;
}
#chat-input {
  flex: 1; padding: 8px var(--space-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
#chat-send-btn {
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #000;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700; font-size: 0.75rem; cursor: pointer;
  letter-spacing: 0.04em;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 80;
  pointer-events: none;
  width: 88%;
  max-width: 380px;
}
.toast {
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  text-align: center;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
}
.toast.info {
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.22);
  color: var(--accent);
}
.toast.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: var(--warning);
}
.toast.danger {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.22);
  color: var(--danger);
}
.toast.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: var(--success);
}
.toast.slide-out {
  animation: toastOut 0.25s ease-in forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* ===== CARD INFO CAROUSEL OVERLAY ===== */
.card-info-overlay {
  align-items: flex-end;
  padding: 0;
  z-index: 110;
}

.card-info-modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: linear-gradient(180deg, rgba(12,13,22,0.98) 0%, rgba(8,9,15,0.99) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 60px rgba(0,0,0,0.6), 0 -2px 0 rgba(255,255,255,0.04);
}

@keyframes sheetUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.card-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.card-info-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin: 0;
}

.card-info-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.card-info-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Carousel track */
.carousel-track-wrap {
  overflow: hidden;
  flex: 1;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 28px 16px;
  gap: 20px;
  overflow-y: auto;
  scrollbar-width: none;
}

.carousel-slide::-webkit-scrollbar { display: none; }

/* Card image area */
.carousel-card-img-wrap {
  position: relative;
  width: 110px;
  height: 150px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}

.carousel-card-glow {
  position: absolute;
  inset: -12px;
  border-radius: 20px;
  background: radial-gradient(ellipse at center, var(--glow, #fff) 0%, transparent 70%);
  opacity: 0.18;
  z-index: 1;
  pointer-events: none;
  animation: glowPulse 2.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.14; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(1.06); }
}

/* Multi-card stacked display */
.carousel-card-img-wrap--multi {
  width: 140px;
}

.carousel-card-img--back {
  position: absolute;
  width: 80px;
  height: 110px;
  left: 0;
  top: 20px;
  transform: rotate(-12deg);
  z-index: 1;
  opacity: 0.7;
}

.carousel-card-img--mid {
  position: absolute;
  width: 85px;
  height: 116px;
  left: 28px;
  top: 10px;
  transform: rotate(-4deg);
  z-index: 2;
  opacity: 0.85;
}

.carousel-card-img--front {
  position: absolute;
  width: 90px;
  height: 122px;
  right: 0;
  top: 0;
  transform: rotate(6deg);
  z-index: 3;
}

/* UNO badge display */
.carousel-card-img-wrap--uno {
  width: 140px;
  height: 140px;
}

.carousel-uno-badge {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff1a1a, #ff6b00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: white;
  letter-spacing: 0.06em;
  box-shadow: 0 0 40px rgba(255, 60, 0, 0.5), 0 8px 32px rgba(0,0,0,0.4);
  animation: unoBadgeSpin 3s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes unoBadgeSpin {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.05) rotate(2deg); }
}

/* Info panel */
.carousel-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 100%;
}

.carousel-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: white;
  text-transform: uppercase;
}

.carousel-card-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.02em;
}

.carousel-card-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 320px;
}

.carousel-card-desc em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.carousel-card-desc strong {
  color: #ff6b00;
  font-weight: 700;
}

.carousel-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.carousel-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  min-width: 72px;
}

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

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Navigation */
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px 20px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  line-height: 1;
}

.carousel-arrow:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.carousel-arrow:active { transform: scale(0.9); }
.carousel-arrow:disabled { opacity: 0.25; cursor: not-allowed; }

.carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.carousel-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ===== CONNECTION STATUS ===== */
#connection-status {
  position: fixed; top: var(--space-sm); left: var(--space-sm);
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 3px 10px; border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.65rem; font-weight: 600; z-index: 200;
  background: rgba(8, 9, 15, 0.7);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}
.status-dot.disconnected {
  background: var(--danger);
  animation: blink 1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== TURN FLASH ===== */
.turn-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.18) 0%, transparent 70%);
}
.turn-flash.flash {
  animation: turnFlash 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes turnFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== CHAT CLOSE BUTTON ===== */
.chat-toggle-spacer {
  flex: 1;
}
.chat-close-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
#chat-panel.open .chat-close-btn { display: flex; }

/* ===== YOUR TURN TOAST (bigger, more dramatic) ===== */
.toast.your-turn-alert {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(124, 77, 255, 0.12));
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1.05rem;
  padding: 14px var(--space-lg);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.25), 0 8px 28px rgba(0,0,0,0.4);
  text-shadow: 0 0 10px var(--accent-glow);
  animation: yourTurnToastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes yourTurnToastIn {
  0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
  60% { transform: translateY(4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== SOUND TOGGLE BUTTON ===== */
#sound-toggle-btn {
  position: fixed;
  top: var(--space-sm);
  right: 46px; /* shifted left to not overlap quit button */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(8, 9, 15, 0.7);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  line-height: 1;
  padding: 0;
}
#sound-toggle-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
#sound-toggle-btn:active { transform: scale(0.9); }
#sound-toggle-btn.muted { color: var(--danger); border-color: rgba(244, 63, 94, 0.3); }

/* ===== VIDEO CALL BUTTON ===== */
.video-call-btn {
  position: fixed;
  top: var(--space-sm);
  right: 80px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(8, 9, 15, 0.7);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  line-height: 1;
  padding: 0;
}
.video-call-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.video-call-btn:active { transform: scale(0.9); }
.video-call-btn.active { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }

/* ===== VIDEO CALL PANEL ===== */
.video-panel {
  position: fixed;
  top: 44px;
  right: var(--space-sm);
  width: 200px;
  background: rgba(8, 9, 15, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 180;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: videoPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes videoPanelIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.video-panel.hidden { display: none; }

.video-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-glass);
}

.video-panel-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.video-controls {
  display: flex;
  gap: 4px;
}

.vc-ctrl-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
  line-height: 1;
}
.vc-ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.vc-ctrl-btn.muted { color: var(--danger); border-color: rgba(244, 63, 94, 0.3); }
.vc-ctrl-btn.vc-end { color: #ff3333; border-color: rgba(255, 50, 50, 0.3); }
.vc-ctrl-btn.vc-end:hover { background: rgba(255, 50, 50, 0.2); }

.video-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.video-slot {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0,0,0,0.6);
  aspect-ratio: 4/3;
}

.video-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-slot.video-self video {
  transform: scaleX(-1); /* mirror self-view */
}

.video-label {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 600;
  color: white;
  background: rgba(0,0,0,0.6);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* ===== SPECTATOR BANNER ===== */
.spectator-banner {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 6px; text-align: center;
  background: rgba(245, 158, 11, 0.06);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-family: var(--font-heading);
  font-size: 0.75rem; font-weight: 600;
  z-index: 60;
  letter-spacing: 0.06em;
}
