/* Escenas ilustradas de las cabeceras (js/exam-scenes.js). Interruptor: config.examUi.headers. Solo transform/opacity en animaciones. */
.sc { position: absolute; pointer-events: none; z-index: 0; }
.sc svg { display: block; width: 100%; height: auto; overflow: visible; }
.sc .s, .sc .f, .sc .a { stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; }
.sc .s { fill: none; stroke: var(--sc-line); }
.sc .s.thin { stroke-width: 1.8; opacity: .8; }
.sc .s.thick { stroke-width: 4; }
.sc .s.dash { stroke-dasharray: 3 8; }
.sc .s.dark { stroke: var(--sc-dark); }
.sc .f { fill: var(--sc-fill); stroke: var(--sc-line); }
.sc .a { fill: var(--sc-acc); stroke: none; }
.sc .s.a-s { stroke: var(--sc-acc); stroke-width: 4; }
.sc .t { font: 800 38px var(--font-display, sans-serif); fill: var(--sc-line); }
.sc .t.sm { font-size: 20px; }
.sc .t.dk { fill: var(--sc-dark); font-size: 28px; }
.sc g, .sc path, .sc circle, .sc rect { transform-box: fill-box; }

/* cabecera de color del examen (blanco sobre el acento) */
.exh-scene { --sc-line: rgb(255 255 255 / .62); --sc-fill: rgb(255 255 255 / .14); --sc-acc: #ffd45e; --sc-dark: #4a3200;
  right: 24px; top: 12px; width: 250px; max-width: 34%; }
.exh-scene .a { opacity: .95; }
.pau-head .exh-scene { top: 10px; }
@media (max-width: 760px) { .exh-scene { right: -14px; top: -6px; width: 210px; max-width: none; opacity: .5; } }
@media (max-width: 420px) { .exh-scene { width: 170px; right: -18px; opacity: .4; } }

/* cabecera clara del IB */
.ib-head { position: relative; overflow: hidden; }
.ib-head > :not(.sc) { position: relative; z-index: 1; }
.ib-scene { --sc-line: color-mix(in srgb, var(--ib-c) 70%, var(--ink, #222)); --sc-fill: color-mix(in srgb, var(--ib-c) 16%, var(--surface)); --sc-acc: var(--gold-bright, #ffc531); --sc-dark: #4a3200;
  right: 16px; bottom: 6px; width: 300px; max-width: 38%; opacity: .75; }
@media (max-width: 760px) { .ib-scene { width: 190px; max-width: none; right: -20px; bottom: -14px; opacity: .3; } }

/* microanimaciones */
@keyframes sc-float { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes sc-spin { to { transform: rotate(360deg); } }
@keyframes sc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes sc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sc-flow { to { stroke-dashoffset: -40; } }
@keyframes sc-rise { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-34px); opacity: 0; } }
@keyframes sc-wave { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(6deg); } }
@media (prefers-reduced-motion: no-preference) {
  .sc .float { animation: sc-float 5s ease-in-out infinite alternate; }
  .sc .float.b { animation-duration: 6.5s; animation-delay: -2s; }
  .sc .float.c { animation-duration: 7.5s; animation-delay: -4s; }
  .sc .spin { animation: sc-spin 9s linear infinite; }
  .sc .spin.slow { animation-duration: 40s; }
  .sc .spin.rev { animation-direction: reverse; animation-duration: 6s; }
  .sc .pulse { animation: sc-pulse 2.6s ease-in-out infinite; }
  .sc .pulse.b { animation-delay: -1.3s; }
  .sc .grow { transform-origin: bottom; animation: sc-grow .7s cubic-bezier(.2, .8, .3, 1) both; animation-delay: var(--d, 0ms); }
  .sc .flow { stroke-dasharray: 10 6; animation: sc-flow 2.4s linear infinite; }
  .sc .rise { animation: sc-rise 3.2s ease-in infinite; }
  .sc .rise.b { animation-delay: -1s; } .sc .rise.c { animation-delay: -2s; }
  .sc .wave { transform-origin: left center; animation: sc-wave 3s ease-in-out infinite; }
}

/* el texto de la cabecera deja libre el hueco de la escena (solo escritorio; en móvil la escena queda de fondo tenue) */
@media (min-width: 761px) {
  .exam-header:has(.exh-scene) .exh-top { padding-right: 270px; }
  .ib-head:has(.ib-scene) > :not(.sc) { max-width: calc(100% - 300px); }
}

/* estados vacíos ilustrados (Errores, Estadísticas) */
.xe { width: 96px; height: 77px; flex: none; }
.xh-empty-art { display: grid; place-items: center; flex: none; width: 112px; height: 96px; border-radius: 24px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--accent) 5%, var(--surface))); }
@keyframes xe-bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes xe-tw { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes xe-grow { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.xe g, .xe path, .xe circle, .xe rect { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .xe .xe-bob { animation: xe-bob 3s ease-in-out infinite alternate; }
  .xe .xe-tw { animation: xe-tw 2.4s ease-in-out infinite; transform-origin: center; }
  .xe .xe-tw.b { animation-delay: -.8s; } .xe .xe-tw.c { animation-delay: -1.6s; }
  .xe .xe-grow { transform-origin: bottom; animation: xe-grow .9s cubic-bezier(.2, .8, .3, 1) both; }
  .xe .xe-grow.b { animation-delay: .15s; }
}
.xh-empty-cta { margin-top: 10px; }

/* progreso por tema en las tarjetas de subtema (js/topic-pick.js) */
.tp-skill-bar { position: relative; display: block; width: 100%; height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tp-skill-bar > i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: 999px; background: var(--accent); transform-origin: left; }
.tp-skill-bar.lv-hi > i { background: var(--green, #12873a); } .tp-skill-bar.lv-mid > i { background: var(--gold-dark, #e0a100); } .tp-skill-bar.lv-lo > i { background: var(--danger, #c0392b); }
.tp-skill-bar > b { position: relative; display: block; font: 800 .64rem/14px var(--font-display, sans-serif); padding: 0 7px; color: var(--ink); mix-blend-mode: normal; text-shadow: 0 0 3px var(--surface); }
.tp-skill-bar.is-empty { height: 6px; opacity: .8; }
@keyframes tp-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: no-preference) {
  .tp-skill-bar > i { animation: tp-fill .6s cubic-bezier(.2, .8, .3, 1) both; }
  .tp-skill .xa { transition: transform .18s; }
  .tp-skill:hover .xa { transform: scale(1.1) rotate(-3deg); }
  .section-card.sec { transition: border-color .15s, transform .15s, box-shadow .15s; }
  .section-card.sec:hover, .test-card.tst:hover { transform: translateY(-3px); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 16%, transparent); }
  .sec-bar .progress > i { animation: tp-fill .8s cubic-bezier(.2, .8, .3, 1) both; transform-origin: left; }
}
.tp-skill:focus-visible, .sec-tab:focus-visible, .exh-tabs .tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Modo oscuro (3.ª ronda): el color de acento de cada examen aclarado cuando es TEXTO sobre fondo oscuro (contraste AA) */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .sec-title .eyebrow,
:root:not([data-theme="light"]) .sec-bar b,
:root:not([data-theme="light"]) .exs-sec .eyebrow,
:root:not([data-theme="light"]) .xt-stat b,
:root:not([data-theme="light"]) .tst-status.is-run,
:root:not([data-theme="light"]) .module-review .mr-part,
:root:not([data-theme="light"]) .skill-report .sr-score,
:root:not([data-theme="light"]) .tp-link,
:root:not([data-theme="light"]) .xh-big,
:root:not([data-theme="light"]) .xh-clock,
:root:not([data-theme="light"]) .xh-kpi b,
:root:not([data-theme="light"]) .xh-count b,
:root:not([data-theme="light"]) .xh-more a,
:root:not([data-theme="light"]) .xh-step,
:root:not([data-theme="light"]) .xh-ic,
:root:not([data-theme="light"]) .xh-sec-ic,
:root:not([data-theme="light"]) .xh-err-big,
:root:not([data-theme="light"]) .xh-task .ic,
:root:not([data-theme="light"]) .tst-summary .ic,
:root:not([data-theme="light"]) .test-card.tst .facts .ic,
:root:not([data-theme="light"]) .section-card.sec .facts .ic { color: color-mix(in srgb, var(--accent) 58%, #fff); }
}
:root[data-theme="dark"] .sec-title .eyebrow,
:root[data-theme="dark"] .sec-bar b,
:root[data-theme="dark"] .exs-sec .eyebrow,
:root[data-theme="dark"] .xt-stat b,
:root[data-theme="dark"] .tst-status.is-run,
:root[data-theme="dark"] .module-review .mr-part,
:root[data-theme="dark"] .skill-report .sr-score,
:root[data-theme="dark"] .tp-link,
:root[data-theme="dark"] .xh-big,
:root[data-theme="dark"] .xh-clock,
:root[data-theme="dark"] .xh-kpi b,
:root[data-theme="dark"] .xh-count b,
:root[data-theme="dark"] .xh-more a,
:root[data-theme="dark"] .xh-step,
:root[data-theme="dark"] .xh-ic,
:root[data-theme="dark"] .xh-sec-ic,
:root[data-theme="dark"] .xh-err-big,
:root[data-theme="dark"] .xh-task .ic,
:root[data-theme="dark"] .tst-summary .ic,
:root[data-theme="dark"] .test-card.tst .facts .ic,
:root[data-theme="dark"] .section-card.sec .facts .ic { color: color-mix(in srgb, var(--accent) 58%, #fff); }
