:root {
  --brand-700: #19335f;
  --brand-600: #2457d6;
  --brand-500: #4f7cff;
  --brand-300: #9ab7ff;
  --brand-100: #e9f0ff;
  --brand-gradient: linear-gradient(135deg, #0f62fe 0%, #5b5ce2 52%, #8a4fff 100%);

  --accent-500: #ffb13b;
  --accent-600: #e68a00;

  --success-500: #12b76a;
  --danger-500: #f04438;
  --info-500: #0ea5e9;

  --ink-950: #0b1220;
  --ink-900: #111827;
  --ink-800: #1f2937;
  --ink-700: #374151;
  --ink-500: #667085;
  --ink-300: #d0d5dd;
  --ink-200: #e4e7ec;
  --ink-100: #f3f4f6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: rgba(248, 250, 252, 0.92);
  --page-bg: #f4f7fb;
  --page-bg-strong: #eef3ff;

  --radius-sm: 0.7rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.12), 0 24px 60px rgba(37, 99, 235, 0.12);
  --shadow-glow: 0 18px 50px rgba(79, 124, 255, 0.28);

  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(79, 124, 255, 0.16), transparent 26%),
    radial-gradient(circle at 90% 10%, rgba(255, 177, 59, 0.12), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, var(--page-bg) 40%, #edf2ff 100%);
  font-family: var(--font-sans);
  color: var(--ink-900);
}

body {
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(8px);
}

body::before {
  width: 22rem;
  height: 22rem;
  top: -7rem;
  right: -5rem;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.18) 0%, rgba(79, 124, 255, 0) 72%);
}

body::after {
  width: 18rem;
  height: 18rem;
  left: -5rem;
  bottom: 10rem;
  background: radial-gradient(circle, rgba(255, 177, 59, 0.16) 0%, rgba(255, 177, 59, 0) 72%);
}

::selection {
  background: rgba(79, 124, 255, 0.18);
  color: var(--ink-950);
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.text-muted { color: var(--ink-500) !important; }
.text-white-75 { color: rgba(255, 255, 255, 0.75) !important; }

.app-main {
  /* SIN z-index explícito a propósito: si se le pone uno (aunque sea 0),
     <main> pasa a ser su propio contexto de apilamiento -- y como los
     modales de Bootstrap (#question-modal, #preview-modal, cualquier
     .modal) viven DENTRO de <main> pero son `position: fixed`, quedan
     atrapados por DEBAJO del `.modal-backdrop` que Bootstrap agrega como
     hijo directo de <body> (z-index 1050) en vez de comparar contra el
     z-index 1055 del modal -- el modal se ve pero ningún click le llega
     (bug real detectado: "el modal nueva pregunta no es funcional").
     `position: relative` solo no crea contexto de apilamiento, así que se
     mantiene por si algún hijo depende de él para posicionarse. */
  position: relative;
}

.icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex-shrink: 0; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.4em; height: 2.4em; }

/* --- Navbar ------------------------------------------------------------- */
.navbar-quizburst {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.brand-mark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink-900) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark .brand-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: inline-block;
}

.brand-mark .brand-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-pill {
  border-radius: 999px;
  padding: 0.46rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
  color: var(--ink-700);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.nav-pill:hover { background: #eef2ff; color: var(--ink-900); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); }
.nav-pill.nav-pill-primary { background: var(--brand-600); color: #fff; }
.nav-pill.nav-pill-primary:hover { background: var(--brand-700); color: #fff; }
.nav-pill.nav-pill-accent { background: var(--accent-500); color: #fff; }
.nav-pill.nav-pill-accent:hover { background: var(--accent-600); color: #fff; }
.nav-pill.nav-pill-ghost { border-color: rgba(15, 23, 42, 0.08); background: rgba(255, 255, 255, 0.82); }

/* Pills de acción principal estilo Kahoot: un color sólido distinto por
   sección, para que la barra se lea como una fila de "botones de arcade",
   no como links de texto. */
.nav-pill.nav-pill-green { background: #26890c; color: #fff; }
.nav-pill.nav-pill-green:hover { background: #1f7009; color: #fff; }
.nav-pill.nav-pill-gold { background: #d89e00; color: #fff; }
.nav-pill.nav-pill-gold:hover { background: #b98600; color: #fff; }
.nav-pill.nav-pill-blue { background: #1368ce; color: #fff; }
.nav-pill.nav-pill-blue:hover { background: #0f56aa; color: #fff; }
.nav-pill.nav-pill-maroon { background: #7a1f3d; color: #fff; }
.nav-pill.nav-pill-maroon:hover { background: #611830; color: #fff; }
.nav-pill.nav-pill-teal { background: #0f9e93; color: #fff; }
.nav-pill.nav-pill-teal:hover { background: #0c8079; color: #fff; }

.account-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.account-button {
  width: 2.65rem;
  height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.dropdown-menu {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  padding: 0.5rem;
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  border-radius: 0.75rem;
  padding-block: 0.65rem;
  font-weight: 600;
}

.dropdown-item:focus,
.dropdown-item:hover {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* --- Botones ------------------------------------------------------------ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding-block: 0.55rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.btn-primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-gradient {
  background: var(--brand-gradient);
  border: none;
  color: #fff;
}
.btn-gradient:hover {
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-warning, .btn-accent {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
}
.btn-warning:hover, .btn-accent:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
}

.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-sm { border-radius: 0.5rem; }

.btn-light {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.65);
  color: var(--ink-900);
}

.btn-light:hover {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--ink-900);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* --- Cards ---------------------------------------------------------------*/
.card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px) saturate(130%);
}

.card-header {
  background: rgba(248, 250, 252, 0.72);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 700;
  color: var(--ink-900);
}

.surface-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px) saturate(130%);
}

.card-clickable {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* --- Badges / pills ------------------------------------------------------*/
.badge { border-radius: 999px; font-weight: 600; padding: 0.4em 0.75em; }
.badge.bg-primary-brand { background: var(--brand-100); color: var(--brand-700); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--brand-600);
  margin-bottom: 0.4rem;
}

.section-lead {
  color: var(--ink-500);
  max-width: 58ch;
  margin-bottom: 0;
}

.panel-card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.9));
  box-shadow: var(--shadow-md);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.status-draft { background: #fef3c7; color: #92400e; }
.status-pill.status-published { background: #d1fae5; color: #065f46; }
.status-pill.status-archived { background: var(--ink-100); color: var(--ink-500); }

.status-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

/* --- Filtro por categoría (Crea/Descubre/Aprende) ------------------------ */
.category-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-500);
  background: var(--ink-100);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.category-chip:hover { background: var(--ink-200); color: var(--ink-900); text-decoration: none; }
.category-chip.active {
  background: var(--brand-600);
  color: #fff;
}
.category-chip .icon { width: 1em; height: 1em; }

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--ink-100);
  color: var(--ink-500);
}
.category-badge .icon { width: 0.95em; height: 0.95em; }

/* --- Hero / landing ------------------------------------------------------*/
.hero-gradient {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-gradient::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.24), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(255, 177, 59, 0.2), transparent 24%),
    radial-gradient(circle at 75% 85%, rgba(255, 255, 255, 0.12), transparent 22%);
  pointer-events: none;
}
.hero-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02));
  pointer-events: none;
}
.hero-gradient > * {
  position: relative;
  z-index: 1;
}

.page-hero {
  position: relative;
  isolation: isolate;
}

.page-hero .lead {
  color: rgba(255, 255, 255, 0.84) !important;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.stat-chip {
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.stat-chip strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-chip span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.hero-code-slab {
  border-radius: 1.25rem;
  padding: 1.4rem 1.3rem;
  background:
    linear-gradient(180deg, rgba(9, 14, 28, 0.96), rgba(18, 28, 52, 0.96));
  color: #fff;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.12), rgba(255, 177, 59, 0.16));
  color: var(--brand-600);
}

/* --- Course cards ----------------------------------------------------------*/
.course-cover {
  height: 6rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
.course-cover.palette-0 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.course-cover.palette-1 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.course-cover.palette-2 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.course-cover.palette-3 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.course-cover.palette-4 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.course-cover.palette-5 { background: linear-gradient(135deg, #f97316, #f59e0b); }
.course-cover.has-photo {
  background-size: cover;
  background-position: center;
}

.empty-state {
  text-align: center;
  padding: 4.5rem 1.5rem;
  color: var(--ink-500);
}
.empty-state .icon-xl { color: var(--ink-300); margin-bottom: 1rem; }

.empty-state .icon-xl {
  width: 3rem;
  height: 3rem;
}

/* --- Question type visual picker ------------------------------------------*/
.type-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.type-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  background: var(--surface);
}
.type-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.type-card.active {
  border-color: var(--brand-600);
  background: var(--brand-100);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.type-card .icon { width: 1.8rem; height: 1.8rem; color: var(--brand-600); }

/* --- Join code / game visuals ---------------------------------------------*/
.join-code-display {
  font-size: 3rem;
  letter-spacing: 0.5rem;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.countdown-ring { font-variant-numeric: tabular-nums; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-aside,
.auth-panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.auth-aside {
  padding: 2rem;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #16386d 55%, #335cff 100%);
  box-shadow: var(--shadow-lg);
}

.auth-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.85rem;
}

.auth-rail {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.auth-feature {
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-feature strong {
  display: block;
  margin-bottom: 0.15rem;
}

.auth-feature span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.92rem;
}

.stack-gap {
  display: grid;
  gap: 1rem;
}

.form-label {
  color: var(--ink-800);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.form-control,
.form-select {
  border-radius: 0.9rem;
  border: 1px solid var(--ink-200);
  background: rgba(255, 255, 255, 0.96);
  padding: 0.78rem 1rem;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.14);
}

.form-text {
  color: var(--ink-500);
}

.form-check-input {
  border-color: var(--ink-300);
}

.form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}

.input-group-text {
  border-radius: 0.9rem;
  border-color: var(--ink-200);
  background: rgba(248, 250, 252, 0.95);
}

.metric-card {
  border-radius: 1.1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  padding: 0.95rem 1rem;
  color: #1e293b;
}

.metric-card strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  color: #4338ca;
}

.metric-card span {
  color: #475569;
  font-size: 0.85rem;
}

.join-code-input {
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
}

.join-code-input::placeholder {
  letter-spacing: normal;
}

.page-intro {
  max-width: 62rem;
}

/* --- FODA colaborativo ---------------------------------------------------- */
.foda-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  position: relative;
  border: 2px solid var(--ink-200, #e2e8f0);
  border-radius: var(--radius-lg, 1rem);
  overflow: hidden;
  min-height: 420px;
}

.foda-quadrant {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--ink-200, #e2e8f0);
}

.foda-q-F { background: rgba(196, 72, 72, 0.06); }
.foda-q-O { background: rgba(45, 114, 80, 0.07); }
.foda-q-D { background: rgba(58, 97, 168, 0.07); }
.foda-q-A { background: rgba(175, 130, 30, 0.07); }

.foda-q-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.35rem;
  margin-bottom: 0.25rem;
}

.foda-q-F .foda-q-header { color: #9b1c1c; }
.foda-q-O .foda-q-header { color: #14532d; }
.foda-q-D .foda-q-header { color: #1e3a8a; }
.foda-q-A .foda-q-header { color: #78350f; }

.foda-items {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.foda-item {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.07);
  animation: foda-pop 0.2s ease;
}

@keyframes foda-pop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

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

.foda-item-text { flex: 1; color: #1e293b; }
.foda-item-nick { font-size: .78rem; font-weight: 600; color: #475569; white-space: nowrap; }

.foda-input-row {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.btn-foda-add {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.65rem;
  flex-shrink: 0;
}

.btn-foda-add:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #3730a3;
}

.foda-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3.5rem;
  height: 3.5rem;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  pointer-events: none;
}

/* Preview en el diseñador */
.foda-board-preview {
  min-height: 240px;
}

.foda-board-preview .foda-quadrant {
  min-height: 110px;
}

/* --- Valoración (rating) -------------------------------------------------- */
.star-picker { gap: .5rem; }
.star-btn {
  background: none;
  border: 2px solid #e2e8f0;
  border-radius: .6rem;
  font-size: 2.5rem;
  line-height: 1;
  padding: .3rem .6rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: color .15s, border-color .15s, transform .1s;
}
/* Cascade: cuando se hovea una estrella, iluminar todas las anteriores */
.star-picker:hover .star-btn { color: #cbd5e1; border-color: #e2e8f0; }
.star-btn:hover ~ .star-btn { color: #cbd5e1 !important; border-color: #e2e8f0 !important; }
.star-picker:hover .star-btn:hover,
.star-picker:hover .star-btn:hover ~ .star-btn + .star-btn { color: #f59e0b; border-color: #f59e0b; }
.star-picker .star-btn:hover,
.star-picker .star-btn:hover ~ .star-btn { pointer-events: none; }
.star-btn.selected { color: #f59e0b; border-color: #f59e0b; }
.star-btn:hover { color: #f59e0b; border-color: #f59e0b; transform: scale(1.08); }
.star-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
@media (max-width: 575.98px) {
  .foda-board {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    min-height: unset;
  }
  .foda-center-label { display: none; }
}

@media print {
  /* Ocultar todo excepto el tablero FODA al imprimir */
  body > *:not(#player-game):not(#host-console) { display: none !important; }
  nav, header, footer, .section-heading, .btn, #p-foda-podium-wrap, #foda-finish-wrap,
  #p-foda-closed-banner, #foda-next-wrap, #btn-lock-foda { display: none !important; }
  #p-section-foda, #section-foda { display: block !important; }
  .foda-board { min-height: unset; break-inside: avoid; }
  .foda-items { max-height: unset; overflow: visible; }
  .foda-center-label { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (max-width: 575.98px) {
  #question-modal.show .modal-dialog,
  #preview-modal.show .modal-dialog {
    margin-top: 1rem !important;
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  #question-modal.show .modal-content,
  #preview-modal.show .modal-content {
    max-height: calc(100vh - 2rem);
  }
}

#question-modal.show {
  display: block;
}

#question-modal.show .modal-dialog,
#preview-modal.show .modal-dialog {
  margin-top: 4.5rem !important;
}

#question-modal.show .modal-content,
#preview-modal.show .modal-content {
  max-height: calc(100vh - 6rem);
}

#question-modal.show .modal-body,
#preview-modal.show .modal-body {
  overflow-y: auto;
}

/* Colores de opciones estilo Kahoot, compartidos entre el diseñador (vista
   previa) y las pantallas de juego (host/jugador). */
.option-color-0 { background-color: #e21b3c; }
.option-color-1 { background-color: #1368ce; }
.option-color-2 { background-color: #d89e00; }
.option-color-3 { background-color: #26890c; }
.option-color-4 { background-color: #864cbf; }
.option-color-5 { background-color: #0f9e93; }

.option-badge {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.drag-handle { cursor: grab; color: var(--ink-300); }
.drag-handle:hover { color: var(--brand-600); }

.sortable-ghost { opacity: 0.35; }

/* --- Utilities ------------------------------------------------------------*/
.bg-brand-soft { background: var(--brand-100); }
.text-brand { color: var(--brand-600); }
.shadow-soft { box-shadow: var(--shadow-sm); }
.rounded-xl { border-radius: var(--radius-md); }

.alert { border-radius: var(--radius-sm); border: none; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #ffe4e6; color: #9f1239; }
.alert-info { background: #e0f2fe; color: #075985; }
.alert-warning { background: #fef3c7; color: #92400e; }

.footer-surface {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(130%);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #cfd8f6, #a3b6ef); border-radius: 999px; }
