:root {
  --bg-dark: #0f172a;
  --bg-gradient: radial-gradient(circle at 50% -20%, #1e1b4b 0%, #0f172a 70%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #f8fafc;
  --muted: #94a3b8;
  --radius: 20px;
  --font: 'Outfit', sans-serif;
}

/* Base resets specifically for realtime panels */
#quizRealTimeContainer * {
  box-sizing: border-box;
}

/* In the simulator, this was body. Providing a modifier class for the app container */
body.realtime-active {
  font-family: var(--font) !important;
  background: var(--bg-gradient) !important;
  background-color: var(--bg-dark) !important;
  color: var(--text) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Explicit exception to restore FontAwesome visibility against the !important font override */
body.realtime-active i[class*="fa-"],
body.realtime-active [class*="fa-solid"],
body.realtime-active [class*="fas"],
body.realtime-active [class*="fab"],
body.realtime-active [class*="far"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
}

/* Goal badge selection for showcase */
.goals-badges-track .goal-badge {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.goals-badges-track .goal-badge.goal-badge--selected {
  outline: 2px solid var(--bs-warning, #ffc107);
  outline-offset: 2px;
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(255,193,7,.25);
}

#quizRealTimeContainer h1,
#quizRealTimeContainer h2,
#quizRealTimeContainer h3 {
  font-weight: 900;
  letter-spacing: -0.02em;
}

#quizRealTimeContainer h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Layout Components */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex-grow: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
}

@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* View Management */
.view {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.view.active {
  display: block;
}

#viewWaiting.active {
  display: flex;
  flex-direction: column;
  min-height: 65vh;
  justify-content: center;
}

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

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

/* Forms & Inputs */
.input-group {
  /* display: flex; */
  /* flex-direction: column; */
  /* gap: 8px; */
  /* margin-bottom: 16px; */
}

#quizRealTimeContainer label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#quizRealTimeContainer input,
#quizRealTimeContainer select,
#quizRealTimeContainer textarea {
  font-family: var(--font);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

#quizRealTimeContainer input:focus,
#quizRealTimeContainer select:focus,
#quizRealTimeContainer textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#quizRealTimeContainer textarea {
  min-height: 100px;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
#quizRealTimeContainer .btn {
  font-family: var(--font);
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

#quizRealTimeContainer .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#quizRealTimeContainer .btn:hover::after {
  opacity: 1;
}

#quizRealTimeContainer .btn:active {
  transform: scale(0.98);
}

#quizRealTimeContainer .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#quizRealTimeContainer .btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#quizRealTimeContainer .btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#quizRealTimeContainer .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--glass-border);
}

#quizRealTimeContainer .btn-block {
  width: 100%;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.badge.connected {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.host {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Header */
.realtime-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

/* Players Grid */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.player-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s;
  color: var(--text);
}

.player-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.player-info {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-weight: 700;
  font-size: 1rem;
}

.player-status {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Playground */
.playground-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.realtime-goal-hud-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  flex: 0 0 100%;
}

.realtime-goal-hud-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Circular Countdown Timer */
.timer-circle-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.timer-circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.35));
  transition: filter 0.4s ease;
}

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

.timer-circle-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s ease;
}

.timer-circle-wrap .timer-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s, text-shadow 0.4s;
  line-height: 1;
}

/* Urgent state (last 3 seconds) */
.timer-circle-wrap.urgent .timer-circle-svg {
  filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.6));
}

.timer-circle-wrap.urgent .timer-circle-progress {
  stroke: var(--danger);
}

.timer-circle-wrap.urgent .timer-text {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  animation: timerPulseText 0.8s infinite alternate;
}

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

  to {
    transform: scale(1.12);
  }
}

.question-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
  border: 1px solid var(--glass-border);
}

.question-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.3;
  color: var(--text);
}

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

.answer-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.answer-key {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--muted);
}

.answer-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.answer-btn.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
}

.answer-btn.selected .answer-key {
  background: var(--primary);
  color: white;
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 25px 10px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes wrongShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

.answer-btn.correct {
  background: rgba(16, 185, 129, 0.3) !important;
  border-color: var(--success) !important;
  animation: correctPulse 1.5s ease-out infinite;
  z-index: 10;
}

.answer-btn.correct .answer-key {
  background: var(--success);
  color: white;
}

.answer-btn.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  animation: wrongShake 0.4s ease-in-out;
  opacity: 0.8 !important;
}

.answer-btn.wrong .answer-key {
  background: #ef4444;
  color: white;
}

.answer-btn.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Side Panel / Logs */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.status-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 16px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.status-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.console-log {
  background: #020617;
  border-radius: 16px;
  padding: 16px;
  flex-grow: 1;
  height: 400px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #a5b4fc;
  border: 1px solid var(--glass-border);
}

.log-entry {
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.log-time {
  color: #64748b;
  margin-right: 8px;
  font-size: 0.7rem;
}

.log-event {
  color: #38bdf8;
  font-weight: 700;
}

.log-data {
  color: #94a3b8;
  margin-top: 4px;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Advanced Settings Toggle */
.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 16px;
  transition: color 0.2s;
}

.advanced-toggle:hover {
  color: white;
}

.advanced-settings {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  animation: fadeIn 0.3s;
}

.advanced-settings.open {
  display: block;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}

.modal-overlay.open {
  display: grid;
  animation: fadeIn 0.3s;
}

body.realtime-active .modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.final-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 8px;
}

.final-stat {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  text-align: center;
}

.final-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.final-stat-value {
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

.solo-performance-card {
  margin: 16px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(87, 45, 13, 0.95), rgba(163, 88, 44, 0.9));
  overflow: hidden;
}

.solo-performance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.solo-performance-main {
  margin: 14px 16px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
  padding: 14px 12px;
}

.solo-performance-score-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.solo-performance-score-value {
  margin-top: 4px;
  font-size: 2.75rem;
  line-height: 1;
  font-weight: 900;
  color: #ffa57c;
}

.solo-performance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 16px 16px;
}

.solo-performance-kpi {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  text-align: center;
}

.solo-performance-kpi-label {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
}

.solo-performance-kpi-value {
  margin-top: 4px;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.1;
  color: #ff6b1a;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.rank-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
}

.ranking-item:nth-child(1) .rank-number {
  color: #fbbf24;
}

/* Gold */
.ranking-item:nth-child(2) .rank-number {
  color: #94a3b8;
}

/* Silver */
.ranking-item:nth-child(3) .rank-number {
  color: #b45309;
}

/* Bronze */

.rank-score {
  font-weight: 900;
  font-size: 1.2rem;
  margin-left: auto;
  color: var(--primary);
}

.host-controls {
  display: none;
  margin-top: 24px;
  padding: 24px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.host-controls.active {
  display: block;
  animation: fadeIn 0.4s;
}

.realtime-session-info-btn {
  position: absolute !important;
  left: 16px;
  bottom: 88px;
  z-index: 1012;
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  padding: 0 !important;
  opacity: 0.84;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.realtime-session-info-btn i {
  font-size: 0.95rem;
}

.session-info-modal-content {
  width: min(680px, 94vw);
}

.session-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.session-info-item {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-info-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.session-info-value {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  word-break: break-word;
}

@media (max-width: 640px) {
  .realtime-session-info-btn {
    bottom: 86px;
    left: 12px;
  }

  .session-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Brutal Elimination Toast */
.elimination-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: rgba(220, 38, 38, 0.95);
  color: white;
  padding: 40px 60px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 0 100px rgba(220, 38, 38, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #f87171;
  backdrop-filter: blur(10px);
}

.elimination-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.elimination-toast i {
  font-size: 5rem;
  margin-bottom: 20px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: pulseSkull 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseSkull {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .7;
    transform: scale(1.1);
  }
}

.elimination-toast .elimination-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.elimination-toast .elimination-name {
  font-size: 1.5rem;
  font-weight: 500;
}

.competition-winner-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: radial-gradient(circle at top, rgba(251, 191, 36, 0.98), rgba(180, 83, 9, 0.96));
  color: #fff8eb;
  padding: 40px 60px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 0 100px rgba(251, 191, 36, 0.55), inset 0 0 22px rgba(120, 53, 15, 0.45);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(255, 251, 235, 0.78);
  backdrop-filter: blur(10px);
}

.competition-winner-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.competition-winner-toast i {
  font-size: 5rem;
  margin-bottom: 20px;
  color: #fff7cc;
  text-shadow: 0 4px 20px rgba(120, 53, 15, 0.45);
  animation: pulseWinnerTrophy 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseWinnerTrophy {

  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  50% {
    opacity: 0.88;
    transform: scale(1.08) rotate(-2deg);
  }
}

.competition-winner-toast .winner-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.competition-winner-toast .winner-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.competition-winner-toast .winner-subtitle {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.96;
}

.competition-winner-fireworks {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000;
}

/* Feedback Toast */
.feedback-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  letter-spacing: 1px;
}

.feedback-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.feedback-toast.success {
  background: linear-gradient(135deg, #10b981, #047857);
  border: 2px solid #34d399;
}

.feedback-toast.error {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: 2px solid #f87171;
}

.solo-contextual-message {
  position: fixed;
  top: 22%;
  left: 50%;
  z-index: 10010;
  pointer-events: none;
  border-radius: 16px;
  padding: 12px 20px;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  max-width: min(88vw, 720px);
  border: none;
  background: rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.solo-contextual-message--flying {
  opacity: 0;
  transform: translate(-140vw, -50%);
  transition:
    transform 750ms cubic-bezier(0.08, 0.82, 0.2, 1),
    opacity 220ms ease-out;
}

.solo-contextual-message--flying.is-entering {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.solo-contextual-message--flying.is-leaving {
  opacity: 0;
  transform: translate(120vw, -50%);
  transition:
    transform 350ms ease-in,
    opacity 350ms ease-in;
}

.solo-contextual-message--flying.tone-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.13), rgba(59, 130, 246, 0.09));
  color: #d1fae5;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.5), 0 0 18px rgba(59, 130, 246, 0.35);
}

.solo-contextual-message--flying.tone-error {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.13), rgba(236, 72, 153, 0.09));
  color: #fef3c7;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.55), 0 0 18px rgba(236, 72, 153, 0.35);
}

.solo-contextual-message--attempts {
  top: 26%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(20, 184, 166, 0.09));
  color: #dbeafe;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.55), 0 0 16px rgba(20, 184, 166, 0.4);
}

.solo-contextual-message--attempts.is-visible {
  animation: soloContextPuffIn 220ms ease-out forwards;
}

.solo-contextual-message--attempts.is-leaving {
  animation: soloContextPuffOut 320ms ease-in forwards;
}

@keyframes soloContextPuffIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes soloContextPuffOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.18);
  }
}

/* ===================================================================
   Goal-achieved celebration  ·  Centered banner + localised fireworks
   =================================================================== */
.solo-goal-celebrate {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10020;
  pointer-events: none;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.solo-goal-celebrate__banner {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  padding: 14px 26px;
  border-radius: 18px;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(236, 72, 153, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(255, 215, 0, 0.45),
    0 0 48px rgba(236, 72, 153, 0.35);
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.7), 0 0 18px rgba(236, 72, 153, 0.55);
  transition: transform 380ms cubic-bezier(0.18, 1.4, 0.4, 1), opacity 220ms ease-out;
}

.solo-goal-celebrate__title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.95;
}

.solo-goal-celebrate__label {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.solo-goal-celebrate.is-on .solo-goal-celebrate__banner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.solo-goal-celebrate.is-off .solo-goal-celebrate__banner {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.12);
  transition: transform 350ms ease-in, opacity 320ms ease-in;
}

.solo-goal-celebrate__fireworks {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

.solo-goal-celebrate__spark {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: -5px 0 0 -5px;
  opacity: 0;
  background: radial-gradient(circle, #fff 0%, #ffd700 45%, rgba(255, 215, 0, 0) 70%);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.9), 0 0 22px rgba(236, 72, 153, 0.55);
  transform: translate(0, 0) scale(0.4);
}

.solo-goal-celebrate__spark.spark--0 { background: radial-gradient(circle, #fff 0%, #ffd700 45%, rgba(255, 215, 0, 0) 70%); }
.solo-goal-celebrate__spark.spark--1 { background: radial-gradient(circle, #fff 0%, #f472b6 45%, rgba(244, 114, 182, 0) 70%); }
.solo-goal-celebrate__spark.spark--2 { background: radial-gradient(circle, #fff 0%, #38bdf8 45%, rgba(56, 189, 248, 0) 70%); }
.solo-goal-celebrate__spark.spark--3 { background: radial-gradient(circle, #fff 0%, #34d399 45%, rgba(52, 211, 153, 0) 70%); }
.solo-goal-celebrate__spark.spark--4 { background: radial-gradient(circle, #fff 0%, #f97316 45%, rgba(249, 115, 22, 0) 70%); }
.solo-goal-celebrate__spark.spark--5 { background: radial-gradient(circle, #fff 0%, #a78bfa 45%, rgba(167, 139, 250, 0) 70%); }

.solo-goal-celebrate.is-on .solo-goal-celebrate__spark {
  animation: soloGoalSpark 1100ms cubic-bezier(0.15, 0.7, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes soloGoalSpark {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(0) scale(0.3);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .solo-goal-celebrate__banner,
  .solo-goal-celebrate.is-on .solo-goal-celebrate__spark {
    transition: opacity 200ms linear;
    animation: none;
  }
  .solo-goal-celebrate.is-on .solo-goal-celebrate__banner {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ===================================================================
   Join-Session inline alert  ·  Frosted-glass translucent panel
   =================================================================== */

/* Outer panel — frosted glass base (fallback + default) */
.join-alert-panel {
  margin: 0.5rem 0.75rem 0.25rem;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  animation: joinAlertSlideIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tint the panel when it carries error items */
.join-alert-panel:has(.join-alert-item--error) {
  border-color: rgba(231, 76, 60, 0.30);
  box-shadow: 0 4px 24px rgba(231, 76, 60, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* Tint the panel when it carries success items */
.join-alert-panel:has(.join-alert-item--success) {
  border-color: rgba(39, 174, 96, 0.30);
  box-shadow: 0 4px 24px rgba(39, 174, 96, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

@keyframes joinAlertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

/* List reset */
.join-alert-list {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Each message row */
.join-alert-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
}

/* Error row */
.join-alert-item--error {
  color: #7f1d1d;
  background: rgba(231, 76, 60, 0.12);
  border-left: 3px solid rgba(231, 76, 60, 0.55);
}

/* Success row */
.join-alert-item--success {
  color: #064e3b;
  background: rgba(39, 174, 96, 0.12);
  border-left: 3px solid rgba(39, 174, 96, 0.55);
}

/* Icon */
.join-alert-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}

.join-alert-icon--error {
  color: #e74c3c;
}

.join-alert-icon--success {
  color: #27ae60;
}

/* Showcase Goals Badges - Modern Horizontal Scrollable */
.goals-showcase-section {
  width: 100%;
}

.goals-section-header {
  display: flex;
  align-items: center;
}

.goals-section-title {
  color: #374151;
  letter-spacing: 0.02em;
}

.goals-swiper-container {
  position: relative;
}

.goals-swiper-container::-webkit-scrollbar {
  display: none;
}

.goals-badges-track {
  padding: 2px;
}

.goal-badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.goal-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Empty state badges */
.goals-placeholder-badge {
  border: 1px dashed #d1d5db;
}

/* Goal badge internal elements */
.goal-badge-icon {
  margin-right: 4px;
}

.goal-badge-value {
  margin-left: 4px;
}

/* Goals section title default styles (override inline) */
.goals-section-title {
  font-size: 11px;
  font-weight: 100;
  color: #3e5984;
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
}

/* Goals swiper container styles (override inline) */
.goals-swiper-container {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.goals-showcase-potential {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.goals-potential-metric {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(62, 89, 132, 0.18);
  border-radius: 8px;
  background: #f8fafc;
}

.goals-potential-label,
.goals-potential-detail {
  display: block;
  color: #64748b;
  font-family: Roboto, Verdana, sans-serif;
  font-size: 9px;
  line-height: 1.25;
  white-space: normal;
}

.goals-potential-label {
  font-weight: 600;
}

.goals-potential-value {
  display: block;
  margin: 3px 0 2px;
  color: #0f172a;
  font-family: "Alfa Slab One", Roboto, Verdana, sans-serif;
  font-size: 0.9rem;
  font-weight: 100;
  line-height: 1.15;
}

@media (max-width: 420px) {
  .goals-showcase-potential {
    grid-template-columns: 1fr;
  }
}

/* Placeholder badge for loading state */
.goals-placeholder-badge {
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
}
