/* Juegos para el aula (zona del profesor): índice, opciones y hojas A4 para imprimir */
body { background: var(--orange, #d8682a); }
.aula { width: 100%; max-width: 1000px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.aula-head { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; text-align: center; }
.aula-head .pf-volver { align-self: flex-start; color: #fff; font-weight: 800; min-height: 44px; display: inline-flex; align-items: center; }
.aula-logo { width: clamp(150px, 24vw, 220px); height: auto; }
.aula-title { font-size: clamp(30px, 5vw, 44px); font-weight: 900; line-height: 1.05; }
.aula-sub { font-size: 18px; font-weight: 700; color: #fff3e6; }
.au-panel { background: #fffaf0; color: var(--ink, #1d1410); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.au-panel h2 { font-size: 24px; font-weight: 900; }
.au-resumen { font-size: 18px; font-weight: 600; }
.au-nota { color: var(--muted, #6a564c); font-weight: 600; font-size: 15px; }
.au-opciones { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.op { display: flex; flex-direction: column; gap: 6px; }
.op-label { font-weight: 800; font-size: 15px; color: var(--muted, #6a564c); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 14px; background: var(--orange-soft, #fbeee6); }
.seg .seg-btn { min-height: 46px; min-width: 46px; padding: 4px 14px; border: 0; border-radius: 10px; background: transparent; font: 800 17px var(--font); color: #6f3f1f; cursor: pointer; }
.seg .seg-btn.on { background: #b8501c; color: #fff; }
.au-partes { display: flex; flex-wrap: wrap; gap: 8px; }
.au-partes .chip { min-height: 44px; padding: 0 14px 0 10px; border-radius: 12px; border: 2px solid #e2d3c6; background: #fff; color: var(--ink, #1d1410); font: 700 15px var(--font); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.au-partes .chip small { font-size: 13px; color: var(--muted, #6a564c); }
.au-partes .chip-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c9b6a8; display: inline-flex; align-items: center; justify-content: center; }
.au-partes .chip.on { border-color: var(--orange, #d8682a); background: var(--orange-soft, #fbeee6); }
.au-partes .chip.on .chip-check { background: #b8501c; border-color: #b8501c; }
.au-partes .chip.on .chip-check::after { content: ""; width: 9px; height: 5px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.au-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.au-boton { min-height: 52px; padding: 8px 22px; border: 0; border-radius: 12px; cursor: pointer; font: 800 18px var(--font); background: #c2561f; color: #fff; }
.au-boton:disabled { opacity: .45; cursor: default; }
.au-claro { background: #fff; color: #a84a18; box-shadow: inset 0 0 0 2.5px #c2561f; }
.recortes .rc-btn.au-boton { --rc-btn: #c2561f; }
.recortes .rc-btn.au-claro { --rc-btn: #fffaf0; box-shadow: none; }
.recortes .au-panel.rc-card { rotate: none !important; transform: none !important; }
.recortes .au-panel.rc-card::before, .recortes .au-panel.rc-card::after { clip-path: none !important; -webkit-mask: none !important; mask: none !important; border-radius: 6px; }

/* ---------- Índice ---------- */
.au-grupo h2 { color: #fff; font-size: 26px; font-weight: 900; margin: 6px 0 10px; }
.au-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.au-juego { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: #fffaf0; color: var(--ink, #1d1410); text-decoration: none; min-height: 44px; }
.au-juego b { font-size: 21px; font-weight: 900; color: #a84a18; }
.au-juego .au-de { font-size: 14px; font-weight: 800; color: #6f3f1f; }
.au-juego span { font-size: 15.5px; font-weight: 600; color: #4d3d35; }
.au-juego .au-mat { font-size: 14px; font-weight: 700; color: var(--muted, #6a564c); }
.au-juego:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.recortes .au-juego.rc-card { rotate: none !important; }

/* ---------- Hojas en pantalla ---------- */
.au-vista { overflow: hidden; }
.hojas { --lvl: #d8682a; display: flex; flex-direction: column; align-items: center; gap: 22px; zoom: var(--z, 1); }
.hoja {
  width: 210mm; height: 297mm; padding: 9mm 10mm 7mm; background: #fff; color: #1d1410; box-shadow: 0 6px 22px rgba(60, 25, 5, .35);
  display: flex; flex-direction: column; gap: 4mm; overflow: hidden; font-family: var(--font); position: relative;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.hj-cab { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4mm; padding-bottom: 2.5mm; border-bottom: .9mm solid var(--lvl); }
.hj-logo { height: 11mm; width: auto; }
.hj-tit { display: flex; flex-direction: column; line-height: 1.1; }
.hj-tit b { font-size: 16pt; font-weight: 900; color: var(--lvl); }
.hj-tit span { font-size: 10.5pt; font-weight: 700; color: #6a564c; }
.hj-serie { font-size: 9pt; font-weight: 700; color: #6a564c; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1mm; }
.hj-nivel { font-style: normal; font-weight: 900; color: #fff; background: var(--lvl); padding: .6mm 2.4mm; border-radius: 1.5mm; }
.hj-cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3mm; }
.hj-pie { display: flex; justify-content: space-between; font-size: 8pt; color: #8a766b; font-weight: 600; }
.hj-nota { font-size: 9.5pt; font-weight: 700; color: #6a564c; }
.hoja h2 { font-size: 15pt; font-weight: 900; color: var(--lvl); }
.hoja h3 { font-size: 12pt; font-weight: 900; }
.hoja p, .hoja li { font-size: 10.5pt; line-height: 1.35; }
.hueco { display: inline-block; border-bottom: .35mm solid #1d1410; height: 6mm; vertical-align: bottom; }

/* guía del profe */
.guia { display: flex; flex-direction: column; gap: 4mm; }
.gu-para { font-size: 12pt !important; font-weight: 600; padding: 3mm 4mm; border-left: 1.4mm solid var(--lvl); background: #fbf3ec; }
.gu-cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 6mm; }
.gu-bloque { display: flex; flex-direction: column; gap: 1.5mm; margin-bottom: 3mm; }
.gu-bloque h3 { color: var(--lvl); }
.gu-bloque ul, .gu-bloque ol { padding-left: 5mm; display: flex; flex-direction: column; gap: 1.4mm; }
.gu-consejo, .gu-web { padding: 2.5mm 4mm; border-radius: 2mm; background: #fbf3ec; }
.gu-web { background: #f1ece6; }

/* piezas para recortar: líneas de corte discontinuas */
.rejilla { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--f), 1fr); border-top: .3mm dashed #a8968b; border-left: .3mm dashed #a8968b; }
.pieza { border-right: .3mm dashed #a8968b; border-bottom: .3mm dashed #a8968b; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3mm; position: relative; overflow: hidden; }
.pieza.vacia { background: none; }
.mini-logo { position: absolute; right: 2mm; bottom: 1.6mm; height: 4.5mm; width: auto; opacity: .55; }
.esquina { position: absolute; left: 2.4mm; top: 1.8mm; font-size: 8pt; font-weight: 800; color: #8a766b; }

/* pentagramas y ritmos de los juegos, en negro y sin recortes de papel (ahorra tinta) */
.hoja .staff { display: block; width: 100%; height: auto; overflow: visible; color: #1d1410; }
.hoja .staff .lines line { stroke: currentColor; stroke-width: 1.4; }
.hoja .staff .lines .bar { stroke-width: 1.8; }
.hoja .staff .clef circle, .hoja .staff .clef > circle { fill: currentColor; }
.hoja .staff .clef path { stroke: currentColor; }
.hoja .staff .head, .hoja .staff .fill { fill: currentColor; }
.hoja .staff .sharp line, .hoja .staff .flat line, .hoja .staff .natural line { stroke: currentColor; stroke-width: 1.4; }
.hoja .staff .flat path { stroke: currentColor; stroke-width: 1.6; }
.hoja .staff .thick { stroke-width: 3 !important; }
.hoja .staff .hole { fill: #fff; }
.hoja .staff text { fill: currentColor; font: 800 13px var(--font); }
.hojas.tinta .hoja :is(.pz-sh, .pz-mg, .cut-sh, .cut-m, .tira, .tira-sombra, .tira-papel, .tira-fibra, .tira-grano, .tira-celo) { display: none; }
.hoja .rhythm { display: block; width: 100%; height: auto; overflow: visible; color: #1d1410; }
.hoja .rhythm .staff-line, .hoja .rhythm .bar, .hoja .rhythm .stem { stroke: currentColor; stroke-width: 1.4; }
.hoja .rhythm .stem { stroke-width: 1.6; }
.hoja .rhythm .head, .hoja .rhythm .head-hollow, .hoja .rhythm .fill { fill: currentColor; }
.hoja .rhythm .hole { fill: #fff; }
.hoja .rhythm .flag, .hoja .rhythm .rest-q, .hoja .rhythm .rest-e path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hoja .rhythm .rest-q { stroke-width: 3; }
.hoja .rhythm .timesig text { font: 900 22px var(--font); text-anchor: middle; fill: currentColor; }
.hoja .rhythm .gap rect { fill: #fff; stroke: var(--lvl); stroke-width: 1.6; stroke-dasharray: 4 3; }
.hoja .rhythm .gap text { font: 900 22px var(--font); text-anchor: middle; fill: var(--lvl); }

/* tablas de soluciones y de control */
.tabla { width: 100%; border-collapse: collapse; font-size: 10pt; }
.tabla th, .tabla td { border-bottom: .25mm solid #d9c9bd; padding: 1.4mm 2mm; text-align: left; vertical-align: middle; }
.tabla th { font-size: 9pt; color: #6a564c; }
.tabla .num { width: 9mm; font-weight: 900; color: var(--lvl); }
.tabla .sol { font-weight: 900; }
.caja { width: 5mm; height: 5mm; border: .35mm solid #1d1410; border-radius: 1mm; display: inline-block; vertical-align: middle; }

@media (max-width: 600px) {
  .au-panel { padding: 16px; }
  .seg .seg-btn { font-size: 16px; padding: 4px 11px; }
}

/* ---------- Imprimir ---------- */
@page { size: A4 portrait; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  .aula { display: block; max-width: none; padding: 0; }
  .aula-head, #barra, .rc-desk, .rc-overlay, .rc-ball, .rc-gl { display: none !important; }
  .au-vista { overflow: visible; }
  .hojas { display: block; zoom: 1 !important; gap: 0; }
  .hoja { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .hoja:last-child { break-after: auto; page-break-after: auto; }
}

/* cartas de notas (Matamoscas, Teclado de papel, Caza fantasmas…) */
.carta-nota { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.5mm; }
.carta-nota .staff { width: 100%; height: auto; }
.carta-nota b { font-size: 14pt; font-weight: 900; color: var(--lvl); }
.cartel { font-size: 54pt; font-weight: 900; color: var(--lvl); line-height: 1; }
.corte { text-align: center; color: #a8968b; font-size: 12pt; line-height: 1; padding: 2.5mm 0; background: linear-gradient(#a8968b, #a8968b) center / 100% .3mm no-repeat; }

/* ---------- Estilo «como en la web»: papel recortado, letras de collage y celo ----------
   (con «Ahorra tinta», .hojas.tinta, todo se queda en líneas y sin fondos) */
.hj-tit b .cl-pal { display: inline-flex; white-space: nowrap; }
.hj-tit b .cl-pal + .cl-pal { margin-left: .3em; }
.cl-l { position: relative; display: inline-block; margin: 0 .01em; padding: .04em .07em .08em; line-height: 1; rotate: var(--r); translate: 0 var(--dy); isolation: isolate; color: #2b1d16; }
.cl-l::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--lp, #fff) url("../../papel/grano.png") 0 0 / 30mm 30mm; clip-path: var(--p); }
.cl-blanco { --lp: #efe3cb; } .cl-crema { --lp: #f3e4c6; }
.cl-partitura::before { background: #f6efe0 url("../../papel/partitura.jpg") 30% 20% / 60mm 60mm; }
.cl-tinta { --lp: #2b1d16; color: #fff; } .cl-naranja { --lp: #c2561f; color: #fff; }
.hojas:not(.tinta) .hj-tit b { font-size: 21pt; color: #2b1d16; letter-spacing: 0; filter: drop-shadow(0 .35mm .2mm rgba(50, 20, 5, .35)); }
.hojas:not(.tinta) .hj-cab { border-bottom: 0; position: relative; padding-bottom: 3.4mm; }
.hojas:not(.tinta) .hj-cab::after { content: ""; position: absolute; left: -2mm; right: -2mm; bottom: 0; height: 1.8mm; background: var(--lvl) url("../../papel/grano.png") 0 0 / 30mm 30mm; background-blend-mode: multiply; clip-path: var(--rc-polyb1); }
.hojas:not(.tinta) .hj-nivel { border-radius: 0; clip-path: var(--rc-polyb2); padding: .9mm 3mm; background: var(--lvl) url("../../papel/grano.png") 0 0 / 30mm 30mm; background-blend-mode: multiply; }
.hojas.tinta .cl-l { rotate: none; translate: none; padding: 0; margin: 0; color: var(--lvl); }
.hojas.tinta .cl-l::before { display: none; }
.hojas.tinta .hj-tit b { font-size: 16pt; }

/* celo */
.celo { position: absolute; z-index: 3; width: 22mm; height: 6.5mm; background: rgba(255, 236, 170, .62); border: .2mm dashed rgba(150, 110, 40, .35); rotate: -8deg; pointer-events: none; }
.hojas.tinta .celo { display: none; }
.hojas:not(.tinta) .hoja::after { content: ""; position: absolute; z-index: 3; left: 4mm; top: 5mm; width: 20mm; height: 6.5mm; background: rgba(255, 236, 170, .62); border: .2mm dashed rgba(150, 110, 40, .35); rotate: -24deg; pointer-events: none; }

/* cada pieza para recortar es un trozo de papel (con el corte de tijera de la web) */
.hojas:not(.tinta) .pieza { isolation: isolate; }
.hojas:not(.tinta) .pieza:not(.vacia)::before { content: ""; position: absolute; inset: 1.6mm; z-index: -1; background: #fbf5e8 url("../../papel/grano.png") 0 0 / 36mm 36mm; clip-path: var(--pp, var(--rc-poly0)); filter: drop-shadow(0 .4mm .25mm rgba(50, 20, 5, .3)); }
.hojas:not(.tinta) .pieza.v1 { --pp: var(--rc-poly1); } .hojas:not(.tinta) .pieza.v2 { --pp: var(--rc-poly2); }
.hojas:not(.tinta) .pieza.v3 { --pp: var(--rc-poly3); } .hojas:not(.tinta) .pieza.v4 { --pp: var(--rc-poly4); }
.hojas:not(.tinta) .pieza.v5 { --pp: var(--rc-poly5); }
.hojas:not(.tinta) .pieza.v1::before { background-color: #f6ecd8; } .hojas:not(.tinta) .pieza.v4::before { background-color: #fff8ea; }

/* guía del profe en recortes */
.hojas:not(.tinta) .gu-para { border: 0; color: #fff; background: #c2561f url("../../papel/grano.png") 0 0 / 36mm 36mm; background-blend-mode: multiply; clip-path: var(--rc-poly2); padding: 4mm 6mm; font-weight: 800; }
.hojas:not(.tinta) .gu-bloque { position: relative; isolation: isolate; padding: 4mm 5mm 3mm; margin-bottom: 2mm; }
.hojas:not(.tinta) .gu-bloque::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(255, 252, 244, .62), rgba(255, 252, 244, .62)), #f6efe0 url("../../papel/partitura-suave.jpg") 0 0 / 120mm 120mm; clip-path: var(--rc-poly1); filter: drop-shadow(0 .5mm .3mm rgba(50, 20, 5, .3)); }
.hojas:not(.tinta) .gu-cols > div:last-child .gu-bloque::before { background-image: linear-gradient(rgba(255, 252, 244, .62), rgba(255, 252, 244, .62)), url("../../papel/pautado-suave.jpg"); clip-path: var(--rc-poly3); }
.hojas:not(.tinta) .guia > .gu-bloque::before { background-image: linear-gradient(rgba(255, 252, 244, .62), rgba(255, 252, 244, .62)), url("../../papel/manuscrito-suave.jpg"); clip-path: var(--rc-poly4); }
.hojas:not(.tinta) .gu-bloque h3 { display: inline-block; align-self: flex-start; color: #fff; background: var(--lvl); padding: .6mm 3mm; clip-path: var(--rc-polyb0); }
.hojas:not(.tinta) .gu-consejo, .hojas:not(.tinta) .gu-web { border-radius: 0; background: #fff4c9 url("../../papel/grano.png") 0 0 / 36mm 36mm; clip-path: var(--rc-poly5); padding: 3mm 5mm; }

/* tablas de soluciones sobre una hoja de cuaderno */
.hojas:not(.tinta) .tabla th { color: #fff; background: var(--lvl); }
.hojas:not(.tinta) .tabla tbody tr:nth-child(odd) td { background: #fbf3e6; }

/* pentagramas como en la web: la clave y las notas son pegatinas recortadas (margen blanco y sombra) */
.hojas:not(.tinta) .staff .cut-sh { opacity: .26; transform: translate(1.1px, 1.8px); }
.hojas:not(.tinta) .staff :is(.cut-sh, .cut-m) .clef path { stroke-width: 6.4px !important; }
.hojas:not(.tinta) .staff .cut-sh :is(.clef path, .sharp line) { stroke: #2b1206 !important; }
.hojas:not(.tinta) .staff .cut-sh :is(.clef circle, .head, .hole) { fill: #2b1206 !important; stroke: #2b1206 !important; stroke-width: 3.4px; }
.hojas:not(.tinta) .staff .cut-m :is(.clef path, .sharp line) { stroke: #fffdf7 !important; }
.hojas:not(.tinta) .staff .cut-m :is(.clef circle, .head, .hole) { fill: #fffdf7 !important; stroke: #fffdf7 !important; stroke-width: 3.4px; }
.hojas:not(.tinta) .staff :is(.cut-sh, .cut-m) .sharp line { stroke-width: 4.6px !important; }
.hojas:not(.tinta) .staff .pz-sh :is(circle, ellipse) { fill: rgba(45, 18, 4, .3); stroke: none; }
.hojas:not(.tinta) .staff .pz-sh path { fill: none; stroke: rgba(45, 18, 4, .3); }
.hojas:not(.tinta) .staff .pz-sh line { stroke: rgba(45, 18, 4, .3); }
.hojas:not(.tinta) .staff .pz-mg circle { fill: #fffdf7; stroke: #fffdf7; stroke-width: 3; }
.hojas:not(.tinta) .staff .pz-mg ellipse { fill: #fffdf7; stroke: #fffdf7; stroke-width: 3.4; }
.hojas:not(.tinta) .staff .pz-mg path { fill: none; stroke: #fffdf7; stroke-width: 6; }
.hojas:not(.tinta) .staff .pz-mg line { stroke: #fffdf7; stroke-width: 4.4; }
.hojas:not(.tinta) .staff .pz-mg .thick { stroke-width: 6; }
.hojas:not(.tinta) .staff .lines line { stroke: #4a3a30; }
/* ritmos sobre su tira de papel con celo, como en Dictado y Repite el ritmo */
.hojas:not(.tinta) .rhythm.on-paper { --tira: #fffdf6; overflow: visible; color: #1d1410; }
.hojas:not(.tinta) .rhythm .tira-papel { fill: var(--tira); }
.hojas:not(.tinta) .rhythm .tira-fibra { fill: #fffefa; }
.hojas:not(.tinta) .rhythm .tira-sombra { fill: rgba(45, 18, 4, .34); }
.hojas:not(.tinta) .rhythm .tira-grano { opacity: .85; }
.hojas:not(.tinta) .rhythm .tira-celo { fill: rgba(255, 236, 170, .7); stroke: rgba(120, 90, 50, .25); stroke-width: .6; }
.hojas:not(.tinta) .rhythm.on-paper .hole { fill: var(--tira); }

/* nombres y carteles como los botones de la web: tiras de cartulina naranja */
.hojas:not(.tinta) .cartel { color: #fff; background: #c2561f url("../../papel/grano.png") 0 0 / 36mm 36mm; background-blend-mode: multiply; padding: 2mm 8mm 3mm; clip-path: var(--rc-polyb3); filter: drop-shadow(.6mm 1mm 0 rgba(50, 20, 5, .35)); rotate: -2deg; }
.hojas:not(.tinta) .pieza:nth-child(even) .cartel { rotate: 1.5deg; clip-path: var(--rc-polyb1); }
.hojas:not(.tinta) .carta-nota b { color: #2a1c16; background: #e7a91c url("../../papel/cart-mostaza.jpg") 0 0 / 30mm 30mm; padding: 0 3mm; box-shadow: .3mm .6mm 0 rgba(40, 14, 2, .35); }
.hojas:not(.tinta) .ll-chuleta b, .hojas:not(.tinta) .fm-sol b:last-child { color: #2a1c16; }
