@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   SAMAR SEQUENCE - Design Tokens (Sampled from app_logo.png)
   ========================================================================== */
:root {
  /* Premium Dark Gaming Obsidian Palette */
  --bg-deep-navy: #050814;
  --bg-surface: #0a1226;
  --bg-surface-elevated: #111e3f;
  --bg-glass: rgba(10, 18, 38, 0.85);
  --primary-blue: #2563eb;
  --primary-blue-glow: rgba(37, 99, 235, 0.5);

  /* Vegas Gold Metallic Highlights */
  --gold-primary: #f59e0b;
  --gold-dark: #d97706;
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #b45309 100%);
  --gold-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);

  /* Neutrals */
  --text-white: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(245, 158, 11, 0.35);

  /* Playing Card Colors */
  --card-white: #ffffff;
  --card-red: #dc2626;
  --card-black: #0f172a;

  /* Team Chip Colors (High Contrast & Distinguishable) */
  --team-0-color: #2563eb; /* Sapphire Blue */
  --team-1-color: #10b981; /* Emerald Green */
  --team-2-color: #ef4444; /* Ruby Red */

  /* UI Sizing & Smooth Motion */
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-deep-navy);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(30, 64, 175, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(217, 119, 6, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    linear-gradient(to bottom, #060914, #04060c);
  background-attachment: fixed;
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

.app-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(6, 11, 26, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

.brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-fast);
}

.brand-link:hover .brand-logo {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-samar {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

.brand-sequence {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 2px;
}

/* Center Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-fast);
}

.header-nav .nav-link:hover {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.header-nav .nav-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: rgba(147, 197, 253, 0.45) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.45) !important;
  font-weight: 800;
}

.nav-icon {
  font-size: 0.95rem;
}

/* Right Header Actions Toolbar */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.user-profile-badge:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.user-avatar-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.user-profile-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-rating-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.user-coins-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.badge-action-btn {
  border: none;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.badge-btn-gold {
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  color: #0b1329;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.badge-btn-gold:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.badge-btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-btn-outline:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

.auth-cta-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  white-space: nowrap;
}

.auth-cta-btn:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: #60a5fa;
  color: #ffffff;
}

.pwa-install-header-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 8px;
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* Notification Toast Banner (Floating HUD Toast) */
.notification-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 8px 18px;
  background: #f59e0b;
  color: #111827;
  font-weight: 700;
  font-size: 0.86rem;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  max-width: min(92vw, 460px);
  text-align: center;
  animation: slideDownToast 0.25s ease-out;
}

@keyframes slideDownToast {
  0% {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.notification-banner.danger {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Views & Cards
   ========================================================================== */
.view {
  display: none;
  flex: 1;
  padding: 16px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.card {
  background: linear-gradient(180deg, rgba(14, 23, 49, 0.92) 0%, rgba(8, 14, 30, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 24px 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  margin-top: 12px;
}

.lobby-card h2, .waiting-card h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* Form inputs & Buttons */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

input[type="text"] {
  width: 100%;
  height: 50px;
  background: rgba(4, 8, 20, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-sm);
  color: var(--text-white);
  padding: 0 16px;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: all var(--transition-fast);
}

input[type="text"]:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
  background: rgba(4, 8, 20, 0.85);
}

.btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--border-radius-sm);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-large {
  width: 100%;
  height: 52px;
  font-size: 1.05rem;
}

.btn-small {
  height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-gold {
  background: var(--gold-gradient);
  color: #0b1329;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
  border: 1px solid rgba(254, 240, 138, 0.5);
  letter-spacing: 0.2px;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.55);
}

.btn-gold:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: var(--text-white);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-white);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: var(--text-white);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-1px);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.divider span {
  padding: 0 10px;
}

/* ==========================================================================
   Executive Lobby & Arena Stage Layout
   ========================================================================== */
.lobby-card {
  padding: 24px 26px;
}

.lobby-command-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 22px;
}

@media (max-width: 720px) {
  .lobby-command-banner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.arena-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: liveDotPulse 1.5s infinite;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.arena-hero-heading {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.15;
}

.arena-hero-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 520px;
}

.player-identity-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  min-width: 260px;
}

.player-identity-card:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.identity-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.identity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.identity-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.identity-label {
  font-size: 0.68rem;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.6px;
}

.identity-edit-hint {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 600;
}

.identity-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.player-name-field {
  width: 100%;
  height: 36px !important;
  background: rgba(6, 11, 26, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  padding: 0 28px 0 10px !important;
  letter-spacing: 0.2px;
}

.player-name-field:focus {
  border-color: #f59e0b !important;
  background: rgba(6, 11, 26, 0.95) !important;
}

.input-pencil-icon {
  position: absolute;
  right: 8px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0.6;
}

/* Lobby Chip Color Selector */
.chip-selector-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 14px;
}

.chip-selector-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #f59e0b;
  text-transform: uppercase;
}

.chip-pills-row {
  display: flex;
  gap: 6px;
}

.chip-select-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(14, 25, 55, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-select-btn:hover {
  background: rgba(24, 40, 80, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.chip-select-btn.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.chip-pip {
  font-size: 0.85rem;
  line-height: 1;
}

.chip-pip-0 { color: #3b82f6; text-shadow: 0 0 5px rgba(59, 130, 246, 0.9); }
.chip-pip-1 { color: #10b981; text-shadow: 0 0 5px rgba(16, 185, 129, 0.9); }
.chip-pip-2 { color: #ef4444; text-shadow: 0 0 5px rgba(239, 68, 68, 0.9); }

/* Featured Modes Grid */
.lobby-modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .lobby-modes-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.mode-card {
  position: relative;
  background: linear-gradient(160deg, #0e1c3e 0%, #081128 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  text-align: left;
}

.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
}

.mode-card-ai {
  border-top: 3.5px solid #3b82f6;
}

.mode-card-ai:hover {
  border-color: #60a5fa;
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.35);
}

.mode-card-room {
  border-top: 3.5px solid #f59e0b;
}

.mode-card-room:hover {
  border-color: #f59e0b;
  box-shadow: 0 12px 35px rgba(245, 158, 11, 0.35);
}

.mode-card-tournament {
  border-top: 3.5px solid #ef4444;
  position: relative;
  animation: tournament-glow-pulse 2.5s ease-in-out infinite;
}

.mode-card-tournament:hover {
  border-color: #f97316;
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.45);
  transform: translateY(-3px);
}

@keyframes tournament-glow-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15); }
  50%       { box-shadow: 0 4px 28px rgba(249, 115, 22, 0.35); }
}

.mode-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.mode-card-badge {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.ai-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.gold-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tournament-badge {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(249, 115, 22, 0.45);
  animation: badge-flicker 1.8s ease-in-out infinite;
}

@keyframes badge-flicker {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

.mode-meta-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.mode-visual-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mode-card-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.ai-bubble {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3) 0%, rgba(29, 78, 216, 0.6) 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
}

.gold-bubble {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(180, 83, 9, 0.6) 100%);
  border: 1px solid rgba(254, 240, 138, 0.35);
}

.tournament-bubble {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(194, 65, 12, 0.65) 100%);
  border: 1px solid rgba(252, 165, 165, 0.35);
}

.btn-tournament {
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
  color: #fff !important;
  border: none;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: box-shadow 0.2s, transform 0.15s;
}

.btn-tournament:hover {
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.55);
  transform: translateY(-1px);
}

.nav-link-tournament {
  color: #fca5a5 !important;
  font-weight: 700;
}

.nav-link-tournament:hover,
.nav-link-tournament.active {
  color: #ff6b6b !important;
}

.mode-title-block h3 {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 2px;
}

.mode-subtitle-tag {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}

.mode-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 18px;
  min-height: 38px;
}

.btn-action-card {
  width: 100%;
  height: 46px;
  font-size: 0.92rem;
  font-weight: 800;
  border-radius: 10px;
}

/* Secondary Actions Grid */
.lobby-secondary-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .lobby-secondary-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.join-room-card, .matchmaking-card {
  background: rgba(10, 18, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  text-align: left;
  margin-top: 0;
}

.secondary-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.secondary-icon {
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.06);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.secondary-card-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.secondary-card-header p {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
}

.join-box {
  display: flex;
  gap: 10px;
}

.code-input {
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 900;
  text-align: center;
  font-size: 1.1rem;
  height: 44px !important;
  border-radius: 8px !important;
}

.join-btn {
  height: 44px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
}

.quick-match-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-matchmaking {
  height: auto;
  padding: 8px 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-matchmaking:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-matchmaking .mode-icon {
  font-size: 1.2rem;
}

.match-btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.btn-matchmaking .mode-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
}

.btn-matchmaking .mode-meta {
  font-size: 0.65rem;
  color: #6ee7b7;
  font-weight: 600;
}

/* Collapsible Rules Accordion */
.rules-accordion {
  background: rgba(10, 18, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
  transition: background 0.2s ease;
}

.rules-accordion[open] {
  background: rgba(10, 18, 42, 0.9);
  border-color: rgba(245, 158, 11, 0.3);
}

.rules-summary {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.rules-summary::-webkit-details-marker {
  display: none;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-icon {
  font-size: 1.1rem;
}

.summary-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.2px;
}

.rules-summary:hover .summary-title {
  color: #fde68a;
}

.summary-chevron {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.rules-accordion[open] .summary-chevron {
  transform: rotate(180deg);
  color: #f59e0b;
}

.rules-accordion-content {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

.rule-mini-card {
  background: rgba(6, 11, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.rule-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.rule-pill-wild {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.rule-pill-remove {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.rule-pill-corner {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.rule-pill-dead {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.rule-mini-card strong {
  display: block;
  font-size: 0.8rem;
  color: #ffffff;
  margin-bottom: 2px;
}

.rule-mini-card p {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
}

/* Waiting Room */
.room-code-badge {
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--gold-primary);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.room-code-badge span {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--gold-primary);
  font-weight: 700;
}

.room-code-badge h1 {
  font-size: 2.2rem;
  letter-spacing: 6px;
  font-weight: 900;
  color: var(--text-white);
  margin: 4px 0 10px;
}

.player-list {
  list-style: none;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--gold-primary);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.host-tag {
  background: var(--gold-primary);
  color: var(--text-dark);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.waiting-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ==========================================================================
   Active Game Table Viewport & Zero-Scroll Layout
   ========================================================================== */
/* Header is completely hidden during active game table view to maximize screen */
body.in-game-table-active,
body:has(#gameTableView.active) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.in-game-table-active .app-header,
body:has(#gameTableView.active) .app-header,
body.in-game-table-active #notificationBanner:not(.danger),
body:has(#gameTableView.active) #notificationBanner:not(.danger) {
  display: none !important;
}

#gameTableView {
  padding: 4px 12px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
}

#gameTableView.active {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center;
  min-height: 100dvh;
  height: auto !important;
  max-height: none !important;
  padding: 6px 12px 14px;
  box-sizing: border-box;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom Sleek Gold Scrollbar for Game Table */
#gameTableView::-webkit-scrollbar,
body.in-game-table-active::-webkit-scrollbar {
  width: 7px;
}
#gameTableView::-webkit-scrollbar-track,
body.in-game-table-active::-webkit-scrollbar-track {
  background: rgba(6, 12, 28, 0.7);
}
#gameTableView::-webkit-scrollbar-thumb,
body.in-game-table-active::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.5);
  border-radius: 4px;
}
#gameTableView::-webkit-scrollbar-thumb:hover,
body.in-game-table-active::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.85);
}

/* Modern Gaming Table Layout: Left Side Panel + Center Board Arena */
.game-table-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

/* ==========================================================================
   Left Side Panel: Players, Teams, Scores & Turn Notifications
   ========================================================================== */
.game-side-panel {
  width: 260px;
  min-width: 240px;
  max-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(8, 16, 38, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.55);
}

.side-room-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-room-header .room-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(12, 22, 50, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-panel-icon {
  font-size: 1rem;
}

.side-panel-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.side-target-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--gold-primary);
  letter-spacing: 0.3px;
}

.side-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual Player Card in Side Panel */
.side-player-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(12, 22, 48, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--team-color, #2563eb);
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.side-player-card:hover {
  background: rgba(18, 32, 68, 0.85);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Mobile App Style Active Turn Highlight on Player Card */
.side-player-card.is-turn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(12, 26, 62, 0.95) 100%);
  border-color: #f59e0b;
  border-left: 4px solid #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45), inset 0 0 10px rgba(245, 158, 11, 0.15);
  animation: turnCardGlow 1.8s infinite alternate ease-in-out;
  transform: translateX(3px);
}

.side-player-card.is-turn.urgent-turn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.28) 0%, rgba(12, 26, 62, 0.95) 100%);
  border-color: #ef4444;
  border-left: 4px solid #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
  animation: urgentCardGlow 0.8s infinite alternate ease-in-out;
}

@keyframes turnCardGlow {
  0% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
    border-color: rgba(245, 158, 11, 0.7);
  }
  100% {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.8), 0 0 8px rgba(254, 240, 138, 0.6);
    border-color: #fef08a;
  }
}

@keyframes urgentCardGlow {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.8);
  }
  100% {
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.95);
    border-color: #fca5a5;
  }
}

.side-player-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.side-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  overflow: hidden;
}

.side-player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-team-pip {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #060b1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 900;
  color: #fff;
}

.side-player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.side-player-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-player-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.role-badge {
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.role-you {
  background: rgba(37, 99, 235, 0.3);
  border: 1px solid rgba(37, 99, 235, 0.6);
  color: #60a5fa;
}

.role-bot {
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.side-player-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
}

.side-team-text {
  font-weight: 600;
}

.side-seq-count {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.side-seq-count strong {
  color: #fff;
}

/* Turn Live Badge on Side Card */
.side-turn-indicator {
  position: absolute;
  top: 4px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #060914;
  font-size: 0.56rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.turn-live-dot {
  width: 5px;
  height: 5px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

.turn-live-timer {
  background: rgba(0, 0, 0, 0.3);
  padding: 0 4px;
  border-radius: 6px;
  color: #fff;
  font-family: monospace;
}

/* Side Match Stats (Draw & Discard) */
.side-match-stats {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(6, 12, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-top: 4px;
}

.side-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-stat-label {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.side-stat-value {
  font-size: 0.78rem;
  color: var(--gold-primary);
}

/* ==========================================================================
   Center Arena: Slim Info Bar, Board & Hand Cards
   ========================================================================== */
.game-center-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 920px;
  flex: 1;
  min-width: 0;
}

.game-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  background: rgba(10, 24, 60, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  width: 100%;
  max-width: min(92vw, calc(100dvh - 150px), 500px);
  flex-shrink: 0;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.room-code-tag {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.hud-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.hud-btn-chat {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.hud-btn-chat:hover {
  background: rgba(37, 99, 235, 0.45);
  color: #fff;
}

.hud-btn-sound {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.hud-btn-leave {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.hud-btn-leave:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* Compact HUD Turn Pill in Top Bar */
.hud-turn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.74rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.hud-turn-pill.your-turn {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--gold-primary);
}

.hud-turn-dot {
  font-size: 0.7rem;
  color: var(--gold-primary);
}

.hud-timer-badge {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-family: monospace;
  color: #fff;
}

/* 10x10 Board */
.board-wrapper {
  width: 100%;
  aspect-ratio: 1.1;
  max-height: min(94vw, calc(100dvh - 130px), 720px);
  max-width: min(94vw, 880px);
  margin: 0 auto;
  padding: 4px;
  background: linear-gradient(135deg, #07162c 0%, #030a16 100%);
  border: 2px solid #d97706;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.75), inset 0 0 12px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  width: 100%;
  height: 100%;
  gap: 2px;
}

.cell {
  position: relative;
  background: linear-gradient(145deg, #ffffff 0%, #f1f4f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  overflow: hidden;
}

.cell:hover:not(.occupied):not(.corner) {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.cell.corner {
  background: radial-gradient(circle at 35% 35%, #fef08a 0%, #eab308 60%, #b45309 100%);
  border: 1.5px solid #fef08a;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.7), 0 2px 5px rgba(0, 0, 0, 0.25);
  color: #1e1e1e;
  font-weight: 900;
  cursor: default;
}

.corner-icon {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.corner-label {
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #451a03;
  line-height: 1;
  margin-top: 1px;
}

.cell-rank {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.3px;
}

.cell-suit {
  font-size: 0.82rem;
  line-height: 1;
  margin-top: 1px;
}

.card-red {
  color: #dc2626 !important;
}

.card-black {
  color: #0f172a !important;
}

/* Highlighted Legal Cell Target - Vibrant Glowing Gold Halo */
.cell.legal-target {
  position: relative;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), inset 0 0 8px rgba(245, 158, 11, 0.45) !important;
  animation: pulseGoldTarget 1.2s ease-in-out infinite alternate !important;
  z-index: 5;
  cursor: pointer !important;
}

@keyframes pulseGoldTarget {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6), inset 0 0 4px rgba(245, 158, 11, 0.3);
  }
  100% {
    transform: scale(1.04);
    box-shadow: 0 0 18px rgba(245, 158, 11, 1), inset 0 0 10px rgba(245, 158, 11, 0.6);
  }
}

/* 3D Tactile Poker Chips with Full Team Color & Overlapping Name Tag */
.cell.occupied {
  overflow: visible;
  z-index: 5;
}

.chip {
  position: absolute;
  height: 86%;
  aspect-ratio: 1;
  width: auto;
  max-width: 86%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
  animation: dropChip 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3;
  user-select: none;
}

/* Overlapping Played Card Tag (Floating cleanly at top of chip) */
.chip-name-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 30, 0.95);
  color: #ffffff;
  font-size: clamp(0.58rem, 1.25vw, 0.74rem);
  font-weight: 900;
  padding: 1.5px 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.2px;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.tag-card-rank {
  font-weight: 900;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
}

.tag-card-suit {
  font-weight: 900;
  font-size: 1.1em;
  line-height: 1;
}

.tag-card-suit.suit-red {
  color: #f87171;
  text-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
}

.tag-card-suit.suit-white {
  color: #ffffff;
}

.tag-card-wild {
  color: #34d399;
  font-weight: 900;
  font-size: 0.82em;
  letter-spacing: 0.4px;
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Authentic Concentric Inner Ring for clean Poker Chip effect */
.chip-inner-ring {
  width: 62%;
  height: 62%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35), 0 0 4px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

/* Full Vibrant Team Color Radial Gradients */
.chip-team-0 {
  background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%);
  border: 2px solid #93c5fd;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
}

.chip-team-0 .chip-name-tag {
  border-color: #60a5fa;
  color: #dbeafe;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.55);
}

.chip-team-1 {
  background: radial-gradient(circle at 35% 35%, #34d399 0%, #059669 55%, #047857 100%);
  border: 2px solid #a7f3d0;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
}

.chip-team-1 .chip-name-tag {
  border-color: #34d399;
  color: #d1fae5;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}

.chip-team-2 {
  background: radial-gradient(circle at 35% 35%, #f87171 0%, #dc2626 55%, #b91c1c 100%);
  border: 2px solid #fca5a5;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
}

.chip-team-2 .chip-name-tag {
  border-color: #f87171;
  color: #fee2e2;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

.chip.locked {
  border: 2.5px solid #fbbf24 !important;
  box-shadow: 0 0 16px #fbbf24, 0 3px 8px rgba(0, 0, 0, 0.7), inset 0 0 6px #fde047 !important;
  animation: lockedGlow 2s infinite alternate ease-in-out;
}

.chip.locked .chip-name-tag {
  border-color: #fbbf24;
  color: #fef08a;
  background: rgba(120, 53, 15, 0.95);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

@keyframes lockedGlow {
  0% {
    box-shadow: 0 0 8px #f59e0b, 0 3px 8px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 18px #fbbf24, 0 4px 10px rgba(0, 0, 0, 0.7);
  }
}

/* ==========================================================================
   Sequence Formation Celebration Highlight (4-Second Grand Celebration)
   ========================================================================== */
.cell.sequence-celebration {
  position: relative;
  z-index: 30 !important;
  animation: sequenceCelebrationPulse 0.75s infinite alternate ease-in-out !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.95), 0 0 45px rgba(245, 158, 11, 0.8), inset 0 0 15px rgba(254, 240, 138, 0.9) !important;
  background: radial-gradient(circle, rgba(254, 243, 199, 0.9) 0%, rgba(251, 191, 36, 0.5) 100%) !important;
}

.cell.sequence-celebration .chip,
.chip.sequence-celebration-chip {
  animation: sequenceChipCelebration 0.75s infinite alternate ease-in-out !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 30px #fbbf24, 0 0 50px rgba(245, 158, 11, 0.9), inset 0 0 12px #fff !important;
}

.cell.sequence-celebration .chip-name-tag {
  border-color: #fff !important;
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 14px #fbbf24, 0 2px 8px rgba(0, 0, 0, 0.9) !important;
  transform: translateX(-50%) scale(1.15) !important;
}

@keyframes sequenceCelebrationPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8), 0 0 30px rgba(245, 158, 11, 0.6), inset 0 0 10px rgba(254, 240, 138, 0.6);
    filter: brightness(1.15);
  }
  100% {
    transform: scale(1.14);
    box-shadow: 0 0 35px rgba(254, 240, 138, 1), 0 0 60px rgba(245, 158, 11, 1), inset 0 0 20px rgba(255, 255, 255, 0.95);
    filter: brightness(1.55);
  }
}

@keyframes sequenceChipCelebration {
  0% {
    transform: scale(0.96) rotate(-2deg);
    filter: drop-shadow(0 0 12px #f59e0b);
  }
  100% {
    transform: scale(1.12) rotate(2deg);
    filter: drop-shadow(0 0 26px #fde047);
  }
}

.chip.last-move::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 1.5px solid #000;
  border-radius: 50%;
  top: 3px;
  right: 3px;
  animation: pulseBeacon 1s infinite alternate;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   Player Hand Tray
   ========================================================================== */
.player-tray {
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 5px 12px 6px;
  background: rgba(8, 15, 35, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  max-width: min(96vw, 920px);
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  font-size: 0.78rem;
  height: 20px;
  padding: 0 2px;
}

.reaction-bar {
  display: none !important; /* Hide during gameplay to guarantee cards never cut off */
}

.my-team-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.82rem;
}

.team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.deck-stats {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hand-container {
  display: flex;
  justify-content: safe center;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 4px 4px;
  scrollbar-width: none;
}

.hand-container::-webkit-scrollbar {
  display: none;
}

.hand-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(58px, 7.6vw, 76px);
  aspect-ratio: 5 / 7;
  height: auto;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
}

.hand-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
  border-color: #94a3b8;
}

.hand-card.selected {
  transform: translateY(-10px) scale(1.08);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.85), 0 0 0 2px #f59e0b;
  border-color: #f59e0b;
  z-index: 10;
}

.card-top {
  position: absolute;
  top: 4px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  pointer-events: none;
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.25rem, 1.8vw, 1.65rem);
  line-height: 1;
  text-align: center;
  pointer-events: none;
  opacity: 0.92;
}

.card-bottom {
  position: absolute;
  bottom: 4px;
  right: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  transform: rotate(180deg);
  pointer-events: none;
}

.card-corner-rank {
  font-size: clamp(0.88rem, 1.15vw, 1.05rem);
  font-weight: 900;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.4px;
  line-height: 0.95;
}

.card-corner-suit {
  font-size: clamp(0.68rem, 0.9vw, 0.8rem);
  line-height: 0.95;
  margin-top: 1px;
}

.hand-card.jack-card {
  padding: 0 !important;
  background: #0f172a;
  overflow: hidden;
}

.hand-card.jack-card .jack-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.hand-card.jack-wild-card {
  border: 2px solid #10b981;
  box-shadow: 0 5px 16px rgba(16, 185, 129, 0.5);
}

.hand-card.jack-remove-card {
  border: 2px solid #ef4444;
  box-shadow: 0 5px 16px rgba(239, 68, 68, 0.5);
}

.hand-card.jack-wild-card:hover {
  border-color: #34d399;
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.7);
}

.hand-card.jack-remove-card:hover {
  border-color: #f87171;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.7);
}

.hand-card.jack-card.selected {
  transform: translateY(-12px) scale(1.12);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.9), 0 0 0 2.5px #f59e0b;
  border-color: #f59e0b;
  z-index: 10;
}

.jack-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 5px;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  z-index: 5;
  text-transform: uppercase;
}

.jack-wild {
  background: linear-gradient(135deg, #10b981, #047857);
  border: 1px solid #34d399;
}

.jack-remove {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 1px solid #f87171;
}

.dead-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 5px;
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #64748b;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.dead-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px 14px;
  cursor: pointer;
  overflow-y: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  border-radius: var(--border-radius-lg);
  padding: 28px 20px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  position: relative;
  cursor: default;
}

.win-trophy {
  font-size: 3rem;
  margin-bottom: 8px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Animations */
@keyframes dropChip {
  0% { transform: scale(0.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseLegal {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.85; }
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Phase 4: Auth Modal Styles
   ========================================================================== */

.auth-modal-card {
  text-align: left;
  max-width: 480px;
  width: min(94vw, 480px);
  max-height: min(88vh, 660px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  padding: 22px 20px 18px;
  background: var(--bg-surface);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  padding-right: 36px;
  flex-shrink: 0;
}

.auth-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: -0.2px;
}

.auth-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0b1329;
  border: 2px solid var(--gold-primary);
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition-fast);
  z-index: 40;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 158, 11, 0.3);
}

.auth-close-btn:hover {
  color: #ffffff;
  background: #dc2626;
  border-color: #fca5a5;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  flex-shrink: 0;
}

.auth-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  padding-bottom: 6px;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.auth-modal-body::-webkit-scrollbar {
  width: 6px;
}

.auth-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.auth-modal-body::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 8px;
}

.auth-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.7);
}

.auth-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  background: var(--royal-blue);
  color: #ffffff;
}

.auth-alert {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: none;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: rgba(5, 14, 45, 0.8);
  color: #fff;
  font-size: 0.95rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px rgba(255, 201, 40, 0.4);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-top: 6px;
}

.auth-links a {
  color: var(--gold-primary);
  text-decoration: none;
  cursor: pointer;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Phase 5: Profile Modal, Avatars, Match History & Friends Styles
   ========================================================================== */
.profile-modal-card {
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.avatar-option:hover {
  background: rgba(255, 255, 255, 0.12);
}

.avatar-option.selected {
  border: 2px solid var(--gold-primary);
  background: rgba(255, 201, 40, 0.15);
  box-shadow: 0 0 10px rgba(255, 201, 40, 0.4);
}

.avatar-option-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 4px;
}

.avatar-option-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.stat-box {
  background: var(--bg-surface-elevated);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.stat-box-value {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold-primary);
}

.stat-box-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.match-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  border-left: 4px solid var(--border-light);
}

.match-card.win {
  border-left-color: #10b981;
}

.match-card.loss {
  border-left-color: #ef4444;
}

.match-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.match-badge.win {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.match-badge.loss {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.friend-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #64748b;
}

.online-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Floating Game Invite Toast */
.invite-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1000;
  animation: slideDownToast 0.3s ease-out;
}

@keyframes slideDownToast {
  0% { transform: translate(-50%, -100%); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   Phase 6: In-Game Chat, Emojis, Floating Reactions & Report/Mute Styles
   ========================================================================== */
.chat-pill-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-unread {
  background: var(--gold-primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
}

.reaction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(10, 31, 107, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.reaction-emojis {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.reaction-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: transform var(--transition-fast);
  line-height: 1;
}

.reaction-btn:hover {
  transform: scale(1.3);
}

.reaction-btn:active {
  transform: scale(0.9);
}

.quick-phrase-wrapper {
  position: relative;
}

.quick-phrases-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 600;
  padding: 4px 0;
  overflow: hidden;
}

.quick-phrase-item {
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.quick-phrase-item:hover {
  background: rgba(255, 201, 40, 0.15);
  color: var(--gold-primary);
}

/* Floating Reactions */
.floating-reactions-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 400;
}

.floating-reaction-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 31, 107, 0.95);
  border: 1px solid var(--gold-primary);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  animation: floatReactionUp 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatReactionUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  75% { opacity: 1; transform: translateY(-40px) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.9); }
}

.bubble-sender {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.bubble-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

/* Chat Drawer */
.chat-drawer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  height: 400px;
  max-width: calc(100vw - 32px);
  background: var(--bg-surface);
  border: 1px solid var(--gold-primary);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-light);
}

.chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-system-message {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 6px;
}

.chat-bubble {
  background: var(--bg-surface-elevated);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--border-light);
  font-size: 0.82rem;
}

.chat-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-bubble-author {
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
}

.chat-bubble-actions {
  display: flex;
  gap: 4px;
}

.chat-action-btn {
  background: transparent;
  border: none;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
}

.chat-action-btn:hover {
  color: var(--gold-primary);
}

.chat-bubble-text {
  color: #e2e8f0;
  word-break: break-word;
}

.chat-input-box {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-light);
}

.chat-input-box input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-light);
  color: #fff;
}

/* ==========================================================================
   Phase 7: Public Matchmaking Styles
   ========================================================================== */
.quick-match-section {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-match-title {
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-match-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-matchmaking {
  padding: 10px 4px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  background: linear-gradient(180deg, #163da8 0%, #0d2777 100%);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-matchmaking:hover {
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 201, 40, 0.25);
}

.btn-matchmaking .mode-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.btn-matchmaking .mode-label {
  font-weight: 800;
  color: #fff;
  font-size: 0.85rem;
}

.btn-matchmaking .mode-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Matchmaking Modal & Radar Animation */
.matchmaking-modal-card {
  text-align: center;
  max-width: 380px;
  padding: 28px 20px;
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.radar-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  animation: radarPing 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  opacity: 0.75;
}

.radar-pulse-delayed {
  animation-delay: 1s;
}

.radar-center {
  position: relative;
  font-size: 2.2rem;
  z-index: 2;
  filter: drop-shadow(0 0 8px var(--gold-primary));
}

@keyframes radarPing {
  0% {
    transform: scale(0.3);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.matchmaking-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.status-separator {
  color: var(--gold-primary);
}

/* ==========================================================================
   Comprehensive Responsive Layout & Mobile Game Screen Optimization
   ========================================================================== */
@media (max-width: 640px) {
  .app-container {
    padding: 0 4px;
  }

  .card {
    padding: 16px 12px;
    margin-top: 6px;
    border-radius: 14px;
  }

  .lobby-card {
    padding: 14px 10px;
  }

  .lobby-command-banner {
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .arena-hero-heading {
    font-size: 1.35rem;
    letter-spacing: -0.3px;
  }

  .arena-hero-sub {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .player-identity-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    min-width: 0;
    width: 100%;
  }

  .identity-avatar-wrap {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .identity-info {
    min-width: 0;
  }

  .chip-selector-block {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 0;
    padding-top: 8px;
    margin-top: 2px;
  }

  .chip-pills-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }

  .chip-select-btn {
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .lobby-modes-grid {
    gap: 10px;
    margin-bottom: 12px;
  }

  .mode-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .mode-visual-row {
    margin: 8px 0 10px;
    gap: 10px;
  }

  .mode-card-icon-bubble {
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
  }

  .mode-card-title {
    font-size: 1.1rem;
  }

  .mode-card-desc {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .btn-mode-launch {
    height: 42px;
    font-size: 0.88rem;
  }

  .lobby-secondary-grid {
    gap: 10px;
    margin-bottom: 12px;
  }

  .join-room-card, .matchmaking-card {
    padding: 12px;
    border-radius: 12px;
  }

  .quick-match-grid {
    gap: 6px;
  }

  .btn-matchmaking {
    padding: 8px 4px;
    font-size: 0.74rem;
  }

  .app-header {
    padding: 6px 12px;
  }

  .header-nav {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .user-profile-name {
    max-width: 60px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-samar {
    font-size: 0.95rem;
  }

  .brand-sequence {
    font-size: 0.65rem;
  }

  .game-info-bar {
    padding: 4px 8px;
    margin-bottom: 4px;
    gap: 4px;
  }

  .turn-status-card {
    padding: 4px 8px;
    gap: 6px;
  }

  .turn-avatar {
    font-size: 1rem;
  }

  .turn-name {
    font-size: 0.75rem;
  }

  .turn-hint {
    font-size: 0.62rem;
  }

  .turn-timer {
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .sequence-scores {
    gap: 3px;
  }

  .seq-score-badge {
    padding: 2px 6px;
    font-size: 0.68rem;
  }

  .board-wrapper {
    padding: 3px;
    border-width: 2px;
    border-radius: 8px;
    max-height: min(94vw, calc(100dvh - 170px));
    max-width: min(94vw, calc(100dvh - 170px));
  }

  .game-board {
    gap: 2px;
  }

  .cell {
    border-radius: 3px;
  }

  .cell-rank {
    font-size: clamp(0.55rem, 2.4vw, 0.75rem);
  }

  .cell-suit {
    font-size: clamp(0.58rem, 2.5vw, 0.78rem);
  }

  .corner-icon {
    font-size: clamp(0.75rem, 3vw, 1rem);
  }

  .corner-label {
    display: none;
  }

  .chip {
    width: 86%;
    height: 86%;
    font-size: clamp(0.6rem, 2.6vw, 0.8rem);
  }

  .chip-name-tag {
    font-size: clamp(0.42rem, 1.8vw, 0.54rem);
    padding: 0 4px;
    top: -4px;
  }

  .player-tray {
    padding: 4px 6px;
    margin-top: 2px;
    margin-bottom: 4px;
    border-radius: 10px;
  }

  .tray-header {
    margin-bottom: 2px;
    font-size: 0.74rem;
    height: 18px;
  }

  .reaction-bar {
    margin-bottom: 2px;
    padding-bottom: 2px;
  }

  .reaction-btn {
    font-size: 0.95rem;
    padding: 1px 3px;
  }

  .hand-container {
    gap: 4px;
    padding: 1px 2px 3px;
  }

  .hand-card {
    width: clamp(50px, 12vw, 66px);
    aspect-ratio: 5 / 7;
    height: auto;
    padding: 0;
    overflow: hidden;
    border-radius: 7px;
  }

  .hand-card.jack-card {
    padding: 0 !important;
  }

  .hand-card:hover {
    transform: translateY(-5px) scale(1.04);
  }

  .hand-card.selected {
    transform: translateY(-8px) scale(1.1);
  }

  .card-corner-rank {
    font-size: 0.88rem;
  }

  .card-corner-suit {
    font-size: 0.68rem;
  }

  .card-center {
    font-size: 1.25rem;
  }

  .jack-badge, .dead-badge {
    font-size: 0.65rem;
    padding: 2.5px 6px;
    bottom: 3px;
  }
}

@media (max-height: 720px) {
  .reaction-bar {
    display: none !important;
  }

  .board-wrapper {
    aspect-ratio: 1.1;
    max-height: min(92vw, calc(100dvh - 150px), 520px);
    max-width: min(92vw, calc(100dvh - 150px), 520px);
  }

  .hand-card {
    width: clamp(52px, 7.5vw, 68px);
    aspect-ratio: 5 / 7;
    height: auto;
  }
}

@media (max-height: 600px) {
  body.in-game-table-active .app-header,
  body:has(#gameTableView.active) .app-header {
    display: none !important;
  }

  #gameTableView.active {
    min-height: 100dvh;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding-bottom: 12px;
  }

  .board-wrapper {
    aspect-ratio: 1.08;
    max-height: min(92vw, calc(100dvh - 130px), 430px);
    max-width: min(92vw, calc(100dvh - 130px), 430px);
  }

  .hand-card {
    width: clamp(46px, 7vw, 56px);
    aspect-ratio: 5 / 7;
    height: auto;
  }
}

@media (min-width: 860px) {
  .hud-turn-pill {
    display: none; /* Turn is already prominently highlighted on the side player card */
  }

  .game-center-arena {
    max-width: 920px;
    flex: 1;
  }

  .board-wrapper {
    aspect-ratio: 1.1;
    max-width: min(calc(100vw - 320px), 880px);
    max-height: min(calc(100dvh - 130px), 720px);
    width: 100%;
  }

  .player-tray {
    max-width: min(calc(100vw - 320px), 920px);
    width: 100%;
  }

  .cell-rank {
    font-size: clamp(0.78rem, 1.4vw, 0.98rem);
  }

  .cell-suit {
    font-size: clamp(0.82rem, 1.5vw, 1.08rem);
  }
}

@media (min-width: 1200px) {
  #gameTableView {
    max-width: 1440px;
  }

  .game-table-container {
    gap: 22px;
  }

  .board-wrapper {
    aspect-ratio: 1.12;
    max-width: min(calc(100vw - 340px), 940px);
    max-height: min(calc(100dvh - 130px), 740px);
  }

  .player-tray {
    max-width: min(calc(100vw - 340px), 940px);
  }
}

@media (max-width: 859px) {
  .game-table-container {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .game-side-panel {
    width: 100%;
    max-width: min(92vw, 500px);
    padding: 6px 10px;
    gap: 6px;
  }

  .board-wrapper {
    aspect-ratio: 1;
    max-height: min(94vw, calc(100dvh - 140px), 480px);
    max-width: min(94vw, calc(100dvh - 140px), 480px);
  }

  .player-tray {
    max-width: min(96vw, 680px);
  }

  .side-panel-header {
    padding-bottom: 4px;
  }

  .side-players-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .side-players-list::-webkit-scrollbar {
    display: none;
  }

  .side-player-card {
    min-width: 155px;
    flex-shrink: 0;
    padding: 6px 8px;
    gap: 8px;
  }

  .side-match-stats {
    display: none;
  }
}

/* ==========================================================================
   Match Configuration & Stakes Dialog (Pre-Game Modal)
   ========================================================================== */
.match-setup-modal-card {
  max-width: 520px;
  width: min(94vw, 520px);
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 22px 20px 16px;
  background: var(--bg-surface);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.match-setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  padding-right: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.match-setup-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-setup-badge-icon {
  font-size: 1.8rem;
  background: rgba(245, 158, 11, 0.15);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.match-setup-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
}

.match-setup-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.match-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.match-setup-body::-webkit-scrollbar {
  width: 6px;
}

.match-setup-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.match-setup-body::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.35);
  border-radius: 4px;
}

.match-setup-body::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.65);
}

.setup-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.setup-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setup-wallet-pill {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}

/* 1. Target Sequences to Win Grid */
.setup-seq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setup-seq-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setup-seq-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.setup-seq-card.active {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.22);
}

.setup-seq-badge {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.4px;
}

.setup-seq-num {
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
}

.setup-seq-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* 2. Chip Color Selector Grid */
.setup-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.setup-chip-btn {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setup-chip-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.setup-chip-btn[data-team="0"].active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.setup-chip-btn[data-team="1"].active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.setup-chip-btn[data-team="2"].active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

.setup-chip-sample {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.setup-chip-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
}

/* 3. Stakes Pills Grid */
.setup-stakes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.setup-stake-pill {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setup-stake-pill:hover {
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.setup-stake-pill.active {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.28);
}

.stake-coin-val {
  font-size: 0.88rem;
  font-weight: 900;
  color: #ffffff;
}

.setup-stake-pill.active .stake-coin-val {
  color: #fde68a;
}

.stake-coin-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Pot Banner Preview */
.setup-pot-preview-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(16, 185, 129, 0.1));
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pot-preview-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pot-trophy {
  font-size: 1.4rem;
}

.pot-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.pot-amount {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold-primary);
}

.pot-preview-note {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* Modal Actions Footer */
.match-setup-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background: var(--bg-surface);
}

/* ==========================================================================
   Match Setup Modal & Waiting Slots Styles
   ========================================================================== */

/* Universal Checkmark on Active Cards */
.setup-player-card,
.setup-opponent-card,
.setup-diff-card,
.setup-seq-card,
.setup-chip-btn,
.setup-stake-pill {
  position: relative !important;
}

.setup-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  z-index: 2;
}

.setup-player-card.active .setup-card-check,
.setup-opponent-card.active .setup-card-check,
.setup-diff-card.active .setup-card-check,
.setup-seq-card.active .setup-card-check,
.setup-chip-btn.active .setup-card-check,
.setup-stake-pill.active .setup-card-check {
  display: flex;
}

/* 1. Total Players Grid */
.setup-players-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.setup-player-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setup-player-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.setup-player-card.active {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
}

.setup-player-badge {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--gold-primary);
  letter-spacing: 0.4px;
}

.setup-player-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
}

.setup-player-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* 2. Opponent Type Grid */
.setup-opponent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setup-opponent-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
}

.setup-opponent-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.setup-opponent-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.28);
}

.setup-opponent-icon {
  font-size: 1.7rem;
  flex-shrink: 0;
}

.setup-opponent-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setup-opponent-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #ffffff;
}

.setup-opponent-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* 3. Waiting Room 4-Slots Grid */
.waiting-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

@media (max-width: 640px) {
  .waiting-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .match-setup-modal-card {
    width: 95%;
    max-height: 92vh;
    padding: 16px 14px 14px;
    border-radius: 14px;
  }

  .match-setup-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    padding-right: 40px;
  }

  .match-setup-badge-icon {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    border-radius: 10px;
  }

  .match-setup-title {
    font-size: 1.1rem;
  }

  .match-setup-subtitle {
    font-size: 0.72rem;
  }

  .match-setup-body {
    gap: 14px;
    padding-right: 4px;
  }

  .setup-group {
    gap: 6px;
  }

  .setup-label {
    font-size: 0.78rem;
  }

  .setup-players-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .setup-player-card {
    padding: 8px 6px;
    border-radius: 10px;
  }

  .setup-player-badge {
    font-size: 0.6rem;
  }

  .setup-player-num {
    font-size: 0.88rem;
  }

  .setup-player-desc {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  .setup-opponent-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .setup-opponent-card {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 10px;
  }

  .setup-opponent-icon {
    font-size: 1.4rem;
  }

  .setup-opponent-title {
    font-size: 0.84rem;
  }

  .setup-opponent-sub {
    font-size: 0.66rem;
  }

  .setup-seq-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .setup-seq-card {
    padding: 10px 10px;
    border-radius: 10px;
  }

  .setup-seq-badge {
    font-size: 0.64rem;
  }

  .setup-seq-num {
    font-size: 0.95rem;
  }

  .setup-seq-desc {
    font-size: 0.66rem;
  }

  .setup-chip-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .setup-chip-btn {
    padding: 8px 4px;
    border-radius: 10px;
    gap: 4px;
  }

  .setup-chip-sample {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .setup-chip-name {
    font-size: 0.76rem;
  }

  .setup-stakes-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .setup-stake-pill {
    padding: 6px 4px;
    border-radius: 8px;
  }

  .stake-coin-val {
    font-size: 0.8rem;
  }

  .stake-coin-sub {
    font-size: 0.62rem;
  }

  .setup-pot-preview-box {
    padding: 8px 10px;
    border-radius: 8px;
  }

  .pot-trophy {
    font-size: 1.2rem;
  }

  .pot-amount {
    font-size: 1rem;
  }

  .pot-preview-note {
    font-size: 0.7rem;
  }

  .match-setup-footer {
    margin-top: 10px;
    padding-top: 10px;
  }

  .match-setup-footer .btn {
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .setup-card-check {
    top: 4px;
    right: 4px;
    width: 15px;
    height: 15px;
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .setup-players-grid {
    grid-template-columns: 1fr;
  }

  .match-setup-footer {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 8px;
  }
}

.waiting-slot-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all var(--transition-fast);
}

.waiting-slot-card.occupied {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.waiting-slot-card.empty {
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.4);
}

.waiting-slot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.waiting-slot-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waiting-slot-tag {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-host {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tag-bot {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.tag-player {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tag-empty {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.btn-slot-bot {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-slot-bot:hover {
  background: rgba(59, 130, 246, 0.35);
  color: #ffffff;
}

.btn-slot-remove {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-slot-remove:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

@media (max-width: 480px) {
  .auth-modal-card {
    padding: 16px 14px 14px;
    max-height: min(92vh, 600px);
    width: calc(100vw - 24px);
  }

  .auth-close-btn {
    top: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }

  .auth-modal-title {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   24. PLAYER LEVEL & XP PROGRESSION & BOT DIFFICULTY STYLES
   ========================================================================== */

/* Header Level Badge */
.user-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.profile-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.45));
  border: 1px solid var(--gold-primary);
  color: #fde047;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Bot Difficulty Cards in Setup Modal */
.setup-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.setup-diff-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-diff-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.setup-diff-card.active {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
}

.setup-diff-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.badge-easy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-hard {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.setup-diff-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.setup-diff-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

@media (max-width: 600px) {
  .setup-difficulty-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* In-game Bot Difficulty Pill */
.bot-diff-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  vertical-align: middle;
}

.bot-diff-pill.easy {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.bot-diff-pill.medium {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.bot-diff-pill.hard {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Game Over XP Section */
.game-over-xp-section {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  text-align: left;
}

.xp-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.xp-star-icon {
  font-size: 1.2rem;
  animation: starPulse 2s infinite ease-in-out;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(10deg); }
}

.xp-bar-container {
  width: 100%;
}

.xp-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #eab308, #fef08a);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 0.75rem;
}

.xp-lvl-tag {
  font-weight: 800;
  color: #f8fafc;
}

.xp-progress-tag {
  color: var(--gold-primary);
  font-weight: 700;
}

/* Level Up Celebration Banner */
.level-up-celebration-pill {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(245, 158, 11, 0.45));
  border: 1.5px solid #facc15;
  color: #fef08a;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.88rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
  animation: levelUpPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes levelUpPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}



