/* ===========================
   Ilm Quest — Quiz Game Styles
   Inherits from Al-Asmaa design system
   =========================== */

/* --- Game Selection Page — Premium --- */

/* Stagger entrance — reuses createReveal keyframe from style.css */
.gs-stagger {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  animation: createReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 0.07s + 0.05s);
}

.gs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Card --- */
.gs-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(15, 19, 36, 0.85) 0%, rgba(10, 14, 26, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  font: inherit;
  color: inherit;
  text-align: left;
}

.gs-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.06) 50%, transparent 95%);
  transition: background 0.35s ease;
}

.gs-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.gs-card:hover {
  border-color: rgba(212, 162, 76, 0.25);
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.35),
    0 0 0 1px rgba(212, 162, 76, 0.08) inset;
}

.gs-card:hover::before {
  background: linear-gradient(90deg, transparent 5%, rgba(212,162,76,0.2) 30%, rgba(255,230,160,0.1) 50%, rgba(212,162,76,0.2) 70%, transparent 95%);
}

.gs-card:hover::after {
  opacity: 1;
  background: radial-gradient(ellipse 80% 100% at 0% 50%, rgba(212, 162, 76, 0.05), transparent 60%);
}

.gs-card:active {
  transform: scale(0.98) translateY(0);
  transition-duration: 0.08s;
}

.gs-card:hover .gs-card-arrow {
  transform: translateX(3px);
  color: var(--gold);
}

.gs-card:hover .gs-card-icon {
  border-color: rgba(212, 162, 76, 0.25);
  box-shadow: 0 0 16px rgba(212, 162, 76, 0.12);
}

/* Glow orb behind card */
.gs-card-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  filter: blur(50px);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.gs-glow-ruby { background: rgba(239, 68, 68, 0.25); }
.gs-glow-emerald { background: rgba(45, 212, 160, 0.25); }

.gs-card:hover .gs-card-glow { opacity: 1; }

/* Inner layout */
.gs-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  position: relative;
  z-index: 1;
}

/* Icon box */
.gs-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.gs-icon-classic {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.12);
  color: var(--ruby);
}

.gs-icon-ilmquest {
  background: rgba(45, 212, 160, 0.08);
  border: 1px solid rgba(45, 212, 160, 0.12);
  color: var(--emerald);
}

.gs-card:hover .gs-icon-classic {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.gs-card:hover .gs-icon-ilmquest {
  color: #5eead4;
  background: rgba(45, 212, 160, 0.12);
}

/* Body */
.gs-card-body {
  flex: 1;
  min-width: 0;
}

.gs-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  transition: color 0.2s;
}

.gs-card:hover .gs-card-title {
  color: var(--gold-light);
}

.gs-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags row */
.gs-card-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.gs-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gs-tag svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Arrow */
.gs-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* New ribbon */
.gs-card-new-ribbon {
  position: absolute;
  top: 10px;
  right: -28px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--emerald), #1a9a6a);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 32px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(45, 212, 160, 0.3);
}

/* Old IQ lobby styles removed — now uses lobby-* classes from style.css */

/* --- Room code click animation --- */
.iq-code-flash {
  animation: iqCodeFlash 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes iqCodeFlash {
  0% { box-shadow: 0 0 0 0 rgba(212,162,76,0.5); border-color: rgba(212,162,76,0.12); }
  30% { box-shadow: 0 0 30px 8px rgba(212,162,76,0.35), 0 0 60px 16px rgba(212,162,76,0.12); border-color: rgba(212,162,76,0.6); background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,162,76,0.18) 0%, transparent 70%), rgba(212,162,76,0.08); }
  100% { box-shadow: 0 0 0 0 rgba(212,162,76,0); border-color: rgba(212,162,76,0.12); }
}

.iq-code-pop {
  animation: iqCodePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes iqCodePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* --- Room Unavailable Screen --- */
.iq-unavail-wrapper {
  margin: auto;
  max-width: 420px;
  width: 100%;
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: iqUnavailIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iqUnavailIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.iq-unavail-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 162, 76, 0.06);
  border: 1.5px solid rgba(212, 162, 76, 0.15);
  color: var(--gold);
  animation: iqUnavailIconPulse 3s ease-in-out infinite;
}

@keyframes iqUnavailIconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 162, 76, 0.08); }
  50% { box-shadow: 0 0 30px 8px rgba(212, 162, 76, 0.12); }
}

.iq-unavail-icon svg {
  stroke: var(--gold);
}

.iq-unavail-title {
  font-family: var(--font-display), var(--font-latin), sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.iq-unavail-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 320px;
}

.iq-unavail-actions {
  margin-top: 12px;
}

.iq-unavail-btn-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-latin), sans-serif;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--gold), #e8c868);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 20px rgba(212, 162, 76, 0.25);
}

.iq-unavail-btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 162, 76, 0.4);
}

.iq-unavail-btn-home:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

/* Score target grid — premium style */
.iq-target-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.iq-target-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: rgba(15, 19, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font: inherit;
  color: inherit;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.iq-target-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(45, 212, 160, 0.06);
  margin-bottom: 2px;
  transition: all 0.3s ease;
}
.iq-target-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}
.iq-target-card.selected .iq-target-icon {
  background: rgba(45, 212, 160, 0.12);
}
.iq-target-card.selected .iq-target-icon svg {
  stroke: #5eead4;
}

.iq-target-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.iq-target-card:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.iq-target-card.selected {
  border-color: rgba(45, 212, 160, 0.45);
  background:
    linear-gradient(135deg, rgba(45, 212, 160, 0.1) 0%, rgba(15, 19, 36, 0.85) 60%, rgba(45, 212, 160, 0.04) 100%);
  box-shadow:
    0 0 0 1px rgba(45, 212, 160, 0.12) inset,
    0 2px 12px rgba(45, 212, 160, 0.1);
}

.iq-target-card.selected::before {
  opacity: 1;
  background: radial-gradient(ellipse 60% 100% at 0% 50%, rgba(45, 212, 160, 0.06), transparent 70%);
}

.iq-target-value {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.2s;
}

.iq-target-card.selected .iq-target-value {
  color: #5eead4;
}

.iq-target-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--emerald);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.iq-target-card.selected .iq-target-label {
  opacity: 1;
}

/* IQ Lobby now uses lobby-player-card from style.css */

/* --- Game Screen --- */

/* Stagger entrance for game elements */
.iq-stagger {
  opacity: 0;
  transform: translateY(18px);
  animation: iqEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--si, 0) * 0.08s + 0.05s);
}

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

#pageIlmQuestGame.page.active {
  justify-content: stretch;
}

.iq-game-container {
  max-width: 620px;
  margin: 0 !important;
  margin-inline: auto !important;
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Top bar — horizontal layout with quit + scoreboard */
.iq-topbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 6px;
  flex-shrink: 0;
}
.iq-topbar .iq-scoreboard {
  flex: 1;
  min-width: 0;
  max-height: 130px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 160, 0.15) transparent;
}

.iq-quit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid rgba(220, 50, 50, 0.30);
  background: rgba(220, 50, 50, 0.10);
  color: #e85555;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(220, 50, 50, 0.10), inset 0 1px 0 rgba(255,255,255,0.04);
}
.iq-quit-btn:hover {
  background: rgba(220, 50, 50, 0.18);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ff6b6b;
  box-shadow: 0 4px 20px rgba(220, 50, 50, 0.20), 0 0 24px rgba(220, 50, 50, 0.10);
  transform: scale(1.08);
}
.iq-quit-btn:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}

/* Centered game area */
.iq-game-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 24px;
  min-height: 0;
}

/* Keep answers above player status during reveal */
.iq-answers {
  position: relative;
  z-index: 2;
}
.iq-player-status {
  position: relative;
  z-index: 1;
}
.iq-source-block {
  position: relative;
  z-index: 1;
}

/* Timer */
.iq-timer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.iq-timer-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iq-timer-svg {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 18px rgba(45, 212, 160, 0.25));
}

.iq-timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 5;
}

.iq-timer-circle {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(45, 212, 160, 0.3));
}

.iq-timer-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.iq-timer-text {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.iq-timer-sub {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--emerald);
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Timer glow halo */
.iq-timer-area::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 160, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Timer critical state (< 20%) */
.iq-timer-critical {
  animation: iq-timer-shake 0.4s ease-in-out infinite;
}
.iq-timer-critical::before {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, transparent 70%) !important;
  animation: iq-emerald-glow 0.8s ease-in-out infinite;
}

/* Score bars — glassmorphism card */
.iq-scoreboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  min-width: 0;
  background: rgba(15, 19, 36, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(45, 212, 160, 0.10);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.iq-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.iq-score-player {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 80px;
  flex-shrink: 0;
}

.iq-score-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.iq-score-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60px;
}

.iq-streak-badge {
  font-size: 0.55rem;
  font-weight: 700;
  color: #f59e0b;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 1px 6px;
  border-radius: 20px;
  animation: iq-pulse 0.6s ease-in-out;
}

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

.iq-score-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}

.iq-score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(45, 212, 160, 0.15);
}

.iq-score-value {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 32px;
  text-align: right;
}

/* Highlight current player */
.iq-score-me {
  background: rgba(45, 212, 160, 0.06);
  border: 1px solid rgba(45, 212, 160, 0.1);
}
.iq-score-me .iq-score-name {
  color: #5eead4;
  font-weight: 600;
}

/* Leader star */
.iq-score-lead .iq-score-avatar::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b' stroke='none'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.86L12 17.77 5.82 21l1.18-6.86-5-4.87 6.91-1.01z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.iq-score-lead .iq-score-player {
  position: relative;
}

/* 2-column grid when 5+ players on wider screens */
@media (min-width: 420px) {
  .iq-scoreboard.iq-sb-multi {
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
  }
}

/* Question */
.iq-question-block {
  background:
    linear-gradient(135deg, rgba(18, 22, 42, 0.8) 0%, rgba(10, 14, 28, 0.9) 100%);
  border: 1px solid rgba(45, 212, 160, 0.1);
  border-radius: 14px;
  padding: 18px 18px 18px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(45, 212, 160, 0.04) inset;
}

/* Top emerald gradient line */
.iq-question-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 160, 0.25), transparent);
}

/* Left emerald accent bar */
.iq-question-block::after {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(to bottom, rgba(45, 212, 160, 0.4), rgba(45, 212, 160, 0.08));
}

.iq-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.iq-question-num {
  font-size: 0.72rem;
  color: #5eead4;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.iq-diff-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.iq-diff-debutant {
  background: rgba(45,212,160,0.12);
  color: var(--emerald);
}

.iq-diff-intermediaire {
  background: rgba(245,158,11,0.12);
  color: var(--amber-warm);
}

.iq-diff-avance {
  background: rgba(239,68,68,0.12);
  color: var(--ruby);
}

.iq-question-text {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.65;
}

/* Answer buttons — always 2x2 grid */
.iq-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 8px;
}

.iq-answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background:
    linear-gradient(135deg, rgba(18, 22, 42, 0.7) 0%, rgba(12, 16, 30, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-primary);
  font-size: 0.9rem;
  position: relative;
  min-height: 0;
}

.iq-answer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(ellipse 120% 100% at 0% 50%, rgba(45, 212, 160, 0.06), transparent 60%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.iq-answer-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.iq-answer-btn:active:not(:disabled) {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.iq-answer-btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.iq-answer-btn.iq-selected {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96,165,250,0.08);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.1);
  opacity: 1 !important;
  transform: none;
}

.iq-answer-btn.iq-correct {
  border-color: rgba(45, 212, 160, 0.5) !important;
  background: rgba(45,212,160,0.12) !important;
  opacity: 1 !important;
  animation: iq-correct-flash 0.6s ease;
  box-shadow: 0 0 24px rgba(45, 212, 160, 0.18) !important;
  transform: none !important;
}

.iq-answer-btn.iq-wrong {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239,68,68,0.08) !important;
  opacity: 0.7 !important;
  transform: none !important;
}

@keyframes iq-correct-flash {
  0% { box-shadow: 0 0 0 0 rgba(45,212,160,0.5); border-color: rgba(45,212,160,0.6); }
  50% { box-shadow: 0 0 28px 4px rgba(45,212,160,0.2); border-color: rgba(45,212,160,0.5); }
  100% { box-shadow: 0 0 18px 0 rgba(45,212,160,0.15); border-color: rgba(45,212,160,0.4); }
}

.iq-answer-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* Letter colors by position: A=emerald, B=gold, C=sapphire, D=violet */
.iq-answer-btn:nth-child(1) .iq-answer-letter {
  background: rgba(45, 212, 160, 0.1);
  border: 1px solid rgba(45, 212, 160, 0.15);
  color: #5eead4;
}
.iq-answer-btn:nth-child(2) .iq-answer-letter {
  background: rgba(212, 162, 76, 0.1);
  border: 1px solid rgba(212, 162, 76, 0.15);
  color: var(--gold);
}
.iq-answer-btn:nth-child(3) .iq-answer-letter {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.iq-answer-btn:nth-child(4) .iq-answer-letter {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.15);
  color: #a78bfa;
}

/* Hover glow matching letter color */
.iq-answer-btn:nth-child(1):hover:not(:disabled) {
  border-color: rgba(45, 212, 160, 0.2);
}
.iq-answer-btn:nth-child(1):hover:not(:disabled) .iq-answer-letter {
  background: rgba(45, 212, 160, 0.18);
  box-shadow: 0 0 10px rgba(45, 212, 160, 0.15);
}
.iq-answer-btn:nth-child(2):hover:not(:disabled) {
  border-color: rgba(212, 162, 76, 0.2);
}
.iq-answer-btn:nth-child(2):hover:not(:disabled) .iq-answer-letter {
  background: rgba(212, 162, 76, 0.18);
  box-shadow: 0 0 10px rgba(212, 162, 76, 0.15);
}
.iq-answer-btn:nth-child(3):hover:not(:disabled) {
  border-color: rgba(96, 165, 250, 0.2);
}
.iq-answer-btn:nth-child(3):hover:not(:disabled) .iq-answer-letter {
  background: rgba(96, 165, 250, 0.18);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.15);
}
.iq-answer-btn:nth-child(4):hover:not(:disabled) {
  border-color: rgba(167, 139, 250, 0.2);
}
.iq-answer-btn:nth-child(4):hover:not(:disabled) .iq-answer-letter {
  background: rgba(167, 139, 250, 0.18);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.15);
}

/* Correct answer letter override */
.iq-answer-btn.iq-correct .iq-answer-letter {
  background: #2dd4a0 !important;
  border-color: #2dd4a0 !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(45, 212, 160, 0.3) !important;
}

.iq-answer-text {
  flex: 1;
  line-height: 1.45;
}

/* Answer entrance animation */
.iq-ans-enter {
  opacity: 0;
  transform: translateY(12px);
  animation: iqAnsIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* --- Player leave popup --- */
.iq-leave-popup {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px) scale(0.9);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px 10px 12px;
  background: linear-gradient(160deg, rgba(18, 22, 44, 0.94), rgba(12, 16, 34, 0.96));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 40px;
  z-index: 6000;
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.iq-leave-popup-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.iq-leave-popup-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) scale(0.92);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.iq-leave-popup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.iq-leave-popup-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.iq-leave-popup-name {
  font-weight: 700;
  color: var(--text-primary);
}

/* Player answer status */
.iq-player-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(15, 19, 36, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-top: 2px;
}

.iq-status-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.3s ease;
}

.iq-status-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.iq-status-icon {
  font-size: 0.6rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
}

.iq-answered .iq-status-avatar {
  border-color: rgba(45, 212, 160, 0.5);
  box-shadow: 0 0 12px rgba(45, 212, 160, 0.25);
  animation: iq-answered-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.iq-waiting .iq-status-avatar {
  opacity: 0.4;
  animation: iq-waiting-pulse 2s ease-in-out infinite;
}

/* Dots animation for waiting */
.iq-dots-anim span {
  animation: iq-dot-blink 1.4s ease-in-out infinite;
}
.iq-dots-anim span:nth-child(2) { animation-delay: 0.2s; }
.iq-dots-anim span:nth-child(3) { animation-delay: 0.4s; }

.iq-status-icon-reveal {
  font-size: 0.88rem;
  font-weight: 700;
}

.iq-status-correct .iq-status-icon-reveal { color: var(--emerald); }
.iq-status-wrong .iq-status-icon-reveal { color: var(--ruby); }
.iq-status-timeout .iq-status-icon-reveal { color: var(--text-muted); }

.iq-revealed {
  animation: iq-flip-reveal 0.5s ease;
}

@keyframes iq-flip-reveal {
  0% { transform: scale(1); }
  40% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

/* Source block */
.iq-source-block {
  background:
    linear-gradient(135deg, rgba(18, 22, 42, 0.8) 0%, rgba(10, 14, 28, 0.9) 100%);
  border: 1px solid rgba(45, 212, 160, 0.15);
  border-radius: 14px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease 0.1s, padding 0.4s ease;
  margin-top: 2px;
}

.iq-source-block.iq-visible {
  max-height: 350px;
  opacity: 1;
  padding: 18px;
}

.iq-source-arabic {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  color: var(--gold-light);
  line-height: 2;
  text-align: center;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(212,162,76,0.04);
  border-radius: 10px;
  border: 1px solid rgba(212,162,76,0.06);
}

.iq-source-translation {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 10px;
}

.iq-source-ref {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
}

/* --- Results / Victory — Premium Redesign --- */

/* Background orbs */
.iq-res-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.iq-res-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: iqOrbFloat var(--orb-dur, 10s) ease-in-out var(--orb-delay, 0s) infinite alternate,
             iqOrbFadeIn 2s ease var(--orb-delay, 0s) forwards;
}

@keyframes iqOrbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 15px) scale(0.9); }
  100% { transform: translate(10px, -30px) scale(1.05); }
}

@keyframes iqOrbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Main wrapper */
.iq-res-wrapper {
  max-width: 520px;
  margin: auto;
  padding: 24px 20px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  width: 100%;
}

/* Glow backdrop */
.iq-res-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: iqGlowIn 1.5s ease 0.2s forwards;
  z-index: 0;
}

.iq-res-glow.victory {
  background: radial-gradient(circle, rgba(212, 162, 76, 0.3) 0%, rgba(212, 162, 76, 0.1) 35%, transparent 70%);
}

.iq-res-glow.tie {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.08) 35%, transparent 70%);
}

@keyframes iqGlowIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.3); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Banner */
.iq-res-banner {
  position: relative;
  padding: 40px 16px 28px;
  overflow: hidden;
  z-index: 1;
}

.iq-res-banner-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.iq-res-particle {
  position: absolute;
  border-radius: 50%;
  animation: iqParticleFloat var(--dur, 3s) ease-in-out infinite alternate;
  opacity: 0;
}

.iq-res-particle.diamond {
  border-radius: 2px;
  transform: rotate(45deg);
}

@keyframes iqParticleFloat {
  0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); }
  20% { opacity: var(--op, 0.6); }
  100% { opacity: 0; transform: translateY(var(--ty, -40px)) translateX(var(--tx, 0px)) scale(1.3) rotate(180deg); }
}

/* Banner icon */
.iq-res-banner-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  animation: iqIconPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.iq-res-banner-icon svg {
  width: 38px;
  height: 38px;
}

.iq-res-banner.victory .iq-res-banner-icon {
  background: linear-gradient(145deg, rgba(212, 162, 76, 0.25), rgba(212, 162, 76, 0.05));
  border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(212, 162, 76, 0.35), 0 0 80px rgba(212, 162, 76, 0.1);
}

.iq-res-banner.victory .iq-res-banner-icon svg {
  stroke: var(--gold-bright, #ffd866);
  filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.6));
}

.iq-res-banner.tie .iq-res-banner-icon {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
  border: 2px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 35px rgba(139, 92, 246, 0.25), 0 0 70px rgba(139, 92, 246, 0.08);
}

.iq-res-banner.tie .iq-res-banner-icon svg {
  stroke: #c4b5fd;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.5));
}

@keyframes iqIconPop {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  40% { opacity: 1; transform: scale(1.2) rotate(5deg); }
  70% { transform: scale(0.95) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Icon pulse rings */
.iq-res-banner.victory .iq-res-banner-icon::after,
.iq-res-banner.tie .iq-res-banner-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  opacity: 0;
  animation: iqIconPulse 2s ease-in-out 1s infinite;
}
.iq-res-banner.tie .iq-res-banner-icon::after { border-color: rgba(167, 139, 250, 0.6); }

.iq-res-banner.victory .iq-res-banner-icon::before,
.iq-res-banner.tie .iq-res-banner-icon::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  animation: iqIconPulse 2s ease-in-out 1.5s infinite;
}
.iq-res-banner.tie .iq-res-banner-icon::before { border-color: rgba(167, 139, 250, 0.4); }

@keyframes iqIconPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Banner title */
.iq-res-banner-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1.1;
  position: relative;
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes iqBannerTitle {
  0% { opacity: 0; transform: scale(0.2) translateY(30px); letter-spacing: 0.5em; }
  50% { transform: scale(1.08) translateY(-4px); }
  75% { transform: scale(0.98) translateY(1px); }
  100% { opacity: 1; transform: scale(1) translateY(0); letter-spacing: 0.12em; }
}

.iq-res-banner.victory .iq-res-banner-title {
  background: linear-gradient(135deg, var(--gold-bright, #ffd866), #fff6c2, var(--gold, #d4a24c), #ffe0a0, var(--gold-bright, #ffd866));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(212, 162, 76, 0.5));
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             iqGoldShift 3s ease-in-out 1.2s infinite;
}

.iq-res-banner.tie .iq-res-banner-title {
  background: linear-gradient(135deg, #a78bfa, #ddd6fe, #818cf8, #c4b5fd, #a78bfa);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.4));
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             iqGoldShift 4s ease-in-out 1.2s infinite;
}

@keyframes iqGoldShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Shimmer on victory title */
.iq-res-banner.victory .iq-res-banner-title::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: iqShimmer 2.5s ease-in-out 1.5s infinite;
}

@keyframes iqShimmer {
  0% { left: -100%; }
  100% { left: 300%; }
}

/* Banner subtitle */
.iq-res-banner-subtitle {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
  animation: iqFadeSlideIn 0.6s ease 0.7s both;
}
.iq-res-banner.victory .iq-res-banner-subtitle { color: var(--gold-light, #f0cc7a); opacity: 0.85; }
.iq-res-banner.tie .iq-res-banner-subtitle { color: #c4b5fd; opacity: 0.85; }

/* --- 2nd place (silver) --- */
.iq-res-glow.silver {
  background: radial-gradient(circle, rgba(192, 192, 192, 0.25) 0%, rgba(192, 192, 192, 0.08) 35%, transparent 70%);
}
.iq-res-banner.place-2 .iq-res-banner-icon {
  background: linear-gradient(145deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
  border: 2px solid rgba(192, 192, 192, 0.6);
  box-shadow: 0 0 35px rgba(192, 192, 192, 0.25), 0 0 70px rgba(192, 192, 192, 0.08);
}
.iq-res-banner.place-2 .iq-res-banner-icon svg {
  stroke: #d1d5db;
  filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.5));
}
.iq-res-banner.place-2 .iq-res-banner-icon::after,
.iq-res-banner.place-2 .iq-res-banner-icon::before {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: iqIconPulse 2s ease-in-out 1s infinite;
}
.iq-res-banner.place-2 .iq-res-banner-icon::after { inset: -6px; border: 1.5px solid rgba(192, 192, 192, 0.5); }
.iq-res-banner.place-2 .iq-res-banner-icon::before { inset: -12px; border: 1px solid rgba(192, 192, 192, 0.3); animation-delay: 1.5s; }
.iq-res-banner.place-2 .iq-res-banner-title {
  background: linear-gradient(135deg, #e5e7eb, #fff, #c0c0c0, #e5e7eb);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(192, 192, 192, 0.4));
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             iqGoldShift 3s ease-in-out 1.2s infinite;
}
.iq-res-banner.place-2 .iq-res-banner-subtitle { color: #d1d5db; opacity: 0.85; }

/* --- 3rd place (bronze) --- */
.iq-res-glow.bronze {
  background: radial-gradient(circle, rgba(205, 127, 50, 0.25) 0%, rgba(205, 127, 50, 0.08) 35%, transparent 70%);
}
.iq-res-banner.place-3 .iq-res-banner-icon {
  background: linear-gradient(145deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
  border: 2px solid rgba(205, 127, 50, 0.6);
  box-shadow: 0 0 35px rgba(205, 127, 50, 0.25), 0 0 70px rgba(205, 127, 50, 0.08);
}
.iq-res-banner.place-3 .iq-res-banner-icon svg {
  stroke: #e8a862;
  filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.5));
}
.iq-res-banner.place-3 .iq-res-banner-icon::after,
.iq-res-banner.place-3 .iq-res-banner-icon::before {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: iqIconPulse 2s ease-in-out 1s infinite;
}
.iq-res-banner.place-3 .iq-res-banner-icon::after { inset: -6px; border: 1.5px solid rgba(205, 127, 50, 0.5); }
.iq-res-banner.place-3 .iq-res-banner-icon::before { inset: -12px; border: 1px solid rgba(205, 127, 50, 0.3); animation-delay: 1.5s; }
.iq-res-banner.place-3 .iq-res-banner-title {
  background: linear-gradient(135deg, #e8a862, #ffd4a0, #cd7f32, #e8a862);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(205, 127, 50, 0.4));
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both,
             iqGoldShift 3s ease-in-out 1.2s infinite;
}
.iq-res-banner.place-3 .iq-res-banner-subtitle { color: #e8a862; opacity: 0.85; }

/* --- Defeat --- */
.iq-res-banner.defeat .iq-res-banner-icon {
  background: linear-gradient(145deg, rgba(107, 114, 128, 0.2), rgba(107, 114, 128, 0.05));
  border: 2px solid rgba(107, 114, 128, 0.4);
  box-shadow: 0 0 25px rgba(107, 114, 128, 0.15);
}
.iq-res-banner.defeat .iq-res-banner-icon svg {
  stroke: #9ca3af;
  filter: drop-shadow(0 0 4px rgba(107, 114, 128, 0.4));
}
.iq-res-banner.defeat .iq-res-banner-title {
  background: linear-gradient(135deg, #9ca3af, #d1d5db, #6b7280, #9ca3af);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(107, 114, 128, 0.3));
  animation: iqBannerTitle 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.iq-res-banner.defeat .iq-res-banner-subtitle { color: #9ca3af; opacity: 0.75; }

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

/* Stats bar */
.iq-res-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.9), rgba(20, 25, 48, 0.85));
  border: 1px solid var(--border-card);
  border-radius: var(--radius, 14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(212, 162, 76, 0.02);
  z-index: 1;
  animation: iqFadeSlideIn 0.6s ease 0.6s both;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.iq-res-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.iq-res-stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-bright, #ffd866);
  transition: color 0.3s ease;
}

.iq-res-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.iq-res-stat-divider {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--border-card), transparent);
}

/* Premium Podium */
.iq-res-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  min-height: 250px;
  padding: 20px 0 0;
  z-index: 1;
  perspective: 600px;
}

.iq-pod-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: iqPodRise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.iq-pod-col:nth-child(1) { animation-delay: 0.4s; }
.iq-pod-col:nth-child(2) { animation-delay: 0.15s; }
.iq-pod-col:nth-child(3) { animation-delay: 0.6s; }

@keyframes iqPodRise {
  0% { opacity: 0; transform: translateY(60px) scale(0.7); }
  60% { transform: translateY(-8px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Podium avatar */
.iq-pod-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iq-pod-avatar:hover { transform: scale(1.1); }

.iq-pod-col.first .iq-pod-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
  border: 3px solid var(--gold);
  box-shadow: 0 0 32px rgba(212, 162, 76, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: iqAvatarGlow 2s ease-in-out 1.2s infinite alternate;
}

.iq-pod-col.iq-pod-tied .iq-pod-avatar {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: iqAvatarTieGlow 2s ease-in-out 1.2s infinite alternate;
}

@keyframes iqAvatarGlow {
  0% { box-shadow: 0 0 24px rgba(212, 162, 76, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 44px rgba(212, 162, 76, 0.5), 0 6px 20px rgba(0, 0, 0, 0.35); }
}

@keyframes iqAvatarTieGlow {
  0% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.45), 0 6px 20px rgba(0, 0, 0, 0.35); }
}

/* Crown */
.iq-pod-crown {
  position: absolute;
  top: -20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: iqCrownBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
}

@keyframes iqCrownBounce {
  0% { opacity: 0; transform: translateY(-20px) scale(0); }
  60% { transform: translateY(3px) scale(1.2); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.iq-pod-crown svg {
  width: 24px;
  height: 24px;
  stroke: var(--gold-bright, #ffd866);
  fill: none;
  filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.7));
}

/* Podium text */
.iq-pod-name {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iq-pod-col.first .iq-pod-name { color: var(--gold-bright, #ffd866); }
.iq-pod-col.iq-pod-tied .iq-pod-name { color: #c4b5fd; }

.iq-pod-score {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Podium bars */
.iq-pod-bar {
  width: 86px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  position: relative;
  overflow: hidden;
  animation: iqBarGrow 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes iqBarGrow {
  0% { max-height: 0; opacity: 0; }
  100% { max-height: 200px; opacity: 1; }
}

.iq-pod-col.first .iq-pod-bar {
  height: 110px;
  width: 106px;
  background: linear-gradient(to top, rgba(212, 162, 76, 0.25), rgba(212, 162, 76, 0.03));
  border: 1px solid var(--gold);
  border-bottom: none;
  color: var(--gold);
  box-shadow: 0 0 28px rgba(212, 162, 76, 0.15);
}

.iq-pod-col.second .iq-pod-bar {
  height: 76px;
  background: linear-gradient(to top, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.02));
  border: 1px solid rgba(192, 192, 192, 0.25);
  border-bottom: none;
  color: rgba(192, 192, 192, 0.6);
}

.iq-pod-col.third .iq-pod-bar {
  height: 52px;
  background: linear-gradient(to top, rgba(180, 120, 60, 0.1), rgba(180, 120, 60, 0.02));
  border: 1px solid rgba(180, 120, 60, 0.22);
  border-bottom: none;
  color: rgba(180, 120, 60, 0.6);
}

.iq-pod-col.iq-pod-tied .iq-pod-bar {
  height: 88px !important;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.03));
  border-color: rgba(167, 139, 250, 0.35);
  color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Leaderboard */
.iq-res-leaderboard {
  z-index: 1;
  animation: iqFadeSlideIn 0.6s ease 0.8s both;
}

.iq-res-lb-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold, #d4a24c);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-align: left;
}

.iq-res-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 19, 36, 0.85), rgba(20, 25, 48, 0.8));
  border: 1px solid var(--border-card, rgba(255,255,255,0.06));
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 8px;
  animation: iqFadeSlideIn 0.4s ease both;
  animation-delay: calc(var(--row-index, 0) * 0.08s + 0.9s);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.iq-res-lb-row:hover {
  border-color: rgba(212, 162, 76, 0.15);
  background: linear-gradient(135deg, rgba(18, 22, 42, 0.9), rgba(24, 30, 56, 0.85));
  transform: translateX(4px);
}

.iq-res-lb-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: #5eead4;
  background: rgba(45, 212, 160, 0.08);
  border: 1px solid rgba(45, 212, 160, 0.12);
  flex-shrink: 0;
}

.iq-res-lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.iq-res-lb-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}

.iq-res-lb-score {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold, #d4a24c);
  font-size: 0.88rem;
}

/* Action buttons */
.iq-res-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
  animation: iqFadeSlideIn 0.6s ease 0.85s both;
}

.iq-res-btn-replay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius, 14px);
  background: linear-gradient(135deg, #2dd4a0, #1a9a6a);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 24px rgba(45, 212, 160, 0.3);
  position: relative;
  overflow: hidden;
}

.iq-res-btn-replay::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.iq-res-btn-replay:hover::before { left: 100%; }

.iq-res-btn-replay:hover {
  background: linear-gradient(135deg, #5eead4, #2dd4a0);
  box-shadow: 0 8px 32px rgba(45, 212, 160, 0.45);
  transform: translateY(-3px);
}

.iq-res-btn-replay:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 12px rgba(45, 212, 160, 0.3);
}

.iq-res-btn-home {
  width: 100%;
  padding: 14px 24px;
  border: 1px solid var(--border-card, rgba(255,255,255,0.06));
  border-radius: var(--radius, 14px);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.iq-res-btn-home:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 162, 76, 0.15);
  color: var(--text-primary);
}

/* Confetti canvas */
.iq-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}


/* --- Geometric Background Particles --- */
.iq-geo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.iq-geo-shape {
  position: absolute;
  border: 1px solid rgba(45, 212, 160, 0.1);
  opacity: 0.5;
  animation: iq-float 20s ease-in-out infinite;
}

.iq-geo-shape:nth-child(1) {
  width: 60px; height: 60px;
  top: 10%; left: 5%;
  transform: rotate(45deg);
  animation-delay: 0s;
}

.iq-geo-shape:nth-child(2) {
  width: 40px; height: 40px;
  top: 30%; right: 10%;
  border-radius: 50%;
  animation-delay: -5s;
}

.iq-geo-shape:nth-child(3) {
  width: 80px; height: 80px;
  bottom: 20%; left: 15%;
  transform: rotate(30deg);
  animation-delay: -10s;
}

.iq-geo-shape:nth-child(4) {
  width: 50px; height: 50px;
  top: 60%; right: 20%;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: rgba(45, 212, 160, 0.03);
  border: none;
  animation-delay: -7s;
}

.iq-geo-shape:nth-child(5) {
  width: 35px; height: 35px;
  top: 80%; left: 50%;
  transform: rotate(60deg);
  animation-delay: -3s;
}

.iq-geo-shape:nth-child(6) {
  width: 70px; height: 70px;
  top: 5%; right: 30%;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background: rgba(45, 212, 160, 0.04);
  border: none;
  animation-delay: -12s;
}

@keyframes iq-float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 45deg)); }
  25% { transform: translateY(-15px) rotate(calc(var(--rot, 45deg) + 5deg)); }
  50% { transform: translateY(-5px) rotate(calc(var(--rot, 45deg) - 3deg)); }
  75% { transform: translateY(-20px) rotate(calc(var(--rot, 45deg) + 8deg)); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .iq-timer-svg { width: 88px; height: 88px; }
  .iq-timer-text { font-size: 1.6rem; }
  .iq-timer-sub { font-size: 0.55rem; }
  .iq-timer-center { gap: 1px; }
  .iq-question-text { font-size: 1rem; }
  .iq-answer-btn { padding: 12px 12px; font-size: 0.85rem; gap: 8px; }
  .iq-answer-letter { width: 28px; height: 28px; font-size: 0.72rem; }
  .iq-room-code { font-size: 2rem; letter-spacing: 4px; }
  .iq-res-banner-title { font-size: 1.4rem; }
  .iq-pod-avatar { width: 40px; height: 40px; font-size: 0.85rem; }
  .iq-pod-col.first .iq-pod-avatar { width: 48px; height: 48px; }
  .iq-res-lb-row { min-width: 70px; }
  .iq-diff-grid { grid-template-columns: 1fr 1fr; }
  /* Compact score on small screens */
  .iq-scoreboard { padding: 6px 8px; }
  .iq-topbar .iq-scoreboard { max-height: 100px; }
  .iq-scoreboard.iq-sb-multi { grid-template-columns: 1fr; gap: 2px; }
  .iq-score-player { width: 64px; }
  .iq-score-name { max-width: 40px; font-size: 0.62rem; }
  .iq-score-avatar { width: 22px; height: 22px; font-size: 0.48rem; }
  .iq-score-value { font-size: 0.65rem; min-width: 26px; }
  .iq-status-avatar { width: 30px; height: 30px; font-size: 0.55rem; }
  .iq-player-status { gap: 6px; padding: 8px 10px; }
  .iq-game-center { gap: 10px; }
}

@media (max-width: 380px) {
  .iq-answers { gap: 6px; }
  .iq-answer-btn { padding: 10px 10px; font-size: 0.82rem; gap: 6px; }
  .iq-answer-letter { width: 24px; height: 24px; font-size: 0.68rem; border-radius: 8px; }
}

@media (min-width: 768px) {
  .iq-game-container { padding: 20px 24px; max-width: 680px; }
  .iq-question-text { font-size: 1.18rem; }
  .iq-answers { gap: 10px; }
  .iq-timer-svg { width: 120px; height: 120px; }
  .iq-timer-text { font-size: 2.2rem; }
  .iq-score-avatar { width: 30px; height: 30px; font-size: 0.58rem; }
  .iq-score-name { max-width: 65px; font-size: 0.78rem; }
  .iq-score-player { width: 90px; }
  .iq-status-avatar { width: 38px; height: 38px; font-size: 0.65rem; }
}

@media (min-width: 1024px) {
  .iq-game-container { max-width: 740px; }
  .iq-lobby-container { max-width: 600px; }
  .iq-res-wrapper { max-width: 600px; }
}

/* --- Browse modal: game type tags --- */
.browse-tag-iq {
  background: rgba(45, 212, 160, 0.12) !important;
  border-color: rgba(45, 212, 160, 0.2) !important;
  color: var(--emerald) !important;
  font-weight: 700;
}

.browse-tag-classic {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.18) !important;
  color: var(--ruby) !important;
  font-weight: 700;
}

/* =====================================================
   ILM QUEST — CREATE PAGE: Emerald Branding
   Scoped under #pageIlmQuestCreate
   ===================================================== */

/* Header — emerald border/glow */
#pageIlmQuestCreate .create-header {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.06) 0%, rgba(10, 14, 30, 0.8) 60%, rgba(45, 212, 160, 0.03) 100%);
  border-color: rgba(45, 212, 160, 0.12);
}
#pageIlmQuestCreate .create-header::before {
  background: linear-gradient(90deg, transparent 5%, rgba(45, 212, 160, 0.3) 30%, rgba(94, 234, 212, 0.15) 50%, rgba(45, 212, 160, 0.3) 70%, transparent 95%);
}
#pageIlmQuestCreate .create-header-badge {
  background: rgba(45, 212, 160, 0.1);
  border-color: rgba(45, 212, 160, 0.15);
  color: var(--emerald);
}

/* Pseudo preview — emerald accent */
#pageIlmQuestCreate .create-pseudo-avatar {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.15), rgba(45, 212, 160, 0.05));
  border-color: rgba(45, 212, 160, 0.25);
  color: #5eead4;
}
#pageIlmQuestCreate .create-pseudo-preview {
  border-color: rgba(45, 212, 160, 0.08);
}
#pageIlmQuestCreate .create-pseudo-preview:hover {
  border-color: rgba(45, 212, 160, 0.18);
}

/* Section titles — emerald */
#pageIlmQuestCreate .create-section-title {
  color: #5eead4;
}
#pageIlmQuestCreate .create-section-title::before {
  background: linear-gradient(to bottom, #5eead4, #1a9a6a);
  box-shadow: 0 0 6px rgba(45, 212, 160, 0.25);
}

/* Difficulty cards .selected — emerald */
#pageIlmQuestCreate .create-diff-card.selected {
  border-color: rgba(45, 212, 160, 0.45);
  background:
    linear-gradient(135deg, rgba(45, 212, 160, 0.1) 0%, rgba(15, 19, 36, 0.85) 60%, rgba(45, 212, 160, 0.04) 100%);
  box-shadow:
    0 0 0 1px rgba(45, 212, 160, 0.12) inset,
    0 2px 12px rgba(45, 212, 160, 0.1);
}
#pageIlmQuestCreate .create-diff-card.selected::before {
  background: radial-gradient(ellipse 60% 100% at 0% 50%, rgba(45, 212, 160, 0.06), transparent 70%);
}
#pageIlmQuestCreate .create-diff-card.selected .create-diff-icon {
  color: var(--emerald);
  background: rgba(45, 212, 160, 0.1);
  border-color: rgba(45, 212, 160, 0.18);
  box-shadow: 0 0 10px rgba(45, 212, 160, 0.12);
}
#pageIlmQuestCreate .create-diff-card.selected .create-diff-name {
  color: #5eead4;
}
#pageIlmQuestCreate .create-diff-card.selected .create-diff-timer {
  color: var(--emerald);
}

/* Stepper — emerald accent */
#pageIlmQuestCreate .stepper-btn:hover {
  border-color: rgba(45, 212, 160, 0.3);
  color: #5eead4;
  background: rgba(45, 212, 160, 0.08);
}
#pageIlmQuestCreate .stepper-value {
  color: #5eead4;
}

/* Visibility cards .selected — emerald */
#pageIlmQuestCreate .create-vis-card.selected {
  border-color: rgba(45, 212, 160, 0.4);
  background: linear-gradient(160deg, rgba(45, 212, 160, 0.1) 0%, rgba(15, 19, 36, 0.9) 100%);
  box-shadow:
    0 0 0 1px rgba(45, 212, 160, 0.1) inset,
    0 4px 20px rgba(45, 212, 160, 0.08);
}
#pageIlmQuestCreate .create-vis-card.selected::before {
  background: radial-gradient(ellipse 90% 70% at 50% 0%, rgba(45, 212, 160, 0.1), transparent 70%);
}
#pageIlmQuestCreate .create-vis-card.selected::after {
  background: linear-gradient(90deg, transparent 5%, rgba(45, 212, 160, 0.3) 30%, rgba(94, 234, 212, 0.15) 50%, rgba(45, 212, 160, 0.3) 70%, transparent 95%);
}
#pageIlmQuestCreate .create-vis-card.selected .create-vis-icon-wrap {
  background: rgba(45, 212, 160, 0.1);
  border-color: rgba(45, 212, 160, 0.2);
  color: var(--emerald);
  box-shadow: 0 0 12px rgba(45, 212, 160, 0.15);
}
#pageIlmQuestCreate .create-vis-card.selected .create-vis-name {
  color: #5eead4;
}
#pageIlmQuestCreate .create-vis-card.selected .create-vis-desc {
  color: #5eead4;
}

/* Create button — emerald gradient */
#pageIlmQuestCreate .btn-primary,
#pageIlmQuestCreate .create-btn {
  background: linear-gradient(135deg, #2dd4a0, #1a9a6a);
  box-shadow: 0 4px 20px rgba(45, 212, 160, 0.25);
  color: #fff;
}
#pageIlmQuestCreate .btn-primary:hover,
#pageIlmQuestCreate .create-btn:hover {
  background: linear-gradient(135deg, #5eead4, #2dd4a0);
  box-shadow: 0 6px 28px rgba(45, 212, 160, 0.4);
}

/* =====================================================
   ILM QUEST — LOBBY PAGE: Emerald Refinements
   Scoped under #pageIlmQuestLobby
   ===================================================== */

/* Config badges — larger */
#pageIlmQuestLobby .lobby-badge {
  font-size: 0.72rem;
  padding: 5px 12px;
}

/* Player card hover — emerald glow */
#pageIlmQuestLobby .lobby-player-card:hover {
  border-color: rgba(45, 212, 160, 0.15);
  box-shadow: 0 0 16px rgba(45, 212, 160, 0.08);
}

/* Start button — emerald */
#pageIlmQuestLobby .lobby-start-btn {
  background: linear-gradient(135deg, #2dd4a0, #1a9a6a);
  box-shadow: 0 4px 24px rgba(45, 212, 160, 0.3);
  color: #fff;
}
#pageIlmQuestLobby .lobby-start-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5eead4, #2dd4a0);
  box-shadow: 0 8px 32px rgba(45, 212, 160, 0.45);
}
#pageIlmQuestLobby .lobby-start-btn:disabled {
  background: rgba(45, 212, 160, 0.15);
  box-shadow: none;
}
#pageIlmQuestLobby .lobby-start-btn-glow {
  background: radial-gradient(circle, rgba(45, 212, 160, 0.25), transparent 70%);
}

/* Start hint */
#pageIlmQuestLobby .lobby-start-hint {
  color: rgba(94, 234, 212, 0.5);
}

/* Waiting text — cleaner */
#pageIlmQuestLobby .lobby-waiting-text {
  color: rgba(94, 234, 212, 0.6);
}

/* =====================================================
   ILM QUEST — GLOBAL ANIMATIONS
   ===================================================== */

@keyframes iq-emerald-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes iq-answered-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes iq-waiting-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.05); }
}

@keyframes iq-timer-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

@keyframes iq-dot-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes iq-score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ======================================================================
   QUIT BUTTONS — Red premium overrides
   ====================================================================== */

/* Preserve sizing from .btn-back / .lobby-back-btn while inheriting red colors */
.btn-back.iq-quit-btn { width: 40px; height: 40px; border-radius: 12px; }
.lobby-back-btn.iq-quit-btn { width: 42px; height: 42px; border-radius: 14px; backdrop-filter: blur(8px); }

/* Results page "Menu principal" — full-width text button */
.iq-res-btn-home.iq-quit-btn {
  width: 100%;
  height: auto;
  padding: 14px 24px;
  border-radius: var(--radius, 14px);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
}
