/* ============================================================================
   1. GLOBAL SYSTEM & VARIABLES
   ============================================================================ */
:root {
  --bg-color: #080811;
  --panel-bg: rgba(18, 18, 35, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;

  --red: #ff3b6c;
  --blue: #00b0ff;
  --green: #00e676;
  --yellow: #ffd600;
  --pink: #ff007f;

  --red-glow: rgba(255, 59, 108, 0.5);
  --blue-glow: rgba(0, 176, 255, 0.5);
  --green-glow: rgba(0, 230, 118, 0.5);
  --yellow-glow: rgba(255, 214, 0, 0.5);
  --pink-glow: rgba(255, 0, 127, 0.5);

  --font-family: 'Outfit', sans-serif;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

/* ============================================================================
   2. DECORATIVE BACKGROUND SYSTEM
   ============================================================================ */
.stars-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(1px 1px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 50px 100px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 80px 200px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1.5px 1.5px at 150px 50px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(2px 2px at 220px 180px, #fff, rgba(0, 0, 0, 0));
  background-size: 300px 300px;
  opacity: 0.15;
  z-index: 1;
}

.glow-orb {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  /* PERFORMANCE: Reduced blur from 120px to 60px — halves GPU compositing cost on mobile */
  filter: blur(60px);
  opacity: 0.10;
  pointer-events: none;
  z-index: 2;
  /* PERFORMANCE: Slowed from 20s to 60s and removed transform scale to reduce repaints */
  animation: orb-drift 60s infinite alternate ease-in-out;
}

.red-orb {
  background-color: var(--red);
  top: -100px;
  left: -100px;
}

.blue-orb {
  background-color: var(--blue);
  bottom: -150px;
  right: -100px;
  animation-delay: -30s;
}

/* Renamed from orb-bounce — no more scale transform, just a gentle drift */
@keyframes orb-drift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(40px, 25px);
  }
}

/* ============================================================================
   3. REUSABLE UTILITIES & BUTTONS
   ============================================================================ */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.glow-button {
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #1f1f2e 0%, #0d0d1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.glow-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.glow-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pink-glow {
  background: linear-gradient(135deg, var(--pink) 0%, #b30059 100%);
  border-color: rgba(255, 0, 127, 0.3);
}

.pink-glow:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--pink-glow);
}

.blue-glow {
  background: linear-gradient(135deg, var(--blue) 0%, #0077b3 100%);
  border-color: rgba(0, 176, 255, 0.3);
}

.blue-glow:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--blue-glow);
}

.green-glow {
  background: linear-gradient(135deg, var(--green) 0%, #00994d 100%);
  border-color: rgba(0, 230, 118, 0.3);
}

.green-glow:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--green-glow);
}

.red-glow {
  background: linear-gradient(135deg, var(--red) 0%, #b30030 100%);
  border-color: rgba(255, 59, 108, 0.3);
}

.red-glow:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--red-glow);
}

.link-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.link-button:hover {
  color: #fff;
}


/* ============================================================================
   4. AUTHENTICATION SCREEN
   ============================================================================ */
#app-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.auth-container {
  display: none;
  width: 100%;
  max-width: 550px;
  padding: 20px;
}

.auth-container.active {
  display: block;
  animation: fade-in 0.5s ease-out;
}

.auth-card {
  padding: 40px 30px;
  text-align: center;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 25px;
}

.logo-title {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--red) 0%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(255, 59, 108, 0.4));
}

.logo-subtitle {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  margin-top: -10px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 35px;
}

.auth-section {
  width: 100%;
  margin-bottom: 25px;
  text-align: left;
}

.auth-section h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group input {
  font-family: var(--font-family);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 14px 20px;
  border-radius: 30px;
  outline: none;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.input-group input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.form-hint {
  font-size: 13px;
  color: var(--green);
  text-align: center;
  margin-bottom: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: bold;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--panel-border);
}

.auth-divider span {
  padding: 0 15px;
}

.google-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 14px 20px;
  border-radius: 30px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.google-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.google-icon {
  width: 18px;
  height: 18px;
}

/* ============================================================================
   5. DASHBOARD / MENU SCREEN
   ============================================================================ */
.dashboard-container {
  display: none;
  width: 100%;
  max-width: 1200px;
  padding: 0 30px 30px 30px;
  flex-direction: column;
  gap: 30px;
  animation: fade-in 0.4s ease-out;
}

.dashboard-container.active {
  display: flex;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  position: relative;
  margin-top: 25px;
  z-index: 100;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(0, 0, 0, 0.2);
}

.user-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.menu-card {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.menu-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.menu-card.pink-accent::after {
  background-color: var(--pink);
}

.menu-card.blue-accent::after {
  background-color: var(--blue);
}

.menu-card h2 {
  font-size: 26px;
  font-weight: 900;
}

.menu-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

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

.play-friends-modes {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.mode-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-panel:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.mode-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.mode-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 5px 0;
}

.mode-separator::before,
.mode-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.mode-separator span {
  padding: 0 15px;
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.join-group {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.join-group input {
  font-family: var(--font-family);
  font-weight: 800;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  color: #fff;
  border-radius: 30px;
  padding: 10px 20px;
  outline: none;
  font-size: 16px;
  flex: 1;
  min-width: 0;
  text-align: center;
  letter-spacing: 1.5px;
  box-sizing: border-box;
  height: 46px;
}

.join-group button {
  flex-shrink: 0;
}

.join-group input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   6. MATCHMAKING SCREEN
   ============================================================================ */
.matchmaking-container {
  display: none;
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.matchmaking-container.active {
  display: block;
  animation: fade-in 0.4s ease-out;
}

.matchmaking-card {
  padding: 40px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.radar-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 176, 255, 0.2);
  overflow: hidden;
}

.radar-sweep {
  position: absolute;
  width: 50%;
  height: 50%;
  background: linear-gradient(45deg, rgba(0, 176, 255, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
  top: 0;
  left: 50%;
  transform-origin: bottom left;
  animation: radar-spin 2s linear infinite;
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(0, 176, 255, 0.15);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring:nth-child(2) {
  width: 33%;
  height: 33%;
}

.radar-ring:nth-child(3) {
  width: 66%;
  height: 66%;
}

.radar-ring:nth-child(4) {
  width: 100%;
  height: 100%;
}

@keyframes radar-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.timer-display {
  font-size: 40px;
  font-weight: 900;
  color: var(--blue);
  text-shadow: 0 0 15px var(--blue-glow);
}

.matched-players-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
  margin: 10px 0;
}

.matched-player-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.matched-player-slot .slot-avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}

.matched-player-slot span {
  font-size: 12px;
  font-weight: 600;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   7. LOBBY SCREEN (PRIVATE ROOM)
   ============================================================================ */
.lobby-container {
  display: none;
  width: 100%;
  max-width: 100%;
  padding: 20px;
}

.lobby-container.active {
  display: block;
  animation: fade-in 0.4s ease-out;
}

.lobby-card {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.lobby-header h2 {
  font-size: 28px;
  font-weight: 900;
}

.room-code-badge {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 10px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.room-code-badge:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.code-value {
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--pink);
  font-size: 18px;
}

.copy-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.players-list-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
}

.players-list-section h3 {
  font-size: 15px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
  letter-spacing: 1.5px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  min-height: 80px;
}

.lobby-player-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.lobby-player-card .player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.lobby-player-card.host .player-avatar {
  border-color: var(--yellow);
  box-shadow: 0 0 10px var(--yellow-glow);
}

.player-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-details .name {
  font-weight: 800;
  font-size: 15px;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-details .role {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.player-details .role.host-text {
  color: var(--yellow);
}

.lobby-action-buttons {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-make-host {
  background: rgba(128, 216, 255, 0.1);
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-make-host:hover {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 10px var(--blue-glow);
}

.btn-kick {
  background: rgba(255, 59, 108, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-kick:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 10px var(--red-glow);
}

.lobby-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lobby-status-msg {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 14px;
}

/* ============================================================================
   8. GAME ARENA (PLAYING SCREEN)
   ============================================================================ */
.game-container {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 20px;
  position: relative;
  justify-content: space-between;
  animation: fade-in 0.5s ease-out;
}

.game-container.active {
  display: flex;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  height: 60px;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 4px 15px;
}

.stat-badge {
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-text {
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.color-text.red {
  background-color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.color-text.blue {
  background-color: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}

.color-text.green {
  background-color: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.color-text.yellow {
  background-color: var(--yellow);
  color: #000;
  box-shadow: 0 0 10px var(--yellow-glow);
}

.color-text.none {
  background-color: rgba(255, 255, 255, 0.1);
}

.penalty-badge {
  background: rgba(255, 59, 108, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 2px 8px;
  border-radius: 12px;
  animation: heart-beat 1.5s infinite;
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  gap: 4px !important;
}

@keyframes heart-beat {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* circular Tilted felt table */
.game-board {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 30;
  max-width: 100vw;
  overflow: hidden;
}



.game-table {
  width: auto;
  min-width: 560px;
  max-width: 1150px;
  height: auto;
  min-height: 260px;
  border-radius: 20px;
  background: radial-gradient(ellipse, #004d26 0%, #001a0d 100%);
  border: 10px solid #1a0f00;
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.7),
    inset 0 0 50px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(0, 230, 76, 0.15);
  position: relative;
  /* Row layout: [seats-left] [table-center] [seats-right] */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 18px 10px;
  transform: rotateX(0deg);
  transform-style: flat;
}

/* Seats containers flanking the center piles */
.seats-left,
.seats-right {
  display: flex;
  flex-flow: row wrap;
  width: 460px;
  min-width: 460px;
  max-width: 460px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  box-sizing: border-box;
}

.seats-left {
  padding-right: 12px;
}

.seats-right {
  padding-left: 12px;
}

/* Direction indicators around bumper */
/* PERFORMANCE: Continuous spin animations disabled — they force GPU layer promotion */
/* The arrow image now switches instantly on direction change via JS class toggle */
.direction-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 24px;
  border: 3px dashed rgba(255, 255, 255, 0.05);
  pointer-events: none;
  /* animation: none — intentionally no continuous rotation */
}

.direction-ring.clockwise {
  /* No spinning. Arrow image shows direction statically. */
  border-color: rgba(0, 230, 118, 0.20);
  box-shadow: inset 0 0 10px rgba(0, 230, 118, 0.05);
  background-image: url('/assets/images/arrow.webp');
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
  /* Smooth transition when direction flips */
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.direction-ring.counter-clockwise {
  /* No spinning. Reverse arrow shows direction statically. */
  border-color: rgba(255, 59, 108, 0.20);
  box-shadow: inset 0 0 10px rgba(255, 59, 108, 0.05);
  background-image: url('/assets/images/arrowreverse.webp');
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
  /* Smooth transition when direction flips */
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Removed: @keyframes spin-clockwise and spin-counter — no longer needed */


.table-center {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  position: relative;
  z-index: 1;
}

/* Draw & Discard Stack styling */
.pile-container {
  position: relative;
  width: 90px;
  height: 135px;
}

.draw-pile {
  cursor: pointer;
}

.deck-shadow-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #331a00;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.deck-shadow-card:nth-child(1) {
  transform: translate(-3px, 3px);
}

.deck-shadow-card:nth-child(2) {
  transform: translate(-1.5px, 1.5px);
}

.pile-count {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--panel-border);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
}

/* Discard Active color glowing border */
.discard-pile {
  border-radius: 8px;
  transition: box-shadow 0.3s ease;
}

.discard-pile.red-glow {
  box-shadow: 0 0 25px var(--red);
}

.discard-pile.blue-glow {
  box-shadow: 0 0 25px var(--blue);
}

.discard-pile.green-glow {
  box-shadow: 0 0 25px var(--green);
}

.discard-pile.yellow-glow {
  box-shadow: 0 0 25px var(--yellow);
}

/* Player seat ID cards in the row layout */
.player-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 40;
  position: relative;
  transition: transform 0.2s ease;
}

.player-seat-card {
  background: rgba(8, 8, 20, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 140px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Highlight current active turn player seat */
.player-seat.active-turn .player-seat-card {
  border-color: var(--green);
  box-shadow:
    0 0 18px var(--green-glow),
    inset 0 0 8px rgba(0, 230, 118, 0.2);
}

.player-seat.active-turn .seat-avatar {
  border-color: var(--green);
}

.seat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #222;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.seat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.seat-name {
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--text-primary);
  display: block;
}

.seat-cards-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

.mini-card-icon {
  width: 10px;
  height: 14px;
  background-color: var(--pink);
  border-radius: 2px;
  display: inline-block;
  border: 1px solid #fff;
}

/* Seat status tags */
.seat-status-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.seat-status-badge.eliminated {
  background-color: var(--red);
  color: #fff;
  box-shadow: 0 0 8px var(--red-glow);
}

.seat-status-badge.disconnected {
  background-color: var(--yellow);
  color: #000;
  box-shadow: 0 0 8px var(--yellow-glow);
}

.seat-status-badge.won {
  background-color: var(--green);
  color: #fff;
  box-shadow: 0 0 8px var(--green-glow);
}

/* Chat overlay message bubbles */
.chat-message-bubble {
  position: absolute;
  top: -63px;
  background-color: #ffffff;
  color: #000000;
  padding: 11px 20px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  animation: float-up-fade 3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99;
  white-space: nowrap;
}

.chat-message-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

@keyframes float-up-fade {
  0% {
    transform: translateY(10px) scale(0.8);
    opacity: 0;
  }

  10% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  85% {
    transform: translateY(-5px) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-15px) scale(0.9);
    opacity: 0;
  }
}

/* ============================================================================
   9. EMOJI AND PRESET TEXT CHAT BOARD
   ============================================================================ */
.chat-bubble-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.chat-trigger-btn {
  font-family: var(--font-family);
  font-weight: 800;
  background-color: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
}

.chat-trigger-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-overlay-menu {
  position: absolute;
  bottom: 45px;
  right: 0;
  width: 260px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: pop-in 0.2s ease-out;
}

.chat-menu-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
  gap: 15px;
}

.chat-menu-tabs span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.chat-menu-tabs span.active {
  color: #fff;
  border-bottom: 2px solid var(--pink);
  padding-bottom: 6px;
}

.chat-menu-content {
  display: grid;
  gap: 8px;
}

.tab-emojis {
  grid-template-columns: repeat(4, 1fr);
  max-height: 185px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.tab-emojis::-webkit-scrollbar {
  width: 4px;
}

.tab-emojis::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.tab-emojis::-webkit-scrollbar-thumb {
  background: rgba(255, 64, 129, 0.4);
  border-radius: 2px;
}

.tab-emojis::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

.tab-texts {
  grid-template-columns: 1fr;
}

.emoji-btn {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.15);
}

.text-btn {
  font-family: var(--font-family);
  font-weight: 600;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
}

.text-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   10. ACTIVE PLAYER FOOTER & DECK HAND
   ============================================================================ */
.game-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 50;
}

.player-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  position: relative;
  z-index: 40;
}

.control-btn {
  padding: 8px 18px;
  font-size: 12px;
}

.hand-container-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 230px;
  z-index: 55;
}

.spectator-banner {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 59, 108, 0.2);
  border: 1px solid var(--red);
  color: var(--red);
  font-weight: 900;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 20px var(--red-glow);
  z-index: 60;
  backdrop-filter: blur(8px);
}

.hand-container {
  display: flex;
  justify-content: safe center;
  align-items: flex-end;
  height: 230px;
  width: 100%;
  max-width: 92vw;
  padding: 50px 40px 30px 40px;
  margin-bottom: -15px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 64, 129, 0.4) rgba(255, 255, 255, 0.05);
}

.hand-container::-webkit-scrollbar {
  height: 6px;
}

.hand-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.hand-container::-webkit-scrollbar-thumb {
  background: rgba(255, 64, 129, 0.4);
  border-radius: 3px;
}

.hand-container::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

/* Overlapping fans cards */
.hand-container .cardversy-card {
  margin: 0 -18px;
  /* Symmetric margins for perfect layout centering */
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s, z-index 0s;
}

/* Hover tilt effect */
.hand-container .cardversy-card:hover {
  transform: translateY(-45px) scale(1.15) rotate(0deg) !important;
  /* Force cancel fans rotations */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
  z-index: 100 !important;
}

/* ============================================================================
   11. cardversy CARD LAYOUT SYSTEM (WITH FALLBACK CSS CARDS)
   ============================================================================ */
.cardversy-card {
  width: 95px;
  height: 140px;
  border-radius: 8px;
  background-color: #111;
  box-shadow: var(--card-shadow);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Highlight playable cards */
.cardversy-card.playable {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  background: transparent;
}

/* Draw Stack Label Styling */
.draw-stack-label {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card turn-based accessibility states */
/* 1. When it is not my turn, dim and disable interactions */
.hand-container.not-my-turn .cardversy-card {
  filter: brightness(0.4) grayscale(0.2);
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none !important;
  box-shadow: none !important;
}

/* 2. When it is my turn, dim non-playable cards to make playable cards pop out! */
.hand-container.my-turn .cardversy-card:not(.playable) {
  filter: brightness(0.55);
  opacity: 0.85;
  cursor: default;
}

/* 3. When it is my turn, highlight playable cards with neon green outline */
.hand-container.my-turn .cardversy-card.playable {
  filter: brightness(1.1);
  opacity: 1;
  border-color: var(--green);
  cursor: pointer;
}

/* CSS Fallback Layout styling */
.card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  position: relative;
  background: #121212;
}

.cardversy-card.red .card-fallback {
  background: linear-gradient(135deg, #ff1a53 0%, #990026 100%);
}

.cardversy-card.blue .card-fallback {
  background: linear-gradient(135deg, #0099ff 0%, #004d80 100%);
}

.cardversy-card.green .card-fallback {
  background: linear-gradient(135deg, #00cc66 0%, #006633 100%);
}

.cardversy-card.yellow .card-fallback {
  background: linear-gradient(135deg, #ffcc00 0%, #997a00 100%);
}

.cardversy-card.wild .card-fallback {
  background: radial-gradient(circle, #2d2d3f 0%, #151520 100%);
}

/* Neon active border glows */
.cardversy-card.red {
  border-color: var(--red);
}

.cardversy-card.blue {
  border-color: var(--blue);
}

.cardversy-card.green {
  border-color: var(--green);
}

.cardversy-card.yellow {
  border-color: var(--yellow);
}

.cardversy-card.wild {
  border-color: var(--pink);
}

.card-index {
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.card-index.top-left {
  top: 5px;
  left: 5px;
}

.card-index.bottom-right {
  bottom: 5px;
  right: 5px;
  transform: rotate(180deg);
}

.center-oval {
  width: 80%;
  height: 55%;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotate(-15deg);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.center-value {
  font-size: 32px;
  font-weight: 900;
  color: #111;
  transform: rotate(15deg);
  /* Counter rotate text */
  letter-spacing: -1px;
}

/* Special icons for Wild centers */
.cardversy-card.wild .center-oval {
  background: conic-gradient(var(--red) 0% 25%, var(--blue) 25% 50%, var(--green) 50% 75%, var(--yellow) 75% 100%);
  border: 2px solid #fff;
}

.cardversy-card.wild .center-value {
  color: #fff;
  font-size: 24px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Card Back Design */
.card-back {
  border-color: #fff;
  background-color: #0d0d1a;
  cursor: default;
}

.card-back-inner {
  width: 88%;
  height: 92%;
  border: 2px solid var(--pink);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, #2d1030 0%, #0d040f 100%);
  position: relative;
  box-shadow: inset 0 0 15px rgba(255, 0, 127, 0.2);
}

.card-back-logo {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 10px var(--pink),
    2px 2px 0 rgba(0, 0, 0, 0.5);
  transform: skewX(-10deg) rotate(-15deg);
  letter-spacing: -1px;
}

.card-back-sublogo {
  font-size: 10px;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 5px var(--yellow-glow);
  letter-spacing: 2px;
  text-align: center;
  margin-top: -5px;
  transform: rotate(-15deg) skewX(-10deg);
}

/* ============================================================================
   12. POPUPS, OVERLAYS & MODALS
   ============================================================================ */
.choice-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* changed from center to allow overflow-y scroll */
  overflow-y: auto;
  /* allow scrolling when content is tall */
  padding: 20px 10px;
  /* top and bottom spacing on mobile */
  box-sizing: border-box;
  z-index: 10000;
  /* higher z-index to ensure it sits on top of all components */
  animation: fade-in 0.25s ease-out;
}

.choice-modal-overlay.hidden {
  display: none;
}

.choice-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 30px;
  text-align: center;
  margin: auto;
  /* flex-item centering vertically if fits, scrolling otherwise */
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.choice-card h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
}

.choice-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 25px;
}

/* Wild Color Wheel popup options */
.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.color-sector-btn {
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  border: none;
  padding: 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.color-sector-btn:hover {
  transform: scale(1.05);
}

.color-sector-btn.red {
  background-color: var(--red);
  box-shadow: 0 0 15px var(--red-glow);
}

.color-sector-btn.blue {
  background-color: var(--blue);
  box-shadow: 0 0 15px var(--blue-glow);
}

.color-sector-btn.green {
  background-color: var(--green);
  box-shadow: 0 0 15px var(--green-glow);
}

.color-sector-btn.yellow {
  background-color: var(--yellow);
  color: #000;
  box-shadow: 0 0 15px var(--yellow-glow);
}

/* 7s Hand Swap Opponents List */
.swap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}

.btn-swap-target {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 20px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.btn-swap-target:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-swap-target img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}

.btn-swap-target span {
  font-weight: 800;
  font-size: 15px;
}

/* Turn announcement banner popup */
.turn-overlay-popup {
  position: fixed;
  top: 25%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
  animation: slide-down-fade 0.5s ease-out;
}

.turn-overlay-popup.hidden {
  display: none;
}

.turn-popup-content {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0) 0%, rgba(0, 230, 118, 0.75) 30%, rgba(0, 230, 118, 0.75) 70%, rgba(0, 230, 118, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 100px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
}

.turn-popup-content h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Elimination Overlay */
.elimination-overlay-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 0, 5, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 600;
  animation: fade-in 0.3s ease-out;
}

.elimination-overlay-popup.hidden {
  display: none;
}

.elimination-card {
  text-align: center;
  animation: heart-beat 0.5s 3 ease-in-out;
}

.elim-skull {
  font-size: 72px;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 15px var(--red));
}

.elimination-card h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
}

/* ============================================================================
   13. GAME OVER / LEADERBOARD SCREEN
   ============================================================================ */
.gameover-card {
  width: 100%;
  max-width: 500px;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.winner-announcement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.crown-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 10px var(--yellow));
}

.winner-announcement h2 {
  font-size: 32px;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 15px var(--yellow-glow);
}

.winner-announcement p {
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.rankings-table-section {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 15px;
}

.rankings-table-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-bottom: 15px;
  text-align: left;
}

.rankings-header {
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
  text-align: left;
}

.rankings-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.ranking-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  text-align: left;
  align-items: center;
  font-size: 14px;
}

.ranking-row:last-child {
  border-bottom: none;
}

.ranking-row .rank-num {
  font-weight: 900;
  font-size: 16px;
}

.ranking-row:nth-child(1) .rank-num {
  color: var(--yellow);
}

.ranking-row:nth-child(2) .rank-num {
  color: #d1d1e0;
}

.ranking-row:nth-child(3) .rank-num {
  color: #cd7f32;
}

.ranking-row .rank-player {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.ranking-row .rank-player img {
  width: 25px;
  height: 25px;
  border-radius: 50%;
}

.ranking-row .rank-status {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.ranking-row:nth-child(1) .rank-status {
  color: var(--yellow);
}

/* ============================================================================
   14. SYSTEM ANIMATIONS
   ============================================================================ */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slide-down-fade {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Hide helper utilities */
.hidden {
  display: none !important;
}

/* Custom scrollbar globally for cleanliness and premium theme style */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 64, 129, 0.4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

/* Connection Status Indicator styling */
.connection-status-banner {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
  display: block;
}

.connection-status-banner.connecting {
  background-color: rgba(255, 214, 0, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(255, 214, 0, 0.3);
}

.connection-status-banner.connected {
  background-color: rgba(0, 230, 118, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.connection-status-banner.failed {
  background-color: rgba(255, 59, 108, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 59, 108, 0.3);
  font-size: 12px;
  line-height: 1.4;
}

/* Color Badge & Turn display layout */
.color-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.turn-row {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.turn-row span {
  color: #fff;
  font-weight: 900;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Mobile responsive media queries */
@media (max-width: 768px) {

  /* Dashboard layout */
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dashboard-container {
    padding: 0 15px 15px 15px;
    gap: 20px;
    max-width: 100%;
  }

  .menu-card {
    padding: 25px 20px;
  }

  .user-avatar {
    width: 38px;
    height: 38px;
  }

  .user-name {
    font-size: 16px;
  }

  /* Private room lobby */
  .lobby-card {
    padding: 20px;
  }

  .lobby-header h2 {
    font-size: 22px;
  }

  .room-code-badge {
    padding: 8px 16px;
    font-size: 14px;
  }

  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
  }

  .lobby-player-card {
    padding: 10px;
    gap: 10px;
  }

  .lobby-player-card .player-avatar {
    width: 35px;
    height: 35px;
  }

  .player-details .name {
    font-size: 13px;
    max-width: 160px;
  }
}

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

/* Sizing/scaling overrides based on viewport width to prevent horizontal overflow */
@media (max-width: 1200px) and (min-width: 681px) {
  .game-table {
    transform: scale(0.85);
  }
}

@media (max-width: 1000px) and (min-width: 681px) {
  .game-table {
    transform: scale(0.72);
  }
}

@media (max-width: 850px) and (min-width: 681px) {
  .game-table {
    transform: scale(0.62);
  }
}

@media (max-width: 680px) {

  /* Scale down all cards */
  .cardversy-card {
    width: 68px;
    height: 102px;
    border-width: 3px;
  }

  .center-oval {
    width: 78%;
    height: 52%;
  }

  .center-value {
    font-size: 22px;
  }

  .card-index {
    font-size: 11px;
  }

  /* Scale down the piles */
  .pile-container {
    width: 68px;
    height: 102px;
  }

  .pile-count {
    bottom: -22px;
    font-size: 10px;
    padding: 1px 8px;
  }

  /* Scale down the board and table */
  .game-board {
    max-width: 100%;
    min-height: 280px;
    overflow: hidden;
  }

  .game-table {
    transform: scale(0.75);
  }

  /* Adjust hand container dimensions */
  .hand-container {
    height: 170px;
    padding: 40px 15px 20px 15px;
    margin-bottom: 0;
  }

  .hand-container .cardversy-card {
    margin: 0 -14px;
  }

  .card-index {
    font-size: 10px;
  }

  .center-value {
    font-size: 22px;
  }

  .cardversy-card.wild .center-value {
    font-size: 18px;
  }

  .hand-container .cardversy-card:hover {
    transform: translateY(-30px) scale(1.15) rotate(0deg) !important;
  }

  .hand-container .cardversy-card.selected {
    transform: translateY(-40px) scale(1.15) rotate(0deg) !important;
    box-shadow: 0 0 20px #ffffff, 0 15px 30px rgba(0, 0, 0, 0.6);
    z-index: 100 !important;
    outline: 2px solid #ffffff;
    outline-offset: -2px;
  }

  .hand-container-wrapper {
    min-height: 170px;
  }

  /* Adjust player controls and header */
  .control-btn {
    padding: 6px 14px;
    font-size: 11px;
  }

  .player-controls {
    gap: 10px;
  }

  .game-stats {
    padding: 6px 12px;
    gap: 10px;
  }

  .stat-badge {
    font-size: 12px;
  }
}

@media (max-width: 480px) {

  /* Extra scaling for small mobile screens */
  .game-board {
    min-height: 230px;
  }

  .game-table {
    transform: scale(0.55);
  }

  .cardversy-card {
    width: 56px;
    height: 84px;
    border-width: 2px;
  }

  .center-value {
    font-size: 16px;
  }

  .pile-container {
    width: 56px;
    height: 84px;
  }

  .hand-container {
    height: 135px;
    padding: 30px 10px 15px 10px;
    margin-bottom: 5px;
  }

  .hand-container .cardversy-card {
    margin: 0 -11px;
  }

  .card-index {
    font-size: 8px;
  }

  .center-value {
    font-size: 16px;
  }

  .cardversy-card.wild .center-value {
    font-size: 13px;
  }

  .hand-container .cardversy-card:hover {
    transform: translateY(-20px) scale(1.15) rotate(0deg) !important;
  }

  .hand-container .cardversy-card.selected {
    transform: translateY(-30px) scale(1.15) rotate(0deg) !important;
    box-shadow: 0 0 15px #ffffff, 0 15px 30px rgba(0, 0, 0, 0.6);
    z-index: 100 !important;
    outline: 2px solid #ffffff;
    outline-offset: -2px;
  }

  .hand-container-wrapper {
    min-height: 135px;
  }

  .control-btn {
    padding: 5px 10px;
    font-size: 9px;
  }

  .player-controls {
    gap: 6px;
  }

  .game-stats {
    padding: 4px 8px;
  }

  .stat-badge {
    font-size: 11px;
  }

  .color-text {
    padding: 2px 6px;
  }

  .turn-row {
    font-size: 10px;
  }

  .game-header {
    height: auto;
    min-height: 50px;
  }

  #btn-exit-game {
    padding: 4px 10px;
    font-size: 9px;
  }

  .radar-container {
    width: 100px;
    height: 100px;
  }

  .timer-display {
    font-size: 32px;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 480px) {
  .game-container {
    padding: 20px 10px 5px 10px;
  }

  .game-header {
    height: auto;
    min-height: 40px;
  }

  .game-board {
    min-height: 160px;
  }

  .game-table {
    transform: scale(0.5);
    margin-top: -20px;
    margin-bottom: -20px;
  }

  .hand-container {
    height: 115px;
    padding: 25px 10px 10px 10px;
  }

  .hand-container .cardversy-card {
    width: 48px;
    height: 72px;
    margin: 0 -10px;
  }

  .card-index {
    font-size: 7px;
  }

  .center-value {
    font-size: 12px;
  }

  .cardversy-card.wild .center-value {
    font-size: 10px;
  }

  .hand-container .cardversy-card:hover {
    transform: translateY(-15px) scale(1.15) rotate(0deg) !important;
  }

  .hand-container .cardversy-card.selected {
    transform: translateY(-25px) scale(1.15) rotate(0deg) !important;
    box-shadow: 0 0 15px #ffffff, 0 15px 30px rgba(0, 0, 0, 0.6);
    z-index: 100 !important;
    outline: 2px solid #ffffff;
    outline-offset: -2px;
  }

  .hand-container-wrapper {
    min-height: 115px;
  }

  .player-controls {
    margin-top: -5px;
    margin-bottom: -5px;
    gap: 5px;
  }

  .control-btn {
    padding: 4px 8px;
    font-size: 9px;
  }

  .chat-bubble-panel {
    bottom: 5px;
    right: 10px;
  }
}

/* Header actions button container */
.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Edit Profile Modal styles */
.profile-edit-card {
  width: 90%;
  max-width: 420px;
  padding: 25px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 15px;
  text-align: left;
}

.profile-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-form label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-form input {
  font-family: var(--font-family);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.profile-form input:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

.profile-form input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* Make exit match button smaller on game screen */
.game-header .glow-button {
  padding: 8px 16px;
  font-size: 12px;
}

/* Vertical screen height scaling for laptop/desktop viewports */
@media (min-width: 681px) and (max-height: 750px) {
  .game-table {
    transform: scale(0.85);
    margin-top: -8px;
    margin-bottom: -8px;
  }

  .hand-container-wrapper {
    min-height: 180px;
  }

  .hand-container {
    height: 180px;
    padding: 30px 40px 20px 40px;
  }

  .hand-container .cardversy-card {
    width: 78px;
    height: 115px;
    margin: 0 -15px;
  }

  .card-index {
    font-size: 11px;
  }

  .center-value {
    font-size: 24px;
  }

  .cardversy-card.wild .center-value {
    font-size: 19px;
  }

  .hand-container .cardversy-card:hover {
    transform: translateY(-30px) scale(1.15) rotate(0deg) !important;
  }

  .hand-container .cardversy-card.selected {
    transform: translateY(-35px) scale(1.15) rotate(0deg) !important;
  }
}

@media (min-width: 681px) and (max-height: 640px) {
  .game-table {
    transform: scale(0.72);
    margin-top: -20px;
    margin-bottom: -20px;
  }

  .hand-container-wrapper {
    min-height: 140px;
  }

  .hand-container {
    height: 140px;
    padding: 20px 40px 10px 40px;
  }

  .hand-container .cardversy-card {
    width: 65px;
    height: 96px;
    margin: 0 -12px;
  }

  .card-index {
    font-size: 9px;
  }

  .center-value {
    font-size: 20px;
  }

  .cardversy-card.wild .center-value {
    font-size: 16px;
  }

  .hand-container .cardversy-card:hover {
    transform: translateY(-20px) scale(1.15) rotate(0deg) !important;
  }

  .hand-container .cardversy-card.selected {
    transform: translateY(-25px) scale(1.15) rotate(0deg) !important;
  }
}

/* Custom Toast Notification styles */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  background: rgba(10, 10, 22, 0.95);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), toast-fade-out 0.3s forwards 2.7s;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.toast-message.success {
  border-color: var(--green);
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.15), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast-message.error {
  border-color: var(--red);
  box-shadow: 0 4px 15px rgba(255, 59, 108, 0.15), 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes toast-slide-in {
  0% {
    transform: translate(-50%, -30px) scale(0.9);
    opacity: 0;
  }

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

@keyframes toast-fade-out {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Red blurry flashing border effect for 20+ cards in hand */
#app-container.danger-alert {
  box-shadow: inset 0 0 40px rgba(255, 59, 108, 0.75);
  animation: danger-flash-glow 1.2s infinite alternate ease-in-out;
  border: 2px solid rgba(255, 59, 108, 0.3);
}

@keyframes danger-flash-glow {
  0% {
    box-shadow: inset 0 0 20px rgba(255, 59, 108, 0.4), 0 0 10px rgba(255, 59, 108, 0.2);
    border-color: rgba(255, 59, 108, 0.2);
  }

  100% {
    box-shadow: inset 0 0 60px rgba(255, 59, 108, 0.95), 0 0 20px rgba(255, 59, 108, 0.5);
    border-color: rgba(255, 59, 108, 0.7);
  }
}

/* Centered Your Cards Count text right above player controls */
.player-hand-count-text {
  font-family: var(--font-family);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: -10px;
  /* pull it close to controls */
  text-align: center;
  z-index: 52;
}

/* Enable scrolling comfort inside specific full screen containers on short viewports */
.auth-container,
.dashboard-container,
.lobby-container,
.matchmaking-container {
  overflow-y: auto !important;
  max-height: 100vh;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 64, 129, 0.4) rgba(255, 255, 255, 0.05);
}



@media (max-width: 680px) {
  .player-hand-count-text {
    font-size: 11px;
    margin-bottom: -5px;
  }
}

/* Header actions and fullscreen icon button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn.fullscreen-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

.icon-btn.fullscreen-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn.rules-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 16px;
}

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

/* Rules book card styles */
.rules-card {
  max-width: 600px !important;
  width: 90% !important;
  max-height: 80vh !important;
  display: flex;
  flex-direction: column;
}

.rules-body {
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}


.rules-section h3 {
  color: var(--yellow);
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  font-family: var(--font-family);
  font-weight: 800;
  text-transform: uppercase;
}

.rules-section p {
  font-size: 12px;
  line-height: 1.5;
  color: #c0c0d8;
  margin: 0 0 6px 0;
}

.rules-section ul {
  font-size: 12px;
  line-height: 1.5;
  color: #c0c0d8;
  margin: 0;
  padding-left: 15px;
}

.rules-section ul li {
  margin-bottom: 4px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

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

.rule-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-card-img {
  width: 45px;
  height: 67px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.rule-details {
  flex: 1;
}

.rule-details h4 {
  margin: 0 0 3px 0;
  font-size: 13px;
  color: #fff;
  font-weight: 800;
  font-family: var(--font-family);
}

.rule-details p {
  margin: 0;
  font-size: 11px;
  color: #a0a0c0;
  line-height: 1.4;
}

.rule-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
}

.rule-badge.red {
  background-color: var(--red);
}

.rule-badge.blue {
  background-color: var(--blue);
}

.rule-badge.yellow {
  background-color: var(--yellow);
  color: #000;
}

.rule-badge.green {
  background-color: var(--green);
}

.rule-badge.purple {
  background-color: #8c00ff;
}

.rule-badge.orange {
  background-color: #ff6a00;
}

.rule-badge.wild {
  background: linear-gradient(45deg, var(--red), var(--blue), var(--green), var(--yellow));
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* Dynamic scroll locking rule on body */
body.scroll-locked {
  overflow: hidden !important;
  height: 100vh !important;
}

.cardversy-popup-content {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0) 0%, rgba(0, 230, 118, 0.75) 30%, rgba(0, 230, 118, 0.75) 70%, rgba(0, 230, 118, 0) 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ============================================================================
   15. RESPONSIVE DASHBOARD LAYOUT & FIT PRESERVATION ON MOBILE
   ============================================================================ */
@media (max-width: 768px) {

  /* Stack the menu cards vertically so they have full width */
  .menu-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* dashboard padding and alignment adjustments */
  .dashboard-container {
    padding: 0 15px 15px 15px !important;
    gap: 20px !important;
  }

  .dashboard-header {
    padding: 12px 16px !important;
  }

  /* Reduce excessive card sizing on tablets and smaller screens */
  .menu-card {
    padding: 24px 20px !important;
    gap: 12px !important;
  }

  .menu-card h2 {
    font-size: 20px !important;
  }

  .menu-card p {
    font-size: 13px !important;
    margin-bottom: 5px !important;
  }

  /* Responsive form inputs and buttons formatting */
  .card-actions {
    gap: 12px !important;
    margin-top: 5px !important;
  }

  .join-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .join-group input {
    font-size: 14px !important;
    padding: 10px 15px !important;
    height: 42px !important;
    box-sizing: border-box !important;
  }

  .glow-button {
    font-size: 13px !important;
    padding: 10px 20px !important;
    height: 42px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .join-group button {
    flex-shrink: 0 !important;
    padding: 0 20px !important;
  }

  /* Prevent buttons inside game arena from getting oversized on responsive viewports */
  .game-container .glow-button {
    font-size: 11px !important;
    padding: 6px 12px !important;
    height: 32px !important;
    min-height: auto !important;
    line-height: 1 !important;
  }

  .game-container .voice-btn {
    font-size: 11px !important;
    padding: 6px 10px !important;
    height: 32px !important;
    line-height: 1 !important;
  }

  .game-container .icon-btn.fullscreen-btn,
  .game-container .icon-btn.rules-btn,
  .game-container .notification-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }

  .game-container .icon-btn.fullscreen-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

@media (max-width: 480px) {
  .user-name {
    font-size: 15px !important;
  }

  .user-avatar {
    width: 35px !important;
    height: 35px !important;
  }

  .dashboard-container {
    padding: 0 10px 10px 10px !important;
  }

  .menu-card h2 {
    font-size: 18px !important;
  }

  .menu-card p {
    font-size: 12px !important;
  }

  .google-button {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
}

/* ============================================================================
   MONETIZATION / ADMIN - NEW STYLES
   ============================================================================ */

/* --- Dashboard Header Updates --- */
.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.free-badge {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.pro-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
  }
}

.matches-left-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--green);
  border-radius: 20px;
}

.matches-left-badge.warning {
  background: rgba(255, 214, 0, 0.1);
  border-color: rgba(255, 214, 0, 0.3);
  color: var(--yellow);
}

.matches-left-badge.danger {
  background: rgba(255, 59, 108, 0.1);
  border-color: rgba(255, 59, 108, 0.3);
  color: var(--red);
  animation: pulse-glow-red 1.5s infinite;
}

@keyframes pulse-glow-red {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 10px rgba(255, 59, 108, 0.4);
  }
}

/* --- Hamburger Menu --- */
.hamburger-menu {
  position: relative;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

.hamburger-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(15, 15, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-width: 200px;
  padding: 6px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.15s;
  display: block;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.dropdown-item.upgrade-item {
  color: #a855f7;
  font-weight: 700;
}

.dropdown-item.upgrade-item:hover {
  background: rgba(168, 85, 247, 0.1);
}

.dropdown-item.signout-item {
  color: var(--red);
}

.dropdown-item.signout-item:hover {
  background: rgba(255, 59, 108, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
}

/* --- Usage Modal --- */
.usage-card {
  max-width: 480px;
  width: 90vw;
}

.usage-account-id-section {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.usage-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.account-id-display {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #a855f7;
  margin: 8px 0;
  word-break: break-all;
}

.copy-btn {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #a855f7;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(168, 85, 247, 0.25);
}

.copy-btn.copied {
  background: rgba(0, 230, 118, 0.15);
  border-color: rgba(0, 230, 118, 0.3);
  color: var(--green);
}

.usage-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}

.usage-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.usage-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.usage-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.usage-stat-value.highlight {
  color: var(--green);
}

/* --- Upgrade Modal --- */
.upgrade-card {
  max-width: 480px;
  width: 90vw;
}

.upgrade-price-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(255, 0, 127, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 40px;
  font-weight: 900;
  color: #a855f7;
}

.price-period {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.upgrade-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.benefit-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
}

.upgrade-steps h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 700;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #a855f7;
  margin-top: 2px;
}

.upi-id {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  color: var(--green);
  display: inline-block;
  margin-top: 4px;
}

.whatsapp-link {
  color: #25D366;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.whatsapp-link:hover {
  text-decoration: underline;
}

.upgrade-account-id {
  margin: 4px 0 8px;
  font-size: 18px;
}

/* --- Upgrade Prompt Modal --- */
.upgrade-prompt-card {
  max-width: 380px;
  text-align: center;
}

.upgrade-prompt-icon {
  font-size: 52px;
  margin-bottom: 12px;
}

/* --- Help Modal --- */
.help-card {
  max-width: 520px;
  width: 90vw;
}

.help-body {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.help-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.help-item:last-child {
  border-bottom: none;
}

.help-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.help-a {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Contact Modal --- */
.contact-card {
  max-width: 420px;
  width: 90vw;
}

.contact-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid;
}

.contact-option.whatsapp-option {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.2);
}

.contact-option.whatsapp-option:hover {
  background: rgba(37, 211, 102, 0.14);
}

.contact-option.email-option {
  background: rgba(0, 176, 255, 0.08);
  border-color: rgba(0, 176, 255, 0.2);
}

.contact-option.email-option:hover {
  background: rgba(0, 176, 255, 0.14);
}

.contact-icon {
  font-size: 28px;
}

.contact-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-detail {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================================
   LANDING / WELCOME SCREEN STYLES
   ============================================================================ */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  align-self: flex-start;
}

.landing-card {
  width: 100%;
  max-width: 1200px;
  padding: 40px 30px;
  text-align: center;
  margin-top: 40px;
  box-sizing: border-box;
  margin-bottom: 40px;
}

.landing-card .logo-area {
  margin-bottom: 25px;
}

.landing-logo-title {
  font-size: 48px;
  font-weight: 900;
  color: #ff3b30;
  text-shadow: 0 0 20px rgba(255, 59, 48, 0.6);
  letter-spacing: 2px;
}

.landing-logo-subtitle {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: block;
  letter-spacing: 4px;
}

.landing-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 35px auto;
  line-height: 1.6;
}

.landing-actions {
  margin-bottom: 45px;
}

.landing-cta-btn {
  font-size: 18px !important;
  padding: 14px 40px !important;
  border-radius: 8px !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ff007f 0%, #ff5252 100%) !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  font-weight: 900 !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  position: relative;
  overflow: hidden;
}

.landing-cta-btn:hover {
  background: linear-gradient(135deg, #ff5252 0%, #ff007f 100%) !important;
  border-color: #fff !important;
  transform: translateY(-2px) scale(1.05);
  box-shadow: none !important;
  text-shadow: none !important;
}

.landing-section {
  width: 100%;
  max-width: 1200px;
  margin: 60px auto 0 auto;
  text-align: center;
  box-sizing: border-box;
}

.section-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ff007f 0%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Special rules card grid */
.rules-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 280px));
  justify-content: center;
  gap: 20px;
  text-align: left;
}

.showcase-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.showcase-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 0, 127, 0.3);
  background: rgba(255, 0, 127, 0.02);
  box-shadow: 0 8px 24px rgba(255, 0, 127, 0.1);
}

.showcase-card-img {
  width: 65px;
  height: 98px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  object-fit: contain;
  background: #000;
  flex-shrink: 0;
}

.showcase-card-details h4 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px 0;
}

.showcase-card-details p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: left;
}

.benefit-card {
  padding: 25px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.benefit-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 191, 255, 0.3);
  background: rgba(0, 191, 255, 0.02);
  box-shadow: 0 8px 24px rgba(0, 191, 255, 0.1);
}

.benefit-icon {
  font-size: 32px;
  margin-bottom: 15px;
}

.benefit-card h4 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px 0;
}

.benefit-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Free/Pro Pricing */
.pricing-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  text-align: center;
}

.pricing-card {
  padding: 40px 30px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.pricing-card.free-tier:hover {
  border-color: rgba(0, 191, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 191, 255, 0.08);
}

.pricing-card.pro-tier {
  border-color: rgba(255, 0, 127, 0.2);
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.pricing-card.pro-tier:hover {
  border-color: rgba(255, 0, 127, 0.4);
  box-shadow: 0 12px 30px rgba(255, 0, 127, 0.1);
}

.pro-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #ff007f 0%, #ff5252 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

.pricing-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 15px 0;
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 5px;
}

.pricing-card.free-tier .price {
  background: linear-gradient(135deg, #00bfff 0%, #00ffd5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-card.pro-tier .price {
  background: linear-gradient(135deg, #ff007f 0%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-card .price .period {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.price-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: inline-block;
}

.pricing-features li {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .landing-card {
    padding: 30px 20px;
    margin-top: 0px;
  }

  .landing-title {
    font-size: 24px;
  }

  .landing-subtitle {
    font-size: 14px;
    margin-bottom: 25px;
  }

  .landing-cta-btn {
    font-size: 15px !important;
    padding: 12px 30px !important;
  }

  .section-title {
    font-size: 20px;
  }

  .section-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .rules-card-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .pricing-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pricing-card {
    padding: 30px 20px;
  }
}

/* Phase 2 transparent overrides */
.game-stats.glass-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modal-color-select.choice-modal-overlay {
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Fallback CSS rotation for portrait screens in fullscreen mode */
@media (orientation: portrait) {

  :fullscreen body,
  :-webkit-full-screen body,
  :-moz-full-screen body,
  :-ms-fullscreen body {
    transform: rotate(90deg);
    transform-origin: center;
    width: 100vh !important;
    height: 100vw !important;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -50vw;
    margin-left: -50vh;
    overflow: hidden;
  }
}

/* Flying Card Styles */
.flying-card {
  pointer-events: none !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65) !important;
  will-change: transform, opacity;
  backface-visibility: hidden;
  position: fixed !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease-out !important;
}

/* Rejoin Notification Icon Button & Badge */
.notification-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.notification-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.notification-btn:active {
  transform: scale(0.95);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 0 10px var(--pink-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Notification Dialog Request List & Card */
.notification-request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 12px;
}

.notification-request-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.notification-request-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-request-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  word-break: break-all;
}

.notification-request-actions {
  display: flex;
  gap: 8px;
}

.btn-approve,
.btn-reject {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-approve {
  background-color: var(--green);
  color: #000;
}

.btn-reject {
  background-color: var(--red);
  color: #fff;
}

.btn-approve:hover,
.btn-reject:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-approve:active,
.btn-reject:active {
  transform: translateY(0);
}

/* Multi-plan Usage display item */
.plans-container {
  margin-top: 15px;
  border-top: 1px solid var(--panel-border);
  padding-top: 15px;
  text-align: left;
  width: 100%;
}

.plans-title {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.plan-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.plan-list-item.next-expiring {
  border-color: var(--pink);
  background: rgba(255, 0, 127, 0.03);
}

.plan-item-matches {
  font-weight: 700;
  color: var(--text-primary);
}

.plan-item-expiry {
  font-size: 11px;
  color: var(--text-secondary);
}

.plan-badge-next {
  background: var(--pink);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 6px;
}

@keyframes radar-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Premium voice control panels */
.voice-controls-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.voice-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.voice-btn.on {
  border-color: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
  background: rgba(0, 230, 118, 0.1);
  color: #fff;
}

.voice-btn.off {
  border-color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
  background: rgba(255, 59, 108, 0.1);
  color: #ff3b6c;
}

.voice-btn:hover {
  transform: scale(1.05);
}

/* Lobby Chat Layout and Aesthetics */
.lobby-main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .lobby-main-content {
    grid-template-columns: 1fr;
  }
}

.lobby-chat-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.lobby-chat-section h3 {
  font-size: 15px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 15px;
  letter-spacing: 1.5px;
}

.lobby-chat-history {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: 280px;
}

.lobby-chat-msg {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 90%;
  align-self: flex-start;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.lobby-chat-msg.self {
  background: rgba(255, 59, 108, 0.1);
  border-color: rgba(255, 59, 108, 0.2);
  align-self: flex-end;
}

.lobby-chat-msg .msg-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.lobby-chat-msg .msg-sender {
  color: var(--blue);
}

.lobby-chat-msg.self .msg-sender {
  color: #8ce3ff;
}

.lobby-chat-msg .msg-time {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 400;
}

.lobby-chat-msg .msg-content {
  color: #fff;
}

.lobby-chat-input-group {
  display: flex;
  gap: 10px;
}

.lobby-chat-input-group input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.lobby-chat-input-group input:focus {
  border-color: var(--blue);
}

.lobby-chat-input-group button {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: none;
  background-color: #009fff;
  cursor: pointer;
}

/* Responsive Voice Control Panels for Mobile/Landscape to prevent header cutoff */
@media (max-width: 768px) {
  .voice-controls-panel {
    padding: 4px 8px;
    gap: 6px;
    border-radius: 20px;
  }

  .voice-btn {
    padding: 4px 10px;
    font-size: 11px;
    gap: 4px;
    border-radius: 15px;
  }

  .header-actions {
    gap: 8px;
  }
}

@media (max-height: 480px) {
  .voice-controls-panel {
    padding: 2px 6px;
    gap: 4px;
    border-radius: 15px;
    margin-right: 5px !important;
  }

  .voice-btn {
    padding: 3px 8px;
    font-size: 10px;
    gap: 3px;
    border-radius: 12px;
  }

  .header-actions {
    gap: 6px;
  }
}

/* Compact button sizes for lobby action and edit profile modals */
#btn-save-profile,
#btn-close-profile,
#btn-delete-account,
#btn-start-game,
#btn-exit-lobby {
  padding: 8px 20px !important;
  font-size: 13px !important;
}

/* --- Speaking Highlights & Peer Mute Overlays --- */
.avatar-container {
  position: relative;
  display: inline-block;
}

.speaking-indicator {
  position: absolute;
  top: -5px;
  left: -5px;
  background: #34c759;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px #34c759;
  animation: speaking-pulse 1.5s infinite;
  z-index: 10;
}

.peer-mute-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition: all 0.2s ease;
}

.peer-mute-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.peer-mute-btn.muted {
  background: var(--red) !important;
  box-shadow: 0 0 8px var(--red);
}

@keyframes speaking-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}


/* In-game Chat overrides and additions */
.quick-chat-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 100;
}

.quick-chat-menu {
  position: absolute;
  bottom: 45px;
  left: 0;
  width: 240px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: pop-in 0.2s ease-out;
}

.message-chat-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.message-chat-menu {
  position: absolute;
  bottom: 45px;
  right: 0;
  width: 300px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: pop-in 0.2s ease-out;
}

.chat-trigger-btn {
  position: relative;
}

.chat-trigger-btn.has-new-messages::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: #34c759;
  border-radius: 50%;
  box-shadow: 0 0 6px #34c759;
  border: 1px solid #1a1a2e;
}

.tab-history {
  display: flex;
  flex-direction: column;
  height: 250px;
  gap: 8px;
}

.game-chat-history {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  max-height: 190px;
}

.game-chat-history::-webkit-scrollbar {
  width: 4px;
}

.game-chat-history::-webkit-scrollbar-track {
  background: transparent;
}

.game-chat-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Responsiveness media queries for chat panels */
@media (max-width: 768px) {
  .quick-chat-panel {
    bottom: 5px;
    left: 10px;
  }

  .message-chat-panel {
    bottom: 5px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .quick-chat-menu {
    width: 200px;
    bottom: 40px;
    padding: 8px;
  }

  .message-chat-menu {
    width: 250px;
    bottom: 40px;
    padding: 8px;
  }

  .game-chat-history {
    max-height: 140px;
  }
}

@media (max-height: 480px) {

  .quick-chat-menu,
  .message-chat-menu {
    bottom: 35px;
    max-height: 70vh;
  }

  .game-chat-history {
    max-height: 110px;
  }
}

/* Sequence number badge over player profile card */
.seat-seq-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--pink);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--panel-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
  animation: pop-in 0.2s ease-out;
}

.seat-seq-badge.active-turn-seq {
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.6);
}

.seat-seq-badge-inline {
  background: var(--pink);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.seat-seq-badge-inline.active-turn-seq {
  box-shadow: 0 0 10px #34c759, 0 0 4px rgba(255, 255, 255, 0.8);
  border-color: #34c759;
}

.seat-seq-badge-inline.color-p1 {
  background-color: #ff3b30;
}

.seat-seq-badge-inline.color-p2 {
  background-color: #007aff;
}

.seat-seq-badge-inline.color-p3 {
  background-color: #34c759;
}

.seat-seq-badge-inline.color-p4 {
  background-color: #ff9500;
}

.seat-seq-badge-inline.color-p5 {
  background-color: #af52de;
}

.seat-seq-badge-inline.color-p6 {
  background-color: #5856d6;
}

.seat-seq-badge-inline.color-p7 {
  background-color: #ff2d55;
}

.seat-seq-badge-inline.color-p8 {
  background-color: #30b0c7;
}

.seat-seq-badge-inline.color-p9 {
  background-color: #ffcc00;
  color: #000;
}

.seat-seq-badge-inline.color-p10 {
  background-color: #e91e63;
}

.seat-seq-badge-inline.color-p11 {
  background-color: #009688;
}

.seat-seq-badge-inline.color-p12 {
  background-color: #9c27b0;
}

.seat-row-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.seat-voice-controls-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  position: relative;
}

.seat-voice-controls-inline .speaking-indicator {
  position: static;
  width: 18px;
  height: 18px;
  font-size: 10px;
  box-shadow: none;
  border-radius: 50%;
  background: #34c759;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.seat-voice-controls-inline .peer-mute-btn {
  position: static;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  z-index: 1;
  transition: all 0.2s ease;
}

/* Ready/Not Ready badges inside lobby cards */
.ready-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: 6px;
  text-transform: uppercase;
}

.ready-badge.ready {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  border: 1px solid #34c759;
}

.ready-badge.not-ready {
  background: rgba(255, 59, 108, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}

/* Hide opponent profiles who are currently offline/left room */
.player-seat.not-present {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Ensure hidden utility always overrides responsive button displays */
.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .lobby-status-msg {
    display: none !important;
  }
}

/* Portrait orientation mobile overlay middle dialog styling */
@media (orientation: portrait) and (max-width: 900px) {
  #modal-orientation-prompt:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(8, 8, 17, 0.92) !important;
    padding: 20px !important;
  }

  #modal-orientation-prompt:not(.hidden) .orientation-prompt-card {
    width: 90vw !important;
    max-width: 420px !important;
    border-radius: 24px !important;
    border: 2px solid var(--panel-border) !important;
    background: linear-gradient(135deg, rgba(18, 18, 35, 0.96), rgba(8, 8, 17, 0.98)) !important;
    padding: 35px 25px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85) !important;
    animation: scale-up-modal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-sizing: border-box !important;
    margin: auto !important;
  }
}

@keyframes scale-up-modal {
  from {
    transform: scale(0.85);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Played Card History Button (Left Center floating) */
.btn-played-history {
  position: absolute;
  left: 20px;
  bottom: 22%;
  top: auto;
  transform: none;
  z-index: 100;
  background: rgba(18, 18, 35, 0.85);
  border: 1px solid var(--panel-border);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-played-history:hover {
  transform: scale(1.1);
  background-color: rgba(255, 0, 127, 0.1);
  border-color: var(--pink);
  box-shadow: 0 0 15px var(--pink-glow);
}

/* Scrollable Played Card History Grid Inside Modal */
.played-history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-content: flex-start;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 64, 129, 0.4) rgba(255, 255, 255, 0.05);
}

.played-history-grid::-webkit-scrollbar {
  width: 6px;
}

.played-history-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.played-history-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 64, 129, 0.4);
  border-radius: 3px;
}

.played-history-grid::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}
}

.history-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 80px;
}

/* Specific small sizes for cards inside played history modal */
.history-card-item .cardversy-card {
  width: 70px !important;
  height: 105px !important;
  border-width: 2px !important;
  border-radius: 6px !important;
  cursor: default !important;
  pointer-events: none !important;
}

.history-card-item .cardversy-card .card-image {
  width: 70px !important;
  height: 105px !important;
}

/* Scaling CSS fallbacks for small history cards */
.history-card-item .cardversy-card .card-fallback {
  transform: scale(0.7) !important;
}

.history-card-item .player-name-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 80px;
}

@media (max-width: 768px),
(max-height: 500px) {
  #modal-played-history .choice-card {
    max-width: 100% !important;
    width: 95vw !important;
    max-height: 95vh !important;
    height: 95vh !important;
    padding: 10px !important;
  }

  #modal-played-history h2 {
    font-size: 16px !important;
    margin: 2px 0 4px 0 !important;
  }

  #modal-played-history p {
    font-size: 11px !important;
    margin-bottom: 6px !important;
  }

  #played-history-cards-container {
    gap: 8px !important;
    padding: 4px !important;
    margin-bottom: 8px !important;
  }

  .history-card-item {
    width: 56px !important;
    gap: 4px !important;
  }

  .history-card-item .cardversy-card {
    width: 52px !important;
    height: 78px !important;
    border-width: 1.5px !important;
    border-radius: 4px !important;
  }

  .history-card-item .cardversy-card .card-image {
    width: 52px !important;
    height: 78px !important;
  }

  .history-card-item .cardversy-card .card-fallback {
    transform: scale(0.5) !important;
  }

  .history-card-item .player-name-label {
    font-size: 9px !important;
    width: 56px !important;
  }

  #btn-close-played-history {
    max-width: 100px !important;
    width: 40% !important;
    height: 28px !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
  }
}

/* Victory styling overrides for popup announcement */
.elimination-overlay-popup.winner {
  background: rgba(0, 15, 5, 0.85) !important;
  /* dark green tint */
}

.elimination-overlay-popup.winner .elim-skull {
  filter: drop-shadow(0 0 20px var(--green)) !important;
}

.elimination-overlay-popup.winner .elimination-card h2 {
  color: var(--green) !important;
  text-shadow: 0 0 25px var(--green-glow) !important;
}

/* Spectator banner winner styles (greeny style) */
.spectator-banner.winner {
  background: rgba(0, 230, 118, 0.2) !important;
  border-color: var(--green) !important;
  color: var(--green) !important;
}

/* ============================================================================
   CARDVERSY: GAME VERSION SELECTION MODAL
   ============================================================================ */

.game-version-select-card {
  padding: 28px 24px 24px;
}

/* Grid of 4 game cards (2x2 on wide, 1-col on mobile) */
.game-version-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 540px) {
  .game-version-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual game card in the selection modal */
.game-version-card {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 145px;
}

.game-version-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

/* Active (playable) game cards */
.game-version-card.active-game {
  border-color: rgba(0, 230, 118, 0.25);
  background: rgba(0, 230, 118, 0.05);
}

.game-version-card.active-game:hover {
  border-color: var(--green);
  background: rgba(0, 230, 118, 0.1);
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.18);
}

/* Selected game card highlight */
.game-version-card.selected {
  border-color: var(--green) !important;
  background: rgba(0, 230, 118, 0.15) !important;
  box-shadow: 0 0 22px rgba(0, 230, 118, 0.3) !important;
  transform: translateY(-3px);
}

/* Coming soon — dimmed and locked */
.game-version-card.coming-soon-game {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: all;
  /* allow click to show "coming soon" toast */
}

.game-version-card.coming-soon-game:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

/* Badge (Available / Coming Soon) */
.gvc-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
}

.available-badge {
  background: rgba(0, 230, 118, 0.2);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.coming-soon-badge {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Game card icon (emoji) */
.gvc-icon {
  font-size: 28px;
  margin-top: 6px;
  line-height: 1;
}

/* Game name */
.gvc-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

/* Game description */
.gvc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Short flavour tag */
.gvc-tag {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

/* ============================================================================
   CARDVERSY: LOBBY GAME VERSION SELECTOR PANEL
   ============================================================================ */

.lobby-game-version-section {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lobby-game-version-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.lobby-game-version-display {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* Host: game version dropdown select */
.game-version-select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  flex: 1;
  max-width: 260px;
  transition: border-color 0.2s;
}

.game-version-select:focus {
  border-color: var(--pink);
}

/* Non-host: read-only game version badge */
.game-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 64, 129, 0.08);
  border: 1px solid rgba(255, 64, 129, 0.25);
  color: var(--pink);
  box-shadow: 0 0 10px rgba(255, 64, 129, 0.1);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

/* Custom styled game version dropdown selector */
.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 280px;
  font-family: var(--font-family);
  user-select: none;
}

.custom-dropdown-trigger {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.custom-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(255, 64, 129, 0.25);
}

.custom-dropdown-trigger .trigger-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-dropdown-trigger .trigger-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-trigger .trigger-arrow {
  transform: rotate(180deg);
  color: var(--pink);
}

.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #1a1525;
  /* Match cardversy dark panel bg */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-dropdown.open .custom-dropdown-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-dropdown-option {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.custom-dropdown-option:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.custom-dropdown-option.active {
  background: rgba(255, 64, 129, 0.12);
  border: 1px solid rgba(255, 64, 129, 0.3);
  color: var(--pink);
}

.custom-dropdown-option.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.custom-dropdown-option .opt-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-dropdown-option .opt-text {
  flex: 1;
}

/* Mobile responsive style adjustments */
@media (max-width: 768px) {
  .lobby-game-version-section {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin: 0 4px 16px 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .lobby-game-version-label {
    text-align: center;
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .lobby-game-version-display {
    justify-content: center;
    width: 100%;
  }

  #lobby-game-version-host {
    max-width: 100% !important;
  }

  .custom-dropdown {
    max-width: 100%;
  }

  .game-version-badge {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   DOUBLE SHIFT: DYNAMIC COLOR CLASSES & SELECTION STYLES
   ============================================================================ */

/* Light Side Custom Colors */
.color-text.light_banana_yellow {
  color: #ffd600;
  text-shadow: 0 0 10px rgba(255, 214, 0, 0.4);
}

.color-text.light_bright_orange {
  color: #ff6d00;
  text-shadow: 0 0 10px rgba(255, 109, 0, 0.4);
}

.color-text.light_lavender_rose {
  color: #ff80ab;
  text-shadow: 0 0 10px rgba(255, 128, 171, 0.4);
}

.color-text.light_morning_glory {
  color: #80d8ff;
  text-shadow: 0 0 10px rgba(128, 216, 255, 0.4);
}

.light_banana_yellow-glow {
  box-shadow: 0 0 20px #ffd600;
}

.light_bright_orange-glow {
  box-shadow: 0 0 20px #ff6d00;
}

.light_lavender_rose-glow {
  box-shadow: 0 0 20px #ff80ab;
}

.light_morning_glory-glow {
  box-shadow: 0 0 20px #80d8ff;
}

/* Dark Side Custom Colors */
.color-text.dark_irish_green {
  color: #00c853;
  text-shadow: 0 0 10px rgba(0, 200, 83, 0.4);
}

.color-text.dark_lovely_purple {
  color: #d500f9;
  text-shadow: 0 0 10px rgba(213, 0, 249, 0.4);
}

.color-text.dark_musturd_yellow {
  color: #ffd600;
  text-shadow: 0 0 10px rgba(255, 214, 0, 0.4);
}

.color-text.dark_tabasco {
  color: #dd2c00;
  text-shadow: 0 0 10px rgba(221, 44, 0, 0.4);
}

.dark_irish_green-glow {
  box-shadow: 0 0 20px #00c853;
}

.dark_lovely_purple-glow {
  box-shadow: 0 0 20px #d500f9;
}

.dark_musturd_yellow-glow {
  box-shadow: 0 0 20px #ffd600;
}

.dark_tabasco-glow {
  box-shadow: 0 0 20px #dd2c00;
}

/* Card Playable Glowing Colors */
.cardversy-card.light_banana_yellow.playable {
  box-shadow: 0 0 15px #ffd600 !important;
}

.cardversy-card.light_bright_orange.playable {
  box-shadow: 0 0 15px #ff6d00 !important;
}

.cardversy-card.light_lavender_rose.playable {
  box-shadow: 0 0 15px #ff80ab !important;
}

.cardversy-card.light_morning_glory.playable {
  box-shadow: 0 0 15px #80d8ff !important;
}

.cardversy-card.dark_irish_green.playable {
  box-shadow: 0 0 15px #00c853 !important;
}

.cardversy-card.dark_lovely_purple.playable {
  box-shadow: 0 0 15px #d500f9 !important;
}

.cardversy-card.dark_musturd_yellow.playable {
  box-shadow: 0 0 15px #ffd600 !important;
}

.cardversy-card.dark_tabasco.playable {
  box-shadow: 0 0 15px #dd2c00 !important;
}

/* Dark Side Card Back Purple Filter tint */
.cardversy-card.card-back.dark-back img {
  filter: hue-rotate(110deg) brightness(0.6) contrast(1.3) saturate(1.5) !important;
}

/* Side indicator badge styling in game header */
#game-side-row span {
  font-family: var(--font-family);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px currentColor;
}

/* Double Shift card images fill the container (aspect ratio 355×502 differs from Brutal Shed) */
.cardversy-card.double-shift-card .card-image {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Modal sections dividers and alignment overrides */
.modal-section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15) 20%, rgba(255, 255, 255, 0.15) 80%, transparent);
  margin: 18px 0;
  width: 100%;
  border: none;
}

.upgrade-steps .step {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 15px;
  text-align: left;
}

.upgrade-steps .step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
}

.upgrade-steps .step div {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.upgrade-benefits {
  margin-top: 15px;
  margin-bottom: 10px;
}