:root{--ink:#18304a;--muted:#5f7488;--primary:#087f86;--accent:#f7b733;--bg:#eef8f8;--surface:#fff;--line:#d6e5e8;--shadow:0 20px 60px #18304a20}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif}button,a{font:inherit}.screen{min-height:100vh;padding:clamp(24px,5vw,70px)}[hidden]{display:none!important}.screen-hero{display:grid;grid-template-columns:minmax(320px,.9fr) 1.6fr;align-items:center;gap:28px;max-width:1500px;margin:auto}.hero-copy{padding:clamp(10px,5vw,70px)}.eyebrow{color:var(--primary);font-size:.78rem;font-weight:900;letter-spacing:.12em;text-transform:uppercase}.hero-copy h1{font-size:clamp(3rem,7vw,6.6rem);line-height:.9;letter-spacing:-.08em;margin:18px 0}.hero-copy h1 em{color:var(--primary);font-style:normal}.hero-copy p{font-size:1.2rem;color:var(--muted);max-width:480px}.hero-copy .skill{font-size:.95rem;border-left:4px solid var(--accent);padding-left:14px}.hero-art{min-height:680px;border-radius:36px;background:url('../assets/backgrounds/hero-bg.png') center/cover;box-shadow:var(--shadow)}.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}.btn{border:0;border-radius:14px;padding:13px 22px;font-weight:850;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:12px}.btn-primary{background:var(--primary);color:#fff;box-shadow:0 8px 18px #087f8640}.btn-ghost{border:1px solid var(--line);background:var(--surface);color:var(--ink)}.btn-wide{width:100%;margin-top:22px}.panel,.play-card,.result-card{max-width:1100px;margin:auto;background:var(--surface);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow);padding:clamp(24px,5vw,58px)}.back{border:0;background:none;color:var(--primary);font-weight:800;cursor:pointer;padding:0 0 22px}.panel h2,.result-card h2{font-size:clamp(2.2rem,5vw,4.3rem);line-height:1;margin:10px 0}.sub{color:var(--muted)}.setting-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px;margin-top:28px}fieldset{border:0;padding:0;margin:0}legend{font-weight:900;margin-bottom:10px}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid var(--line);border-radius:12px;background:#f8fbfb;color:var(--ink);padding:10px 13px;cursor:pointer}.chip.is-selected{background:#dff4f3;border-color:var(--primary);color:var(--primary);font-weight:800}.setting-row{display:flex;gap:20px;flex-wrap:wrap;margin-top:28px}.switch{display:flex;align-items:center;gap:8px;font-weight:700}.switch input{accent-color:var(--primary)}.game-top{max-width:1100px;margin:auto;display:flex;align-items:center;gap:22px;margin-bottom:18px}.icon-btn{border:1px solid var(--line);background:var(--surface);border-radius:12px;width:44px;height:44px;cursor:pointer}.progress{flex:1}.progress strong{font-size:.9rem}.progress div{height:8px;background:var(--line);border-radius:20px;overflow:hidden}.progress i{display:block;height:100%;background:var(--accent);width:0;transition:width .3s}.top-actions{display:flex;align-items:center;gap:8px}.top-actions span{color:#e69b0d;font-size:1.2rem;white-space:nowrap}.play-card{padding:24px}.instruction{display:flex;align-items:center;gap:15px}.mascot{display:grid;place-items:center;width:52px;height:52px;background:#fff4c9;color:var(--accent);border-radius:16px;font-size:2rem}.instruction h2{margin:0;font-size:clamp(1.4rem,3vw,2.5rem)}.instruction small{color:var(--muted)}.listen{margin-left:auto;border:1px solid var(--line);background:var(--surface);padding:10px 14px;border-radius:12px;cursor:pointer}.scene{position:relative;max-width:960px;margin:22px auto 10px;aspect-ratio:1.5;overflow:hidden;border-radius:20px}.scene>img{width:100%;height:100%;object-fit:cover}.hotspot{position:absolute;border:3px solid transparent;background:transparent;border-radius:18px;cursor:pointer}.hotspot:hover,.hotspot:focus-visible{border-color:#fff;box-shadow:0 0 0 4px #087f8688;outline:0}.hotspot.correct{border-color:#29ad75;background:#29ad7533}.hotspot.hint{animation:pulse 1s infinite;border-color:#f7b733}.hotspot-monitor{left:20%;top:11%;width:53%;height:45%}.hotspot-colunas{left:5%;top:42%;width:17%;height:28%}.hotspot-computador{right:2%;top:27%;width:24%;height:44%}.hotspot-teclado{left:14%;bottom:8%;width:58%;height:24%}.hotspot-rato{right:6%;bottom:8%;width:15%;height:18%}.hotspot-ecra{left:24%;top:10%;width:52%;height:45%}.hotspot-touchpad{left:37%;bottom:8%;width:25%;height:21%}.feedback{text-align:center;min-height:34px;color:var(--primary);font-weight:900;font-size:1.25rem}.next{display:block;margin:0 auto}.result-card{text-align:center;max-width:700px;margin-top:8vh}.result-star{font-size:5rem;color:var(--accent)}.result-card p{color:var(--muted);font-size:1.15rem}.final-stars{font-size:2rem;color:var(--accent);letter-spacing:5px}dialog{border:0;border-radius:20px;padding:30px;max-width:420px;color:var(--ink);box-shadow:var(--shadow)}dialog::backdrop{background:#18304a88}.dialog-close{float:right;border:0;background:none;font-size:1.5rem;cursor:pointer}@keyframes pulse{50%{box-shadow:0 0 0 12px #f7b73333}}.listen-object{border:1px solid var(--line);background:var(--surface);border-radius:18px;padding:24px;display:grid;gap:10px;place-items:center;color:var(--ink);cursor:pointer;font-size:1.1rem}.listen-object b{font-size:3rem;color:var(--primary)}.scene:has(.listen-object){display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:20px;background:#e4f3f3;aspect-ratio:auto}@media(max-width:800px){.screen-hero{grid-template-columns:1fr}.hero-art{min-height:320px;order:-1}.setting-grid{grid-template-columns:1fr}.top-actions span{font-size:.9rem}.top-actions .icon-btn{width:38px}.listen span{display:none}}@media(max-width:520px){.screen{padding:16px}.hero-copy{padding:20px 8px}.hero-copy h1{font-size:3.8rem}.hero-art{min-height:260px;border-radius:22px}.panel,.play-card,.result-card{border-radius:20px;padding:20px}.scene{aspect-ratio:1.1}.scene:has(.listen-object){grid-template-columns:repeat(2,1fr)}.instruction{align-items:flex-start}.listen{margin-left:0}.top-actions{gap:3px}.top-actions span{display:none}}
/* Entrada integrada: configurações visíveis no mesmo ecrã do jogo. */
.screen-hero{grid-template-columns:minmax(260px,1fr) minmax(300px,1.25fr) minmax(260px,.82fr);max-width:1600px;align-items:stretch}.hero-art{position:relative;min-height:520px}.hero-mascot{position:absolute;z-index:2;right:3%;bottom:4%;width:105px;filter:drop-shadow(0 10px 10px #18304a33)}.hero-number{position:absolute;z-index:2;top:18px;right:22px;display:grid;width:76px;height:76px;place-items:center;border-radius:50%;background:var(--accent);color:#fff;font-size:2.6rem;font-weight:950;box-shadow:0 10px 20px #b9791838}.hero-number-label{position:absolute;z-index:2;top:94px;right:18px;color:#fff;font-weight:900;text-transform:uppercase;font-size:.72rem;letter-spacing:.08em}.hero-settings{align-self:center;padding:26px;border:1px solid var(--line);border-radius:28px;background:var(--surface);box-shadow:var(--shadow)}.hero-settings h2{margin:7px 0 0;font-size:2rem}.hero-settings>p{margin:4px 0 20px;color:var(--muted)}.hero-settings fieldset+fieldset{margin-top:18px}.hero-settings legend{font-size:.86rem}.hero-settings .chip{padding:8px 10px;font-size:.82rem}.hero-settings .setting-row{margin-top:20px;font-size:.85rem}.hero-settings .switch{font-weight:750}@media(max-width:1100px){.screen-hero{grid-template-columns:1fr 1fr}.hero-copy{grid-column:1}.hero-art{grid-column:2;grid-row:1 / span 2}.hero-settings{grid-column:1}.hero-copy{padding:20px}}@media(max-width:700px){.screen-hero{display:flex;flex-direction:column}.hero-art{min-height:300px;order:-1}.hero-copy{padding:10px}.hero-settings{width:100%;padding:20px}.hero-number{transform:scale(.8);transform-origin:top right}.hero-mascot{width:80px}}
/* Composição alinhada com os restantes jogos: hero à esquerda e configuração à direita. */
.screen-hero{position:relative;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(360px,.8fr);max-width:1420px;min-height:calc(100vh - 48px);align-items:stretch}.hero-art{grid-column:1;grid-row:1 / span 2;min-height:680px;border-radius:30px}.hero-copy{position:absolute;z-index:3;top:50px;left:54px;width:min(54%,540px);padding:0}.hero-copy h1{margin:14px 0;font-size:clamp(3.6rem,6vw,6.6rem);text-shadow:0 2px 18px #fff9}.hero-copy p,.hero-copy .skill{color:var(--ink);text-shadow:0 1px 10px #fff}.hero-copy .skill{background:#ffffffaa;border-radius:10px;padding:10px 14px}.hero-settings{grid-column:2;grid-row:1 / span 2;align-self:stretch;display:flex;flex-direction:column;justify-content:center;margin-left:24px;padding:clamp(30px,4vw,58px);border-radius:30px}.hero-settings h2{font-size:clamp(2.2rem,4vw,3.5rem)}.hero-settings .actions{margin-top:30px}.hero-settings .actions .btn-primary{width:100%;min-height:58px;font-size:1.1rem}.hero-settings .actions .btn-ghost{width:100%}@media(max-width:1100px){.screen-hero{grid-template-columns:1fr 360px}.hero-copy{left:36px;width:52%}.hero-art{min-height:600px}.hero-settings{margin-left:16px;padding:26px}}@media(max-width:760px){.screen-hero{display:flex;min-height:0}.hero-art{min-height:440px;order:-2}.hero-copy{position:absolute;top:34px;left:28px;width:70%}.hero-copy h1{font-size:3.6rem}.hero-settings{order:-1;margin-left:0;padding:24px}.hero-settings .actions{margin-top:22px}.hero-settings .actions .btn-primary{min-height:52px}}
/* Enquadramento do hero: desloca os livros para a lateral e liberta a área do texto. */
body .hero-art{background-size:115% 115%;background-position:right center;background-repeat:no-repeat}
@media(max-width:760px){body .hero-art{background-size:cover;background-position:center}}
/* Barra de jogo: o retorno tem texto e não deve usar a largura de um botão apenas com ícone. */
body .game-top .icon-btn{width:auto;min-width:190px;height:44px;padding:9px 14px;white-space:nowrap;font-weight:800;color:var(--ink)}
@media(max-width:620px){body .game-top{gap:8px;align-items:flex-start}body .game-top .icon-btn{min-width:44px;width:44px;padding:9px;font-size:0}body .game-top .icon-btn::first-letter{font-size:1rem}.game-top .progress{min-width:70px}}
body .game-top button[data-action="hero"]{display:inline-flex!important;width:auto!important;min-width:190px!important;height:44px!important;padding:9px 14px!important;align-items:center;justify-content:center;white-space:nowrap!important;line-height:1.2!important;font-size:.88rem!important}
@media(max-width:620px){body .game-top button[data-action="hero"]{min-width:44px!important;width:44px!important;padding:9px!important;font-size:0!important}body .game-top button[data-action="hero"]::first-letter{font-size:1rem!important}}
/* Painel de configurações mais amplo e confortável. */
body .screen-hero{grid-template-columns:minmax(0,1.15fr) minmax(440px,.95fr)!important;gap:28px!important}
body .hero-settings{min-width:0!important;margin-left:0!important;padding:clamp(38px,4.5vw,68px)!important}
body .hero-settings h2{font-size:clamp(2.5rem,4.5vw,4rem)!important}
body .hero-settings .chip{padding:11px 14px!important;font-size:.9rem!important}
body .hero-settings fieldset+fieldset{margin-top:24px!important}
body .hero-settings .setting-row{gap:24px!important;margin-top:26px!important;font-size:.95rem!important}
@media(max-width:1100px){body .screen-hero{grid-template-columns:minmax(0,1fr) 390px!important}}
@media(max-width:760px){body .screen-hero{display:flex!important}.hero-settings{padding:28px!important}}
/* Hero sem deformação: a ilustração conserva a proporção original. */
body .hero-art{background-size:cover!important;background-position:center center!important;background-repeat:no-repeat!important;aspect-ratio:16 / 9;min-height:0!important;height:auto}
@media(min-width:761px){body .screen-hero{align-items:start!important}.hero-art{min-height:620px!important;height:auto!important;aspect-ratio:16 / 9}}
@media(max-width:760px){body .hero-art{aspect-ratio:16 / 9;min-height:0!important;height:auto!important}}
/* Composição final alinhada com Typing Divertido: imagem limpa à esquerda, painel completo à direita. */
body .hero-settings .hero-copy{position:static!important;width:auto!important;padding:0!important;order:0}
body .hero-settings .hero-copy h1{font-size:clamp(2.6rem,4vw,4.6rem)!important;margin:14px 0!important;text-shadow:none!important}
body .hero-settings .hero-copy p{font-size:.98rem!important;color:var(--muted)!important;text-shadow:none!important}
body .hero-settings .hero-copy .skill{background:transparent!important;padding:0 0 0 14px!important}
body .hero-art{background-size:cover!important;background-position:center!important;aspect-ratio:auto!important;min-height:620px!important;height:auto!important}
body .screen-hero{align-items:stretch!important}
@media(max-width:760px){body .hero-art{min-height:280px!important;aspect-ratio:16 / 9!important}body .hero-settings .hero-copy h1{font-size:3rem!important}}
/* O cenário prolonga-se por trás das configurações; o painel mantém leitura através de transparência suave. */
body .screen-hero{background-image:linear-gradient(90deg,rgba(238,248,248,.04),rgba(238,248,248,.12)),url('../assets/backgrounds/hero-bg.png')!important;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important;border-radius:30px;overflow:hidden;padding:clamp(26px,4vw,58px)!important}
body .screen-hero .hero-art{background:transparent!important;box-shadow:none!important}
body .screen-hero .hero-settings{background:rgba(255,255,255,.84)!important;border-color:rgba(255,255,255,.74)!important;backdrop-filter:blur(8px);box-shadow:0 20px 50px rgba(24,48,74,.16)!important}
@media(max-width:760px){body .screen-hero{padding:18px!important;border-radius:22px}body .screen-hero .hero-settings{background:rgba(255,255,255,.9)!important}}
/* Proporção mais equilibrada: painel ligeiramente mais largo e hero completo, sem corte vertical. */
body .screen-hero{grid-template-columns:minmax(0,1.08fr) minmax(480px,.92fr)!important;min-height:0!important}
body .screen-hero .hero-art{min-height:540px!important;height:540px!important;background-size:contain!important;background-position:center!important;background-color:#bfe8e7!important}
body .screen-hero .hero-settings{min-height:540px!important}
@media(max-width:1100px){body .screen-hero{grid-template-columns:minmax(0,1fr) 430px!important}}
@media(max-width:760px){body .screen-hero{display:flex!important}.screen-hero .hero-art{height:auto!important;min-height:0!important;aspect-ratio:16 / 9;background-size:cover!important}.screen-hero .hero-settings{min-height:0!important}}
body .screen-hero .hero-art{background-image:url('../assets/backgrounds/hero-bg.png')!important;background-size:contain!important;background-position:center!important;background-repeat:no-repeat!important;background-color:transparent!important}
body .screen-hero{background-size:100% auto!important;background-position:top center!important;background-repeat:no-repeat!important;background-color:#bfe8e7!important}
body .screen-hero .hero-art{background-image:none!important;background-color:transparent!important}
/* Painel principal mais largo para dar protagonismo ao título e às configurações. */
body .screen-hero{grid-template-columns:minmax(0,1fr) minmax(560px,1.12fr)!important}
body .screen-hero .hero-settings{width:100%!important;padding-left:clamp(42px,4.5vw,76px)!important;padding-right:clamp(42px,4.5vw,76px)!important}
@media(max-width:1100px){body .screen-hero{grid-template-columns:minmax(0,1fr) 480px!important}}
@media(max-width:760px){body .screen-hero{display:flex!important}.screen-hero .hero-settings{width:100%!important;padding-left:28px!important;padding-right:28px!important}}
/* Hotspots ajustados aos contornos reais das duas ilustrações. */
body .scene-desktop .hotspot-monitor{left:26%;top:12%;width:48%;height:42%}
body .scene-desktop .hotspot-colunas{left:14%;top:39%;width:12%;height:29%}
body .scene-desktop .hotspot-computador{right:5%;top:28%;width:20%;height:42%}
body .scene-desktop .hotspot-teclado{left:19%;bottom:9%;width:48%;height:22%}
body .scene-desktop .hotspot-rato{right:10%;bottom:8%;width:12%;height:18%}
body .scene-laptop .hotspot-ecra{left:25%;top:11%;width:50%;height:42%}
body .scene-laptop .hotspot-teclado{left:19%;bottom:10%;width:58%;height:24%}
body .scene-laptop .hotspot-touchpad{left:39%;bottom:11%;width:22%;height:20%}
body .scene-laptop .hotspot-rato{right:7%;bottom:8%;width:15%;height:22%}
/* Hotspots específicos do portátil: colunas laterais e periféricos alinhados ao desenho. */
body .scene-laptop .hotspot-colunas-left{left:13%;top:39%;width:12%;height:23%}
body .scene-laptop .hotspot-colunas-right{right:13%;top:39%;width:12%;height:23%}
body .scene-laptop .hotspot-teclado{left:19%;bottom:20%;width:61%;height:22%}
body .scene-laptop .hotspot-touchpad{left:39%;bottom:20%;width:23%;height:17%}
body .scene-laptop .hotspot-rato{right:7%;bottom:14%;width:15%;height:20%}
/* Hotspots do computador de secretária alinhados à ilustração 1536x1024. */
body .scene-desktop .hotspot-monitor{left:18.5%;top:13%;width:47%;height:46%}
body .scene-desktop .hotspot-colunas{left:8%;top:43%;width:9.5%;height:26%}
body .scene-desktop .hotspot-computador{right:5.5%;top:28%;width:20%;height:43%}
body .scene-desktop .hotspot-teclado{left:13.5%;bottom:16%;width:55%;height:16%}
body .scene-desktop .hotspot-rato{right:14%;bottom:12%;width:13%;height:16%}
/* O rato fica mais acima para a área de toque acompanhar o periférico. */
body .scene-desktop .hotspot-rato{right:14%;bottom:17%;width:13%;height:16%}
body .scene-laptop .hotspot-rato{right:7%;bottom:18%;width:15%;height:20%}
/* Ajuste final pedido: caixa do rato do computador 30px acima e mais abrangente. */
body .scene-desktop .hotspot-rato{right:14%;bottom:17%;width:14%;height:19%;transform:translateY(-30px)}
/* Posição intermédia do rato: menos subida, mantendo a caixa sobre o periférico. */
body .scene-desktop .hotspot-rato{transform:translateY(-15px)}
/* Rato do portátil: caixa sobre o objeto, sem descer para a mesa. */
body .scene-laptop .hotspot-rato{right:7%;bottom:18%;width:14%;height:18%;transform:translateY(-42px)}
/* Ajuste visual confirmado na captura: caixa do rato de secretária sobre o periférico. */
body .scene-desktop .hotspot-rato{right:9%;width:14%;height:14%;transform:translateY(25px)}
/* Modo de teste ativo: mostra todas as áreas de toque e respetivas etiquetas. */
body .screen-play .hotspot{border:3px dashed #e05a47!important;background:rgba(255,255,255,.18)!important;z-index:4}
body .screen-play .hotspot::after{content:attr(data-part);position:absolute;left:3px;top:3px;padding:2px 6px;border-radius:6px;background:#e05a47;color:#fff;font-size:.72rem;font-weight:900;text-transform:uppercase;pointer-events:none}
body .screen-play .hotspot.correct{border-color:#198754!important;background:rgba(25,135,84,.24)!important}
/* Alinhamento medido na captura do portátil com as caixas de teste visíveis. */
body .scene-laptop .hotspot-colunas-left{left:14%!important;top:40%!important;width:10%!important;height:23%!important}
body .scene-laptop .hotspot-colunas-right{right:14%!important;top:40%!important;width:10%!important;height:23%!important}
body .scene-laptop .hotspot-ecra{left:26%!important;top:11%!important;width:48%!important;height:43%!important}
body .scene-laptop .hotspot-teclado{left:25%!important;bottom:5%!important;width:55%!important;height:22%!important;transform:none!important}
body .scene-laptop .hotspot-touchpad{left:39%!important;bottom:8%!important;width:23%!important;height:14%!important;transform:none!important}
body .scene-laptop .hotspot-rato{right:5%!important;bottom:3%!important;width:14%!important;height:18%!important;transform:none!important}
/* Alinhamento final da segunda cena, computador de secretária, em modo de teste. */
body .scene-desktop .hotspot-monitor{left:20%!important;top:13%!important;width:50%!important;height:46%!important}
body .scene-desktop .hotspot-colunas{left:8%!important;top:43%!important;width:10%!important;height:26%!important}
body .scene-desktop .hotspot-computador{right:0%!important;top:28%!important;width:21%!important;height:43%!important}
body .scene-desktop .hotspot-teclado{left:14.5%!important;bottom:5%!important;width:58%!important;height:16%!important;transform:none!important}
body .scene-desktop .hotspot-rato{right:9%!important;bottom:12%!important;width:14%!important;height:14%!important;transform:none!important}
/* Os botões recebem hotspot-colunas + colunas-left/right; aplicar a posição às classes finais. */
body .scene-laptop .hotspot.colunas-left{left:14%!important;right:auto!important;top:40%!important;width:10%!important;height:23%!important}
body .scene-laptop .hotspot.colunas-right{right:14%!important;left:auto!important;top:40%!important;width:10%!important;height:23%!important}
/* Medição direta da laptop-scene.png (1536x1024): caixas apertadas aos objetos. */
body .scene-laptop .hotspot.colunas-left{left:13.5%!important;top:43.4%!important;width:9.6%!important;height:18.6%!important}
body .scene-laptop .hotspot.colunas-right{left:71%!important;right:auto!important;top:43.4%!important;width:9.5%!important;height:18.6%!important}
body .scene-laptop .hotspot-ecra{left:24.4%!important;top:16.1%!important;width:45.2%!important;height:44.4%!important}
body .scene-laptop .hotspot-teclado{left:23.8%!important;top:61.7%!important;bottom:auto!important;width:46.5%!important;height:14%!important}
body .scene-laptop .hotspot-touchpad{left:36.4%!important;top:71.8%!important;bottom:auto!important;width:18.7%!important;height:10%!important}
body .scene-laptop .hotspot-rato{left:77.5%!important;right:auto!important;top:68.4%!important;bottom:auto!important;width:13%!important;height:15%!important;transform:none!important}
/* Correção final observada na captura real do portátil. */
body .scene-laptop .hotspot-ecra{left:25.8%!important;width:48%!important}
body .scene-laptop .hotspot.colunas-right{left:75%!important;right:auto!important;width:10%!important}
body .scene-laptop .hotspot-teclado{left:25%!important;width:49%!important}
body .scene-laptop .hotspot-touchpad{left:39%!important;width:19%!important}
body .scene-laptop .hotspot-rato{left:82%!important;right:auto!important;width:13%!important}
/* Hotspots calibrados sobre as imagens completas, com a proporção original 4:3. */
body .screen-play .scene.scene-desktop,
body .screen-play .scene.scene-laptop{aspect-ratio:4 / 3!important;height:auto!important}
body .screen-play .scene.scene-desktop>img,
body .screen-play .scene.scene-laptop>img{display:block;width:100%;height:100%;object-fit:fill}

/* Computador de secretária: caixas coincidem com os objetos na desktop-scene.png. */
body .screen-play .scene.scene-desktop .hotspot.colunas-left{left:8.5%!important;right:auto!important;top:40.3%!important;bottom:auto!important;width:11%!important;height:22.5%!important;transform:none!important}
body .screen-play .scene.scene-desktop .hotspot.colunas-right{left:69.5%!important;right:auto!important;top:40.3%!important;bottom:auto!important;width:10%!important;height:22.5%!important;transform:none!important}
body .screen-play .scene.scene-desktop .hotspot-monitor{left:19.5%!important;right:auto!important;top:12.4%!important;bottom:auto!important;width:50.2%!important;height:43.2%!important;transform:none!important}
body .screen-play .scene.scene-desktop .hotspot-computador{left:78%!important;right:auto!important;top:27%!important;bottom:auto!important;width:21%!important;height:40%!important;transform:none!important}
body .screen-play .scene.scene-desktop .hotspot-teclado{left:14.2%!important;right:auto!important;top:65.3%!important;bottom:auto!important;width:59%!important;height:14%!important;transform:none!important}
body .screen-play .scene.scene-desktop .hotspot-rato{left:77.8%!important;right:auto!important;top:69.2%!important;bottom:auto!important;width:13%!important;height:11.7%!important;transform:none!important}

/* Portátil: caixas estreitas, separadas e centradas em cada objeto. */
body .screen-play .scene.scene-laptop .hotspot.colunas-left{left:14.4%!important;right:auto!important;top:40.7%!important;bottom:auto!important;width:10.5%!important;height:17.7%!important;transform:none!important}
body .screen-play .scene.scene-laptop .hotspot.colunas-right{left:75.5%!important;right:auto!important;top:40.7%!important;bottom:auto!important;width:10.2%!important;height:17.7%!important;transform:none!important}
body .screen-play .scene.scene-laptop .hotspot-ecra{left:25.8%!important;right:auto!important;top:15.2%!important;bottom:auto!important;width:48%!important;height:43%!important;transform:none!important}
body .screen-play .scene.scene-laptop .hotspot-teclado{left:24.8%!important;right:auto!important;top:57.8%!important;bottom:auto!important;width:49%!important;height:9.3%!important;transform:none!important}
body .screen-play .scene.scene-laptop .hotspot-touchpad{left:38.4%!important;right:auto!important;top:67.4%!important;bottom:auto!important;width:20.5%!important;height:7.5%!important;transform:none!important}
body .screen-play .scene.scene-laptop .hotspot-rato{left:82.5%!important;right:auto!important;top:64.5%!important;bottom:auto!important;width:12.5%!important;height:13.5%!important;transform:none!important}

/* Modo normal: as áreas continuam clicáveis, mas a grelha de diagnóstico fica oculta. */
body .screen-play .hotspot,
body .screen-play .hotspot.correct,
body .screen-play .hotspot.hint{border-color:transparent!important;background:transparent!important;box-shadow:none!important;animation:none!important}
body .screen-play .hotspot::after{display:none!important;content:none!important}
body .screen-play .hotspot:focus-visible{outline:3px solid var(--primary)!important;outline-offset:3px}

/* Nível 2 — puzzle deslizante: doze quadrados e apenas um espaço vazio. */
body .screen-play .scene.scene-puzzle{aspect-ratio:4 / 3!important;height:auto!important;overflow:hidden;background:#dbeef1;padding:clamp(10px,2.2vw,26px)!important}
body .screen-play .scene.scene-puzzle .puzzle-board{width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(135deg,#f4fbfb,#d5edf0);border:2px solid rgba(8,127,134,.18);border-radius:clamp(12px,2vw,24px);padding:clamp(8px,1.6vw,20px);box-sizing:border-box}
body .screen-play .scene.scene-puzzle .puzzle-grid{width:min(100%,980px);height:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:clamp(4px,.8vw,10px);align-content:center;justify-content:center}
body .screen-play .scene.scene-puzzle .puzzle-tile,
body .screen-play .scene.scene-puzzle .puzzle-empty{min-width:0;min-height:0;aspect-ratio:1;border-radius:clamp(5px,1vw,12px);box-sizing:border-box}
body .screen-play .scene.scene-puzzle .puzzle-tile{display:block;width:100%;height:100%;border:2px solid rgba(25,58,83,.2);background-repeat:no-repeat;background-size:400% 300%;box-shadow:0 3px 8px rgba(25,58,83,.14);cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
body .screen-play .scene.scene-puzzle .puzzle-tile.is-movable{border-color:rgba(8,127,134,.75);box-shadow:0 0 0 3px rgba(8,127,134,.18),0 4px 10px rgba(25,58,83,.18)}
body .screen-play .scene.scene-puzzle .puzzle-tile.is-movable:hover{transform:translateY(-2px);box-shadow:0 0 0 4px rgba(247,183,51,.58),0 6px 12px rgba(25,58,83,.2)}
body .screen-play .scene.scene-puzzle .puzzle-tile:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
body .screen-play .scene.scene-puzzle .puzzle-tile[aria-disabled="true"]{cursor:default}
body .screen-play .scene.scene-puzzle .puzzle-empty{display:grid;place-items:center;border:3px dashed rgba(8,127,134,.42);background:rgba(255,255,255,.62);color:rgba(8,127,134,.5);font-size:clamp(1.4rem,4vw,3rem);font-weight:800}
body .screen-play .scene.scene-puzzle .puzzle-empty span{line-height:1;transform:translateY(-2px)}
@media (max-width:600px){
  body .screen-play .scene.scene-puzzle{padding:8px!important}
  body .screen-play .scene.scene-puzzle .puzzle-board{padding:6px}
  body .screen-play .scene.scene-puzzle .puzzle-grid{gap:3px}
  body .screen-play .scene.scene-puzzle .puzzle-tile{border-width:1px}
}

/* Nível 3 — labirintos com rato, caminho pintado e destino de TIC. */
body .screen-play .scene.scene-maze{aspect-ratio:4 / 3!important;height:auto!important;overflow:visible;background:url('../assets/backgrounds/maze-circuit-bg.png') center/cover;border:1px solid rgba(8,127,134,.18);padding:clamp(10px,2vw,22px)!important}
body .screen-play .scene.scene-maze .maze-board{position:relative;width:100%;height:100%;min-height:0;padding:clamp(8px,1.5vw,16px);background:rgba(255,255,255,.78);border:2px solid rgba(8,127,134,.24);border-radius:clamp(12px,2vw,24px);box-shadow:0 10px 24px rgba(24,48,74,.14);outline:0}
body .screen-play .scene.scene-maze .maze-board:focus-visible{box-shadow:0 0 0 4px rgba(8,127,134,.3),0 10px 24px rgba(24,48,74,.14)}
body .screen-play .scene.scene-maze .maze-grid{position:relative;width:100%;height:calc(100% - 28px);display:grid;grid-template-columns:repeat(23,minmax(0,1fr));grid-template-rows:repeat(15,minmax(0,1fr));overflow:hidden;border:2px solid rgba(24,48,74,.3);border-radius:clamp(8px,1.3vw,16px);background:#fffdf4}
body .screen-play .scene.scene-maze .maze-cell{position:relative;z-index:1;min-width:0;min-height:0;display:grid;place-items:center;border:0;background:transparent}
body .screen-play .scene.scene-maze .maze-cell.is-wall{background:transparent}
body .screen-play .scene.scene-maze .maze-cell.is-open{background:rgba(255,253,244,.96)}
body .screen-play .scene.scene-maze .maze-cell.is-trail{background:rgba(255,226,139,.74)}
body .screen-play .scene.scene-maze .maze-walls{position:absolute;inset:0;z-index:2;width:100%;height:100%;pointer-events:none;overflow:visible}
body .screen-play .scene.scene-maze .maze-walls line{stroke:#173e49;stroke-width:.11;stroke-linecap:square;stroke-linejoin:miter}
body .screen-play .scene.scene-maze .maze-trail{position:absolute;inset:0;z-index:3;width:100%;height:100%;pointer-events:none;overflow:visible}
body .screen-play .scene.scene-maze .maze-trail polyline{fill:none;stroke:#f09f2f;stroke-width:.22;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 1px rgba(125,78,10,.25))}
body .screen-play .scene.scene-maze .maze-player{position:relative;z-index:4;width:76%;height:76%;object-fit:contain;filter:drop-shadow(0 3px 3px rgba(24,48,74,.3));pointer-events:none}
body .screen-play .scene.scene-maze .maze-target{position:relative;z-index:4;display:grid;place-items:center;width:78%;height:78%;border:3px solid #e69b0d;border-radius:50%;background:#fff8d5;color:#087f86;font-size:clamp(1rem,3vw,2.2rem);font-weight:950;line-height:1;box-shadow:0 3px 8px rgba(125,78,10,.22)}
body .screen-play .scene.scene-maze .maze-target-monitor{color:#087f86}
body .screen-play .scene.scene-maze .maze-target-teclado{color:#b26b00}
body .screen-play .scene.scene-maze .maze-target-rato{color:#d45f50}
body .screen-play .scene.scene-maze .maze-target-colunas{color:#7d58b3}
body .screen-play .scene.scene-maze .maze-target-portatil{color:#087f86}
body .screen-play .scene.scene-maze .maze-keyboard-help{position:absolute;right:clamp(10px,2vw,18px);bottom:3px;margin:0;color:var(--muted);font-size:clamp(.68rem,1.2vw,.84rem);font-weight:800}
@media (max-width:600px){
  body .screen-play .scene.scene-maze{padding:6px!important}
  body .screen-play .scene.scene-maze .maze-board{padding:6px}
  body .screen-play .scene.scene-maze .maze-grid{height:calc(100% - 24px);border-width:1px}
  body .screen-play .scene.scene-maze .maze-cell{border-width:1px}
  body .screen-play .scene.scene-maze .maze-target{border-width:2px}
  body .screen-play .scene.scene-maze .maze-keyboard-help{font-size:.63rem}
}

/* Contraste garantido no cartão claro quando o tema global está escuro. */
body .screen-play .play-card,
body .screen-play .instruction h2,
body .screen-play .listen{color:var(--ink)!important}

/* Controlos do jogo: música e entrada/saída do ecrã inteiro. */
body .game-top .top-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
body .game-top .top-actions .icon-btn{width:auto;min-width:44px;padding:9px 12px;color:var(--ink);white-space:nowrap}
body .game-top .top-actions button[data-action="repeat"],
body .game-top .top-actions button[data-action="toggleSound"]{width:44px;min-width:44px;padding:9px}
body .game-top .top-actions button[data-action="toggleMusic"].is-active{background:var(--primary);border-color:var(--primary);color:#fff}
body .screen-play:fullscreen,
body .screen-play:-webkit-full-screen,
body .screen-play.is-fullscreen-fallback{width:100vw;height:100dvh;min-height:100dvh;overflow:auto;margin:0;padding:12px clamp(12px,2vw,32px);background:var(--bg);border-radius:0}
body .screen-play:fullscreen .game-top,
body .screen-play:-webkit-full-screen .game-top,
body .screen-play.is-fullscreen-fallback .game-top{width:100%;max-width:1600px;margin:0 auto 10px}
body .screen-play:fullscreen .play-card,
body .screen-play:-webkit-full-screen .play-card,
body .screen-play.is-fullscreen-fallback .play-card{width:100%;max-width:1600px;height:calc(100dvh - 76px);min-height:0;margin:0 auto;padding:clamp(12px,2vw,28px);display:flex;flex-direction:column}
body .screen-play:fullscreen .scene,
body .screen-play:-webkit-full-screen .scene,
body .screen-play.is-fullscreen-fallback .scene{width:min(100%,1400px);max-height:calc(100dvh - 190px);flex:1 1 auto;min-height:0;margin:12px auto 8px;aspect-ratio:4 / 3}
body .screen-play:fullscreen .scene.scene-maze,
body .screen-play:-webkit-full-screen .scene.scene-maze,
body .screen-play.is-fullscreen-fallback .scene.scene-maze{aspect-ratio:23 / 15}
body .screen-play:fullscreen .scene.scene-puzzle,
body .screen-play:-webkit-full-screen .scene.scene-puzzle,
body .screen-play.is-fullscreen-fallback .scene.scene-puzzle{height:auto}
@media(max-width:900px){
  body .game-top .top-actions .control-label{display:none}
  body .game-top .top-actions button[data-action="toggleMusic"],
  body .game-top .top-actions button[data-action="fullscreen"],
  body .game-top .top-actions button[data-action="exitFullscreen"]{width:44px;min-width:44px;padding:9px;font-size:0}
  body .game-top .top-actions button[data-action="toggleMusic"] span[aria-hidden="true"],
  body .game-top .top-actions button[data-action="fullscreen"] span[aria-hidden="true"],
  body .game-top .top-actions button[data-action="exitFullscreen"] span[aria-hidden="true"]{font-size:1rem}
}
@media(max-width:620px){
  body .screen-play:fullscreen,
  body .screen-play:-webkit-full-screen,
  body .screen-play.is-fullscreen-fallback{padding:8px}
  body .screen-play:fullscreen .game-top,
  body .screen-play:-webkit-full-screen .game-top,
  body .screen-play.is-fullscreen-fallback .game-top{flex-wrap:wrap;gap:8px}
  body .screen-play:fullscreen .progress,
  body .screen-play:-webkit-full-screen .progress,
  body .screen-play.is-fullscreen-fallback .progress{order:3;flex-basis:100%}
  body .screen-play:fullscreen .play-card,
  body .screen-play:-webkit-full-screen .play-card,
  body .screen-play.is-fullscreen-fallback .play-card{height:calc(100dvh - 128px);padding:10px}
  body .screen-play:fullscreen .scene,
  body .screen-play:-webkit-full-screen .scene,
  body .screen-play.is-fullscreen-fallback .scene{max-height:calc(100dvh - 238px);margin-top:8px}
}

/* Nível 4 — três labirintos isométricos sobre circuitos eletrónicos. */
body .screen-play .scene.scene-isometric-maze{aspect-ratio:16 / 9!important;height:auto!important;overflow:visible;background:var(--iso-background) center/cover;border:1px solid rgba(8,127,134,.2);padding:clamp(8px,1.6vw,18px)!important}
body .screen-play .scene.scene-isometric-maze .iso-board{position:relative;width:100%;height:100%;min-height:0;overflow:hidden;border:2px solid rgba(8,127,134,.28);border-radius:clamp(12px,1.8vw,24px);background:rgba(255,255,255,.42);box-shadow:0 12px 28px rgba(24,48,74,.18);outline:0}
body .screen-play .scene.scene-isometric-maze .iso-board:focus-visible{box-shadow:0 0 0 4px rgba(8,127,134,.3),0 12px 28px rgba(24,48,74,.18)}
body .screen-play .scene.scene-isometric-maze .iso-canvas{position:absolute;inset:0;display:grid;place-items:center;padding:clamp(4px,1vw,12px)}
body .screen-play .scene.scene-isometric-maze .iso-svg{display:block;width:100%;height:100%;overflow:visible}
body .screen-play .scene.scene-isometric-maze .iso-cell .iso-top{stroke:rgba(24,48,74,.26);stroke-width:1.2;stroke-linejoin:round}
body .screen-play .scene.scene-isometric-maze .iso-cell .iso-side-left,
body .screen-play .scene.scene-isometric-maze .iso-cell .iso-side-right{stroke:rgba(24,48,74,.12);stroke-width:1;stroke-linejoin:round}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-wall .iso-top{fill:#153c4a}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-wall .iso-side-left{fill:#0c2b38}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-wall .iso-side-right{fill:#104454}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-open .iso-top{fill:rgba(255,253,241,.94)}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-open .iso-side-left{fill:rgba(190,218,218,.9)}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-open .iso-side-right{fill:rgba(160,198,201,.94)}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-trail .iso-top{fill:rgba(247,183,51,.75)}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-trail .iso-side-left{fill:rgba(218,158,45,.82)}
body .screen-play .scene.scene-isometric-maze .iso-cell.is-trail .iso-side-right{fill:rgba(197,132,29,.86)}
body .screen-play .scene.scene-isometric-maze .iso-trail{fill:none;stroke:#ed9d25;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 2px rgba(125,78,10,.25));pointer-events:none}
body .screen-play .scene.scene-isometric-maze .iso-player{filter:drop-shadow(0 4px 3px rgba(24,48,74,.35));pointer-events:none}
body .screen-play .scene.scene-isometric-maze .iso-target{fill:#fff6c6;stroke:#e69b0d;stroke-width:4;filter:drop-shadow(0 3px 3px rgba(125,78,10,.22))}
body .screen-play .scene.scene-isometric-maze .iso-target-glyph{fill:#087f86;font-size:24px;font-weight:900;pointer-events:none}
body .screen-play .scene.scene-isometric-maze .iso-controls{position:absolute;right:clamp(10px,2vw,22px);bottom:clamp(10px,2vw,22px);z-index:5;display:grid;justify-items:center;gap:4px;padding:6px;border:1px solid rgba(8,127,134,.25);border-radius:14px;background:rgba(255,255,255,.78);backdrop-filter:blur(6px);box-shadow:0 5px 12px rgba(24,48,74,.16)}
body .screen-play .scene.scene-isometric-maze .iso-controls>div{display:flex;gap:4px}
body .screen-play .scene.scene-isometric-maze .iso-controls button{width:34px;height:30px;border:1px solid rgba(8,127,134,.3);border-radius:8px;background:rgba(255,255,255,.88);color:var(--ink);font-weight:900;cursor:pointer}
body .screen-play .scene.scene-isometric-maze .iso-controls button:hover,
body .screen-play .scene.scene-isometric-maze .iso-controls button:focus-visible{background:var(--primary);color:#fff;outline:3px solid rgba(8,127,134,.28);outline-offset:2px}
body .screen-play .scene.scene-isometric-maze .iso-keyboard-help{position:absolute;left:clamp(10px,2vw,22px);bottom:clamp(10px,2vw,22px);z-index:4;margin:0;padding:5px 9px;border-radius:9px;background:rgba(255,255,255,.72);color:var(--muted);font-size:clamp(.64rem,1.1vw,.8rem);font-weight:800}
body .screen-play:fullscreen .scene.scene-isometric-maze,
body .screen-play:-webkit-full-screen .scene.scene-isometric-maze,
body .screen-play.is-fullscreen-fallback .scene.scene-isometric-maze{aspect-ratio:16 / 9}
@media(max-width:600px){
  body .screen-play .scene.scene-isometric-maze{padding:5px!important}
  body .screen-play .scene.scene-isometric-maze .iso-board{border-width:1px}
  body .screen-play .scene.scene-isometric-maze .iso-controls{right:8px;bottom:8px;transform:scale(.86);transform-origin:bottom right}
  body .screen-play .scene.scene-isometric-maze .iso-keyboard-help{left:8px;bottom:8px;font-size:.58rem}
}

/* Entrada compacta: mantém o conteúdo, mas deixa níveis, controlos e ações à vista. */
body .game-shell{width:min(100% - 24px,1280px);margin-inline:auto}
body .screen-hero{grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)!important;gap:clamp(12px,2vw,26px)!important;min-height:0!important;height:auto!important;padding:clamp(12px,2vw,24px)!important;align-items:center!important}
body .screen-hero .hero-art{grid-column:1!important;grid-row:1!important;position:relative!important;width:100%!important;height:clamp(280px,42vh,440px)!important;min-height:0!important;border-radius:18px!important;background-size:contain!important;background-position:center!important;box-shadow:none!important}
body .screen-hero .hero-settings{grid-column:2!important;grid-row:1!important;align-self:center!important;justify-content:flex-start!important;gap:6px!important;width:100%!important;min-height:0!important;margin:0!important;padding:clamp(16px,2.2vw,28px)!important;border-radius:12px!important;color:#18304a!important;background:#fff!important;box-shadow:0 8px 28px rgba(24,48,74,.12)!important}
body .hero-settings>.hero-copy{position:static!important;top:auto!important;left:auto!important;width:auto!important;margin:0 0 4px!important;padding:0!important}
body .hero-settings .hero-copy .eyebrow{font-size:.68rem!important;letter-spacing:.08em!important}
body .hero-settings .hero-copy h1{margin:5px 0 8px!important;font-size:clamp(1.8rem,2.6vw,2.6rem)!important;line-height:1.02!important;letter-spacing:-.04em!important;text-shadow:none!important}
body .hero-settings .hero-copy h1 em{color:var(--primary)!important}
body .hero-settings .hero-copy p{max-width:none!important;margin:4px 0!important;color:#43586c!important;font-size:.86rem!important;line-height:1.35!important;text-shadow:none!important}
body .hero-settings .hero-copy .skill{padding:0 0 0 9px!important;border-left:3px solid var(--accent)!important;background:transparent!important;font-size:.78rem!important}
body .hero-settings>.eyebrow{font-size:.68rem!important;letter-spacing:.08em!important}
body .hero-settings #settings-title{margin:0!important;color:#18304a!important;font-size:1.28rem!important;line-height:1.15!important}
body .hero-settings>p{margin:0 0 2px!important;color:#53687b!important;font-size:.82rem!important}
body .hero-settings fieldset{margin:0!important;padding:0!important}
body .hero-settings legend{margin:0 0 5px!important;color:#18304a!important;font-size:.78rem!important}
body .hero-settings #levels{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important}
body .hero-settings .chip{min-height:36px!important;padding:6px 8px!important;border-radius:6px!important;font-size:.76rem!important;line-height:1.15!important}
body .hero-settings .settings-note{display:block;margin-top:5px;color:#5f7488!important;font-size:.72rem!important;line-height:1.25!important}
body .hero-settings .setting-row{justify-content:flex-start!important;gap:18px!important;margin:4px 0 0!important;color:#18304a!important;font-size:.76rem!important}
body .hero-settings .switch{gap:6px!important;font-weight:700!important}
body .hero-settings .setup-actions{display:grid!important;grid-template-columns:1fr!important;gap:5px!important;margin:5px 0 0!important}
body .hero-settings .setup-actions .btn{width:100%!important;min-height:40px!important;padding:8px 14px!important;border-radius:6px!important;font-size:.88rem!important}
body .hero-settings .setup-actions .btn-ghost{min-height:34px!important}
@media(max-width:760px){
  body .game-shell{width:min(100% - 16px,620px)}
  body .screen-hero{display:flex!important;flex-direction:column!important;gap:8px!important;padding:8px!important}
  body .screen-hero .hero-art{order:0!important;width:100%!important;height:clamp(112px,18vh,150px)!important;min-height:0!important;aspect-ratio:16/9!important;background-size:contain!important}
  body .screen-hero .hero-settings{order:1!important;width:100%!important;padding:12px!important;gap:4px!important}
  body .hero-settings .hero-copy h1{font-size:1.72rem!important}
  body .hero-settings .hero-copy p{font-size:.78rem!important}
  body .hero-settings .hero-copy .skill{font-size:.72rem!important}
  body .hero-settings #settings-title{font-size:1.12rem!important}
  body .hero-settings .setting-row{gap:12px!important}
}
@media(max-width:390px){
  body .hero-settings #levels{grid-template-columns:repeat(2,minmax(0,1fr))}
  body .hero-settings .chip{font-size:.7rem!important}
  body .hero-settings .hero-copy p:not(.skill){font-size:.74rem!important}
}

/* Níveis 1 e 2: tabuleiro mais contido para se ver sem zoom do navegador. */
body .screen-play .scene.scene-desktop,
body .screen-play .scene.scene-laptop{width:min(72%,1180px)!important;max-height:calc(100vh - 250px)!important;margin:10px auto!important}
@media(max-width:760px){body .screen-play .scene.scene-desktop,body .screen-play .scene.scene-laptop{width:min(96%,680px)!important;max-height:calc(100vh - 210px)!important}}
body .screen-play .scene.scene-puzzle{display:block!important;width:min(80%,1220px)!important;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;overflow:hidden!important;margin:8px auto!important;padding:clamp(8px,1.1vw,14px)!important;border-radius:10px!important;background:#eaf4f5!important}
body .screen-play .scene.scene-puzzle .puzzle-workspace{display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;width:100%;height:100%;min-height:0}
body .screen-play .scene.scene-puzzle .puzzle-reference{display:flex;align-items:center;justify-content:center;gap:12px;min-height:0;padding:5px 10px;border:1px solid rgba(8,127,134,.16);border-radius:7px;background:rgba(255,255,255,.82)}
body .screen-play .scene.scene-puzzle .puzzle-reference span{color:#18304a;font-size:clamp(.68rem,1vw,.82rem);font-weight:800}
body .screen-play .scene.scene-puzzle .puzzle-reference img{display:block;width:auto;height:clamp(48px,8vh,76px);max-width:70%;object-fit:contain;border-radius:4px}
body .screen-play .scene.scene-puzzle .puzzle-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(220px,.85fr);gap:clamp(8px,1vw,14px);min-height:0}
body .screen-play .scene.scene-puzzle .puzzle-board-panel,
body .screen-play .scene.scene-puzzle .puzzle-tray-panel{display:flex;flex-direction:column;min-width:0;min-height:0;padding:8px;border:1px solid rgba(8,127,134,.18);border-radius:7px;background:rgba(255,255,255,.86)}
body .screen-play .scene.scene-puzzle .puzzle-board-panel h3,
body .screen-play .scene.scene-puzzle .puzzle-tray-panel h3{margin:0 0 6px;color:#18304a;font-size:clamp(.72rem,1.1vw,.9rem);line-height:1.2}
body .screen-play .scene.scene-puzzle .puzzle-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:4px;width:min(100%,720px);height:auto;aspect-ratio:3/2;align-self:center;margin:auto;align-content:stretch;justify-content:stretch}
body .screen-play .scene.scene-puzzle .puzzle-slot{display:block;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:6/5;overflow:hidden;border:1px dashed rgba(8,127,134,.55);border-radius:3px;background-color:rgba(225,241,242,.72);background-repeat:no-repeat;background-size:500% 400%;box-shadow:none;cursor:pointer;touch-action:none}
body .screen-play .scene.scene-puzzle .puzzle-slot:not(.is-filled):hover,
body .screen-play .scene.scene-puzzle .puzzle-slot:not(.is-filled):focus-visible{outline:2px solid #087f86;outline-offset:1px;background-color:rgba(8,127,134,.12)}
body .screen-play .scene.scene-puzzle .puzzle-slot.is-filled{border-style:solid;border-color:rgba(24,48,74,.25);cursor:pointer}
body .screen-play .scene.scene-puzzle .puzzle-slot.puzzle-anchor{border:2px solid #087f86;cursor:default}
body .screen-play .scene.scene-puzzle .puzzle-tray{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:4px;flex:1;min-height:0;align-content:center;justify-items:stretch;align-items:center}
body .screen-play .scene.scene-puzzle .puzzle-piece,
body .screen-play .scene.scene-puzzle .puzzle-tray-empty{display:block;width:100%;height:auto;aspect-ratio:6/5;min-width:0;min-height:0;padding:0;overflow:hidden;border:1px solid rgba(24,48,74,.2);border-radius:3px;background-color:#fff;background-repeat:no-repeat;background-size:500% 400%;box-shadow:0 1px 3px rgba(24,48,74,.12)}
body .screen-play .scene.scene-puzzle .puzzle-piece{cursor:grab;touch-action:none;user-select:none}
body .screen-play .scene.scene-puzzle .puzzle-piece:hover,
body .screen-play .scene.scene-puzzle .puzzle-piece.is-selected{outline:2px solid #087f86;outline-offset:1px;box-shadow:0 0 0 2px rgba(8,127,134,.16)}
body .screen-play .scene.scene-puzzle .puzzle-piece.is-dragging{opacity:.5;cursor:grabbing}
body .screen-play .scene.scene-puzzle .puzzle-status{min-height:2.4em;margin:6px 0 0;color:#465f70;font-size:clamp(.64rem,.95vw,.76rem);line-height:1.25}
body .puzzle-drag-preview{position:fixed;z-index:9999;width:clamp(54px,7vw,90px);aspect-ratio:6/5;border:2px solid #087f86;border-radius:4px;background-repeat:no-repeat;background-size:500% 400%;box-shadow:0 8px 18px rgba(24,48,74,.28);transform:translate(-50%,-50%);pointer-events:none}
@media(max-width:760px){
  body .screen-play .scene.scene-puzzle{width:min(96%,680px)!important;padding:6px!important}
  body .screen-play .scene.scene-puzzle .puzzle-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto}
  body .screen-play .scene.scene-puzzle .puzzle-grid{width:min(100%,560px)}
  body .screen-play .scene.scene-puzzle .puzzle-tray-panel{min-height:240px}
  body .screen-play .scene.scene-puzzle .puzzle-tray{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr))}
}
@media(max-width:420px){
  body .screen-play .scene.scene-puzzle .puzzle-board-panel,
  body .screen-play .scene.scene-puzzle .puzzle-tray-panel{padding:6px}
  body .screen-play .scene.scene-puzzle .puzzle-grid,
  body .screen-play .scene.scene-puzzle .puzzle-tray{gap:3px}
}
body .screen-play:fullscreen .scene.scene-puzzle,
body .screen-play:-webkit-full-screen .scene.scene-puzzle,
body .screen-play.is-fullscreen-fallback .scene.scene-puzzle{width:min(80%,1400px)!important;max-height:calc(100dvh - 188px)!important;flex:1 1 auto}
@media(max-width:760px){body .screen-play:fullscreen .scene.scene-puzzle,body .screen-play:-webkit-full-screen .scene.scene-puzzle,body .screen-play.is-fullscreen-fallback .scene.scene-puzzle{width:min(96%,680px)!important;max-height:none!important;flex:0 0 auto}}
body .screen-play:has(.scene-puzzle) .instruction h2{font-size:clamp(1rem,1.5vw,1.28rem)!important;line-height:1.2!important}
body .screen-play .scene.scene-puzzle{height:clamp(330px,44vh,410px)!important;max-height:calc(100vh - 410px)!important}
body .screen-play .scene.scene-puzzle .puzzle-workspace{grid-template-rows:64px minmax(0,1fr)!important}
body .screen-play .scene.scene-puzzle .puzzle-grid{width:min(100%,390px)!important;max-height:calc(100% - 8px)!important}
body .screen-play .scene.scene-puzzle .puzzle-tray-panel{overflow:hidden}
body .screen-play:fullscreen .scene.scene-puzzle,
body .screen-play:-webkit-full-screen .scene.scene-puzzle,
body .screen-play.is-fullscreen-fallback .scene.scene-puzzle{height:clamp(330px,60vh,620px)!important;max-height:calc(100dvh - 188px)!important}
@media(max-width:760px){
  body .screen-play .scene.scene-puzzle{height:auto!important;max-height:none!important}
  body .screen-play .scene.scene-puzzle .puzzle-workspace{grid-template-rows:58px auto!important}
  body .screen-play .scene.scene-puzzle .puzzle-grid{width:min(100%,560px)!important;max-height:none!important}
  body .screen-play .scene.scene-puzzle .puzzle-tray-panel{overflow:visible}
  body .screen-play:fullscreen .scene.scene-puzzle,body .screen-play:-webkit-full-screen .scene.scene-puzzle,body .screen-play.is-fullscreen-fallback .scene.scene-puzzle{height:auto!important;max-height:none!important}
}

/* A ilustração da sala fica na coluna esquerda; o painel mantém o fundo sólido à direita. */
body .screen-hero{background-image:none!important;background-color:#bfe8e7!important}
body .screen-hero .hero-art{background-image:url('../assets/backgrounds/hero-bg.png')!important;background-size:cover!important;background-position:72% center!important;background-repeat:no-repeat!important;background-color:#bfe8e7!important}
@media(max-width:760px){body .screen-hero .hero-art{background-position:72% center!important}}

/* Nível 2 — peças de encaixe tradicionais e reposicionáveis. */
body .screen-play .scene.scene-puzzle .puzzle-grid{gap:0!important;overflow:visible!important}
body .screen-play .scene.scene-puzzle .puzzle-slot{position:relative;display:block;min-width:0;min-height:0;width:100%;height:100%;aspect-ratio:6/5;padding:0;border:0;border-radius:0;background:transparent;overflow:visible;box-shadow:none;touch-action:none;z-index:1}
body .screen-play .scene.scene-puzzle .puzzle-slot.is-filled{border:0;background:transparent;cursor:grab;z-index:2}
body .screen-play .scene.scene-puzzle .puzzle-slot.is-filled:hover{z-index:3}
body .screen-play .scene.scene-puzzle .puzzle-slot.is-filled.is-selected{z-index:4}
body .screen-play .scene.scene-puzzle .puzzle-slot.puzzle-anchor{border:0;background:transparent;cursor:default}
body .screen-play .scene.scene-puzzle .puzzle-cell-art{display:block;width:100%;height:100%;overflow:visible;pointer-events:none}
body .screen-play .scene.scene-puzzle .puzzle-piece-outline{fill:none;stroke:rgba(24,48,74,.72);stroke-width:1.25;vector-effect:non-scaling-stroke;stroke-linejoin:round}
body .screen-play .scene.scene-puzzle .puzzle-anchor .puzzle-piece-outline{stroke:#087f86;stroke-width:2.2}
body .screen-play .scene.scene-puzzle .puzzle-slot.is-selected .puzzle-piece-outline{stroke:#087f86;stroke-width:3}
body .screen-play .scene.scene-puzzle .puzzle-empty-art path{fill:rgba(8,127,134,.09);stroke:rgba(8,127,134,.68);stroke-width:1.5;stroke-dasharray:3 2;vector-effect:non-scaling-stroke;stroke-linejoin:round}
body .screen-play .scene.scene-puzzle .puzzle-tray{gap:clamp(4px,.65vw,9px)!important;overflow:visible!important;padding:6px 8px}
body .screen-play .scene.scene-puzzle .puzzle-piece,
body .screen-play .scene.scene-puzzle .puzzle-tray-empty{position:relative;display:block;width:100%;height:auto;min-width:0;min-height:0;aspect-ratio:6/5;padding:0;border:0;border-radius:0;background:transparent;overflow:visible;box-shadow:none;touch-action:none;user-select:none;z-index:1}
body .screen-play .scene.scene-puzzle .puzzle-piece{cursor:grab}
body .screen-play .scene.scene-puzzle .puzzle-piece .puzzle-piece-outline{stroke:rgba(24,48,74,.68);stroke-width:1.15}
body .screen-play .scene.scene-puzzle .puzzle-piece:hover{z-index:3;filter:drop-shadow(0 3px 3px rgba(24,48,74,.25))}
body .screen-play .scene.scene-puzzle .puzzle-piece.is-selected{z-index:4;filter:drop-shadow(0 0 3px rgba(8,127,134,.8))}
body .screen-play .scene.scene-puzzle .puzzle-piece.is-selected .puzzle-piece-outline{stroke:#087f86;stroke-width:2.5}
body .screen-play .scene.scene-puzzle .puzzle-piece.is-dragging{opacity:.28;cursor:grabbing}
body .screen-play .scene.scene-puzzle .puzzle-tray-empty{cursor:default}
body .screen-play .scene.scene-puzzle .puzzle-tray-empty:focus-visible,
body .screen-play .scene.scene-puzzle .puzzle-piece:focus-visible,
body .screen-play .scene.scene-puzzle .puzzle-slot:focus-visible{outline:2px solid #087f86;outline-offset:2px;z-index:5}
body .screen-play .scene.scene-puzzle .puzzle-piece.is-dragging,
body .screen-play .scene.scene-puzzle .puzzle-slot.is-filled.is-dragging{opacity:.12;cursor:grabbing}
body .puzzle-drag-preview{position:fixed;z-index:9999;width:clamp(64px,8vw,104px);aspect-ratio:6/5;transform:translate(12px,12px);pointer-events:none;filter:drop-shadow(0 7px 9px rgba(24,48,74,.34))}
body .puzzle-drag-preview .puzzle-cell-art{width:100%;height:100%;overflow:visible}
body .screen[hidden]{display:none!important}

/* Em ecrã inteiro, compacta as cinco filas da bandeja sem reduzir o tabuleiro. */
body .screen-play:fullscreen .scene.scene-puzzle .puzzle-tray,
body .screen-play:-webkit-full-screen .scene.scene-puzzle .puzzle-tray,
body .screen-play.is-fullscreen .scene.scene-puzzle .puzzle-tray,
body .screen-play.is-fullscreen-fallback .scene.scene-puzzle .puzzle-tray{grid-template-rows:repeat(5,max-content)!important;grid-auto-rows:max-content!important;align-content:center!important;gap:clamp(2px,.25vw,4px)!important;padding:2px 4px!important}
@media(max-width:760px){
  body .screen-play:fullscreen .scene.scene-puzzle .puzzle-tray,
  body .screen-play:-webkit-full-screen .scene.scene-puzzle .puzzle-tray,
  body .screen-play.is-fullscreen .scene.scene-puzzle .puzzle-tray,
  body .screen-play.is-fullscreen-fallback .scene.scene-puzzle .puzzle-tray{grid-template-rows:repeat(4,max-content)!important;gap:clamp(2px,.45vw,4px)!important}
}

/* O cartão final mantém contraste próprio nos dois temas do Portal. */
body .screen-result .result-card{color:#18304a;background:#fff}
body .screen-result .result-card h2{color:#18304a}
body .screen-result .result-card p{color:#52687c}
html[data-theme="dark"] body .screen-result .result-card{color:#f3f7ff;background:#172338;border-color:#33455e}
html[data-theme="dark"] body .screen-result .result-card h2{color:#f3f7ff}
html[data-theme="dark"] body .screen-result .result-card p{color:#c3cee0}
html[data-theme="dark"] body .screen-result .result-card .eyebrow{color:#a9c1ff}
html[data-theme="dark"] body .screen-result .result-card .btn-ghost{color:#f3f7ff;background:#243650;border-color:#526986}

/* Nível 5 — puzzle deslizante 4×3, recuperado como modo separado do puzzle de encaixe. */
body .screen-play .scene.scene-sliding-puzzle{display:grid!important;place-items:center;width:min(96%,1000px)!important;max-width:1000px!important;height:auto!important;min-height:0!important;aspect-ratio:4/3!important;overflow:hidden!important;padding:clamp(10px,2vw,22px)!important;border:1px solid rgba(8,127,134,.2);background:linear-gradient(145deg,#eaf6f6,#d6ebee)!important}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-grid{display:grid;width:min(100%,900px);height:auto;aspect-ratio:4/3;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:clamp(3px,.7vw,8px);padding:clamp(5px,1vw,12px);border:1px solid rgba(8,127,134,.22);border-radius:clamp(8px,1.2vw,14px);background:rgba(255,255,255,.78);box-shadow:0 8px 24px rgba(24,48,74,.14);outline:0}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-grid:focus-visible{box-shadow:0 0 0 3px rgba(8,127,134,.34),0 8px 24px rgba(24,48,74,.14)}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile,body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-empty{display:block;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:1;border-radius:clamp(4px,.7vw,9px);box-sizing:border-box}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile{padding:0;border:1px solid rgba(25,58,83,.22);background-color:#fff;background-repeat:no-repeat;background-size:400% 300%;box-shadow:0 2px 6px rgba(25,58,83,.13);cursor:pointer;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile.is-movable{border-color:rgba(8,127,134,.72);box-shadow:0 0 0 2px rgba(8,127,134,.17),0 3px 7px rgba(25,58,83,.16)}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile.is-movable:hover{transform:translateY(-1px);box-shadow:0 0 0 3px rgba(247,183,51,.55),0 4px 9px rgba(25,58,83,.18)}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile[aria-disabled="true"]{cursor:default}
body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-empty{border:2px dashed rgba(8,127,134,.45);background:rgba(222,241,241,.7)}
html[data-theme="dark"] body .screen-play .scene.scene-sliding-puzzle{background:linear-gradient(145deg,#24364a,#19283a)!important}
html[data-theme="dark"] body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-grid{background:rgba(255,255,255,.08);border-color:rgba(185,211,225,.22)}
html[data-theme="dark"] body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-tile{border-color:rgba(210,230,240,.26)}
html[data-theme="dark"] body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-empty{border-color:rgba(120,208,205,.58);background:rgba(120,208,205,.12)}
@media(max-width:600px){body .screen-play .scene.scene-sliding-puzzle{width:100%!important;padding:8px!important;border-radius:10px!important}body .screen-play .scene.scene-sliding-puzzle .sliding-puzzle-grid{gap:3px;padding:5px}}

/* Jogo em ecrãs baixos: reservar espaço para o tabuleiro sem pedir zoom ao aluno. */
body .screen-play.is-sliding-puzzle{min-height:0!important;padding:clamp(8px,2vh,20px) clamp(12px,3vw,42px)!important}
body .screen-play.is-sliding-puzzle .game-top{margin-bottom:clamp(8px,1.2vh,14px)!important}
body .screen-play.is-sliding-puzzle .play-card{padding:clamp(12px,1.6vw,20px)!important}
body .screen-play.is-sliding-puzzle .instruction{gap:10px!important}
body .screen-play.is-sliding-puzzle .instruction .mascot{flex:0 0 40px;width:40px;height:40px;font-size:1.55rem}
body .screen-play.is-sliding-puzzle .instruction h2{font-size:clamp(1.2rem,1.9vw,1.6rem)!important;line-height:1.2!important}
body .screen-play .scene.scene-sliding-puzzle{width:min(96%,max(220px,calc((100vh - 380px)*1.3333)))!important;margin:12px auto 6px!important;padding:clamp(6px,.8vw,12px)!important}
@supports (height:100dvh){body .screen-play .scene.scene-sliding-puzzle{width:min(96%,max(220px,calc((100dvh - 380px)*1.3333)))!important}}
@media(max-width:620px){body .game-top{gap:4px!important;align-items:center!important}body .game-top .progress{flex:1 1 48px!important;min-width:42px!important;max-width:60px}body .game-top .top-actions{flex:0 0 auto;gap:2px!important}body .game-top .top-actions .icon-btn{width:42px!important;min-width:42px!important;height:42px!important;padding:6px!important}body .game-top .top-actions #stars{display:inline-flex!important;font-size:.78rem!important;white-space:nowrap}body .game-top .top-actions span[aria-hidden="true"]{display:inline-flex!important}body .game-top .top-actions span.control-label{display:none!important}body .game-top button[data-action="hero"]::before{content:"←";font-size:1rem!important}}
@media(max-width:600px){body .screen-play.is-sliding-puzzle .instruction h2{font-size:clamp(1.15rem,5vw,1.35rem)!important;line-height:1.2!important}body .screen-play .scene.scene-sliding-puzzle{width:min(100%,max(220px,calc((100vh - 380px)*1.3333)))!important;padding:6px!important}}
@media(max-height:700px){body .screen-play.is-sliding-puzzle{padding-top:6px!important;padding-bottom:6px!important}body .screen-play.is-sliding-puzzle .play-card{padding:10px!important}body .screen-play.is-sliding-puzzle .instruction h2{font-size:1.15rem!important}body .screen-play .scene.scene-sliding-puzzle{width:min(96%,max(200px,calc((100vh - 310px)*1.3333)))!important;margin:8px auto 4px!important;padding:5px!important}}

/* Níveis 1 e 2: dimensionar a imagem pela altura útil do ecrã, sem zoom. */
body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback){
  min-height:calc(100vh - 72px)!important;
  padding:clamp(8px,1.5vh,14px) clamp(12px,3vw,36px)!important;
}
body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .game-top{margin-bottom:10px!important}
body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .play-card{padding:clamp(12px,1.4vw,18px)!important}
body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-desktop,
body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-laptop{
  width:min(72%,1180px,max(300px,calc((100vh - 400px)*1.3333)))!important;
  max-height:calc(100vh - 400px)!important;
  margin:8px auto 6px!important;
}
@supports(height:100dvh){
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback){min-height:calc(100dvh - 72px)!important}
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-desktop,
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-laptop{
    width:min(72%,1180px,max(300px,calc((100dvh - 400px)*1.3333)))!important;
    max-height:calc(100dvh - 400px)!important;
  }
}
@media(max-width:760px){
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback){min-height:calc(100vh - 64px)!important;padding:8px!important}
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-desktop,
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-laptop{
    width:min(96%,680px,calc((100vh - 400px)*1.3333))!important;
    max-height:calc(100vh - 400px)!important;
  }
  body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .play-card{padding:12px!important}
}
@supports(height:100dvh){
  @media(max-width:760px){
    body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback){min-height:calc(100dvh - 64px)!important}
    body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-desktop,
    body .screen-play:not(:fullscreen):not(.is-fullscreen-fallback) .scene.scene-laptop{
      width:min(96%,680px,calc((100dvh - 400px)*1.3333))!important;
      max-height:calc(100dvh - 400px)!important;
    }
  }
}
