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

:root {
  --bg: #0a0a1a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f0f0ff;
  --text-muted: rgba(240, 240, 255, 0.5);
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;

  --answer-a: #ef4444;
  --answer-b: #3b82f6;
  --answer-c: #f59e0b;
  --answer-d: #10b981;

  --glow-purple: 0 0 40px rgba(139, 92, 246, 0.4);
  --glow-pink: 0 0 40px rgba(236, 72, 153, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Outfit', 'Segoe UI', sans-serif;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== BACKGROUND ORBS ===== */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatOrb 8s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -150px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  bottom: -100px;
  right: -80px;
  animation-delay: 2s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-cyan);
  top: 40%;
  left: 60%;
  animation-delay: 4s;
}

@keyframes floatOrb {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(20px, -30px) scale(1.05);
  }
}

/* ===== STICKERS RAIN ===== */
.stickers-rain-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sticker-drop {
  position: absolute;
  top: -150px;
  opacity: 0.8;
  animation: fall linear forwards;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(120vh) rotate(var(--rot-dir, 360deg)); }
}

/* ===== GLASS PANEL ===== */
.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  z-index: 1;
}

/* ===== LANDING ===== */
.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px #f59e0b);
}

.logo-text {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 48px;
  font-weight: 300;
}

.tagline em {
  color: var(--accent-cyan);
  font-style: normal;
  font-weight: 600;
}

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.role-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  color: var(--text);
}

.role-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.host-card:hover {
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(139, 92, 246, 0.3);
  border-color: var(--accent-purple);
}

.player-card:hover {
  box-shadow: 0 20px 60px rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(6, 182, 212, 0.3);
  border-color: var(--accent-cyan);
}

.role-icon {
  font-size: 3rem;
}

.role-title {
  font-size: 1.4rem;
  font-weight: 800;
}

.role-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== PANEL ===== */
.panel {
  max-width: 560px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.panel-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group select option {
  background: #1a1a2e;
}

/* ===== BUTTONS ===== */
.primary-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
}

.primary-btn:hover:not(:disabled)::after {
  background: rgba(255, 255, 255, 0.1);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.secondary-btn {
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 0;
  transition: color 0.2s;
  display: block;
}

.back-btn:hover {
  color: var(--text);
}

.add-q-btn {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.add-q-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}

.import-row {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.import-btn {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.import-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
}

.import-hint {
  font-size: 0.8rem;
  min-height: 18px;
  margin-bottom: 8px;
  padding: 0 2px;
  transition: color 0.2s;
}

.import-hint.success {
  color: var(--accent-green);
}

.import-hint.error {
  color: #ef4444;
}

.finish-btn {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ===== QUESTIONS LIST ===== */
.questions-list {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-green);
  animation: slideIn 0.3s ease;
}

.q-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.q-item-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.q-item-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.q-item-del {
  background: none;
  border: none;
  color: rgba(239, 68, 68, 0.6);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.q-item-del:hover {
  color: #ef4444;
}

/* ===== LOBBY ===== */
.lobby-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  max-width: 800px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.room-code-display {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.room-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.room-code {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(245, 158, 11, 0.5));
}

.room-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.players-panel h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.players-list {
  list-style: none;
  min-height: 120px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.players-list li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
}

.players-list li::before {
  content: '👤';
  font-size: 1rem;
}

.empty-state {
  color: var(--text-muted);
  justify-content: center;
  font-size: 0.85rem !important;
}

.empty-state::before {
  display: none;
}

/* ===== PLAYER LOBBY ===== */
.lobby-center {
  position: relative;
  z-index: 1;
}

.waiting-panel {
  text-align: center;
  max-width: 420px;
  position: relative;
  padding: 48px 40px;
}

.waiting-panel h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.player-name-display {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

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

.pulse-ring {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--accent-green);
  animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
  from {
    transform: scale(1);
    opacity: 1;
  }

  to {
    transform: scale(2);
    opacity: 0;
  }
}

.dots-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dots-loader span {
  width: 10px;
  height: 10px;
  background: var(--accent-purple);
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite;
}

.dots-loader span:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--accent-pink);
}

.dots-loader span:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--accent-cyan);
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

/* ===== QUESTION SCREEN ===== */
#screen-host-question,
#screen-player-question {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
  background: linear-gradient(180deg, #0d0d25 0%, #0a0a1a 100%);
  overflow: hidden;
}

.question-header {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.player-header {
  background: rgba(6, 182, 212, 0.08);
  border-bottom-color: rgba(6, 182, 212, 0.2);
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.q-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.question-body {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.question-text-wrap {
  padding: 24px 28px;
  text-align: center;
  position: relative;
}

.host-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-block;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.answer-btn {
  padding: 20px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.answer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.2s;
}

.answer-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.answer-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.answer-btn.selected {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5), 0 8px 30px rgba(0, 0, 0, 0.4);
  transform: scale(1.03);
}

.answer-btn-a {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.answer-btn-b {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.answer-btn-c {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.answer-btn-d {
  background: linear-gradient(135deg, #10b981, #059669);
}

.answer-letter {
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* REVEAL STATES */
.answer-btn.correct {
  box-shadow: 0 0 0 4px #4ade80, 0 0 40px rgba(74, 222, 128, 0.5);
  animation: correctPulse 0.5s ease;
}

.answer-btn.wrong {
  opacity: 0.35;
  filter: grayscale(0.5);
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }

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

.waiting-answers-bar {
  width: 100%;
  padding: 12px 24px;
  background: rgba(139, 92, 246, 0.12);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  text-align: center;
  font-size: 0.95rem;
  color: var(--accent-purple);
  font-weight: 600;
  flex-shrink: 0;
}

/* Player answered overlay */
.answered-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  animation: fadeIn 0.3s ease;
}

.answered-msg {
  text-align: center;
}

.answered-icon {
  font-size: 3rem;
}

.answered-msg p {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 8px;
}

.small-text {
  font-size: 0.85rem !important;
  color: var(--text-muted);
  margin-top: 4px !important;
}

/* ===== RESULTS ===== */
.results-wrap {
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.results-header {
  text-align: center;
  padding: 24px;
}

.results-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.results-header p {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 0.9rem;
}

.leaderboard h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-list li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.leaderboard-list li:first-child {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.3);
}

.lb-rank {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

.lb-name {
  flex: 1;
  font-weight: 600;
}

.lb-score {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-cyan);
}

.lb-change {
  font-size: 0.85rem;
  color: var(--accent-green);
  font-weight: 600;
}

/* ===== PODIUM ===== */
.podium-wrap {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  width: 100%;
}

.podium-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
  }

  50% {
    filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.7));
  }
}

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.podium-avatar {
  font-size: 2.5rem;
}

.podium-name {
  font-size: 0.9rem;
  font-weight: 700;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.podium-block {
  width: 100px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.5);
}

.podium-1st .podium-block {
  height: 120px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.podium-2nd .podium-block {
  height: 80px;
  background: linear-gradient(180deg, #94a3b8, #64748b);
}

.podium-3rd .podium-block {
  height: 60px;
  background: linear-gradient(180deg, #cd7c3f, #a85d28);
}

.full-leaderboard {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.full-leaderboard li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  animation: slideIn 0.3s ease both;
}

.full-leaderboard li:nth-child(1) {
  animation-delay: 0.1s;
}

.full-leaderboard li:nth-child(2) {
  animation-delay: 0.2s;
}

.full-leaderboard li:nth-child(3) {
  animation-delay: 0.3s;
}

.full-leaderboard li:nth-child(4) {
  animation-delay: 0.4s;
}

.full-leaderboard li:nth-child(5) {
  animation-delay: 0.5s;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

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

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

.answers-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== MISC ===== */
.error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 640px) {

  /* Keep screens fixed to avoid scroll jumps, but add safe padding */
  .screen {
    justify-content: flex-start;
    padding: 24px 12px 32px;
  }

  /* Glass panels — tighter padding */
  .glass-panel {
    padding: 20px 16px;
  }

  /* ── Landing ── */
  .logo-icon {
    font-size: 2rem;
  }

  .logo-text {
    font-size: 2.2rem;
  }

  .tagline {
    font-size: 0.95rem;
    margin-bottom: 28px;
  }

  .role-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .role-card {
    padding: 24px 16px;
  }

  .role-icon {
    font-size: 2.2rem;
  }

  .role-title {
    font-size: 1.2rem;
  }

  /* ── Setup panel ── */
  .panel {
    max-width: 100%;
  }

  .panel-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  /* Buttons — big enough to tap comfortably (≥48px) */
  .primary-btn {
    padding: 16px;
    font-size: 1rem;
  }

  .secondary-btn {
    padding: 14px 16px;
  }

  .add-q-btn,
  .import-btn {
    padding: 14px 10px;
    font-size: 0.9rem;
  }

  .import-row {
    flex-direction: column;
  }

  /* ── Lobby ── */
  .lobby-wrap {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .room-code {
    font-size: 3.2rem;
  }

  /* ── Question screen ── */
  .question-header {
    padding: 10px 14px 8px;
  }

  .question-body {
    padding: 12px 10px;
    gap: 12px;
  }

  .question-text-wrap {
    padding: 16px 14px;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .host-badge {
    font-size: 0.72rem;
  }

  /* Answer buttons — full-width stack, large tap target */
  .answers-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .answer-btn {
    padding: 18px 14px;
    font-size: 1rem;
    min-height: 58px;
  }

  .answer-letter {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .waiting-answers-bar {
    font-size: 0.85rem;
    padding: 10px 14px;
  }

  /* ── Player lobby (Loading Screen) ── */
  .waiting-panel {
    padding: 40px 20px 32px;
    margin-top: 20px;
  }

  .waiting-panel h2 {
    font-size: 1.8rem;
  }

  .player-name-display {
    font-size: 1.4rem;
  }

  .pulse-ring {
    top: -25px;
    right: auto;
    left: 50%;
    margin-left: -25px;
    width: 50px;
    height: 50px;
  }

  /* ── Results ── */
  .results-wrap {
    gap: 14px;
  }

  .results-header h2 {
    font-size: 1.2rem;
  }

  /* ── Podium ── */
  .podium-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }

  .podium-block {
    width: 72px;
  }

  .podium-1st .podium-block {
    height: 90px;
  }

  .podium-2nd .podium-block {
    height: 60px;
  }

  .podium-3rd .podium-block {
    height: 44px;
  }

  .podium-avatar {
    font-size: 1.8rem;
  }

  .podium-name {
    font-size: 0.8rem;
    max-width: 72px;
  }

  /* ── Modal — full screen on mobile ── */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .answers-form {
    grid-template-columns: 1fr;
  }
}