/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds — warm purple-dark */
  --bg: #1a1625;
  --bg2: #241e35;
  --bg3: #2e2645;
  --surface: #362d50;

  /* Primary accents */
  --accent: #ff5c93;
  --accent2: #ff9f43;

  /* Extended cartoon palette */
  --purple: #a55eea;
  --blue: #45b7d1;
  --green: #26de81;
  --yellow: #fed330;
  --gold: #ffc312;
  --red: #fc5c65;
  --cyan: #0be4e4;

  /* Text */
  --text: #f0edf6;
  --text2: #9b8fc2;

  /* Semantic */
  --danger: #fc5c65;
  --heart: #ff5c93;
  --heart-dead: #443a5c;

  /* Radii — rounder, more playful */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;

  /* Colored shadows */
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-glow-pink: 0 0 20px rgba(255,92,147,0.3);
  --shadow-glow-green: 0 0 20px rgba(38,222,129,0.3);
  --shadow-glow-purple: 0 0 20px rgba(165,94,234,0.3);

  /* Per-player colors */
  --player1: #45b7d1;
  --player2: #a55eea;
  --player3: #ff9f43;
  --player4: #26de81;
}

html, body {
  height: 100%;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(165,94,234,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(255,92,147,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 90%, rgba(69,183,209,0.05) 0%, transparent 50%);
  color: var(--text);
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

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

.screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none;
  z-index: 1;
  overflow-y: auto;
}
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ─── AUTH SIDEBAR ─── */
.auth-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.auth-sidebar {
  position: absolute; top: 0; right: 0; width: 380px; max-width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  overflow-y: auto; padding: 24px;
  animation: slideInRight 0.25s ease;
}
.auth-sidebar-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text2); font-size: 1.8rem;
  cursor: pointer; line-height: 1; transition: color 0.2s;
}
.auth-sidebar-close:hover { color: var(--text); }
.auth-sidebar-content { margin-top: 40px; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ─── AUTH (legacy) ─── */
.auth-container {
  width: 100%; max-width: 420px; margin: auto; padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}

.logo { text-align: center; animation: fadeInUp 0.6s ease; transform: rotate(3deg); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.logo h1 { font-family: 'Fredoka One', cursive; font-size: 2.4rem; font-weight: 900; letter-spacing: 4px; line-height: 1.1; text-shadow: 0 0 30px rgba(165,94,234,0.4); }
.logo .accent { color: var(--accent); }
.tagline { color: var(--text2); font-size: 0.95rem; margin-top: 5px; font-style: italic; }

.bomb-icon {
  display: inline-block; width: 75px; height: 90px;
  animation: shake 1.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255,92,147,0.3));
}
.bomb-svg { display: block; }

.auth-box {
  width: 100%; background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border: 2px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 25px;
  animation: fadeInUp 0.6s ease 0.1s both; box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: flex; margin-bottom: 20px; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text2); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.auth-tab.active { background: var(--surface); color: var(--text); }

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

.input-group input {
  width: 100%; padding: 14px 16px; background: var(--bg);
  border: 2px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 1rem; font-family: 'Nunito', sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s; outline: none;
}
.input-group input:focus { border-color: var(--accent); box-shadow: var(--shadow-glow-pink); }

.auth-error { color: var(--danger); font-size: 0.85rem; min-height: 20px; text-align: center; }
.forgot-link { display: block; text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 4px; text-decoration: none; transition: color 0.2s; }
.forgot-link:hover { color: var(--accent); }
.forgot-form { margin-top: 12px; }
.forgot-form .input-group { margin-bottom: 8px; }
.forgot-form .auth-error { font-size: 0.8rem; }

/* ─── DELETE ACCOUNT ─── */
.delete-account-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); text-align: center; }
.btn-danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); font-size: 0.75rem; padding: 8px 16px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.btn-danger-outline:hover { background: rgba(252,92,101,0.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e04555; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.delete-modal-content { max-width: 420px; }
.delete-warning { color: var(--muted); font-size: 0.85rem; margin: 12px 0 8px; line-height: 1.5; }
.delete-list { color: var(--muted); font-size: 0.8rem; margin: 0 0 16px 20px; line-height: 1.8; }
.delete-confirm-text { color: var(--text); font-size: 0.85rem; margin-bottom: 8px; }

/* ─── BUTTONS ─── */
.btn {
  padding: 14px 28px; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif; text-transform: uppercase;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1); letter-spacing: 1px;
  position: relative; overflow: hidden;
}
.btn:active { animation: jelly 0.4s ease; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple)); color: white;
  box-shadow: 0 4px 15px rgba(255,92,147,0.4);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 25px rgba(255,92,147,0.5); }
.btn-secondary {
  background: var(--bg3); color: var(--text); border: 2px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: var(--surface); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text2); padding: 8px 16px; font-size: 0.85rem; }
.btn-ghost:hover { color: var(--text); }
.btn-bomb {
  background: linear-gradient(135deg, var(--accent), var(--red)); color: white;
  animation: bombPulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(255,92,147,0.4);
}

@keyframes bombPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,147,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,92,147,0); }
}

.online-count {
  display: flex; align-items: center; gap: 8px;
  color: var(--text2); font-size: 0.85rem;
}
.pulse-dot {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ─── LOBBY ─── */
.lobby-container {
  width: 100%; max-width: 500px; margin: auto; padding: 20px;
  display: flex; flex-direction: column; min-height: 100vh;
}
.lobby-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem;
}
.user-info h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.elo-badge {
  display: inline-block; padding: 3px 12px;
  background: linear-gradient(135deg, rgba(255,195,18,0.15), rgba(255,195,18,0.05));
  border: 1px solid rgba(255,195,18,0.3);
  border-radius: 20px; font-size: 0.75rem; color: var(--gold); font-weight: 700;
}
.header-stats { display: flex; gap: 12px; font-size: 0.85rem; color: var(--text2); }
.header-stats b { color: var(--text); }
.fire-streak::before { content: '🔥 '; }

.lobby-main { flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 20px 0; }

.play-section { text-align: center; }
.btn-play {
  width: 100%; padding: 25px;
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--accent2));
  background-size: 200% 200%; animation: shimmer 3s infinite, scalePulse 2s ease-in-out infinite;
  color: white; border-radius: var(--radius); font-size: 1.6rem;
  font-family: 'Fredoka One', cursive;
  letter-spacing: 3px; position: relative; overflow: hidden;
  box-shadow: 0 6px 30px rgba(255,92,147,0.4);
}
.btn-play .btn-sub {
  display: block; font-size: 0.8rem; font-weight: 400;
  letter-spacing: 1px; margin-top: 4px; opacity: 0.8;
}
.btn-play:hover { transform: translateY(-3px); box-shadow: 0 10px 40px rgba(255, 46, 99, 0.4); }
.btn-play::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 3s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* Queue with slots */
.queue-section { text-align: center; }
.searching { padding: 20px 0; }
.queue-slots { display: flex; justify-content: center; gap: 12px; margin-bottom: 15px; }
.q-slot {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px dashed rgba(255,255,255,0.15);
  background: var(--bg2);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; justify-content: center;
}
.q-slot.filled {
  border: 3px solid var(--green); background: rgba(38,222,129,0.1);
  animation: bounceIn 0.4s ease;
  box-shadow: 0 0 12px rgba(38,222,129,0.3);
}
.q-slot.filled::after {
  content: '✓'; color: var(--green); font-weight: 900; font-size: 1.2rem;
}
@keyframes slotPop {
  0% { transform: scale(0.8); } 50% { transform: scale(1.15); } 100% { transform: scale(1); }
}
.queue-text {
  color: var(--text2); font-size: 1rem;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.5; } 50% { opacity: 1; }
}

/* Nav */
.lobby-nav {
  display: flex; background: var(--bg2); border-radius: var(--radius-sm); padding: 3px;
}
.nav-btn {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text2); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.nav-btn.active { background: var(--surface); color: var(--text); }

.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--bg2); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 18px; text-align: center;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-value { font-family: 'Fredoka One', cursive; font-size: 1.8rem; font-weight: 900; color: var(--accent); }
.stat-label {
  font-size: 0.75rem; color: var(--text2); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 4px;
}

/* Leaderboard */
.leaderboard-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto;
}
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg2); border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,0.06);
  transition: transform 0.2s; box-shadow: var(--shadow-sm);
}
.lb-row:hover { transform: translateY(-2px); }
.lb-row.top1 { border-color: var(--gold); background: rgba(255, 215, 0, 0.08); box-shadow: 0 0 15px rgba(255,195,18,0.2); }
.lb-row.top2 { border-color: #c0c0c0; }
.lb-row.top3 { border-color: #cd7f32; }
.lb-rank { width: 30px; text-align: center; font-weight: 900; font-size: 0.9rem; }
.lb-row.top1 .lb-rank { color: var(--gold); }
.lb-row.top2 .lb-rank { color: #c0c0c0; }
.lb-row.top3 .lb-rank { color: #cd7f32; }
.lb-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.lb-elo { color: var(--gold); font-weight: 700; font-size: 0.9rem; }
.lb-record { color: var(--text2); font-size: 0.75rem; }

/* Rules */
.rules-content { display: flex; flex-direction: column; gap: 10px; }
.rule {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 16px; background: var(--bg2);
  border-radius: var(--radius); border: 2px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.rule:hover { transform: translateY(-2px); }
.rule-num {
  width: 26px; height: 26px; min-width: 26px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.75rem;
}
.rule p { font-size: 0.82rem; color: var(--text2); line-height: 1.4; }
.rule b { color: var(--text); }

.lobby-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── GAME SCREEN ─── */
.game-container {
  position: relative;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 10px 15px;
  display: flex; flex-direction: column; height: 100vh;
}

/* Music toggle */
.music-toggle {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg3); border: 2px solid rgba(255,255,255,0.1);
  color: var(--text2); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.music-toggle:hover { background: var(--surface); color: var(--text); transform: scale(1.1); }
.music-toggle.active { border-color: var(--purple); color: var(--purple); background: rgba(165,94,234,0.15); }
.music-toggle.muted { opacity: 0.5; }

/* Players Bar */
.players-bar {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  padding: 8px 0;
}
.player-card {
  flex: 1; min-width: 0; max-width: 130px;
  padding: 10px 8px; background: var(--bg2);
  border-radius: var(--radius);
  border: 3px solid rgba(255,255,255,0.08);
  text-align: center; transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative; box-shadow: var(--shadow-sm);
}
.player-card[data-player="0"] { border-color: var(--player1); background: rgba(69,183,209,0.08); }
.player-card[data-player="1"] { border-color: var(--player2); background: rgba(165,94,234,0.08); }
.player-card[data-player="2"] { border-color: var(--player3); background: rgba(255,159,67,0.08); }
.player-card[data-player="3"] { border-color: var(--player4); background: rgba(38,222,129,0.08); }
.player-card.is-you { border-color: var(--green); background: rgba(38,222,129,0.1); }
.player-card.has-bomb {
  border-color: var(--accent); background: rgba(255,92,147,0.12);
  animation: scalePulse 1.5s ease-in-out infinite;
  box-shadow: var(--shadow-glow-pink);
}
.player-card .p-name {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-card.is-you .p-name { color: var(--green); }
/* Hearts display */
.p-hearts { display: flex; justify-content: center; gap: 4px; margin-top: 5px; }
.heart {
  font-size: 1.1rem; transition: all 0.3s;
}
.heart.full { color: var(--heart); text-shadow: 0 0 8px rgba(255,92,147,0.5); }
.heart.empty { color: var(--heart-dead); }
/* Eliminated player */
.player-card.eliminated {
  opacity: 0.4; filter: grayscale(0.8); border-color: rgba(255,255,255,0.04) !important;
  background: rgba(0,0,0,0.2) !important;
}
.player-card.eliminated .p-name { text-decoration: line-through; }
.p-status-dead { font-size: 1rem; margin-top: 2px; }
.p-lives-final { font-size: 0.85rem; }
.p-timer-bar {
  width: 100%; height: 4px; background: var(--bg3);
  border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.p-timer-fill {
  height: 100%; border-radius: 2px;
  transition: width 1s linear, background 0.3s;
}
.p-timer-text {
  font-size: 0.55rem; font-weight: 700; color: var(--text2);
  margin-top: 1px; font-variant-numeric: tabular-nums;
}
.player-card .p-bomb-icon {
  position: absolute; top: -8px; right: -8px; font-size: 1.2rem;
  animation: wobble 1s ease-in-out infinite;
}

/* Timer */
.timer-section { display: flex; justify-content: center; padding: 5px 0; }
.timer-ring {
  width: 100px; height: 100px; position: relative;
  filter: drop-shadow(0 0 10px rgba(38,222,129,0.3));
  transition: filter 0.3s;
}
.timer-ring.danger {
  filter: drop-shadow(0 0 15px rgba(252,92,101,0.5));
  animation: screenShake 0.3s ease infinite;
}
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--bg3); stroke-width: 6; }
.timer-progress {
  fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-progress.warning { stroke: var(--accent2); }
.timer-progress.danger { stroke: var(--accent); }
.timer-text {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums;
}
.timer-text.warning { color: var(--accent2); }
.timer-text.danger { color: var(--red); }
.timer-text.danger span { display: inline-block; animation: heartbeat 0.6s ease-in-out infinite; }

/* Bomb zone */
.bomb-zone { text-align: center; padding: 3px 0; }
.game-bomb {
  display: inline-block; width: 60px; height: 72px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255,92,147,0.3));
}
.bomb-label { font-size: 0.8rem; color: var(--text2); margin-top: 3px; }
.bomb-label b { color: var(--accent); }
.bomb-zone.your-turn .game-bomb {
  animation: wobble 0.6s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255,92,147,0.5));
}

/* Round */
.round-info { text-align: center; padding: 5px 0; }
.round-badge {
  display: inline-block; padding: 4px 14px; background: var(--bg3);
  border-radius: 20px; font-size: 0.65rem; font-weight: 700;
  font-family: 'Fredoka One', cursive;
  color: var(--text2); text-transform: uppercase; letter-spacing: 1px;
  border: 2px solid rgba(255,255,255,0.08);
}
.prompt-text {
  display: block; margin-top: 4px; font-size: 0.85rem;
  color: var(--accent2); font-style: italic;
}

/* Confession input */
.confession-zone { padding: 10px 0; position: relative; }
.confession-zone textarea {
  width: 100%; padding: 16px 18px; background: var(--bg2);
  border: 3px solid var(--purple); border-radius: var(--radius);
  color: var(--text); font-size: 1rem; resize: none;
  outline: none; font-family: 'Nunito', sans-serif;
  box-shadow: var(--shadow-sm); transition: border-color 0.3s, box-shadow 0.3s;
}
.confession-zone textarea:focus { border-color: var(--accent); box-shadow: var(--shadow-glow-pink); }
.confession-zone::after {
  content: '';
  position: absolute; bottom: 5px; left: 30px;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--purple);
}
.confession-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
}
.char-count { font-size: 0.75rem; color: var(--text2); }

/* Rating */
.rating-zone { text-align: center; padding: 8px 0; animation: fadeInUp 0.3s ease; }
.rating-confession {
  background: var(--bg2); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.rating-author {
  font-size: 0.7rem; color: var(--accent); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 4px;
}
.rating-text { font-size: 0.95rem; line-height: 1.4; }
.rate-label { font-size: 0.8rem; color: var(--text2); margin-bottom: 8px; }
.star-rating { display: flex; justify-content: center; gap: 8px; }
.star {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.12); background: var(--bg2);
  color: var(--text2); font-size: 1.2rem; font-weight: 900;
  font-family: 'Fredoka One', cursive;
  cursor: pointer; transition: all 0.15s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-sm);
}
.star:hover {
  transform: scale(1.2) rotate(-5deg);
  border-color: var(--accent); background: var(--accent); color: white;
  box-shadow: 0 0 20px rgba(255,92,147,0.4);
}
.star.active {
  animation: starBurst 0.4s ease;
  border-color: var(--accent); background: var(--accent); color: white;
}
.star[data-value="4"]:hover, .star[data-value="4"].active,
.star[data-value="5"]:hover, .star[data-value="5"].active {
  border-color: var(--green); background: var(--green);
  box-shadow: 0 0 20px rgba(38,222,129,0.4);
}
.rating-labels {
  display: flex; justify-content: space-between; padding: 6px 30px 0;
  font-size: 0.65rem; color: var(--text2); text-transform: uppercase; letter-spacing: 1px;
}

/* Vote timer bar */
.vote-timer-bar {
  width: 100%; height: 4px; background: var(--bg3);
  border-radius: 2px; margin-top: 10px; overflow: hidden;
}
.vote-timer-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px; width: 100%;
  transition: width linear;
}

/* Waiting */
.waiting-zone { text-align: center; padding: 15px 0; }
.waiting-zone p { color: var(--text2); font-size: 0.85rem; }
.pulse-loader {
  width: 35px; height: 35px; margin: 12px auto; border-radius: 50%;
  background: var(--accent); animation: pulseLoader 1s ease-in-out infinite;
}
@keyframes pulseLoader {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* Feed */
.confession-feed {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  gap: 5px; padding: 6px 0; min-height: 0;
}
.feed-item {
  padding: 12px 16px; background: var(--bg2); border-radius: var(--radius);
  border-left: 5px solid var(--accent); animation: slideBounceUp 0.4s ease both;
  box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.feed-item:hover { transform: translateX(4px); }
.feed-item.rating-high { border-left-color: var(--green); }
.feed-item.rating-mid { border-left-color: var(--yellow); }
.feed-item.rating-low { border-left-color: var(--red); }
.feed-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.feed-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 900; color: white; flex-shrink: 0;
}
.feed-avatar[data-player="0"] { background: var(--player1); }
.feed-avatar[data-player="1"] { background: var(--player2); }
.feed-avatar[data-player="2"] { background: var(--player3); }
.feed-avatar[data-player="3"] { background: var(--player4); }
.feed-author {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text2); flex: 1;
}
.feed-score { font-weight: 900; font-size: 0.75rem; font-family: 'Fredoka One', cursive; }
.feed-score.score-high { color: var(--green); }
.feed-score.score-mid { color: var(--yellow); }
.feed-score.score-low { color: var(--red); }
.feed-bubble {
  background: rgba(255,255,255,0.04); padding: 8px 12px;
  border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.4;
}

/* ─── OVERLAYS ─── */
.overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.overlay.hidden { display: none; }

.countdown-number {
  font-family: 'Fredoka One', cursive;
  font-size: 10rem; font-weight: 900; color: var(--yellow);
  animation: countSlam 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 0 40px rgba(254,211,48,0.6), 0 4px 0 var(--accent2), 0 8px 0 var(--accent);
}

/* ─── RESULT MODAL ─── */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-content {
  background: linear-gradient(145deg, var(--bg2), var(--bg3));
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg); padding: 35px; max-width: 420px;
  width: 90%; text-align: center; animation: bounceIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
}

.result-icon { font-size: 4.5rem; margin-bottom: 10px; animation: wobble 1s ease; }
.result-content h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem; font-weight: 900; letter-spacing: 3px;
}
.result-content h2.win { color: var(--green); text-shadow: 0 0 15px rgba(38,222,129,0.4); }
.result-content h2.lose { color: var(--accent); }
.result-subtitle { color: var(--text2); font-size: 0.85rem; margin-top: 4px; }

.placements-list {
  margin: 15px 0; display: flex; flex-direction: column; gap: 6px;
}
.placement-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm);
}
.placement-row.me { border: 1px solid var(--green); }
.p-place { font-weight: 900; font-size: 1rem; width: 24px; }
.p-place.gold { color: var(--gold); }
.p-place.silver { color: #c0c0c0; }
.p-place.bronze { color: #cd7f32; }
.p-info { flex: 1; text-align: left; }
.p-info .p-n { font-weight: 700; font-size: 0.85rem; }
.p-elo-change { font-weight: 700; font-size: 0.85rem; }
.p-elo-change.pos { color: var(--green); }
.p-elo-change.neg { color: var(--accent); }

.result-my-elo { margin: 12px 0 18px; }
.elo-change {
  font-size: 1.3rem; font-weight: 900;
  margin-right: 8px;
}
.elo-change.positive { color: var(--green); }
.elo-change.negative { color: var(--accent); }
.new-elo { font-size: 0.85rem; color: var(--text2); }

.result-history { margin-bottom: 12px; text-align: center; }
#toggleHistoryBtn {
  background: rgba(255,92,147,0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
#toggleHistoryBtn:hover {
  background: rgba(255,92,147,0.25);
}
.history-list {
  max-height: 200px; overflow-y: auto; margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px; text-align: left;
}
.history-item {
  padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--purple);
}
.history-item.history-passed { border-left-color: var(--green); }
.history-item.history-kept { border-left-color: var(--red); }
.history-prompt {
  font-size: 0.7rem; color: var(--accent2); font-style: italic;
  margin-bottom: 3px;
}
.history-answer {
  font-size: 0.8rem; color: var(--text); line-height: 1.3;
}
.history-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 3px; font-size: 0.65rem; color: var(--text2);
}
.history-score { font-weight: 700; }
.history-score.score-high { color: var(--green); }
.history-score.score-low { color: var(--red); }

.result-actions { display: flex; gap: 10px; }
.result-actions .btn { flex: 1; }

/* ─── TOAST ─── */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; background: var(--surface);
  border: 2px solid rgba(255,255,255,0.12); border-radius: var(--radius);
  color: var(--text); font-size: 0.85rem; font-weight: 600;
  animation: toastBounceIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 300px; box-shadow: var(--shadow-md);
}
.toast.error { border-left: 4px solid var(--red); }
.toast.success { border-left: 4px solid var(--green); }
.toast.info { border-left: 4px solid var(--blue); }
@keyframes toastBounceIn {
  0% { opacity: 0; transform: translateX(60px) scale(0.8); }
  50% { opacity: 1; transform: translateX(-8px) scale(1.02); }
  100% { transform: translateX(0) scale(1); }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── CARTOON ANIMATION LIBRARY ─── */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.08); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes elasticPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes wobble {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(5deg); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}
@keyframes jelly {
  0% { transform: scale(1, 1); }
  25% { transform: scale(0.9, 1.1); }
  50% { transform: scale(1.1, 0.9); }
  75% { transform: scale(0.95, 1.05); }
  100% { transform: scale(1, 1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(2deg); }
  75% { transform: translateY(-3px) rotate(-2deg); }
}
@keyframes slideBounceUp {
  0% { opacity: 0; transform: translateY(30px); }
  60% { opacity: 1; transform: translateY(-5px); }
  80% { transform: translateY(2px); }
  100% { transform: translateY(0); }
}
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-3px) rotate(-0.5deg); }
  30% { transform: translateX(3px) rotate(0.5deg); }
  50% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
  90% { transform: translateX(-1px); }
}
@keyframes scalePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes countSlam {
  0% { transform: scale(3) rotate(10deg); opacity: 0; }
  40% { transform: scale(0.85) rotate(-3deg); opacity: 1; }
  60% { transform: scale(1.1) rotate(1deg); }
  80% { transform: scale(0.97); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes starBurst {
  0% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.4) rotate(-10deg); }
  60% { transform: scale(0.9) rotate(5deg); }
  100% { transform: scale(1.1) rotate(0deg); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

/* ─── EXPLOSION OVERLAY ─── */
.explosion-content {
  text-align: center; animation: bounceIn 0.5s ease;
}
.explosion-icon {
  font-size: 5rem; animation: wobble 0.6s ease;
}
.explosion-title {
  font-family: 'Fredoka One', cursive; font-size: 3rem;
  color: var(--accent); text-shadow: 0 0 30px rgba(255,92,147,0.6),
  0 4px 0 #c44, 0 6px 0 #a33;
  animation: screenShake 0.4s ease;
}
.explosion-name {
  font-family: 'Fredoka One', cursive; font-size: 1.5rem;
  color: var(--text); margin-top: 10px;
}
.explosion-sub {
  font-size: 1rem; color: var(--text2); margin-top: 6px;
}

/* Screen shake class */
.screen-shake { animation: screenShake 0.5s ease !important; }

/* Feed verdict badge */
.feed-verdict {
  font-size: 0.55rem; font-weight: 900; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px;
}
.feed-verdict.feed-passed {
  background: rgba(38,222,129,0.2); color: var(--green); border: 1px solid var(--green);
}
.feed-verdict.feed-kept {
  background: rgba(252,92,101,0.2); color: var(--red); border: 1px solid var(--red);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 400px) {
  .logo h1 { font-size: 1.8rem; }
  .player-card { padding: 6px 4px; max-width: 110px; }
  .player-card .p-name { font-size: 0.6rem; }
  .heart { font-size: 0.9rem; }
  .timer-ring { width: 85px; height: 85px; }
  .timer-text { font-size: 1.6rem; }
  .star { width: 44px; height: 44px; font-size: 1rem; }
  .countdown-number { font-size: 7rem; }
}

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

.loading { text-align: center; padding: 30px; color: var(--text2); }

/* ─── LANGUAGE SELECTOR ─── */
.lang-selector {
  display: flex; align-items: center; gap: 14px;
  justify-content: center; padding: 8px 0;
}
.lang-label {
  font-size: 0.8rem; color: var(--text2); font-weight: 600;
}
.lang-option {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.85rem; cursor: pointer; user-select: none;
  padding: 6px 12px; background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.lang-option:has(input:checked) {
  border-color: var(--accent); background: rgba(255, 46, 99, 0.08);
}
.lang-option input { display: none; }
.lang-flag { font-size: 1.1rem; }

/* ─── PROMPT FLAG ─── */
.prompt-line {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px;
}
.prompt-flag { font-size: 1rem; }

/* ─── PLAY BUTTONS ─── */
.play-buttons { display: flex; flex-direction: column; gap: 10px; }
.play-row { display: flex; gap: 10px; }
.flex-btn { flex: 1; padding: 12px 10px; font-size: 0.85rem; letter-spacing: 0.5px; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-copy { font-size: 0.75rem; padding: 4px 10px; }
.upload-label { cursor: pointer; display: inline-block; }

/* ─── AVATAR WITH IMAGE ─── */
.avatar {
  overflow: hidden; background-size: cover; background-position: center;
}

/* ─── FRIENDS PANEL ─── */
.friends-section { display: flex; flex-direction: column; gap: 12px; }
.add-friend-bar {
  display: flex; gap: 8px;
}
.add-friend-bar input {
  flex: 1; padding: 10px 14px; background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; outline: none;
}
.add-friend-bar input:focus { border-color: var(--accent); }

.friend-requests {
  display: flex; flex-direction: column; gap: 6px;
}
.freq-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(255, 46, 99, 0.06);
  border: 1px solid rgba(255, 46, 99, 0.15); border-radius: var(--radius-sm);
  animation: slideBounceUp 0.4s ease;
}
.freq-item .freq-name { font-weight: 700; font-size: 0.85rem; }
.freq-item .freq-actions { display: flex; gap: 6px; }

.friends-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.friend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.04); border-radius: var(--radius-sm);
}
.friend-item .friend-avatar {
  width: 32px; height: 32px; border-radius: 50%; min-width: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.8rem; overflow: hidden;
  background-size: cover; background-position: center;
}
.friend-item .friend-name { flex: 1; font-weight: 600; font-size: 0.85rem; }
.friend-item .friend-elo { color: var(--gold); font-size: 0.75rem; font-weight: 700; }
.friend-status {
  width: 8px; height: 8px; border-radius: 50%;
}
.friend-status.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.friend-status.offline { background: #444; }

.friend-remove {
  background: transparent; border: none; color: var(--text2);
  cursor: pointer; font-size: 0.75rem; padding: 4px 8px;
  border-radius: 4px; transition: all 0.2s;
}
.friend-remove:hover { color: var(--accent); background: rgba(255,46,99,0.1); }

.no-friends { text-align: center; color: var(--text2); font-size: 0.85rem; padding: 20px; }

/* ─── PRIVATE LOBBY SCREEN ─── */
.plobby-container {
  width: 100%; max-width: 500px; margin: auto; padding: 20px;
  display: flex; flex-direction: column; height: 100vh;
}
.plobby-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0 15px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.plobby-code {
  display: flex; align-items: center; gap: 8px;
}
.code-label {
  font-size: 0.65rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1px;
}
.code-value {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem; font-weight: 900; letter-spacing: 4px;
  color: var(--accent);
}

.plobby-players {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 15px 0;
  justify-content: center;
}
.plobby-player {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 16px; background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-sm);
  min-width: 90px; position: relative;
}
.plobby-player.is-host { border-color: var(--gold); }
.plobby-player .pp-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.9rem; overflow: hidden;
  background-size: cover; background-position: center;
}
.plobby-player .pp-name {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.plobby-player .pp-elo { font-size: 0.65rem; color: var(--gold); }
.plobby-player .host-badge {
  position: absolute; top: -6px; right: -6px;
  font-size: 0.7rem; background: var(--gold); color: #000;
  padding: 1px 6px; border-radius: 10px; font-weight: 900;
}
.plobby-slot {
  display: flex; align-items: center; justify-content: center;
  width: 90px; height: 80px; border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); color: var(--text2); font-size: 0.75rem;
}

/* ─── LOBBY CHAT ─── */
.plobby-chat {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); margin: 10px 0; min-height: 0;
  overflow: hidden;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-msg {
  font-size: 0.8rem; line-height: 1.4;
  animation: fadeIn 0.2s ease;
}
.chat-msg .chat-author {
  font-weight: 700; color: var(--accent); margin-right: 6px;
}
.chat-msg.system-msg {
  color: var(--text2); font-style: italic; font-size: 0.75rem;
  text-align: center;
}
.chat-input-bar {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input-bar input {
  flex: 1; padding: 8px 12px; background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.85rem; outline: none;
}
.chat-input-bar input:focus { border-color: var(--accent); }

/* ─── LOBBY SETTINGS ─── */
.plobby-settings {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 0;
}
.plobby-setting {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-sm);
}
.setting-label {
  font-size: 0.8rem; font-weight: 700; color: var(--text2);
}
.setting-controls {
  display: flex; align-items: center; gap: 10px;
}
.setting-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg3); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.setting-btn:hover { background: var(--surface); border-color: var(--accent); }
.setting-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.setting-value {
  font-family: 'Fredoka One', cursive; font-size: 1rem;
  color: var(--accent); min-width: 40px; text-align: center;
}

.plobby-info {
  text-align: center; font-size: 0.78rem; color: var(--text2);
  padding: 8px 14px; background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  font-style: italic;
}

.plobby-actions {
  display: flex; gap: 10px; padding: 10px 0;
}
.plobby-actions .btn { flex: 1; }

/* ─── PROFILE MODAL ─── */
.profile-modal-content {
  text-align: left;
}
.profile-modal-content h2 { text-align: center; margin-bottom: 16px; }
.profile-avatar-section {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.profile-avatar-preview {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; overflow: hidden;
  background-size: cover; background-position: center;
}
.input-group label {
  display: block; font-size: 0.75rem; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}
.input-group textarea {
  width: 100%; padding: 10px 14px; background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; outline: none; resize: none;
  font-family: inherit;
}
.input-group textarea:focus { border-color: var(--accent); }
.input-group { margin-bottom: 10px; }
.profile-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.profile-actions .btn { flex: 1; }

/* ─── INVITE NOTIFICATION ─── */
.invite-notif {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 20px;
  z-index: 150; text-align: center;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  max-width: 320px; width: 90%;
}
.invite-notif.hidden { display: none; }
.invite-notif p { font-size: 0.9rem; margin-bottom: 10px; }
.invite-actions { display: flex; gap: 8px; justify-content: center; }
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── DECK SYSTEM ─── */
.decks-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.decks-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text2);
}
.decks-title-sm {
  font-size: 0.75rem; font-weight: 600; color: var(--text2);
  margin-right: 8px;
}
.decks-selected {
  display: flex; flex-wrap: nowrap; gap: 6px; min-height: 32px; align-items: center;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; padding-bottom: 4px;
}
.decks-placeholder {
  font-size: 0.78rem; color: var(--text2); font-style: italic;
}
.deck-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  color: var(--text); transition: all 0.2s;
  white-space: nowrap; flex-shrink: 0;
}
.deck-chip .chip-lang {
  font-size: 0.65rem; opacity: 0.7;
}
.deck-chip .chip-remove {
  background: none; border: none; color: var(--text2); cursor: pointer;
  font-size: 0.7rem; padding: 0 2px; line-height: 1;
}
.deck-chip .chip-remove:hover { color: var(--accent); }

.decks-hint {
  font-size: 0.72rem; color: var(--accent2); font-style: italic;
  margin-top: 6px; opacity: 0.8;
}
.deck-soft-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 1px 6px; border-radius: 4px; vertical-align: middle;
  background: rgba(38,222,129,0.15); color: var(--green);
  border: 1px solid rgba(38,222,129,0.3); margin-left: 4px;
}

/* Lobby deck section */
.plobby-decks {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Queue deck card */
.queue-deck-card {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  animation: fadeInUp 0.3s ease;
}
.queue-deck-card.readonly {
  opacity: 0.8;
}
.qdc-top {
  display: flex; align-items: center; gap: 10px;
}
.qdc-icon {
  font-size: 1.3rem; flex-shrink: 0;
}
.qdc-info {
  flex: 1; min-width: 0;
}
.qdc-selected {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qdc-hint {
  font-size: 0.68rem; color: var(--accent2); margin-top: 1px;
}

/* Deck browser modal */
.deck-browser-modal {
  max-width: 500px; text-align: left; max-height: 80vh;
  display: flex; flex-direction: column;
}
.deck-browser-modal h2 { text-align: center; margin-bottom: 12px; }
.deck-browser-filters {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;
}
.deck-browser-langs, .decks-lang-filter {
  display: flex; gap: 4px;
}
.deck-lang-btn {
  padding: 5px 14px; border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg); border-radius: 20px; color: var(--text2);
  font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.deck-lang-btn.active {
  background: var(--accent); border-color: var(--accent); color: white;
}
.deck-browser-tabs, .decks-panel-tabs {
  display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 3px;
}
.deck-tab {
  flex: 1; padding: 8px; border: none; background: transparent;
  color: var(--text2); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.deck-tab.active { background: var(--surface); color: var(--text); }
.deck-browser-list, .decks-panel-list {
  flex: 1; overflow-y: auto; max-height: 340px;
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px;
}
.deck-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s;
}
.deck-item:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.deck-item.selected { border-color: var(--accent); background: rgba(255,92,147,0.06); }
.deck-item-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: transparent; transition: all 0.2s;
  flex-shrink: 0;
}
.deck-item.selected .deck-item-check {
  background: var(--accent); border-color: var(--accent); color: white;
}
.deck-item-info { flex: 1; min-width: 0; }
.deck-item-name {
  font-size: 0.85rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-item-desc {
  font-size: 0.7rem; color: var(--text2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-item-meta {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.deck-item-lang {
  font-size: 0.65rem; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text2); font-weight: 700;
}
.deck-item-count {
  font-size: 0.65rem; color: var(--text2);
}
.deck-vote-area {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.deck-vote-btn {
  background: none; border: none; cursor: pointer; font-size: 0.9rem;
  padding: 2px 4px; transition: all 0.2s; opacity: 0.5;
}
.deck-vote-btn:hover { opacity: 1; transform: scale(1.2); }
.deck-vote-btn.voted { opacity: 1; }
.deck-vote-btn.up.voted { color: var(--green); }
.deck-vote-btn.down.voted { color: var(--red); }
.deck-vote-score {
  font-size: 0.7rem; font-weight: 700; min-width: 20px; text-align: center;
}
.deck-vote-score.positive { color: var(--green); }
.deck-vote-score.negative { color: var(--red); }

.deck-browser-difficulty {
  display: flex; gap: 4px;
}
.deck-diff-btn {
  padding: 5px 14px; border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg); border-radius: 20px; color: var(--text2);
  font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.deck-diff-btn.active {
  background: var(--green); border-color: var(--green); color: #000;
}

.deck-browser-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06);
}
.deck-selected-count { font-size: 0.8rem; color: var(--text2); font-weight: 600; }
.deck-browser-actions { display: flex; gap: 8px; }

/* Create deck modal */
.create-deck-modal { max-width: 460px; text-align: left; }
.create-deck-modal h2 { text-align: center; margin-bottom: 16px; }
.deck-select {
  width: 100%; padding: 10px 14px; background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; outline: none;
  font-family: inherit;
}
.deck-select option { background: var(--bg2); color: var(--text); }
.deck-cards-count {
  font-size: 0.75rem; color: var(--text2); text-align: right; margin-top: -6px; margin-bottom: 6px;
}

/* Decks panel in lobby */
.decks-panel-content {
  display: flex; flex-direction: column; gap: 10px;
}
.decks-panel-header {
  display: flex; align-items: center; justify-content: space-between;
}
.decks-panel-header h4 {
  font-size: 0.9rem; font-weight: 700;
}

/* ─── CHAT FAB (mobile) ─── */
.chat-fab {
  display: none; /* hidden on desktop */
  position: fixed; bottom: 20px; right: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border: none; color: white; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,92,147,0.4);
  animation: scalePulse 2s ease-in-out infinite;
}
.chat-close-bar {
  display: none; /* hidden on desktop */
  text-align: right; padding: 6px 10px 0;
}
.chat-close-btn {
  background: none; border: none; color: var(--text2); font-size: 1.3rem;
  cursor: pointer; padding: 4px 8px;
}
.chat-close-btn:hover { color: var(--text); }

/* ─── RESPONSIVE ADDITIONS ─── */
@media (max-width: 600px) {
  .chat-fab { display: flex; align-items: center; justify-content: center; }
  .chat-close-bar { display: block; }
  .plobby-chat {
    display: none; /* hidden by default on mobile */
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    height: 55vh; margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
    background: var(--bg2);
  }
  .plobby-chat.chat-open {
    display: flex;
  }
}
@media (max-width: 400px) {
  .plobby-player { min-width: 75px; padding: 10px 12px; }
  .plobby-player .pp-avatar { width: 30px; height: 30px; }
  .play-row { flex-direction: column; }
}

/* ─── INVENTORY BUTTON ─── */
.inventory-btn {
  position: relative; padding: 8px 12px; font-size: 1.1rem;
}
.inv-icon { font-size: 1.2rem; }
.inv-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent); color: #fff;
  font-size: 0.65rem; font-weight: 900;
  min-width: 18px; height: 18px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  line-height: 1;
}

/* ─── INVENTORY MODAL ─── */
.inventory-modal-content { max-width: 460px; text-align: center; }
.inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 16px;
}
.inv-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; background: var(--bg);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); transition: transform 0.2s;
}
.inv-item:hover { transform: translateY(-2px); }
.inv-emoji { font-size: 2rem; }
.inv-name { font-size: 0.75rem; font-weight: 700; }
.inv-count-badge {
  display: inline-block; padding: 2px 10px;
  background: rgba(255,255,255,0.08); border-radius: 20px;
  font-size: 0.7rem; font-weight: 900;
}
.inv-rarity {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.inv-empty {
  grid-column: 1 / -1; padding: 30px;
  color: var(--text2); font-size: 0.85rem; font-style: italic;
}

/* ─── SPIN BUTTON ─── */
.btn-spin {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--gold), var(--accent2));
  color: #000; font-family: 'Fredoka One', cursive;
  font-size: 1rem; letter-spacing: 2px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 15px rgba(255,195,18,0.3);
  transition: all 0.2s;
}
.btn-spin:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(255,195,18,0.4); }
.btn-spin:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-spin .btn-sub {
  font-size: 0.7rem; font-weight: 400; opacity: 0.8;
  font-family: 'Nunito', sans-serif; letter-spacing: 0;
}
.spin-icon { font-size: 1.3rem; }

/* ─── WHEEL MODAL ─── */
.wheel-modal-content { max-width: 380px; text-align: center; }
.wheel-container {
  position: relative; width: 300px; height: 300px; margin: 16px auto 0;
}
.wheel-pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  font-size: 1.8rem; color: var(--accent); z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
#wheelCanvas { border-radius: 50%; box-shadow: var(--shadow-md); }
.wheel-result {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 16px; animation: bounceIn 0.5s ease;
}
.wheel-result-emoji { font-size: 2.5rem; }
.wheel-result-name { font-size: 1.1rem; font-weight: 900; }
.wheel-result-rarity {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ─── IN-GAME ITEM BAR ─── */
.item-bar {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px; padding: 6px 0;
}
.item-use-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--bg2);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 20px; color: var(--text);
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.item-use-btn:hover { transform: scale(1.08); background: var(--surface); }
.item-use-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  background: rgba(255,255,255,0.1); border-radius: 50%;
  font-size: 0.65rem; font-weight: 900;
}

/* ─── PREMIUM DECK ─── */
.deck-premium-badge {
  display: inline-block; font-size: 0.6rem; margin-left: 4px;
  vertical-align: middle; opacity: 0.7;
}
.deck-item.locked { opacity: 0.5; }
.deck-item.locked:hover { opacity: 0.6; }
