@font-face { font-family: "Sarakanda"; src: url("sarakanda.ttf") format("truetype"); font-display: swap; }

.mg-screen { position: relative; aspect-ratio: 16 / 10; background: #fff; border-radius: 16px; overflow: hidden; container-type: inline-size; user-select: none; -webkit-user-select: none; }
.mg-screen button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mg-screen button img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mg-screen button:focus-visible { outline: 3px solid #004DA9; outline-offset: 2px; border-radius: 50%; }

.mg-top { position: absolute; left: 0; right: 0; top: 0; height: 15%; display: flex; align-items: center; justify-content: center; gap: 2cqw; }
.mg-top button { width: 6cqw; height: 6cqw; }
.mg-title { font-family: "Sarakanda", sans-serif; font-weight: 700; font-size: 3.1cqw; color: #00B6F2; white-space: nowrap; }

.mg-mid { position: absolute; left: 0; right: 0; top: 15%; height: 70%; display: flex; }
.mg-left { width: 45%; height: 100%; box-sizing: border-box; padding: 0 2.2cqw; display: flex; flex-direction: column; justify-content: center; }
.mg-pic { width: 35%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mg-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mg-btns { width: 20%; height: 100%; box-sizing: border-box; padding: 1.2cqw; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; }
.mg-btns button { width: 10.5cqw; height: 10.5cqw; transition: transform .1s; }
.mg-btns button:active { transform: scale(.94); }
.mg-btns button[aria-pressed="true"] { animation: mg-pulse 1s ease-in-out infinite; }
@keyframes mg-pulse { 50% { transform: scale(1.06); } }

.mg-frase { display: flex; flex-direction: column; justify-content: center; gap: 2.2cqw; height: 100%; }
.mg-frase img { display: block; height: auto; }
.mg-frase .w1 { width: 75%; } .mg-frase .w2 { width: 50%; } .mg-frase .w3 { width: 100%; }

.mg-silaba { height: 100%; display: flex; align-items: center; justify-content: center; }

.mg-escucha { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1cqw; font-family: "Sarakanda", sans-serif; font-size: 6.6cqw; line-height: 1.1; color: #00B6F2; }
.mg-escucha div { min-height: 1.1em; white-space: nowrap; }

.mg-aviso { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; font-family: "Sarakanda", sans-serif; font-size: 3.2cqw; color: #E53935; text-align: center; line-height: 1.3; }

.mg-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 15%; display: flex; align-items: center; justify-content: space-between; padding: 0 3cqw; box-sizing: border-box; }
.mg-bottom > img, .mg-bottom button { width: 7cqw; height: 7cqw; }
.mg-bottom > img { object-fit: contain; opacity: .9; }
.mg-bottom button { transition: transform .1s; }
.mg-bottom button:active { transform: scale(.94); }
.mg-vista { display: contents; }

/* Actividades (como ActP6Activity.kt) */
.mg-title-act { font-size: 2.5cqw; }
.mg-juego { position: absolute; left: 0; right: 0; top: 15%; height: 70%; display: flex; box-sizing: border-box; padding: 0 1cqw; }
.mg-col20 { width: 20%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mg-col80 { width: 80%; height: 100%; display: flex; flex-direction: column; align-items: center; }
.mg-altavoz { width: 14cqw; height: 14cqw; }
.mg-ilus { flex: 1 1 0; min-height: 0; width: 100%; }
.mg-ilus img { width: 100%; height: 100%; object-fit: contain; }
.mg-opciones { display: flex; justify-content: space-evenly; width: 100%; padding-bottom: 1.5cqw; min-height: 9cqw; }
.mg-screen .mg-opciones button { font-family: "Sarakanda", sans-serif; font-size: 6.6cqw; line-height: 1.2; padding: 0 2cqw; }
.mg-exito { flex: 1 1 0; width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.mg-exito img { flex: 1 1 0; min-height: 0; max-width: 100%; object-fit: contain; object-position: left center; padding: .8cqw; box-sizing: border-box; }
.mg-perdidas { justify-content: space-evenly; }
.mg-perdidas button.mg-fuera { visibility: hidden; }
.mg-frase2 { font-family: "Sarakanda", sans-serif; font-size: 4.7cqw; white-space: pre; padding-top: 1.5cqw; line-height: 1.2; }


/* Actividad 3: ordena las sílabas */
.mg-act { width: 65%; height: 100%; box-sizing: border-box; padding: 0 2cqw; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6cqw; font-family: "Sarakanda", sans-serif; font-size: 6.6cqw; line-height: 1; }
.mg-huecos, .mg-piezas { display: flex; justify-content: center; gap: 1.6cqw; min-height: 10cqw; }
.mg-hueco, .mg-pieza { box-sizing: border-box; min-width: 12cqw; height: 10cqw; padding: 0 1.2cqw; border-radius: 1.6cqw; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.mg-hueco { border: .35cqw dashed #9DB8D9; background: #F3F8FF; }
.mg-pieza { position: relative; z-index: 1; background: #fff; border: .35cqw solid #00B6F2; color: #00B6F2; box-shadow: 0 .5cqw 1.2cqw rgba(0,53,122,.18); cursor: grab; touch-action: none; }
.mg-pieza.mg-arrastra { z-index: 5; cursor: grabbing; box-shadow: 0 1cqw 2.4cqw rgba(0,53,122,.3); }
.mg-pieza.mg-vuelve { transition: transform .25s ease-out; }
.mg-hueco .mg-pieza { min-width: 0; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: default; }
.mg-huecos.mg-hecho { gap: 0; }
.mg-huecos.mg-hecho .mg-hueco { border: 0; background: transparent; min-width: 0; padding: 0; }
.mg-huecos.mg-hecho .mg-pieza { animation: mg-pulse .6s ease-in-out 2; }

.mg-hidden { display: none !important; }
.mg-help { margin: 16px 4px 0; font-size: 16px; line-height: 1.55; color: #3A4D66; text-align: center; }
.mg-help img { width: 26px; height: 26px; vertical-align: -7px; margin: 0 2px; }

/* Zona de la demo: tablet + «¡Pruébalo!» y libros para elegir la lengua */
.mg-demo-zona { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 36px; }
.mg-demo-tablet { flex: 1 1 560px; max-width: 680px; min-width: 0; }
.mg-elige { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mg-pruebalo { margin: 0; font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(44px, 9vw, 64px); line-height: 1; color: #E4572E; transform: rotate(-3deg); }
.mg-elige-txt { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: #3A4D66; text-align: center; max-width: 280px; }
.mg-lomos { display: flex; flex-direction: column; gap: 4px; }
.mg-lomo { height: 46px; border: 0; border-radius: 6px 10px 10px 6px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-sizing: border-box; font: 800 14px Nunito, system-ui, sans-serif; cursor: pointer; transition: translate .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.mg-lomo:hover { translate: -8px 0; }
.mg-lomo[aria-pressed="true"] { translate: -18px 0; box-shadow: 0 6px 16px rgba(0,53,122,.35); }
.mg-lomo:focus-visible { outline: 3px solid #0B1F3A; outline-offset: 2px; }
.mg-lomo-marca { font-size: 11px; opacity: .9; }

/* Textos de las lenguas con frases escritas en código */
.mg-txt { font-family: "Sarakanda", sans-serif; line-height: 1.15; white-space: pre; }
.mg-txt .o, .mg-opciones .o { color: #004DA9; } .mg-txt .c, .mg-opciones .c { color: #00B6F2; }
.mg-filas { display: flex; flex-direction: column; justify-content: center; gap: .6cqw; height: 100%; }
.mg-filas > div { white-space: nowrap; }
.mg-big { font-family: "Sarakanda", sans-serif; color: #00B6F2; line-height: 1; }
.mg-silaba img { max-width: 90%; max-height: 80%; object-fit: contain; }
.mg-perdidas .mg-ptxt { font-family: "Sarakanda", sans-serif; color: #004DA9; line-height: 1.1; }
.mg-perdidas button.mg-img { width: 11.4cqw; height: 11.4cqw; }
.mg-exito.mg-exito-una img { width: 100%; }
