:root {
  --bg: #1c1e36;
  --bg-soft: #23274c;
  --panel: rgba(33, 38, 77, 0.95);
  --panel-strong: rgba(43, 49, 99, 0.97);
  --line: rgba(255, 255, 255, 0.15);
  --text: #f0f4ff;
  --muted: #a3b8db;
  --accent: #8b6dff;
  --accent-2: #00f5d4;
  --warning: #ffb703;
  --danger: #ff4d6d;
  --success: #2ee59d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 24px;
  --canvas-w: 800px;
}

/* ═══════════════════════════════════════
   BASE RESET
═══════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }

/* ═══════════════════════════════════════
   PAGE TOGGLES
═══════════════════════════════════════ */
.landing-page { display: flex; flex-direction: column; min-height: 100vh; }
.game-page { display: block; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════
   LANDING NAV
═══════════════════════════════════════ */
.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  background: rgba(18, 20, 46, 0.88);
  position: sticky;
  top: 0;
  z-index: 50;
}
.land-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.04em;
  text-shadow: 0 0 20px rgba(124,92,255,0.4);
}
.land-logo:hover { color: var(--accent-2); }
.logo-icon { font-size: 1.3em; }
/* Logo image used in navbars — keep it small like a proper nav logo */
.nav-logo-img {
  height: 36px !important;
  width: auto !important;
  max-width: 180px !important;
  max-height: 36px !important;
  object-fit: contain;
  display: inline-block !important;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.3));
  transition: filter 140ms;
}
.land-logo:hover .nav-logo-img,
.in-game-logo:hover .nav-logo-img {
  filter: drop-shadow(0 0 12px rgba(0, 245, 212, 0.5));
}
.nav-logo-text {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(124, 92, 255, 0.35);
}
.nav-logo-rush {
  background: linear-gradient(90deg, #00d4ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.land-nav-links { display: flex; gap: 24px; align-items: center; }
.land-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 140ms, text-shadow 140ms, transform 140ms, filter 140ms, box-shadow 140ms;
  display: inline-flex;
  align-items: center;
  min-height: 42px; /* Matches live badge height for perfect vertical centering */
}
.land-nav-links a:hover { color: var(--accent-2); }
.land-nav-links a.active {
  color: var(--accent-2);
  font-weight: 800;
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}
/* Style 'Play Now' link on subpages as a beautiful call-to-action button */
.land-nav-links a[href="/"] {
  background: linear-gradient(135deg, var(--accent), #ff4ecd);
  color: #ffffff;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(124, 92, 255, 0.25);
}
.land-nav-links a[href="/"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35);
  color: #ffffff;
}


/* ═══════════════════════════════════════
   LANDING HERO
═══════════════════════════════════════ */
.land-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 65px);
  padding: 60px 24px 80px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(124,92,255,0.28), transparent 38rem),
    radial-gradient(circle at bottom right, rgba(0,245,212,0.14), transparent 28rem),
    linear-gradient(135deg, #1d203a 0%, #292d5c 52%, #1e213e 100%);
}
.land-hero-content {
  max-width: 680px;
  text-align: center;
  z-index: 2;
}
.land-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,245,212,0.3);
  background: rgba(0,245,212,0.08);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.land-title {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #ffffff;
  text-shadow: 0 0 60px rgba(124,92,255,0.3);
  margin-bottom: 22px;
}
.land-title-accent {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.land-subtitle {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 36px;
}

/* Form Card */
.land-form-card {
  background: rgba(20,22,49,0.9);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  backdrop-filter: blur(18px);
  margin-bottom: 20px;
}
.land-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}
.land-input-group { margin-bottom: 16px; }
.land-room-group { margin-top: 4px; }
.land-input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.land-input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(0,245,212,0.1);
}
.land-input::placeholder { color: rgba(255,255,255,0.3); font-weight: 400; }

/* Avatar Picker Carousel Styles */
.avatar-select-container {
  margin-bottom: 20px;
  text-align: left;
}
.avatar-carousel-wrapper {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.avatar-carousel {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  gap: 12px;
  scroll-behavior: smooth;
  flex-grow: 1;
  padding: 4px 2px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch;
}
.avatar-carousel::-webkit-scrollbar {
  display: none !important;
}
.avatar-item {
  min-width: 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.avatar-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08) translateY(-1px);
}
.avatar-item.active {
  background: rgba(0, 245, 212, 0.12);
  border-color: var(--accent-2);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.25);
  transform: scale(1.12);
}
.carousel-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 140ms ease;
  user-select: none;
  flex-shrink: 0;
}
.carousel-nav-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}
.carousel-nav-btn:active {
  transform: scale(0.95);
}
.land-btn-group { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 8px; }
.land-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font: 900 0.92rem/1 inherit;
  cursor: pointer;
  transition: transform 140ms, filter 140ms;
  text-decoration: none;
}
.land-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.land-btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff4ecd);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(124,92,255,0.35);
  font-size: 1.05rem;
}
.land-btn-ghost {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 0.85rem;
}
.land-disclaimer {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
}
.land-disclaimer a { color: var(--muted); text-decoration: underline; }

/* Floating doodles */
.land-doodles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.doodle {
  position: absolute;
  font-size: 2.2rem;
  opacity: 0.12;
  animation: doodleFloat 8s ease-in-out infinite;
  filter: blur(0.5px);
}
.doodle-1  { top: 12%;  left: 5%;   animation-delay: 0s;    font-size: 2rem; }
.doodle-2  { top: 25%;  right: 8%;  animation-delay: 1.2s;  font-size: 2.8rem; }
.doodle-3  { top: 55%;  left: 3%;   animation-delay: 2.4s;  font-size: 1.8rem; }
.doodle-4  { top: 70%;  right: 5%;  animation-delay: 0.6s;  font-size: 2.4rem; }
.doodle-5  { top: 8%;   right: 22%; animation-delay: 3.0s;  font-size: 2rem; }
.doodle-6  { bottom: 15%; left: 10%;  animation-delay: 1.8s; font-size: 2.6rem; }
.doodle-7  { top: 40%;  left: 6%;   animation-delay: 2.0s;  font-size: 2rem; }
.doodle-8  { bottom: 20%; right: 12%; animation-delay: 0.3s; font-size: 2.2rem; }
@keyframes doodleFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-18px) rotate(4deg); }
}

/* ═══════════════════════════════════════
   FEATURES SECTION
═══════════════════════════════════════ */
.land-features {
  padding: 80px 40px;
  background: rgba(15,16,36,0.6);
  border-top: 1px solid var(--line);
}
.land-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.land-feature-card {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(12px);
  transition: transform 180ms, border-color 180ms, box-shadow 180ms;
}
.land-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,245,212,0.3);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.feature-icon { display: block; font-size: 2rem; margin-bottom: 12px; }
.land-feature-card h3 { color: #fff; font-size: 1rem; font-weight: 900; margin-bottom: 8px; }
.land-feature-card p  { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

/* ═══════════════════════════════════════
   HOW TO PLAY (landing section)
═══════════════════════════════════════ */
.land-howto {
  padding: 80px 40px;
  background: radial-gradient(circle at top right, rgba(124,92,255,0.1), transparent 28rem),
              linear-gradient(135deg, #141628, #1a1d38);
  border-top: 1px solid var(--line);
}
.land-section-title {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 48px;
}
.land-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.land-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}
.step-num {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff4ecd);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
}
.land-step strong { display: block; color: #fff; font-size: 0.95rem; margin-bottom: 4px; }
.land-step p { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin: 0; }

/* ═══════════════════════════════════════
   FOOTER — compact single-row
═══════════════════════════════════════ */
.land-footer {
  margin-top: auto;
  padding: 18px 40px;
  border-top: 1px solid var(--line);
  background: rgba(16, 18, 42, 0.95);
}
.land-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.land-footer-brand { display: flex; align-items: center; gap: 8px; }
.land-footer-brand strong { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.land-footer-links { display: flex; gap: 20px; }
.land-footer-links a { color: var(--muted); font-size: 0.82rem; text-decoration: none; font-weight: 600; transition: color 140ms; }
.land-footer-links a:hover { color: var(--accent-2); }
.land-footer-copy p { color: rgba(255,255,255,0.3); font-size: 0.78rem; line-height: 1.4; }
.land-footer-disclaimer { display: none; }

/* ═══════════════════════════════════════
   IN-GAME HEADER (redesigned)
═══════════════════════════════════════ */
.header-left { display: flex; align-items: center; gap: 16px; }
.in-game-logo {
  display: flex;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  opacity: 0.85;
  transition: opacity 140ms;
}
.in-game-logo:hover { opacity: 1; color: var(--accent-2); }
.header-room-info { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.header-room-info strong { color: var(--accent-2); }

/* ═══════════════════════════════════════
   LEGAL / ABOUT / HOW-TO-PLAY PAGES
═══════════════════════════════════════ */
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #181a33 0%, #202447 52%, #1a1d38 100%);
  overflow-x: hidden;
}
.legal-page { min-height: 100vh; display: flex; flex-direction: column; }
.legal-content { flex: 1; max-width: 860px; margin: 0 auto; padding: 60px 32px; }
.legal-hero { text-align: center; margin-bottom: 60px; }
.legal-icon { font-size: 3.5rem; display: block; margin-bottom: 16px; }
.legal-hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 12px;
}
.legal-date { color: var(--muted); font-size: 0.82rem; margin-bottom: 16px; }
.legal-intro { color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 600px; margin: 0 auto; }
.legal-section { margin-bottom: 44px; }
.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-2);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,245,212,0.15);
}
.legal-section h3 { color: #fff; font-size: 1rem; font-weight: 800; margin: 18px 0 8px; }
.legal-section p { color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.legal-section ul { color: var(--muted); line-height: 1.7; padding-left: 22px; margin-bottom: 10px; }
.legal-section ul li { margin-bottom: 6px; }
.legal-section a { color: var(--accent-2); }
.legal-section code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 5px; font-size: 0.88em; color: var(--accent-2); }
.legal-highlight {
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.25);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 16px 0;
}
.legal-highlight strong { display: block; color: var(--danger); margin-bottom: 8px; font-size: 0.95rem; }
.legal-highlight p { margin: 0; font-size: 0.9rem; }

/* About Stats */
.about-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.about-stat { text-align: center; padding: 20px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.04); }
.stat-num { display: block; font-size: 1.8rem; font-weight: 900; color: var(--accent-2); letter-spacing: -0.04em; }
.stat-label { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 700; margin-top: 4px; }

/* How to Play page */
.htp-steps { display: flex; flex-direction: column; gap: 16px; }
.htp-step { display: flex; align-items: flex-start; gap: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.03); }
.htp-step-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.htp-step h3 { color: #fff; font-size: 0.95rem; font-weight: 900; margin-bottom: 6px; }
.htp-step p, .htp-step ul { color: var(--muted); font-size: 0.88rem; line-height: 1.65; }
.htp-step ul { padding-left: 18px; }
.htp-step ul li { margin-bottom: 4px; }
.htp-difficulty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.difficulty-card { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.difficulty-card h3 { font-size: 0.95rem; font-weight: 900; margin-bottom: 6px; }
.difficulty-card p { color: var(--muted); font-size: 0.84rem; line-height: 1.5; margin-bottom: 0; }
.difficulty-examples { font-size: 0.78rem !important; color: rgba(255,255,255,0.35) !important; margin-top: 8px !important; }
.difficulty-card.easy { border-color: rgba(46,229,157,0.25); }
.difficulty-card.easy h3 { color: var(--success); }
.difficulty-card.medium { border-color: rgba(255,183,3,0.25); }
.difficulty-card.medium h3 { color: var(--warning); }
.difficulty-card.hard { border-color: rgba(255,77,109,0.25); }
.difficulty-card.hard h3 { color: var(--danger); }
.htp-cta { text-align: center; margin-top: 60px; padding: 48px 32px; border: 1px solid rgba(0,245,212,0.2); border-radius: 24px; background: radial-gradient(circle, rgba(0,245,212,0.06), transparent 60%); }
.htp-cta h2 { font-size: 1.8rem; font-weight: 900; color: #fff; margin-bottom: 10px; }
.htp-cta p { color: var(--muted); margin-bottom: 24px; }

/* ═══════════════════════════════════════
   RESPONSIVE – LANDING
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .land-footer-inner { grid-template-columns: 1fr 1fr; }
  .land-footer-copy { text-align: left; grid-column: 1 / -1; }
  .about-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .htp-difficulty-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .land-nav { padding: 14px 20px; }
  .land-nav-links { gap: 12px; font-size: 0.82rem; }
  .land-btn-group { grid-template-columns: 1fr; }
  .land-form-card { padding: 20px 16px; }
  .land-footer-inner { grid-template-columns: 1fr; }
  .land-footer-copy { text-align: left; }
  .land-steps { grid-template-columns: 1fr; }
  .land-features { padding: 48px 20px; }
  .land-howto { padding: 48px 20px; }
  .land-footer { padding: 32px 20px; }
  .legal-content { padding: 40px 18px; }
  .about-stats-grid { grid-template-columns: repeat(2, 1fr); }
}


body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.35), transparent 34rem),
    radial-gradient(circle at top right, rgba(0, 245, 212, 0.18), transparent 30rem),
    linear-gradient(135deg, #181a33 0%, #202447 52%, #1a1d38 100%);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
.page-shell { width: min(1500px, calc(100vw - 24px)); margin: 0 auto; padding: 18px 0 28px; }
.hero-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.eyebrow { margin: 0 0 4px; color: var(--accent-2); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 4.2rem); line-height: 0.9; letter-spacing: -0.08em; text-shadow: 0 0 30px rgba(124, 92, 255, 0.42); }
h2 { margin-bottom: 0; font-size: 1rem; }
.room-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.primary-btn, .ghost-btn, .danger-btn { min-height: 42px; padding: 0 16px; border-radius: 999px; color: var(--text); font-weight: 900; transition: transform 140ms ease, filter 140ms ease, background 140ms ease; }
.primary-btn { background: linear-gradient(135deg, var(--accent), #ff4ecd); box-shadow: 0 12px 30px rgba(124, 92, 255, 0.25); }
.ghost-btn { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); }
.danger-btn { background: linear-gradient(135deg, #ff4d6d, #ff7a00); }
.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-btn:disabled, .ghost-btn:disabled, .danger-btn:disabled { cursor: not-allowed; opacity: 0.5; transform: none; }
#muteBtn { width: 42px; min-width: 42px; padding: 0; font-size: 1.15rem; line-height: 1; }
.ad-banner { display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; border: 1px dashed rgba(255, 255, 255, 0.24); border-radius: 18px; background: rgba(255, 255, 255, 0.055); color: rgba(255, 255, 255, 0.58); font-weight: 800; letter-spacing: 0.05em; }
.ad-728x90 { width: min(728px, 100%); height: 90px; }
.game-grid { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 840px) minmax(280px, 340px); gap: 16px; align-items: start; }
.panel, .center-stage { min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.leaderboard-panel, .chat-panel { padding: 16px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.room-badge, .mode-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(0, 245, 212, 0.13); color: var(--accent-2); font-size: 0.74rem; font-weight: 1000; letter-spacing: 0.06em; }
.mode-badge.artist { color: #111324; background: var(--warning); }
.leaderboard-list { display: grid; gap: 10px; }
.player-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.055); }
.player-row.artist { border-color: rgba(255, 183, 3, 0.8); background: rgba(255, 183, 3, 0.11); }
.rank-pill { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: var(--accent-2); font-size: 0.78rem; font-weight: 1000; }
.player-meta { min-width: 0; }
.player-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 900; }
.player-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brush-mark { font-size: 0.95rem; }
.points { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.score-value { color: var(--text); font-weight: 1000; }
.center-stage { display: grid; gap: 12px; }
.game-topbar { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.mini-label, .tool-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
#wordHint { display: block; max-width: 520px; overflow: hidden; color: #ffffff; font-size: clamp(1.05rem, 2.2vw, 1.8rem); text-overflow: ellipsis; white-space: nowrap; }
#roundCounter { font-size: 1.35rem; }
.timer-widget { position: relative; display: grid; place-items: center; width: 54px; height: 54px; }
.timer-ring { position: absolute; inset: 0; width: 54px; height: 54px; transform: rotate(-90deg); }
.timer-track, .timer-progress { fill: none; stroke-width: 5; }
.timer-track { stroke: rgba(255, 255, 255, 0.1); }
.timer-progress { stroke: var(--accent-2); stroke-linecap: round; stroke-dasharray: 113.097; stroke-dashoffset: 0; transition: stroke-dashoffset 220ms linear; }
#timerText { position: relative; font-size: 0.95rem; z-index: 1; }
.canvas-card { position: relative; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)); box-shadow: var(--shadow); overflow: hidden; }
#gameCanvas { display: block; width: 100%; max-width: var(--canvas-w); aspect-ratio: 4 / 3; margin: 0 auto; background: #ffffff; touch-action: none; cursor: crosshair; }
#gameCanvas.locked { cursor: not-allowed; }
.tools-panel { display: grid; grid-template-columns: 140px 1fr minmax(140px, 180px) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tools-panel.disabled { opacity: 0.52; pointer-events: none; }
.canvas-ad-container { width: 100%; min-height: 90px; background: rgba(18, 14, 38, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px dashed rgba(124, 92, 255, 0.25); border-radius: var(--radius); margin-top: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; transition: all 0.2s ease; }
.canvas-ad-container:hover { border-color: rgba(124, 92, 255, 0.5); background: rgba(18, 14, 38, 0.6); }
.ad-placeholder-text { opacity: 0.6; letter-spacing: 0.05em; text-transform: uppercase; }
.color-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot { width: 30px; height: 30px; border: 3px solid rgba(255, 255, 255, 0.25); border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12); }
.color-dot.active { border-color: #ffffff; transform: scale(1.08); }
.brush-group label { display: flex; align-items: center; justify-content: space-between; }
#brushSize { width: 100%; accent-color: var(--accent-2); }
.tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chat-panel { display: grid; grid-template-rows: auto minmax(460px, 560px) auto; gap: 12px; }
.chat-box { height: 560px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(0, 0, 0, 0.22); scrollbar-width: thin; }
.chat-line { margin-bottom: 10px; color: #dfe7ff; font-size: 0.92rem; line-height: 1.35; word-break: break-word; }
.chat-line strong { color: var(--accent-2); }
.chat-line.system strong, .chat-line.notice strong, .chat-line.join strong { color: var(--warning); }
.chat-line.correct { padding: 9px 10px; border-radius: 12px; background: rgba(46, 229, 157, 0.12); color: var(--success); font-weight: 900; }
.chat-line.reveal { padding: 9px 10px; border-radius: 12px; background: rgba(124, 92, 255, 0.16); color: #dcd6ff; font-weight: 900; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#chatInput { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; outline: none; color: var(--text); background: rgba(255, 255, 255, 0.08); }
#chatInput:focus { border-color: rgba(0, 245, 212, 0.72); box-shadow: 0 0 0 4px rgba(0, 245, 212, 0.11); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(2, 3, 12, 0.72); backdrop-filter: blur(8px); z-index: 5; }
.hidden { display: none !important; }
.modal-card { width: min(560px, 100%); border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.28), transparent 18rem), rgba(16, 18, 43, 0.96); box-shadow: 0 32px 110px rgba(0, 0, 0, 0.58); }
.compact-modal { padding: 24px; text-align: center; }
.choice-grid { display: grid; gap: 12px; margin: 18px 0 12px; }
.choice-grid button { min-height: 52px; border-radius: 16px; color: #ffffff; background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(0, 245, 212, 0.68)); font-size: 1.1rem; font-weight: 1000; }
.muted { color: var(--muted); }
.intermission-modal { display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.ad-rectangle { display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(255, 255, 255, 0.24); border-radius: 18px; background: rgba(255, 255, 255, 0.055); color: rgba(255, 255, 255, 0.58); font-weight: 900; }
.ad-300x250 { width: min(300px, 100%); height: 250px; }
.round-gains { width: 100%; display: grid; gap: 8px; }
.gain-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); text-align: left; }
.gain-row strong:last-child { color: var(--success); }
.toast-stack { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; width: min(340px, calc(100vw - 36px)); z-index: 30; }
.toast { padding: 13px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16, 18, 43, 0.98); box-shadow: var(--shadow); color: var(--text); font-weight: 900; animation: toastIn 180ms ease both; }
.toast.success { border-color: rgba(46, 229, 157, 0.45); color: var(--success); }
.toast.close { border-color: rgba(255, 183, 3, 0.55); color: var(--warning); }
.toast.error { border-color: rgba(255, 77, 109, 0.55); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1250px) {
  .game-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .chat-panel { grid-column: 1 / -1; grid-template-rows: auto 320px auto; }
  .chat-box { height: 320px; }
}
@media (max-width: 850px) {
  .page-shell { width: min(100vw - 14px, 720px); padding-top: 10px; }
  .hero-header { align-items: flex-start; flex-direction: column; }
  .room-actions { width: 100%; justify-content: stretch; }
  .room-actions button { flex: 1; }
  .game-grid { grid-template-columns: 1fr; }
  .game-topbar { grid-template-columns: 1fr auto; }
  .timer-widget { grid-row: span 2; }
  .tools-panel { grid-template-columns: 1fr; }
  .tool-buttons { justify-content: stretch; }
  .tool-buttons button { flex: 1; }
  .leaderboard-panel { order: 2; }
  .center-stage { order: 1; }
  .chat-panel { order: 3; }
}
@media (max-width: 520px) {
  .primary-btn, .ghost-btn, .danger-btn { min-height: 40px; padding: 0 12px; font-size: 0.86rem; }
  .game-topbar { padding: 10px; }
  .leaderboard-panel, .chat-panel { padding: 12px; }
  .chat-form { grid-template-columns: 1fr; }
}

.bot-actions {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.bot-btn {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-2);
  transition: all 140ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-btn:hover {
  background: rgba(0, 245, 212, 0.08);
  border-color: rgba(0, 245, 212, 0.5);
  transform: translateY(-1px);
}

.bot-btn.remove:hover {
  background: rgba(255, 77, 109, 0.08);
  border-color: rgba(255, 77, 109, 0.5);
}

/* Battle Royale Tournament Styles */
.tournament-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(7, 7, 22, 0.95), rgba(124, 92, 255, 0.1));
  box-shadow: 0 0 25px rgba(0, 245, 212, 0.08);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  animation: slideDown 250ms ease both;
}

.tournament-info-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tournament-info-item strong {
  font-size: 1.35rem;
  font-weight: 1000;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.lobby-countdown-banner {
  text-align: center;
  padding: 24px 18px;
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 16, 36, 0.95), rgba(124, 92, 255, 0.15));
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  animation: pulseNeon 2s infinite ease-in-out;
}

.lobby-countdown-banner h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  margin-bottom: 8px;
  font-weight: 900;
}

.lobby-countdown-banner p {
  color: var(--muted);
  margin: 0;
}

.bot-disclaimer-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 183, 3, 0.08);
  border: 1px solid rgba(255, 183, 3, 0.25);
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseNeon {
  0%, 100% { border-color: rgba(124, 92, 255, 0.4); box-shadow: 0 0 20px rgba(124, 92, 255, 0.1); }
  50% { border-color: rgba(0, 245, 212, 0.7); box-shadow: 0 0 35px rgba(0, 245, 212, 0.2); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Leaderboard Tournament Formatting */
.leaderboard-zone-title {
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 12px 0 6px;
  padding-left: 4px;
}

.leaderboard-zone-title.gold {
  color: var(--warning);
  text-shadow: 0 0 10px rgba(255, 183, 3, 0.25);
}

.leaderboard-zone-title.danger {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.25);
}

.player-row.eliminated {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
  opacity: 0.45;
}

.player-row.eliminated .player-name span:first-child {
  text-decoration: line-through;
}

.player-row.eliminated .rank-pill {
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.leaderboard-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  font-weight: 800;
  opacity: 0.6;
}

.player-row.gold-star {
  border-color: rgba(255, 183, 3, 0.45);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 15px rgba(255, 183, 3, 0.04);
}

.player-row.danger-star {
  border-color: rgba(255, 77, 109, 0.45);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 15px rgba(255, 77, 109, 0.04);
}

/* Intermission ad adjustment */
.ad-rectangle.ad-300x250 {
  margin: 10px 0;
}

/* Floating Visual Reference Card for Artist */
.artist-ref-card {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(18, 18, 28, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 245, 212, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 245, 212, 0.12);
  z-index: 100;
  max-width: 280px;
  animation: slideInPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: none;
}

@keyframes slideInPulse {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.artist-ref-emoji {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.artist-ref-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.artist-ref-text {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1px;
}

.artist-ref-hint {
  color: var(--muted);
  font-size: 0.74rem;
  margin: 0;
  line-height: 1.25;
}

/* Tool Selector Group */
.tool-selectors {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.tool-select-btn {
  flex: 1;
  min-height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 140ms ease;
}

.tool-select-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tool-select-btn.active {
  color: #111324;
  background: var(--accent-2);
  box-shadow: 0 4px 12px rgba(0, 245, 212, 0.25);
}

/* ═══════════════════════════════════════
   PRIVATE ROOM SETTINGS MODAL
═══════════════════════════════════════ */
.settings-modal {
  text-align: left !important;
  max-width: 520px;
  width: min(520px, calc(100vw - 32px)) !important;
  padding: 32px !important;
  border-radius: 28px !important;
  background: rgba(30, 34, 68, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.6) !important;
}
.settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  position: relative;
}
.settings-modal .modal-header h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  text-align: left;
}
.settings-modal .close-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms, transform 140ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.settings-modal .close-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}
.form-row.flex-column {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}
.form-row-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #dfe7ff;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.setting-badge {
  font-size: 0.76rem;
  font-weight: 900;
  background: rgba(0, 245, 212, 0.12);
  color: var(--accent-2);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 212, 0.2);
}
.settings-form select {
  height: 38px;
  width: 210px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  padding: 0 32px 0 12px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ea4c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: border-color 140ms, box-shadow 140ms;
  text-align: left;
}
.form-row-grid select {
  width: 100% !important;
}
.settings-form select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}
.settings-form input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-2);
  cursor: pointer;
  margin-right: 4px;
}
.settings-form input[type="range"] {
  accent-color: var(--accent-2);
  width: 100%;
  cursor: pointer;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: none;
}
.settings-disclaimer {
  font-size: 0.78rem;
  color: var(--warning);
  background: rgba(255, 183, 3, 0.08);
  border: 1px solid rgba(255, 183, 3, 0.2);
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.5;
  margin: 6px 0 0;
  text-align: left;
}
#botSettingsArea {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 4px;
}
#botSettingsArea .form-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.disabled-settings {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 180ms ease;
}

/* ═══════════════════════════════════════
   LIVE PLAYER COUNT BADGE
   ═══════════════════════════════════════ */
.live-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 42px;
  border-radius: 999px;
  background: rgba(46, 229, 157, 0.08);
  border: 1px solid rgba(46, 229, 157, 0.25);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(46, 229, 157, 0.3);
  box-shadow: inset 0 0 12px rgba(46, 229, 157, 0.05);
  backdrop-filter: blur(8px);
  user-select: none;
  pointer-events: none;
  animation: pulseGreen 2.5s infinite ease-in-out;
  transition: transform 140ms ease;
}

.live-count-badge .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success), 0 0 15px var(--success);
  display: inline-block;
  animation: blinkGreen 1.5s infinite ease-in-out;
}

@keyframes pulseGreen {
  0%, 100% {
    border-color: rgba(46, 229, 157, 0.25);
    box-shadow: 0 0 0 rgba(46, 229, 157, 0);
  }
  50% {
    border-color: rgba(46, 229, 157, 0.6);
    box-shadow: 0 0 15px rgba(46, 229, 157, 0.15);
  }
}

@keyframes blinkGreen {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 850px) {
  .room-actions .live-count-badge {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .land-nav {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }
  .land-nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
  }
  .land-nav .live-count-badge {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════
   BUY ME A COFFEE (SUPPORT CREATOR) BUTTONS
   ═══════════════════════════════════════ */
.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #ffdd00;
  color: #111111;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(255, 221, 0, 0.25), 0 0 15px rgba(255, 221, 0, 0.1);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  user-select: none;
  cursor: pointer;
  border: 0;
}
.bmc-btn:hover {
  transform: translateY(-2px);
  background: #ffe53d;
  box-shadow: 0 14px 30px rgba(255, 221, 0, 0.38), 0 0 25px rgba(255, 221, 0, 0.2);
}
.bmc-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 221, 0, 0.1);
  border: 1px solid rgba(255, 221, 0, 0.3);
  color: #ffdd00;
  font-weight: 800;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 140ms ease;
  user-select: none;
  cursor: pointer;
}
.bmc-btn-small:hover {
  background: #ffdd00;
  color: #111111;
  box-shadow: 0 6px 18px rgba(255, 221, 0, 0.35);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════
   TOURNAMENT LEADERBOARD HIGHLIGHTS & RANK POLISH
   ═══════════════════════════════════════ */
.player-row.warning-star {
  border-color: rgba(255, 159, 28, 0.45) !important;
  background: linear-gradient(135deg, rgba(255, 159, 28, 0.08), rgba(255, 255, 255, 0.035)) !important;
  box-shadow: 0 0 15px rgba(255, 159, 28, 0.04);
}

@keyframes pulseDangerPill {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 0 8px rgba(255, 77, 109, 0.4);
  }
  50% {
    transform: scale(1.04);
    filter: brightness(1.15);
    box-shadow: 0 0 14px rgba(255, 77, 109, 0.7);
  }
}

/* ═══════════════════════════════════════
   COIN & UNLOCK SHOP PREMIUM STYLING
   ═══════════════════════════════════════ */
.coin-balance-badge {
  animation: pulseNeon 3s infinite ease-in-out;
}
.chat-elim-badge {
  color: var(--danger);
  margin-right: 4px;
  font-weight: 900;
}
.player-avatar-badge {
  display: inline-block;
  vertical-align: middle;
}
.chat-avatar-inline {
  display: inline-block;
  vertical-align: middle;
}

/* Shop Item Card Styling */
.shop-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: all 150ms ease;
  user-select: none;
}
.shop-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
.shop-item-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}
.shop-item-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.shop-item-cost {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--warning);
  margin-top: -4px;
}
.shop-item-btn {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  transition: background 140ms, color 140ms;
}
.shop-item-btn.buy {
  background: var(--warning);
  color: #111111;
}
.shop-item-btn.buy:hover {
  background: #ffe53d;
}
.shop-item-btn.use {
  background: var(--accent-2);
  color: #111111;
}
.shop-item-btn.use:hover {
  background: #5efce8;
}
.shop-item-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: not-allowed;
  pointer-events: none;
}

/* Border styles in Leaderboard */
.border-neon {
  border: 1.5px solid var(--accent-2) !important;
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.4) !important;
}
.border-golden {
  border: 1.5px solid #ffb703 !important;
  box-shadow: 0 0 15px rgba(255, 183, 3, 0.4) !important;
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.08), rgba(255, 255, 255, 0.04)) !important;
}
.border-rainbow {
  position: relative;
  border: 1.5px solid transparent !important;
  background: linear-gradient(#1e2244, #1e2244) padding-box,
              linear-gradient(135deg, #ff4d6d, #ffb703, #2ee59d, #00bbf9, #7c5cff) border-box !important;
  box-shadow: 0 0 15px rgba(124, 92, 255, 0.3) !important;
}

/* ═══════════════════════════════════════
   EMOJI REACTION STORM
   ═══════════════════════════════════════ */
.reactions-panel {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  background: rgba(30, 34, 68, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 15;
  transition: all 0.2s ease;
}

.reactions-panel:hover {
  background: rgba(30, 34, 68, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.reaction-btn {
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

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

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

.floating-reaction {
  position: absolute;
  bottom: -40px; /* start slightly off-screen at the bottom of the canvas */
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 10;
  will-change: transform, opacity;
  animation: floatUpReaction 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes floatUpReaction {
  0% {
    transform: translateY(0) translateX(0) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(-20px) translateX(var(--sway-x, 0px)) scale(1.2);
  }
  50% {
    transform: translateY(-150px) translateX(calc(var(--sway-x, 0px) * -1)) scale(1);
  }
  100% {
    transform: translateY(-420px) translateX(var(--sway-x, 0px)) scale(0.8);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════
   POST-GAME AWARDS CAROUSEL (Turn 2.2)
   ═══════════════════════════════════════ */
.awards-carousel-container {
  width: 100%;
  margin-top: 15px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.awards-carousel-header h3 {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 12px;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.awards-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.awards-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none;  /* Hide scrollbar IE/Edge */
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  gap: 16px;
}

.awards-carousel::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

/* Awards Cards */
.award-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  border-radius: 18px;
  background: var(--card-bg, rgba(255, 255, 255, 0.06));
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.award-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.award-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}

.award-icon-wrapper {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 2.5rem;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.award-player-avatar {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 2;
}

.award-card h4 {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.award-player-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.award-description {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 260px;
}

.awards-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 140ms ease;
  user-select: none;
  flex-shrink: 0;
  z-index: 10;
}

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

.awards-nav-btn:active {
  transform: scale(0.92);
}

/* Dots Indicator */
.awards-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.awards-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 150ms ease;
}

.awards-dot:hover {
  background: rgba(255, 255, 255, 0.3);
}

.awards-dot.active {
  background: var(--accent-2);
  width: 18px;
  border-radius: 99px;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
}

/* ═══════════════════════════════════════
   RESPONSIVE DESIGN FIXES (Turn 2.2 Patch)
   ═══════════════════════════════════════ */
@media (max-width: 640px) {
  .reactions-panel {
    bottom: 8px !important;
    right: 8px !important;
    padding: 4px 8px !important;
    gap: 4px !important;
  }
  .reaction-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.25rem !important;
    padding: 2px !important;
  }
  .intermission-modal {
    padding: 14px 16px !important;
    gap: 10px !important;
    max-width: 95vw !important;
    width: 95vw !important;
  }
  .awards-carousel-container {
    padding: 10px !important;
    margin-top: 10px !important;
  }
  .award-card {
    padding: 14px !important;
  }
  .award-icon-wrapper {
    width: 54px !important;
    height: 54px !important;
    font-size: 2rem !important;
    margin-bottom: 8px !important;
  }
  .award-player-avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 1rem !important;
  }
  .award-card h4 {
    font-size: 1.05rem !important;
  }
  .award-description {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    max-width: 200px !important;
  }
  .awards-nav-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 1.1rem !important;
  }
}

@media (max-width: 480px) {
  #adVideoContainer {
    aspect-ratio: 4/3 !important; /* expand height on small devices to prevent text clip */
  }
}
