/* =========================================================
   Modo Cachimbo · Pantallas de inicio y final con el búho
   (repaso, practicar tema y repaso mixto). Va con escena.js.
   Títulos Barlow cursiva, cuadros con borde de color y el búho
   disfrazado según el área con su globo de ánimo.
   ========================================================= */
.bc { font-family: 'Barlow Condensed', 'Nunito', sans-serif; text-transform: uppercase; }
.startscreen { padding: 22px 22px 26px; }
.rp-hero { display: flex; align-items: flex-end; justify-content: center; gap: 4px; max-width: 400px; margin: 0 auto 10px; }
.rp-buho { position: relative; flex: none; width: 124px; height: 130px; }
.rp-buho .escena { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.rp-buho .mcb { width: 96px; }
/* Piso: un tronco echado con un par de hojas */
.rp-buho .piso { position: absolute; left: 50%; bottom: 0; width: 100%; translate: -50% 0; filter: drop-shadow(0 4px 3px rgba(0,0,0,.45)); }
.rp-buho .piso svg { display: block; width: 100%; height: auto; }
.rp-buho .escena { bottom: 17px; z-index: 1; }
.rp-buho .mcb { translate: 0 var(--drop); }
/* Cada vez que cambia de pose da un saltito */
.rp-buho .mcb { transform-origin: 50% 100%; animation: rp-salto .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes rp-salto { 0% { transform: translateY(0) scale(1.06,.92); } 40% { transform: translateY(-16%) scale(.95,1.06); } 75% { transform: translateY(0) scale(1.04,.96); } 100% { transform: none; } }
/* Con disfraz del área: la imagen ya trae su tronco; se mueve con un brinquito y se sacude si lo molestan */
.rp-buho.rp-disf { width: 138px; height: auto; }
.rp-disf .piso { display: none; }
.rp-disf .escena { position: relative; bottom: 0; }
.rp-buho .mcb-disfraz { display: block; width: 100%; height: auto; aspect-ratio: auto; translate: none; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 5px 4px rgba(0,0,0,.4)); animation-name: rp-brinco; }
.rp-buho .mcb-disfraz.rp-molesto { animation: rp-sacude .5s ease-in-out 2; }
/* Después del brinquito, cada emoción se queda con su propio movimiento */
.rp-buho .rp-e-feliz { animation: rp-brinco .55s, rp-mece 2.6s ease-in-out .55s infinite; }
.rp-buho .rp-e-asombrado { animation: rp-brinco .55s, rp-flota 1.1s ease-in-out .55s infinite alternate; }
.rp-buho .rp-e-pensativo { animation: rp-brinco .55s, rp-duda 3.2s ease-in-out .55s infinite; }
.rp-buho .rp-e-triste { animation: rp-brinco .55s, rp-suspiro 3s ease-in-out .55s infinite; }
.rp-buho .rp-e-triste.rp-molesto { animation: rp-sacude .5s ease-in-out 2; }
@keyframes rp-mece { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes rp-flota { to { transform: translateY(-3%) scale(1.01); } }
@keyframes rp-duda { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg) translateX(-1%); } }
@keyframes rp-suspiro { 0%, 100% { transform: none; } 50% { transform: scale(1.015, .975); } }
/* Efectos sobre la cabeza: destellos si está feliz, signos si duda o se asombra, gotitas si está triste */
.rp-fx { --k: 0; position: absolute; z-index: 2; top: 4%; right: calc(4% + var(--k) * 15%); width: 18px; color: #F6C21C; pointer-events: none; opacity: 0;
  animation: rp-fx-sube 1.6s ease-out calc(var(--k) * .18s) forwards; }
.rp-fx svg { display: block; width: 100%; fill: currentColor; }
.rp-fx b { display: block; font: italic 900 30px/1 'Barlow Condensed', sans-serif; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.rp-fx-feliz:nth-of-type(2n) { width: 12px; top: 16%; }
.rp-fx-asombrado { color: #FF9600; right: calc(6% + var(--k) * 10%); } .rp-fx-asombrado:nth-of-type(2n) { top: 12%; rotate: 14deg; }
.rp-fx-pensativo { color: #1CB0F6; } .rp-fx-pensativo:nth-of-type(2n) b { font-size: 22px; }
.rp-fx-triste { width: 10px; color: #7ED3FF; top: 34%; left: calc(31% + var(--k) * 34%); right: auto; animation-name: rp-fx-cae; }
@keyframes rp-fx-sube { 0% { opacity: 0; transform: translateY(8px) scale(.4); } 25% { opacity: 1; transform: translateY(0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes rp-fx-cae { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px); } }
@keyframes rp-brinco { 0% { transform: scale(1.05,.93); } 40% { transform: translateY(-7%) scale(.97,1.04) rotate(-2deg); } 75% { transform: scale(1.02,.98) rotate(1deg); } 100% { transform: none; } }
@keyframes rp-sacude { 0%, 100% { transform: none; } 20% { transform: translateX(-5%) rotate(-3deg); } 50% { transform: translateX(5%) rotate(3deg); } 80% { transform: translateX(-3%); } }
@media (prefers-reduced-motion: reduce) { .rp-buho .mcb { animation: none !important; } .rp-fx { display: none; } }
.rp-globo { --gc: var(--accent); position: relative; flex: 1; min-height: 98px; display: flex; align-items: center; margin-bottom: 40px; padding: 10px 14px; text-align: left;
  background: #1D1834; color: #EEEAF7; border: 2px solid #2F284E; border-bottom: 4px solid var(--gc); border-radius: 16px; font: 800 14px/1.35 'Nunito', sans-serif; }
.rp-globo b { color: var(--gc); font-weight: 900; }
.rp-globo > span { display: block; }
.rp-globo::before { content: ''; position: absolute; left: -9px; bottom: 16px; width: 14px; height: 14px; background: #1D1834; border: solid #2F284E; border-width: 0 0 2px 2px; rotate: 45deg; border-radius: 0 0 0 4px; }
.rp-matematica .rp-globo { --gc: #1CB0F6; } .rp-ciencia-tecnologia .rp-globo { --gc: #C6E000; }
.rp-comunicacion .rp-globo { --gc: #CE82FF; } .rp-ciencias-sociales .rp-globo { --gc: #FF9600; }
.startscreen .start-badge { margin-bottom: 8px; padding: 5px 11px; font: 800 14px/1 'Barlow Condensed', sans-serif !important; letter-spacing: .06em; text-transform: uppercase; }
.startscreen h1.rp-tit { font: italic 900 40px/1 'Barlow Condensed', sans-serif; letter-spacing: .01em; margin-bottom: 8px; }
.startscreen p { margin-bottom: 18px; }
.rp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.startscreen #btnStart { margin-bottom: 26px; }
.rp-stat { display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; background: #1D1834; border: 1px solid #2A2346; border-bottom: 4px solid var(--c); border-radius: 14px; }
.rp-stat svg { width: 22px; height: 22px; color: var(--c); margin-bottom: 2px; }
.rp-stat b { font: italic 900 32px/1 'Barlow Condensed', sans-serif; color: #fff; }
.rp-stat small { font: 800 13px/1.1 'Barlow Condensed', sans-serif; letter-spacing: .06em; color: var(--text-dim); }
.rp-cor { --c: #FF4B4B; } .rp-cor svg { fill: currentColor; }
.rp-preg { --c: var(--accent); }
.rp-tem { --c: #1CB0F6; }
.rp-sec { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: italic 900 20px/1 'Barlow Condensed', sans-serif; color: #fff; text-align: left; }
.rp-sec::after { content: ''; flex: 1; height: 2px; background: #2A2346; }
.rp-temas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.rp-temas span { padding: 6px 10px; border-radius: 10px; background: rgba(28,176,246,.1); border: 1px solid rgba(28,176,246,.35); color: #bfe8ff; font: 800 12.5px/1.2 'Nunito', sans-serif; text-align: left; }
.rp-temas span.mas { background: none; border-style: dashed; color: var(--text-dim); }
.rp-reglas { list-style: none; display: grid; gap: 8px; text-align: left; }
.rp-reglas li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #1D1834; border: 1px solid #2A2346; border-left: 4px solid var(--c); border-radius: 12px; font: 800 14px/1.3 'Nunito', sans-serif; color: #dcd7ee; }
.rp-reglas li i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font: italic 900 17px/1 'Barlow Condensed', sans-serif; }
.rp-reglas li i svg { width: 18px; height: 18px; }
.rp-reglas li b { color: #fff; font-weight: 900; }
.startscreen .btn.primary { font: italic 900 22px/1 'Barlow Condensed', sans-serif; letter-spacing: .06em; padding: 14px 12px; }
@media (min-width: 640px) {
  .rp-buho { width: 144px; height: 152px; } .rp-buho .mcb { width: 114px; }
  .rp-buho.rp-disf { width: 160px; height: auto; } .rp-buho .mcb-disfraz { width: 100%; }
  .rp-globo { font-size: 15px; min-height: 84px; margin-bottom: 52px; }
  .startscreen h1.rp-tit { font-size: 48px; }
  .rp-stat b { font-size: 38px; } .rp-stat small { font-size: 14px; }
}
@media (min-width: 900px) { .startscreen { padding: 26px 30px 30px; } }
/* Pantalla final: el búho reacciona al resultado */
.endscreen .rp-buho { margin: -6px auto 12px; }
.endscreen h2 { font: italic 900 38px/1 'Barlow Condensed', sans-serif; margin-bottom: 8px; }
.endscreen .score { font: italic 900 56px/1 'Barlow Condensed', sans-serif; text-transform: none; }
/* Modo claro: globo y cuadros blancos con borde lila, letras oscuras */
html[data-modo="claro"] .rp-globo, html[data-modo="claro"] .rp-globo::before { background: #fff; border-color: #DCD8E8; }
html[data-modo="claro"] .rp-globo { color: #1A1626; border-bottom-color: var(--gc); box-shadow: 0 4px 14px rgba(26,22,38,.08); }
html[data-modo="claro"].rp-ciencia-tecnologia .rp-globo b { color: #6F8000; }
html[data-modo="claro"] .rp-buho .mcb-disfraz { filter: drop-shadow(0 5px 4px rgba(26,22,38,.18)); }
html[data-modo="claro"] .rp-stat, html[data-modo="claro"] .rp-reglas li { background: #fff !important; border-color: #DCD8E8 !important; border-bottom-color: var(--c) !important; }
html[data-modo="claro"] .rp-reglas li { border-bottom-color: #DCD8E8 !important; border-left-color: var(--c) !important; color: #4A4560 !important; }
html[data-modo="claro"] .rp-stat b, html[data-modo="claro"] .rp-sec, html[data-modo="claro"] .rp-reglas li b { color: #1A1626 !important; }
html[data-modo="claro"] .rp-sec::after { background: #DCD8E8; }
html[data-modo="claro"] .rp-temas span { color: #0A6EA6 !important; background: rgba(28,176,246,.08) !important; }
html[data-modo="claro"] .rp-temas span.mas { color: #6B6485 !important; background: none !important; }
html[data-modo="claro"] .rp-fx b { text-shadow: none; }
