* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00f0ff;
  --primary-dark: #00b8c4;
  --accent: #00ff88;
  --accent-dark: #00cc66;
  --gold: #FFD700;
  --gold-dark: #b8960f;
  --bg-dark: #0D0D1A;
  --bg-darker: #08080F;
  --bg-card: rgba(0, 0, 0, 0.8);
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --danger: #FF4757;
  --warning: #FFB800;
  --success: #00ff88;
  --border: rgba(0, 240, 255, 0.3);
  --border-glow: rgba(0, 240, 255, 0.1);
  --card-glow: 0 0 10px rgba(0, 240, 255, 0.1);
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow: hidden;
  min-height: 100vh;
  overscroll-behavior: none;
}

html {
  overscroll-behavior: none;
}

/* ==================== WAGERWARRIORS NAVBAR (matches main site) ==================== */

#ww-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(22, 22, 42, 0.97) 0%, rgba(18, 18, 36, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  max-width: 100%;
}

/* Warm reddish accent line at bottom of navbar */
.nav-accent-line {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #e85d3a 20%, #f97316 50%, #e85d3a 80%, transparent 100%);
  opacity: 0.7;
}

/* --- Left: Logo + Brand --- */
.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-logo-link:hover {
  opacity: 0.85;
}

.nav-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 177, 78, 0.4));
}

.nav-brand-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: white;
  letter-spacing: 1.5px;
}

.nav-beta-badge {
  background: #f97316;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* --- Center: Navigation Links --- */
.nav-center {
  display: flex;
  align-items: center;
  gap: 32px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 6px 2px;
  position: relative;
  transition: color 0.2s;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.95);
}

.nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #f97316;
  border-radius: 1px;
}

/* --- Right: Coins, Deposit, User --- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Coin balance pill */
.nav-coin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

.nav-coin-icon {
  flex-shrink: 0;
}

#header-balance {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 0.3px;
}

/* Deposit button */
.nav-deposit-btn {
  background: #22c55e;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-deposit-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

/* User section */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-user:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.nav-user-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.nav-user-hi {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.nav-user-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.nav-chevron {
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

/* --- Hamburger Menu (mobile only) --- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1px;
  transition: all 0.3s ease;
}

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

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

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

/* --- Mobile Dropdown Menu --- */
.nav-mobile-menu {
  background: rgba(18, 18, 36, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
}

.nav-mobile-menu.hidden {
  display: none;
}

.nav-mobile-link {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s;
}

.nav-mobile-link:last-child {
  border-bottom: none;
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  color: #f97316;
}

/* --- Responsive: Tablet and below --- */
@media (max-width: 900px) {
  .nav-center {
    display: none;
  }

  .nav-hamburger {
    display: flex;
    order: 3;
  }

  .nav-right {
    order: 2;
  }

  .nav-user-info {
    display: none;
  }

  .nav-chevron {
    display: none;
  }

  .navbar-inner {
    padding: 0 16px;
  }
}

@media (max-width: 600px) {
  .nav-brand-name {
    display: none;
  }

  .nav-beta-badge {
    display: none;
  }

  .nav-deposit-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .nav-coin-badge {
    padding: 5px 10px;
    gap: 6px;
  }

  #header-balance {
    font-size: 13px;
  }
}

/* Adjust screens to account for navbar height */
.screen {
  padding-top: 64px;
}

/* Screens */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.screen.hidden {
  display: none;
}

/* Loading Screen */
#loading-screen {
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.loading-content {
  text-align: center;
}

.snake-logo {
  font-size: 80px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.loading-content h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  margin: 20px 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loading-bar {
  width: 300px;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  margin: 30px auto;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
  0% { width: 0%; }
  100% { width: 100%; }
}

#loading-text {
  color: var(--text-secondary);
}

/* Animated Lobby Background Canvas */
#lobby-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#lobby-bg-canvas.hidden {
  display: none;
}

/* Preview snake canvas — right side only on desktop */
#preview-snake-canvas {
  position: fixed;
  top: 66px; /* below navbar + accent line */
  left: 380px; /* right of the sidebar */
  width: calc(100% - 380px);
  height: calc(100% - 66px);
  z-index: 2; /* above lobby bg (0), below UI */
  pointer-events: none;
}

#preview-snake-canvas.hidden {
  display: none;
}

@media (max-width: 1024px) {
  #preview-snake-canvas {
    display: none !important;
  }
}

/* Start Screen — 2-column layout: left sidebar + right background */
#start-screen {
  background: transparent;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-start;
}

/* Login Screen — transparent for animated background */
#login-screen {
  background: transparent;
}

/* Left sidebar panel */
.start-content {
  width: 380px;
  max-width: 380px;
  min-width: 380px;
  height: 100%;
  padding: 20px 16px 30px;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 240, 255, 0.15);

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.2) transparent;
}

.start-content::-webkit-scrollbar {
  width: 4px;
}

.start-content::-webkit-scrollbar-track {
  background: transparent;
}

.start-content::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 4px;
}

.start-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.35);
}

/* Below 1024px: revert to single-column centered layout */
@media (max-width: 1024px) {
  #start-screen {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }

  .start-content {
    width: 100%;
    max-width: 560px;
    min-width: 0;
    height: auto;
    padding: 40px 20px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: none;
    overflow-y: visible;
  }
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.snake-emoji {
  font-size: 2rem;
  animation: wiggle 2s infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Restore larger title on mobile single-column */
@media (max-width: 1024px) {
  .game-title {
    font-size: 2.2rem;
    gap: 15px;
    margin-bottom: 10px;
  }

  .snake-emoji {
    font-size: 2.8rem;
  }

  .tagline {
    font-size: 1.05rem;
    margin-bottom: 25px;
  }
}

/* ==================== GLASS CARD SECTIONS ==================== */

.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--card-glow);
}

@media (max-width: 1024px) {
  .section {
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
  }
}

/* ==================== BUTTONS ==================== */

.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-dark);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg-dark);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--accent-dark));
  color: var(--bg-dark);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-large {
  font-size: 1.2rem;
  padding: 16px 32px;
  width: 100%;
}

.btn-small {
  font-size: 0.9rem;
  padding: 8px 16px;
}

/* Wallet Info */
.wallet-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--accent);
  border-radius: 12px;
}

.wallet-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s infinite;
}

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

#wallet-address {
  font-family: monospace;
  font-size: 0.9rem;
}

#wallet-balance {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent);
}

/* ==================== PLAYER INFO CARD ==================== */

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.player-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

#player-name {
  font-weight: 600;
  color: var(--primary);
}

#coin-balance {
  margin-left: auto;
  font-family: 'Orbitron', sans-serif;
  color: var(--gold);
}

/* ==================== SNAKE COLOR SELECTOR ==================== */

.color-selector-section {
  text-align: center;
}

.color-selector-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.color-options {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.color-option:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.color-option.selected {
  transform: scale(1.2);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5), 0 0 24px rgba(0, 240, 255, 0.2);
}

/* (Snake dot preview removed — color selector only shows circles) */

/* ==================== FACE SHOP SECTION ==================== */

.face-shop-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.face-shop-info {
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin-bottom: 10px;
}

.face-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}

.face-grid::-webkit-scrollbar {
  width: 4px;
}
.face-grid::-webkit-scrollbar-track {
  background: transparent;
}
.face-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}

.face-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.face-tile:hover {
  border-color: rgba(0, 240, 255, 0.5);
  transform: scale(1.05);
  background: rgba(0, 0, 0, 0.65);
}

.face-tile.selected {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4), 0 0 20px rgba(0, 240, 255, 0.15);
  background: rgba(0, 240, 255, 0.08);
}

.face-tile.selected .face-selected-label {
  display: block;
}

.face-tile .face-sprite {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  margin-bottom: 3px;
}

.face-tile .face-price {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  color: var(--gold);
  white-space: nowrap;
}

.face-tile .face-price.free {
  color: #00ff88;
}

.face-tile .face-name {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.1;
  margin-top: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-selected-label {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.45rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Tier badges for faces */
.face-tile[data-tier="3"] {
  border-color: rgba(255, 215, 0, 0.2);
}
.face-tile[data-tier="4"] {
  border-color: rgba(255, 100, 100, 0.25);
}
.face-tile[data-tier="3"]:hover {
  border-color: rgba(255, 215, 0, 0.5);
}
.face-tile[data-tier="4"]:hover {
  border-color: rgba(255, 100, 100, 0.5);
}
.face-tile[data-tier="3"].selected {
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.face-tile[data-tier="4"].selected {
  border-color: #FF6666;
  box-shadow: 0 0 10px rgba(255, 100, 100, 0.3), 0 0 20px rgba(255, 100, 100, 0.1);
}

/* Unaffordable face tiles */
.face-tile.unaffordable {
  opacity: 0.35;
  pointer-events: none;
}

/* ==================== STAKE SECTION ==================== */

.stake-info {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.stake-input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

#stake-amount {
  width: 100%;
  padding: 16px 70px 16px 20px;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--bg-darker);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-align: center;
}

#stake-amount:focus {
  outline: none;
  border-color: var(--primary);
}

.sol-label {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Stake Button Grid */
.stake-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.stake-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px 10px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
  font-family: inherit;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .stake-grid {
    gap: 12px;
    margin: 20px 0;
  }

  .stake-btn {
    padding: 16px 10px 12px;
    border-radius: 12px;
  }
}

.stake-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.stake-btn:hover .card-snake-preview .card-snake-segment {
  animation-play-state: running;
}

.stake-btn.selected {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.stake-btn.selected .stake-amount {
  color: var(--accent);
}

.stake-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 700;
}

.stake-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.stake-btn .stake-amount {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Outfit', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: none;
}

@media (max-width: 1024px) {
  .stake-btn .stake-amount {
    font-size: 1.5rem;
  }
}

.stake-btn .stake-label {
  font-size: 0.7rem;
  font-family: 'Outfit', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  text-transform: lowercase;
}

.stake-btn:hover .stake-amount {
  color: #ffffff;
  text-shadow: none;
}

/* Popular badge */
.stake-btn.popular-tier {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.popular-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1a1a00;
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 0 0 8px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: popularPulse 2s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes popularPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.7); }
}

/* Snake size preview in card */
.card-snake-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 8px 0 4px;
  min-height: 18px;
}

.card-snake-segment {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  animation: cardSnakeWave 1.8s ease-in-out infinite paused;
}

.card-snake-segment:first-child {
  width: 13px;
  height: 13px;
}

@keyframes cardSnakeWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Stagger card snake wave */
.card-snake-segment:nth-child(1) { animation-delay: 0s; }
.card-snake-segment:nth-child(2) { animation-delay: 0.06s; }
.card-snake-segment:nth-child(3) { animation-delay: 0.12s; }
.card-snake-segment:nth-child(4) { animation-delay: 0.18s; }
.card-snake-segment:nth-child(5) { animation-delay: 0.24s; }
.card-snake-segment:nth-child(6) { animation-delay: 0.30s; }
.card-snake-segment:nth-child(7) { animation-delay: 0.36s; }
.card-snake-segment:nth-child(8) { animation-delay: 0.42s; }
.card-snake-segment:nth-child(9) { animation-delay: 0.48s; }
.card-snake-segment:nth-child(10) { animation-delay: 0.54s; }
.card-snake-segment:nth-child(11) { animation-delay: 0.60s; }
.card-snake-segment:nth-child(12) { animation-delay: 0.66s; }
.card-snake-segment:nth-child(13) { animation-delay: 0.72s; }
.card-snake-segment:nth-child(14) { animation-delay: 0.78s; }
.card-snake-segment:nth-child(15) { animation-delay: 0.84s; }
.card-snake-segment:nth-child(16) { animation-delay: 0.90s; }

.stake-size-label {
  font-size: 10px;
  font-family: 'Outfit', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.stake-preview {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 0;
  border: 1px solid rgba(0, 240, 255, 0.1);
}

.preview-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.preview-item .label {
  color: var(--text-secondary);
}

/* ==================== ENTER ARENA BUTTON ==================== */

.enter-arena-section {
  margin-bottom: 14px;
}

.enter-arena-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
  border: none;
  border-radius: 12px;
  font-family: 'Outfit', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: #0a0a0f;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .enter-arena-section {
    margin-bottom: 20px;
  }

  .enter-arena-btn {
    padding: 18px 30px;
    font-size: 1.15rem;
    border-radius: 14px;
    gap: 10px;
  }
}

.enter-arena-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 0 60px rgba(0, 255, 136, 0.2);
}

.enter-arena-btn:active {
  transform: scale(0.98);
}

.enter-arena-btn.disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.enter-arena-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.enter-arena-btn .btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(10, 10, 15, 0.3);
  border-top: 3px solid #0a0a0f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.enter-arena-btn.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== LIVE ARENA STATS ==================== */

.live-arena-section {
  text-align: left;
}

.arena-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.arena-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.arena-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(0, 240, 255, 0.1);
}

.arena-stat-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.arena-stat-info {
  display: flex;
  flex-direction: column;
}

.arena-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.arena-stat-value.gold {
  color: var(--gold);
}

.arena-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.arena-empty-msg {
  text-align: center;
  padding: 12px;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.9rem;
}

/* Green pulsing dot for online status */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  margin-right: 4px;
  animation: onlinePulse 2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #00ff88; }
  50% { opacity: 0.5; box-shadow: 0 0 8px #00ff88; }
}

/* Legacy live stats (keeping for compatibility) */
.live-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--card-glow);
}

.stat span:first-child {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==================== HOW TO PLAY — COLLAPSIBLE ==================== */

.how-to-play {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--card-glow);
  overflow: hidden;
}

.how-to-play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.how-to-play-header:hover {
  background: rgba(0, 240, 255, 0.03);
}

.how-to-play-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 0.95rem;
}

.how-to-play-toggle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.how-to-play-toggle.open {
  transform: rotate(180deg);
}

.how-to-play-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}

.how-to-play-content.open {
  max-height: 400px;
  padding: 0 20px 16px;
}

.how-to-play ul {
  list-style: none;
}

.how-to-play li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==================== GAME SCREEN ==================== */

#game-screen {
  z-index: 1;
}

#game-canvas {
  width: 100%;
  height: 100%;
  background: #0a0a15;
}

/* Game HUD */
#game-hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.hud-panel {
  position: absolute;
  background: rgba(13, 13, 26, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.hud-top-left {
  top: 80px;
  left: 15px;
}

.hud-top-right {
  top: 80px;
  right: 16px;
  width: 220px;
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid rgba(0, 240, 255, 0.45);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25), 0 0 30px rgba(0, 240, 255, 0.08);
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hud-bottom-right {
  bottom: 20px;
  right: 20px;
  padding: 5px;
}

.hud-bottom-left {
  bottom: 20px;
  left: 20px;
  padding: 5px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.player-stats {
  margin-bottom: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.stat-icon {
  font-size: 1.2rem;
}

.stat-value {
  font-family: 'Orbitron', 'Rajdhani', 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
}

#hud-length {
  color: #FFFFFF;
}

.stat-unit {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
}

/* Leaderboard — Bold neon gaming style */
.hud-top-right h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #00f0ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

#leaderboard-list {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.3s;
}

.lb-row.lb-first {
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

.lb-row.lb-me {
  background: rgba(0, 240, 255, 0.12);
  border-left: 3px solid #00f0ff;
  color: #00f0ff;
  font-weight: 700;
}

.lb-rank {
  width: 20px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.lb-row.lb-first .lb-rank { color: #FFD700; }
.lb-row.lb-me .lb-rank { color: #00f0ff; }

.lb-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.lb-score {
  font-family: 'Orbitron', 'Rajdhani', monospace;
  font-weight: 700;
  font-size: 11px;
  color: #FFD700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.lb-row.lb-first .lb-score { color: #FFD700; }
.lb-row.lb-me .lb-score { color: #00f0ff; }

.lb-separator {
  height: 1px;
  background: rgba(0, 240, 255, 0.2);
  margin: 6px 0;
}

/* Minimap */
#minimap {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
}

/* Boost Indicator */
#boost-indicator {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--warning), var(--danger));
  color: var(--bg-dark);
  padding: 10px 30px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.2rem;
  animation: boost-pulse 0.3s infinite;
}

@keyframes boost-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}

/* ==================== DEATH SCREEN ==================== */

#death-screen {
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
}

.death-content {
  text-align: center;
  padding: 40px;
}

.death-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  color: var(--danger);
  margin-bottom: 30px;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

#death-stats {
  margin-bottom: 30px;
}

#death-stats p {
  font-size: 1.2rem;
  padding: 10px 0;
  color: var(--text-secondary);
}

#death-stats span {
  color: var(--text);
  font-weight: 700;
}

.death-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ==================== MODAL ==================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  margin-bottom: 20px;
  text-align: center;
}

.cashout-details {
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.detail-row.total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.detail-row.fee {
  color: var(--text-secondary);
}

.detail-row.payout {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--success);
  border-bottom: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* ==================== LOBBY ENTRANCE ANIMATION ==================== */

@keyframes lobbySlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.start-content .section,
.start-content .enter-arena-section,
.start-content .how-to-play {
  animation: lobbySlideIn 0.4s ease both;
}

.start-content .section:nth-child(3) { animation-delay: 0.05s; }  /* player info */
.start-content .section:nth-child(4) { animation-delay: 0.10s; }  /* color selector */
.start-content .section:nth-child(5) { animation-delay: 0.15s; }  /* face shop */
.start-content .section:nth-child(6) { animation-delay: 0.20s; }  /* stake */
.start-content .enter-arena-section   { animation-delay: 0.25s; }  /* enter btn */
.start-content .section:nth-child(8) { animation-delay: 0.30s; }  /* arena stats */
.start-content .how-to-play          { animation-delay: 0.35s; }  /* how to play */

/* ==================== RECONNECTING BANNER ==================== */

.reconnect-banner {
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255, 184, 0, 0.95);
  color: #1a1a00;
  text-align: center;
  padding: 8px 16px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reconnect-banner.visible {
  transform: translateY(0);
}

.reconnect-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(26, 26, 0, 0.3);
  border-top: 2px solid #1a1a00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ==================== BALANCE SKELETON ==================== */

.balance-skeleton {
  display: inline-block;
  width: 60px;
  height: 14px;
  background: linear-gradient(90deg, rgba(255,215,0,0.1) 25%, rgba(255,215,0,0.25) 50%, rgba(255,215,0,0.1) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  vertical-align: middle;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== RESPONSIVE ==================== */

/* --- Tablet (768px - 1024px) --- */
@media (max-width: 1024px) and (min-width: 769px) {
  /* Face shop: horizontal scrollable row */
  .face-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 8px;
    padding-bottom: 8px;
    padding-right: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .face-tile {
    min-width: 70px;
    flex-shrink: 0;
  }

  .face-grid::-webkit-scrollbar {
    height: 4px;
    width: auto;
  }
  .face-grid::-webkit-scrollbar-track { background: transparent; }
  .face-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
  }
}

/* --- Mobile (<768px) --- */
@media (max-width: 768px) {
  .start-content {
    max-width: 100%;
    padding: 20px 12px 80px !important;
  }

  /* Compact card padding */
  .section {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .game-title {
    font-size: 1.5rem;
    gap: 8px;
    margin-bottom: 4px;
  }

  .snake-emoji {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  /* Face shop: single horizontal row, smaller tiles */
  .face-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 6px;
    padding-bottom: 6px;
    padding-right: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .face-tile {
    min-width: 56px;
    max-width: 64px;
    flex-shrink: 0;
    padding: 4px 2px 3px;
  }

  .face-tile .face-sprite {
    width: 32px;
    height: 32px;
    margin-bottom: 2px;
  }

  .face-tile .face-price {
    font-size: 0.5rem;
  }

  .face-tile .face-name {
    font-size: 0.45rem;
  }

  .face-grid::-webkit-scrollbar {
    height: 3px;
    width: auto;
  }

  /* Stake grid: 2 per row */
  .stake-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 8px 0;
  }

  .stake-btn {
    padding: 10px 4px 8px;
    border-radius: 8px;
  }

  .stake-btn .stake-amount {
    font-size: 1.1rem;
  }

  .stake-size-label {
    font-size: 9px;
  }

  /* Enter arena button: sticky at bottom */
  .enter-arena-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 10px 16px;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
  }

  .enter-arena-btn {
    font-size: 0.8rem;
    padding: 14px 12px;
    border-radius: 10px;
  }

  /* Arena stats: single column */
  .arena-stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .arena-stat {
    padding: 8px 10px;
  }

  .arena-stat-value {
    font-size: 0.85rem;
  }

  .arena-header {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  /* Color options: tighter */
  .color-options {
    gap: 8px;
    margin-bottom: 10px;
  }

  .color-option {
    width: 28px;
    height: 28px;
  }

  .color-selector-section h2,
  .face-shop-section h2 {
    font-size: 0.7rem;
    margin-bottom: 8px;
  }

  /* Player info compact */
  .player-info {
    padding: 10px 14px;
    gap: 8px;
  }

  #coin-balance {
    font-size: 0.85rem;
  }

  /* How to play compact */
  .how-to-play-header {
    padding: 12px 14px;
  }

  .how-to-play-header h3 {
    font-size: 0.85rem;
  }

  .how-to-play li {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  /* Lobby entrance animation: slide up on mobile instead of left */
  @keyframes lobbySlideIn {
    from {
      opacity: 0;
      transform: translateY(15px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Game HUD mobile */
  .hud-panel {
    padding: 10px;
  }
  
  .hud-top-right {
    width: 160px;
    padding: 8px;
    opacity: 0.8;
    right: 8px;
  }
  
  .hud-top-right h3 {
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }
  
  #leaderboard-list { font-size: 11px; }
  .lb-score { font-size: 9px; }
  .lb-rank { width: 16px; font-size: 10px; }
  .lb-color { width: 8px; height: 8px; }
  
  .death-actions {
    flex-direction: column;
  }

  .live-stats {
    flex-direction: column;
  }
}

/* (Spectator mode CSS removed) */

/* ==================== MOBILE CONTROLS ==================== */

body.mobile {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#mobile-controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

#joystick-area {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 200px;
  height: 200px;
  pointer-events: auto;
  background: transparent;
}

#joystick-base {
  position: fixed;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

#joystick-thumb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.7);
  border: 2px solid rgba(0, 255, 136, 1);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
  transition: transform 0.05s ease-out;
}

#mobile-boost-btn {
  position: absolute;
  bottom: 40px;
  right: 40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.8), rgba(0, 255, 136, 0.8));
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  color: white;
  transition: all 0.1s ease;
}

#mobile-boost-btn span {
  font-size: 28px;
  line-height: 1;
}

#mobile-boost-btn small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#mobile-boost-btn.active {
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.9), rgba(255, 100, 0, 0.9));
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 184, 0, 0.6);
}

#mobile-boost-btn:active {
  transform: scale(0.95);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .hud-panel {
    padding: 8px;
    font-size: 12px;
  }
  
  .hud-top-left {
    top: 78px;
    left: 8px;
  }
  
  .hud-top-right {
    top: 78px;
    right: 8px;
    width: 180px;
    opacity: 0.85;
  }
  
  .hud-bottom-right {
    bottom: 10px;
    right: 10px;
  }
  
  .hud-bottom-left {
    bottom: 100px;
    left: 10px;
  }
  
  #minimap {
    width: 100px;
    height: 100px;
  }
  
  .stat-value {
    font-size: 16px;
  }
  
  .stat-icon {
    font-size: 14px;
  }
  
  #cash-out-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .lb-row {
    font-size: 11px;
    padding: 3px 4px;
  }
  
  .game-title {
    font-size: 28px;
  }
  
  .how-to-play {
    font-size: 12px;
  }
  
  .stake-preview {
    flex-direction: column;
    gap: 5px;
  }
}

/* Portrait mode warning */
@media (max-height: 500px) and (orientation: landscape) {
  /* Landscape on short screens is fine */
}

@media (max-width: 500px) and (orientation: portrait) {
  #mobile-boost-btn {
    width: 70px;
    height: 70px;
    bottom: 30px;
    right: 20px;
  }
  
  #mobile-boost-btn span {
    font-size: 24px;
  }
  
  #joystick-area {
    width: 150px;
    height: 150px;
  }
}

/* ==================== FOOTER ==================== */

#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #16162a 0%, #1a1a2e 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 15px 24px;
  z-index: 999;
  font-size: 14px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 13px;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-separator {
  color: var(--text-secondary);
  opacity: 0.5;
}

.footer-copyright {
  color: var(--text-secondary);
  font-size: 12px;
  opacity: 0.7;
}

.footer-copyright p {
  margin: 0;
}

/* Adjust body to account for footer */
body {
  padding-bottom: 60px;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
  #site-footer {
    padding: 12px 16px;
  }
  
  .footer-content {
    gap: 6px;
  }
  
  .footer-link {
    font-size: 12px;
  }
  
  .footer-copyright {
    font-size: 11px;
  }
  
  body {
    padding-bottom: 65px;
  }
}
