/* SirEdwards Quiz v2.0 — «Tema Sir Edwards»: la app a juego con las insignias ilustradas.
 *
 * Solo presentación (colores, bordes, fondos y sombras). No cambia estructura, textos ni lógica.
 * Se carga la ÚLTIMA (después de main.css y online.css) para poder ajustarla o retirarla de una vez.
 * Paleta: marino #1c2340 / #2a3560, oro #c9992e / #e8c874, pergamino #fbf6ea / #f3e9d2.
 * Se conserva todo lo que comunica algo: verde/rojo de acierto/fallo, color del texto de cada modo,
 * bloqueados apagados y la atmósfera propia del modo secreto.
 */

:root {
  --se-navy: #1c2340;
  --se-navy-2: #2a3560;
  --se-gold: #c9992e;
  --se-gold-light: #e8c874;
  --se-gold-hair: rgba(201,153,46,.45);
  --se-gold-soft: rgba(201,153,46,.22);
  --se-parch: #f4ecd8;
  --se-parch-2: #e8dcc0;
  --se-ink-on-navy: #f6e6b8;
}
[data-theme="dark"] {
  --se-parch: #1d2544;
  --se-parch-2: #171d36;
  --se-gold-hair: rgba(201,153,46,.38);
  --se-gold-soft: rgba(201,153,46,.16);
}

/* ---- Botón principal: marino con filete y texto dorados (en oscuro, al revés: oro con texto marino) ---- */
.btn-primary,
.card[class*="theme-"] .btn-primary,
body.in-game .actions .btn-primary {
  background: linear-gradient(180deg, var(--se-navy-2), var(--se-navy)) !important;
  color: var(--se-ink-on-navy) !important;
  border: 1.5px solid var(--se-gold) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 4px 12px rgba(28,35,64,.22) !important;
  letter-spacing: .2px;
}
.btn-primary:hover,
.card[class*="theme-"] .btn-primary:hover {
  background: linear-gradient(180deg, #34427a, var(--se-navy-2)) !important;
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .card[class*="theme-"] .btn-primary,
[data-theme="dark"] body.in-game .actions .btn-primary {
  background: linear-gradient(180deg, var(--se-gold-light), var(--se-gold)) !important;
  color: var(--se-navy) !important;
  border-color: #f0d99a !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 14px rgba(0,0,0,.35) !important;
}
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .card[class*="theme-"] .btn-primary:hover { background: linear-gradient(180deg, #f0d99a, #d6a93a) !important; }
.btn-primary:disabled { opacity: .55; }

/* Selector segmentado de Ajustes (Claro/Oscuro, Sonido…): la opción elegida, marino y oro. */
.segmented-btn.active {
  background: linear-gradient(180deg, var(--se-navy-2), var(--se-navy)) !important;
  color: var(--se-ink-on-navy) !important;
  border-color: var(--se-gold) !important;
}
[data-theme="dark"] .segmented-btn.active {
  background: linear-gradient(180deg, var(--se-gold-light), var(--se-gold)) !important;
  color: var(--se-navy) !important;
  border-color: #f0d99a !important;
}

/* ---- Tarjetas de modos (Jugar, Duelos, dificultades no): pergamino con filete dorado, sin tintes pastel ---- */
#view-modes .mode-card:not(.mode-lucidez),
#duel-home .seq-d-card {
  background: linear-gradient(170deg, var(--se-parch), var(--se-parch-2)) !important;
  border: 1.5px solid var(--se-gold-hair) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 16px rgba(28,35,64,.07) !important;
}
#view-modes .mode-card:not(.mode-lucidez):hover,
#duel-home .seq-d-card:not(.locked):hover { border-color: var(--se-gold) !important; }
#view-modes .mode-card::after,
#duel-home .seq-d-card::after { display: none !important; }
[data-theme="dark"] #view-modes .mode-card:not(.mode-lucidez),
[data-theme="dark"] #duel-home .seq-d-card { box-shadow: 0 6px 18px rgba(0,0,0,.28) !important; }
/* El modo secreto conserva su atmósfera violeta, con el mismo filete dorado. */
#view-modes .mode-card.mode-lucidez { border-color: var(--se-gold-hair) !important; }
/* «Continuar partida»: destacada con oro, sin el color del modo. */
#resume-game-card { border: 1.5px solid var(--se-gold) !important; background: linear-gradient(170deg, var(--se-parch), var(--se-parch-2)) !important; }

/* ---- Partida: marco dorado común a todos los modos; el color de cada modo, en sus acentos (más abajo) ---- */
.card[class*="theme-"]:not(.theme-lucidez) {
  border: 2px solid var(--se-gold-hair) !important;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--se-gold-soft), 0 14px 40px rgba(28,35,64,.10) !important;
}


.card[class*="theme-"]:not(.theme-lucidez) #choice-options .choice-btn:not(.correct):not(.incorrect) {
  background: var(--se-parch) !important;
  border-color: var(--se-gold-soft) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) #choice-options .choice-btn:not(.correct):not(.incorrect):hover:not(:disabled) {
  border-color: var(--se-gold) !important;
  box-shadow: 0 4px 14px rgba(201,153,46,.18) !important;
}




/* ---- Barras de nivel (inicio de partida, Jugar, expediente) en oro ---- */
#game-level-bar-fill, #stats-level-bar-fill, #home-level-bar-fill { background: linear-gradient(90deg, #b8862a, var(--se-gold-light)) !important; }



/* Aviso «¡Nuevo modo desbloqueado!»: insignia del modo. */
.mode-unlock-toast .toast-badge { width: 44px; height: 44px; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.mode-unlock-toast .toast-multi-icon .toast-badge { width: 26px; height: 26px; display: inline-block; vertical-align: middle; }
.mode-unlock-toast { border-color: var(--se-gold) !important; }

/* Bienvenida: franja superior en oro; la lista usa iconos sueltos, sin marco circular. */
.welcome-card::before { background: linear-gradient(90deg, #b8862a, var(--se-gold-light), #b8862a) !important; }
#welcome-modal .welcome-list li > span:first-child .welcome-ico { width: 30px; height: 30px; display: block; margin-top: -1px; }
/* Récords personales con la insignia mini del modo. */
.stat-extra-icon.has-img { background: none !important; border: 0 !important; box-shadow: none !important; }
.stat-extra-icon.has-img .mode-img-mini { width: 34px; height: 34px; display: block; }

/* ---- Color de cada modo dentro de la partida ----
   El marco dorado es común; cada modo recupera su color (el mismo del texto de su cabecera) en cuatro acentos:
   franja superior, barra lateral de la pregunta, barra de progreso y fondo de la cabecera (y la respuesta elegida). */
.card.theme-standard   { --mode-accent: #2563eb; --mode-accent-2: #60a5fa; }
.card.theme-review     { --mode-accent: #0d9488; --mode-accent-2: #2dd4bf; }
.card.theme-survival   { --mode-accent: #d97706; --mode-accent-2: #fbbf24; }
.card.theme-sudden     { --mode-accent: #b91c1c; --mode-accent-2: #ef4444; }
.card.theme-timetrial  { --mode-accent: #db2777; --mode-accent-2: #f472b6; }
.card.theme-mentalcalc { --mode-accent: #15803d; --mode-accent-2: #22c55e; }
[data-theme="dark"] .card.theme-mentalcalc { --mode-accent: #5fae7d; --mode-accent-2: #86c59a; }

.card[class*="theme-"]:not(.theme-lucidez)::before {
  background: linear-gradient(90deg, var(--mode-accent), var(--mode-accent-2), var(--mode-accent)) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) {
  box-shadow: 0 0 0 4px var(--card), 0 0 0 6px color-mix(in srgb, var(--mode-accent) 38%, transparent), 0 14px 40px color-mix(in srgb, var(--mode-accent) 18%, transparent) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) .mode-header.game-hud {
  background: linear-gradient(170deg, color-mix(in srgb, var(--mode-accent) 10%, var(--se-parch)), var(--se-parch-2)) !important;
  border: 1px solid color-mix(in srgb, var(--mode-accent) 32%, transparent) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) .q-box {
  background: color-mix(in srgb, var(--mode-accent) 4%, var(--se-parch)) !important;
  border-left-color: var(--mode-accent) !important;
  box-shadow: 0 2px 10px rgba(28,35,64,.05) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) #bar-fill {
  background: linear-gradient(90deg, var(--mode-accent), var(--mode-accent-2)) !important;
}
.card[class*="theme-"]:not(.theme-lucidez) #choice-options .choice-btn.selected:not(.correct):not(.incorrect) {
  border-color: var(--mode-accent) !important;
  background: color-mix(in srgb, var(--mode-accent) 12%, var(--se-parch)) !important;
}

/* Último enigma: la insignia del ojo en lugar del emoji. */
.lucidez-enigma-eye { width: 64px; height: 64px; margin: 0 auto 6px !important; font-size: 0 !important; }
.lucidez-enigma-eye .mode-img { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(91,46,143,.45)); }

/* Categorías (Estadísticas) y candados con sus insignias. */
.cat-img { width: 28px; height: 28px; vertical-align: -9px; margin-right: 8px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.radar-note .cat-img { width: 24px; height: 24px; vertical-align: -7px; margin-right: 3px; }
.radar-svg image { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
.lock-img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; border-radius: 50%; }
.fragment-milestone-state .lock-img { width: 22px; height: 22px; margin: 0; }
.mode-lock-badge { background: none !important; border: 0 !important; box-shadow: none !important; }
.mode-lock-badge::before { width: 38px !important; height: 38px !important; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.mode-card.locked .mode-lock-badge::before { background-image: url("../assets/cats/candado.webp") !important; }
.mode-card:not(.locked) .mode-lock-badge::before { background-image: url("../assets/cats/candado-abierto.webp") !important; }
.knowledge-tag .cat-img { width: 22px; height: 22px; vertical-align: -6px; margin: 0 3px 0 2px; }

/* Logros: insignias ilustradas (assets/logros/). */
.ach-ico.has-img { background: none !important; border: 0 !important; box-shadow: none !important; width: 48px !important; height: 48px !important; }
.ach-img { width: 100%; height: 100%; display: block; border-radius: 50%; -webkit-user-drag: none; user-select: none; }
.ach-row.is-done .ach-ico.has-img .ach-img { filter: drop-shadow(0 3px 6px rgba(201,153,46,.45)); }
.ach-row.is-locked .ach-ico.has-img { filter: grayscale(1) brightness(.95); opacity: .5; }
.session-medal-icon.has-img { background: none !important; border: 0 !important; box-shadow: none !important; width: 46px; height: 46px; padding: 0 !important; }
.session-medal-icon.has-img .ach-img { animation: ach-stamp .55s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes ach-stamp { 0% { transform: scale(1.8) rotate(-12deg); opacity: 0; } 60% { transform: scale(.94) rotate(2deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .session-medal-icon.has-img .ach-img { animation: none; } }

/* ---- Últimos iconos ilustrados (assets/ui, assets/familias) y trazos dorados ---- */
.ui-img { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.32em; display: inline-block; -webkit-user-drag: none; user-select: none; }
.ui-title-img { margin-right: .35em; }
.ui-btn-img { width: 1.5em; height: 1.5em; margin-right: .4em; vertical-align: -.4em; border-radius: 50%; }
.ui-stamp-img { width: 1.5em; height: 1.5em; margin-right: .35em; vertical-align: -.4em; }
.seq-id .ui-line { margin: 0 0 0 .25em; color: var(--se-gold); }
.seq-profile-edit .ui-line { margin: 0; color: var(--se-gold); }
.gate-perk-ico .ui-img { width: 30px; height: 30px; vertical-align: middle; }
.game-streak-inline-icon .ui-img { width: 22px; height: 22px; vertical-align: -5px; }
.result-chip-icon .ui-img { width: 22px; height: 22px; vertical-align: -5px; }
.fx-streak-fire .ui-img { width: 1.1em; height: 1.1em; vertical-align: -.15em; }
.fragment-milestone-icon .ui-img { width: 34px; height: 34px; }
.fragment-milestone-icon img[src*="mini/"] { border-radius: 50%; }
.ach-frag img { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; }
.ach-g-ico.has-img { background: none !important; box-shadow: none !important; border: 0 !important; }
.ach-g-ico.has-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.results-mood-icon.has-img, #results-card .results-mood-icon.has-img { font-size: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; width: 72px !important; height: 72px !important; }
#results-card .results-mood-icon .mood-img, .results-mood-icon .mood-img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.dif-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .45em; vertical-align: .02em; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.12); }
.dif-facil { background: #16a34a; } .dif-medio { background: #eab308; } .dif-dificil { background: #dc2626; }
.mode-req .lock-img { width: 15px; height: 15px; }

/* Trazos dorados de los botones pequeños (máscara CSS: sin <svg> en el DOM). */
.ui-line { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; margin-right: .4em; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ui-line-pencil { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%2020h4L19%209l-4-4L4%2016v4zM14%206l4%204%27/%3E%3C/svg%3E"); }
.ui-line-copy { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9%209h10v11H9zM5%2015V4h10%27/%3E%3C/svg%3E"); }
.ui-line-swap { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%208h13l-3-3M20%2016H7l3%203%27/%3E%3C/svg%3E"); }
.ui-line-arrow { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%2012h15M13%206l6%206-6%206%27/%3E%3C/svg%3E"); }
.ui-line-install { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%203v12M7%2010l5%205%205-5M5%2020h14%27/%3E%3C/svg%3E"); }
.ui-line-warn { --ico: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%203L2%2020h20L12%203zM12%2010v4M12%2017v.5%27/%3E%3C/svg%3E"); }

/* Selector de avatares: el elegido, con filete dorado (antes azul). */
.seq-av-btn.sel { border-color: var(--se-gold) !important; background: color-mix(in srgb, var(--se-gold) 12%, var(--card)) !important; }
.seq-av-btn.sel .seq-av-name { color: var(--accent-gold-strong, #92400e) !important; }
[data-theme="dark"] .seq-av-btn.sel .seq-av-name { color: var(--se-gold-light) !important; }


/* ---- Estadísticas: iconos de los títulos (insignias completas, con su disco) ---- */
h3.stats-h .stats-h-img { width: 34px; height: 34px; flex: 0 0 auto; object-fit: contain; border-radius: 50%; margin: -3px 0 -3px -2px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }

/* ---- «¿Sabías que…?» y «Explicación»: tarjeta con marco dorado, protagonista bajo la respuesta ---- */
.sabias-que-box {
  margin-top: 14px; padding: 12px 15px 14px; opacity: 1;
  border: 1.5px solid var(--se-gold) !important; border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--se-parch) 92%, #fff 8%), color-mix(in srgb, var(--se-parch) 78%, var(--se-gold) 22%));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--se-gold) 18%, transparent), 0 8px 22px rgba(0,0,0,.22);
  color: var(--text); font-size: 16px; line-height: 1.5; text-align: left;
}
[data-theme="dark"] .sabias-que-box { background: linear-gradient(160deg, #232b4a, #1a2140); }
.sabias-que-box .sq-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 7px; padding-bottom: 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--se-gold) 45%, transparent);
  font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #8a5a0b;
}
[data-theme="dark"] .sabias-que-box .sq-head { color: var(--se-gold-light); }
.sabias-que-box .sq-ico { width: 38px; height: 38px; margin: -10px 0 -10px -6px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.30)); }
.sabias-que-box .sq-text { color: var(--text); font-weight: 500; }
@keyframes sqIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { .sabias-que-box { animation: sqIn .35s ease-out .12s both; } }
body.keyboard-open .sabias-que-box { margin-top: 8px; padding: 6px 10px 7px; font-size: 12.5px; }
body.keyboard-open .sabias-que-box .sq-head { margin-bottom: 3px; padding-bottom: 3px; font-size: 11px; }
body.keyboard-open .sabias-que-box .sq-ico { width: 26px; height: 26px; margin: -6px 0 -6px -4px; }

/* Logros y Fragmentos: iconos del título sin el disco de la insignia, a tamaño legible. */
.achievements-progress-title .ui-title-img, .fragments-progress-title .ui-title-img { width: 38px; height: 38px; margin: -8px .3em -8px 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

/* ---- Iconos ilustrados en textos (src/ui/icons.js): sustituyen a los emojis ---- */
.seq-ico { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -0.33em; margin-right: .32em; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.22)); }
.seq-ico-lg { width: 1.7em; height: 1.7em; vertical-align: -0.45em; }
.seq-ico-h { width: 1.25em; height: 1.25em; }
.seq-ico-xl { width: 64px; height: 64px; margin: 0; vertical-align: middle; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
.modal-warning-icon .seq-ico-xl { width: 72px; height: 72px; }
.stats-empty-icon .seq-ico-xl { width: 72px; height: 72px; }
.session-medal-icon .seq-ico { margin: 0; }
.toast-icon .seq-ico { width: 24px; height: 24px; margin: 0; vertical-align: middle; }
.seq-d-ach-img { width: 38px; height: 38px; object-fit: contain; display: block; }
.stamp-badge .seq-ico { width: 1.25em; height: 1.25em; }

/* ---- Cabecera de la partida: el objeto del modo suelto (assets/modes/suelto/), sin aro ni disco ---- */
.game-mode-badge { width: 36px !important; height: 36px !important; border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)) !important; }

/* Récords personales: ilustración suelta, sin anillo ni fondo. */
.stat-extra-icon.has-img .mode-img-loose { width: 40px; height: 40px; display: block; object-fit: contain; border-radius: 0; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
#extra-stats .stat-extra-icon.has-img { background: none !important; border: 0 !important; box-shadow: none !important; }

/* Modo oscuro: el subtítulo morado de inicio se leía apenas; mismo tono, más claro. */
[data-theme="dark"] .home-subtitle { color: #b79be0; }
/* «Novedades de la v2.0»: la versión hereda la tipografía del título. */
#update-modal-version { font: inherit; letter-spacing: inherit; }

/* Título «Supervivencia: Elige Dificultad»: corazón suelto, sin borde ni fondo. */
.ui-title-img.ui-title-loose { width: 40px; height: 40px; object-fit: contain; border-radius: 0; box-shadow: none; background: none; border: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
/* Botones de Duelo/Retos: ilustración suelta (sin borde), un poco más grande para que se aprecie. */
.btn .seq-ico[src*="modes/suelto/"] { width: 1.6em; height: 1.6em; vertical-align: -0.5em; margin-top: -0.2em; margin-bottom: -0.2em; }

/* Estadísticas: iconos de título y de historial sueltos, sin círculo ni fondo */
h3.stats-h .stats-h-img { border-radius: 0; background: none; border: 0; width: 36px; height: 36px; }
.hist-ico:has(.mode-img-loose) { background: none; border: 0; width: 42px; height: 42px; }
.hist-ico .mode-img-loose { width: 40px; height: 40px; object-fit: contain; background: none; border: 0; border-radius: 0; box-shadow: none; }

/* Iconos ilustrados sueltos junto a títulos y botones (zona de peligro, instalar la app) */
.ui-btn-ico { width: 1.9em; height: 1.9em; object-fit: contain; vertical-align: -.5em; margin-right: .4em; background: none; border: 0; }
h3 .ui-btn-ico { width: 34px; height: 34px; vertical-align: middle; margin: -4px 8px -4px 0; }
.settings-install-btn .ui-btn-ico { width: 2.4em; height: 2.4em; vertical-align: middle; margin: -.6em .3em -.6em 0; }

/* Bandera blanca (derrota en Duelo/Retos): en pequeño, sobre fondos claros, necesita un contorno sutil para leerse */
.seq-ico[src$="bandera-blanca.webp"] { width: 1.45em; height: 1.45em; vertical-align: -0.4em; filter: drop-shadow(0 0 1px rgba(40,30,20,.55)) drop-shadow(0 1px 2px rgba(40,30,20,.25)); }

/* Punto de color por dificultad (Muerte Súbita, «A reforzar  En progreso»): sustituye a los emojis */
.dif-dot { display: inline-block; width: .72em; height: .72em; border-radius: 50%; margin-right: .4em; vertical-align: .02em; box-shadow: 0 0 0 1.5px rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.25); }
.dif-dot.dif-facil { background: #16a34a; }
.dif-dot.dif-medio { background: #eab308; }
.dif-dot.dif-dificil { background: #dc2626; }

/* Logros: cofre de medallas suelto, algo más grande que un icono de título normal */
.achievements-progress-title .ui-title-img.ui-title-loose { width: 46px; height: 46px; margin: -8px 6px -8px 0; }

/* 2.0 · Cabecera de juego en dos líneas fijas: nombre del modo (pequeño) y datos de la partida. */
#game-progress-lbl:has(> .hud-name) { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.32; white-space: nowrap; padding-top: 1px; }
#game-progress-lbl > .hud-name { font-size: 9.5px; letter-spacing: .9px; opacity: .78; }
#game-progress-lbl > .hud-data { font-size: 12px; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 3px; flex-wrap: nowrap; }
#game-progress-lbl > .hud-data .seq-ico { width: 13px; height: 13px; }
.results-character.char-neutral { animation: moodPop .4s cubic-bezier(.34,1.56,.64,1); }
/* Etiqueta mínima en las pastillas de la tarjeta final (qué es cada número). */
.result-chip-label { font-size: 11px; font-weight: 700; color: var(--sub); margin-left: -2px; white-space: nowrap; }

/* ===== Home: botones grandes en azul noche con oro («Noche y oro») y acentos suaves en las tarjetas pequeñas ===== */
.home-small-card { background: linear-gradient(var(--hc, #c9a227), var(--hc, #c9a227)) top / 100% 3px no-repeat, linear-gradient(180deg, color-mix(in srgb, var(--hc, #c9a227) 9%, #f4ecd8), #e8dcc0); }
.home-small-card .home-small-arrow { color: var(--hc, var(--brand-gold)); }
.home-small-card .home-small-divider { background: var(--hc, var(--brand-gold)); }
.home-card-stats { --hc: #3b6fd6; }
.home-card-medals { --hc: #c9a227; }
.home-card-settings { --hc: #64748b; }
[data-theme="dark"] .home-small-card { background: linear-gradient(var(--hc), var(--hc)) top / 100% 3px no-repeat, linear-gradient(180deg, color-mix(in srgb, var(--hc) 14%, var(--brand-cream)), var(--brand-cream-deep)); }

/* ===== Tarjetas de Duelos y de Jugar con el color de su sección/modo (mismo estilo que la home) ===== */
#duel-home .seq-d-card, .modes-grid .mode-card { --hc: var(--brand-gold); }
#duel-home .seq-d-v-duel { --hc: var(--dz-duel); }
#duel-home .seq-d-v-retos { --hc: var(--dz-reto); }
#duel-home .seq-d-v-amigos { --hc: #2f9e5b; }
[data-theme="dark"] #duel-home .seq-d-v-amigos { --hc: #5fcf8a; }
.modes-grid .mode-standard { --hc: #2563eb; }
.modes-grid .mode-review { --hc: #0d9488; }
.modes-grid .mode-survival { --hc: #d97706; }
.modes-grid .mode-sudden { --hc: #b91c1c; }
.modes-grid .mode-timetrial { --hc: #db2777; }
.modes-grid .mode-mentalcalc { --hc: #15803d; }
[data-theme="dark"] .modes-grid .mode-mentalcalc { --hc: #5fae7d; }
.modes-grid .mode-lucidez { --hc: #7c3aed; }
#duel-home .seq-d-card, #view-modes .modes-grid .mode-card {
  border: 1px solid color-mix(in srgb, var(--hc) 38%, transparent) !important;
  background: linear-gradient(var(--hc), var(--hc)) top / 100% 3px no-repeat, linear-gradient(160deg, color-mix(in srgb, var(--hc) 11%, #f4ecd8), #e8dcc0) !important;
}
[data-theme="dark"] #duel-home .seq-d-card, [data-theme="dark"] #view-modes .modes-grid .mode-card {
  background: linear-gradient(var(--hc), var(--hc)) top / 100% 3px no-repeat, linear-gradient(160deg, color-mix(in srgb, var(--hc) 16%, var(--brand-cream)), var(--brand-cream-deep)) !important;
}
#view-modes .modes-grid .mode-card.locked { background: linear-gradient(color-mix(in srgb, var(--hc) 45%, transparent), color-mix(in srgb, var(--hc) 45%, transparent)) top / 100% 3px no-repeat, linear-gradient(160deg, color-mix(in srgb, var(--hc) 5%, #f4ecd8), #dfd3b4) !important; border-color: color-mix(in srgb, var(--hc) 18%, transparent) !important; }

.home-big-card.home-card-jugar, .home-big-card.home-card-duelo {
  background: linear-gradient(160deg, #1b2650, #0e1630 70%);
  border: 1.5px solid #c9a227;
  box-shadow: 0 0 0 3px rgba(201,162,39,.12), 0 14px 30px rgba(15,23,42,.35);
}
.home-big-card.home-card-jugar::before, .home-big-card.home-card-duelo::before { background: radial-gradient(120% 90% at 12% -15%, rgba(232,200,116,.18), transparent 55%); }
.home-big-card.home-card-jugar::after, .home-big-card.home-card-duelo::after { display: none; }
.home-big-card .home-big-title { color: #e8c874; letter-spacing: 2px; }
.home-big-card .home-big-sub { color: #efe6cf; opacity: .9; }
.home-big-card.home-card-jugar .home-big-arrow { background: #2d5bb8; border-color: #e8c874; }
.home-big-card.home-card-duelo .home-big-arrow { background: #9f1d3f; border-color: #e8c874; }
[data-theme="dark"] .home-big-card.home-card-jugar, [data-theme="dark"] .home-big-card.home-card-duelo { background: linear-gradient(160deg, #202d5e, #0b1228 70%); }

/* ===== Logros: fila del título de cada grupo con un fondo dorado suave, para distinguirla de los logros ===== */
/* Logros: solo franja dorada lateral, sin tinte en el título */
.ach-group { border-left: 5px solid #c9992e !important; }
.ach-group[open] > summary { border-bottom: 1px solid rgba(201,153,46,.55); }

/* Estadísticas y Ajustes: franja dorada lateral (la zona de peligro conserva su rojo) */
#view-stats .stats-section, #view-stats .history-container, #view-settings .settings-section:not(.settings-danger-zone) {
  border-left: 4px solid #c9992e !important;
  background: linear-gradient(90deg, rgba(201,153,46,.07), transparent 45%);
}

/* Jugar, modo oscuro: las tarjetas bloqueadas conservan un fondo oscuro (antes heredaban el claro y no se leían) */
[data-theme="dark"] #view-modes .modes-grid .mode-card.locked {
  background: linear-gradient(color-mix(in srgb, var(--hc) 45%, transparent), color-mix(in srgb, var(--hc) 45%, transparent)) top / 100% 3px no-repeat, linear-gradient(160deg, color-mix(in srgb, var(--hc) 7%, var(--brand-cream)), var(--brand-cream-deep)) !important;
  border-color: color-mix(in srgb, var(--hc) 22%, transparent) !important;
  opacity: .85;
}

/* 2.3: HUD estrecho (320 px) o con 4 vidas en Cálculo de Fondo: la fila de datos pasa a dos líneas en vez de recortarse bajo la píldora de racha. */
#game-progress-lbl > .hud-data { flex-wrap: wrap; row-gap: 1px; }

/* Bola de dificultad dentro del HUD (Muerte Súbita): no se encoge ni se recorta por la izquierda. */
#game-progress-lbl .dif-dot { flex: none; margin: 0 .4em 0 3px; }

/* 2.3: selector Cálculo (Turbo / Fondo): mismas tarjetas que las dificultades, con una línea de descripción. */
#menu-difficulty-modes .modes-grid[hidden] { display: none !important; }
#menu-difficulty-modes .mode-card .diff-card-text { flex: 1 1 auto; min-width: 0; text-align: left; }
#menu-difficulty-modes .mode-card .diff-card-text h3 { text-align: left !important; }
#menu-difficulty-modes .mode-card .diff-card-text p { text-align: left !important; margin: 4px 0 0 !important; font-size: 12.5px; line-height: 1.35; color: var(--sub); }
/* Título del submenú (Elige dificultad / Elige cómo sufrir): una sola línea hasta 320 px. */
#diff-menu-title { font-size: clamp(17px, 5.6vw, 24px) !important; line-height: 1.1; }
#diff-menu-title .ui-title-img { width: 34px; height: 34px; margin-right: 4px; }
@media (max-width: 359px) { #diff-menu-title .ui-title-img { display: none; } }

/* Récords personales: cuadrícula pareja (mismas alturas) y «Preguntas dominadas» a todo el ancho. */
@media (min-width: 340px) { #extra-stats { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: 1fr; } }
#extra-stats .stat-extra { align-items: center; }
#extra-stats .stat-extra.stat-master { grid-column: 1 / -1; }
#extra-stats .stat-extra.stat-master { justify-content: center; }


/* ===== Revisión de coherencia claro/oscuro (14/10) ===== */
/* Inicio (oscuro): la tarjeta Logros mezclaba oro al 14 % con el azul noche y quedaba gris verdoso; con menos oro encaja con Estadísticas y Ajustes. */
[data-theme="dark"] .home-small-card.home-card-medals {
  background: linear-gradient(var(--hc), var(--hc)) top / 100% 3px no-repeat, linear-gradient(180deg, color-mix(in srgb, var(--hc) 6%, var(--brand-cream)), var(--brand-cream-deep));
}
/* «Continuar partida» (oscuro): filete superior del color del modo en curso, como en el claro y como las tarjetas de modos de debajo. */
[data-theme="dark"] #resume-game-card.mode-card { --hc: #3b6fd6; background: linear-gradient(var(--hc), var(--hc)) top / 100% 4px no-repeat, linear-gradient(170deg, var(--se-parch), var(--se-parch-2)) !important; }
[data-theme="dark"] #resume-game-card.mode-review { --hc: #14b8a6; }
[data-theme="dark"] #resume-game-card.mode-survival { --hc: #e08a14; }
[data-theme="dark"] #resume-game-card.mode-sudden { --hc: #dc3545; }
[data-theme="dark"] #resume-game-card.mode-timetrial { --hc: #e0457f; }
[data-theme="dark"] #resume-game-card.mode-mentalcalc { --hc: #22a559; }
[data-theme="dark"] #resume-game-card.mode-lucidez { --hc: #8b5cf6; }
