:root {
  --navy:#17374d;
  --navy-dark:#0d2839;
  --bronze:#9a612c;
  --bronze-dark:#68401f;
  --orange:#ef7d2e;
  --orange-dark:#b9511d;
  --green:#4e8b57;
  --green-dark:#2d6339;
  --yellow:#ffd867;
  --cream:#fff8e8;
  --ink:#18384b;
  --shadow:0 18px 48px rgba(25,48,63,.2);
}

* { box-sizing:border-box; }
html,body,#app { width:100%; min-height:100%; margin:0; }
body { color:var(--ink); background:#ece5d4; font-family:"Nunito","Trebuchet MS",sans-serif; overscroll-behavior:none; }
button { font:inherit; -webkit-tap-highlight-color:transparent; }
button:focus-visible { outline:4px solid var(--yellow); outline-offset:3px; }
.screen { display:none; min-height:100vh; }
.screen.active { display:block; }
.circle-button { width:46px; height:46px; border:0; border-radius:50%; color:var(--navy); background:white; box-shadow:0 4px 15px #1b30472b; font-size:20px; cursor:pointer; }
.primary-button { border:0; border-radius:17px; padding:16px 24px; color:white; background:linear-gradient(#ffad47,#ed782b); box-shadow:0 6px 0 var(--orange-dark),0 13px 26px #9d481e3d; font-weight:900; letter-spacing:.03em; cursor:pointer; transition:.15s transform,.15s box-shadow; }
.primary-button:hover { transform:translateY(-2px); }
.primary-button:active { transform:translateY(4px); box-shadow:0 2px 0 var(--orange-dark); }
.chapter-tag { display:block; width:max-content; padding:7px 11px; border-radius:999px; color:#815016; background:#ffefb2; font-size:9px; font-weight:900; letter-spacing:.13em; }
.legal-copy { margin:25px auto 0; color:#6f776f; font-size:10px; font-weight:700; text-align:center; }

/* Início */
.home-screen { padding:9px 16px 25px; background:linear-gradient(180deg,#fffdf6,#f3ead5); }
.brand-bar { max-width:1160px; height:68px; margin:auto; display:flex; align-items:center; gap:12px; }
.mini-logo { width:48px; height:48px; overflow:hidden; border:3px solid white; border-radius:50%; box-shadow:0 4px 13px #27475b28; }
.mini-logo img { width:100%; height:100%; object-fit:cover; }
.brand-copy { display:flex; flex-direction:column; }
.brand-copy strong { color:var(--navy); font-size:18px; font-weight:900; }
.brand-copy small { color:#7b7d72; font-size:8px; font-weight:900; letter-spacing:.14em; }
.brand-bar .circle-button { margin-left:auto; }
.hero-panel { position:relative; max-width:1160px; min-height:535px; margin:auto; overflow:hidden; border:6px solid white; border-radius:35px; background:#d5aa64 url("assets/background-vale-ela.png") center/cover no-repeat; box-shadow:var(--shadow); }
.hero-shade { position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,250,232,.97) 0 49%,rgba(255,246,220,.6) 62%,rgba(40,50,45,.08)); }
.hero-copy { position:relative; z-index:5; width:59%; padding:58px 0 48px 55px; }
.hero-copy h1 { margin:17px 0; color:var(--navy); font-size:clamp(40px,5vw,67px); line-height:.98; letter-spacing:-.045em; }
.hero-copy h1 em { color:#c46727; font-style:normal; }
.hero-copy>p { max-width:570px; margin:0; color:#48606c; font-size:16px; font-weight:700; line-height:1.55; }
.age-label { margin:23px 0 8px; color:#687463; font-size:10px; font-weight:900; letter-spacing:.12em; }
.age-options { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:21px; }
.age-options button { border:2px solid white; border-radius:999px; padding:8px 12px; color:#5b633e; background:#ffffffc7; font-size:11px; font-weight:900; cursor:pointer; }
.age-options button.selected { color:white; border-color:var(--green-dark); background:var(--green-dark); }
.home-hint { display:block; margin:13px 0 0 8px; color:#6b746d; font-size:10px; font-weight:800; }
.hero-characters { position:absolute; z-index:3; inset:0 0 0 55%; }
.davi-preview,.golias-preview { position:absolute; bottom:10px; display:block; background-repeat:no-repeat; filter:drop-shadow(0 11px 7px #4b321f55); }
.davi-preview { z-index:3; left:0; width:195px; height:390px; background-image:url("assets/davi-sprites.png"); background-size:400% 100%; background-position:0 0; }
.golias-preview { z-index:2; right:10px; width:353px; height:470px; background-image:url("assets/golias-sprites.png"); background-size:200% 100%; background-position:0 0; }
.hero-bubble { position:absolute; z-index:5; right:25px; top:35px; width:225px; padding:14px 17px; border-radius:20px; color:var(--navy); background:white; box-shadow:0 8px 22px #204f662b; text-align:center; font-size:14px; font-weight:900; }
.hero-bubble::after { content:""; position:absolute; left:34px; bottom:-13px; border:14px solid transparent; border-top-color:white; border-left:0; }
.benefit-row { max-width:1080px; margin:20px auto 0; display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.benefit-row article { display:flex; align-items:center; gap:12px; padding:10px 16px; }
.benefit-row article>span { width:52px; height:52px; flex:0 0 auto; display:grid; place-items:center; border-radius:17px; background:white; box-shadow:0 5px 17px #173b5715; font-size:28px; }
.benefit-row strong,.benefit-row small { display:block; }
.benefit-row strong { color:var(--navy); font-size:16px; font-weight:900; }
.benefit-row small { color:#747e83; font-size:10px; font-weight:800; }

/* História */
.intro-screen { position:relative; overflow:hidden; background:#111; }
.intro-screen.active { display:grid; place-items:end center; }
.classroom { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.story-shade { position:absolute; inset:0; background:linear-gradient(transparent 25%,rgba(12,39,48,.83)); }
.story-card { position:relative; z-index:2; width:min(920px,calc(100% - 32px)); min-height:195px; margin:0 auto 35px; display:grid; grid-template-columns:180px 1fr; align-items:end; border:5px solid white; border-radius:28px; background:#fffdf4ed; box-shadow:0 20px 50px #00000054; backdrop-filter:blur(8px); }
.sprite { display:block; background-repeat:no-repeat; background-position:0 0; }
.tio-sprite { background-image:url("assets/animations/tio-calvino-talk-v2.png"); background-size:400% 100%; }
.story-tio { width:126px; height:282px; align-self:end; margin:-92px auto 0; filter:drop-shadow(0 7px 5px #4025112e); }
.tio-sprite.talking { animation:spriteFour .95s linear infinite; }
.story-card>div { padding:22px 28px 23px; }
.speaker { color:#d76b28; font-size:9px; font-weight:900; letter-spacing:.18em; }
.story-card p { margin:7px 0 18px; color:var(--navy); font-size:18px; line-height:1.48; font-weight:800; }
.story-card .primary-button { padding:12px 18px; font-size:11px; }

/* Jogo */
.game-screen { padding-bottom:112px; background:#eee7d8; }
.game-header { position:relative; z-index:20; height:72px; display:flex; align-items:center; gap:13px; padding:9px clamp(11px,3vw,36px); background:white; box-shadow:0 5px 18px #12334829; }
.game-header .circle-button { background:#edf1eb; box-shadow:none; }
.game-title { display:flex; flex-direction:column; }
.game-title small { color:#c56b2d; font-size:8px; font-weight:900; letter-spacing:.16em; }
.game-title strong { color:var(--navy); font-size:15px; font-weight:900; }
.score { margin-left:auto; display:flex; align-items:center; gap:5px; padding:7px 11px; border-radius:99px; color:#8d6212; background:#fff5ca; }
.score span { font-size:18px; }
.score strong { font-size:12px; }
.progress { display:flex; align-items:center; gap:8px; }
.progress>span { color:#3e825d; font-size:11px; font-weight:900; }
.progress>div { width:min(16vw,165px); height:10px; overflow:hidden; border-radius:99px; background:#e0e5dc; }
.progress i { display:block; width:0; height:100%; border-radius:99px; background:linear-gradient(90deg,#53a568,#f0c749); transition:.35s; }
.world { position:relative; height:min(58vh,535px); min-height:370px; overflow:hidden; border-bottom:8px solid #85592f; outline:0; background:#d0a85b url("assets/background-vale-ela.png") center 58%/cover no-repeat; }
.world.phase-1 { filter:saturate(.96) brightness(1.07); }
.world.phase-2 { background-position:center 72%; filter:saturate(.9) sepia(.08); }
.world.phase-3 { background-position:center 50%; filter:saturate(.78) contrast(.96); }
.world.phase-4 { background-position:center 92%; filter:saturate(1.08) brightness(1.02); }
.world.phase-5 { background-position:center 45%; filter:saturate(.92) contrast(1.04); }
.scene-tint { position:absolute; inset:0; pointer-events:none; background:linear-gradient(transparent 60%,rgba(76,50,25,.13)); }
.object-layer,.obstacle-layer { position:absolute; inset:0; }
.mission-object { position:absolute; bottom:34px; min-width:78px; display:grid; justify-items:center; padding:8px; border:0; background:transparent; cursor:pointer; transform:translateX(-50%); transition:.25s transform,.25s opacity; }
.mission-object>span { width:62px; height:62px; display:grid; place-items:center; border:4px solid #fff; border-radius:21px; background:#fff8d2; box-shadow:0 8px 17px #3a2c1d42; font-size:37px; }
.mission-object small { margin-top:5px; padding:4px 8px; border-radius:99px; color:white; background:#17374dcc; font-size:8px; font-weight:900; white-space:nowrap; }
.mission-object.near>span { animation:pulse 1s infinite; box-shadow:0 0 0 8px #ffe17c66,0 8px 17px #3a2c1d42; }
.mission-object.collected { opacity:0; pointer-events:none; transform:translate(-50%,-75px) scale(.45); }
.obstacle { position:absolute; bottom:24px; width:72px; text-align:center; font-size:58px; filter:drop-shadow(0 7px 4px #3b2d204f); transform:translateX(-50%); }
.obstacle small { display:block; margin-top:-9px; color:#513b28; font-size:8px; font-weight:900; }
.player { position:absolute; z-index:8; left:6%; bottom:20px; width:118px; height:235px; margin-left:-59px; transform-origin:center bottom; transition:.12s left; filter:drop-shadow(0 8px 5px #3c2b2047); }
.player.left { transform:scaleX(-1); }
.player.right { transform:scaleX(1); }
.player.jumping { animation:jump .62s ease-in-out; }
.davi-sprite { width:100%; height:100%; display:block; background:url("assets/davi-sprites.png") 0 0/400% 100% no-repeat; }
.player.walking .davi-sprite { animation:daviWalk .58s steps(1) infinite; }
.player>i { position:absolute; z-index:-1; left:17%; right:17%; bottom:-4px; height:14px; border-radius:50%; background:#4b332f42; }
.giant { position:absolute; z-index:5; right:4%; bottom:20px; width:270px; height:360px; background:url("assets/golias-sprites.png") 0 0/200% 100% no-repeat; filter:drop-shadow(0 10px 6px #33231b55); }
.giant.surprised { background-position:100% 0; animation:giantReact .65s ease-in-out; }
.nearby-button { position:absolute; z-index:14; left:50%; bottom:22px; padding:10px 15px; border:3px solid white; border-radius:99px; color:white; background:var(--orange); box-shadow:0 5px 12px #52351f47; font-size:10px; font-weight:900; transform:translateX(-50%); cursor:pointer; }
.nearby-button[hidden] { display:none; }
.mission-area { display:grid; grid-template-columns:1fr 1.25fr; gap:12px; padding:11px clamp(10px,3vw,35px); background:#f7f1e3; }
.dialog-box { min-height:78px; display:flex; align-items:center; gap:10px; padding:8px 12px; border:3px solid white; border-radius:18px; background:#fffdf7; box-shadow:0 5px 18px #173b5714; }
.dialog-tio { width:31px; height:69px; flex:0 0 auto; filter:drop-shadow(0 3px 2px #48291324); }
.dialog-box p { flex:1; margin:0; font-size:12px; line-height:1.45; font-weight:800; }
.dialog-box p strong { color:#ce6826; }
.listen-button { width:34px; height:34px; flex:0 0 auto; border:0; border-radius:50%; background:#edf2ed; cursor:pointer; }
.quest-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
.quest-list article { min-width:0; display:flex; align-items:center; gap:6px; padding:7px; border:2px solid #ded8c9; border-radius:14px; background:#faf8f0; opacity:.62; }
.quest-list article>span { width:31px; height:31px; flex:0 0 auto; display:grid; place-items:center; border-radius:9px; background:white; }
.quest-list article>div { min-width:0; flex:1; }
.quest-list strong,.quest-list small { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.quest-list strong { font-size:8px; }
.quest-list small { color:#7a8586; font-size:7px; }
.quest-list article>b { color:#a6aaa2; font-size:13px; }
.quest-list article.done { opacity:1; border-color:#69a979; background:#e9f6e9; }
.quest-list article.done>b { color:#3d8d5a; font-size:0; }
.quest-list article.done>b::after { content:"✓"; font-size:16px; }
.touch-controls { position:fixed; z-index:40; left:50%; bottom:max(12px,env(safe-area-inset-bottom)); display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:25px; background:#ffffffdf; box-shadow:0 8px 28px #173b5742; backdrop-filter:blur(9px); transform:translateX(-50%); }
.touch-controls button { width:58px; height:58px; border:0; border-radius:18px; color:white; background:var(--navy); box-shadow:0 5px 0 var(--navy-dark); font-size:23px; cursor:pointer; touch-action:none; }
.touch-controls button:active { transform:translateY(3px); box-shadow:0 2px 0 var(--navy-dark); }
.touch-controls .action,.touch-controls .jump { width:73px; height:73px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.touch-controls .action { background:var(--orange); box-shadow:0 5px 0 var(--orange-dark); }
.touch-controls .jump { background:var(--green); box-shadow:0 5px 0 var(--green-dark); }
.touch-controls .action small,.touch-controls .jump small { font-size:7px; font-weight:900; }

/* Modais e conclusão */
.modal[hidden] { display:none; }
.modal { position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:18px; background:#091f2eae; backdrop-filter:blur(7px); }
.modal-card { width:min(530px,100%); padding:28px clamp(20px,5vw,45px); border:6px solid white; border-radius:30px; background:#fffaf0; box-shadow:0 25px 70px #00000057; text-align:center; }
.quiz-icon { width:82px; height:82px; margin:-6px auto 15px; display:grid; place-items:center; border-radius:50%; background:#fff1ba; box-shadow:0 0 0 10px #ffe69366; font-size:46px; }
.modal-card .chapter-tag { margin:auto; }
.modal-card h2 { margin:8px 0; color:var(--navy); font-size:31px; }
.modal-card>p { color:#536b79; font-weight:700; line-height:1.45; }
.answer-options { display:grid; gap:9px; margin-top:18px; }
.answer-options button { border:2px solid #dcd8c9; border-radius:15px; padding:13px 15px; color:var(--navy); background:white; text-align:left; font-size:12px; font-weight:900; cursor:pointer; }
.answer-options button:hover { border-color:#ef9b3e; background:#fff5dc; }
.answer-options button.correct { color:#3d7024; border-color:#6ba840; background:#eaf7de; }
.answer-options button.wrong { color:#963d2b; border-color:#dc7056; background:#ffebe6; }
.feedback { min-height:22px; margin-bottom:0; color:#548633!important; font-size:12px; font-weight:900!important; }
.aim-meter { position:relative; height:34px; margin:25px 0; overflow:hidden; border:5px solid white; border-radius:99px; background:linear-gradient(90deg,#d9664e 0 30%,#f2c44b 30% 43%,#68ae61 43% 57%,#f2c44b 57% 70%,#d9664e 70%); box-shadow:inset 0 0 0 2px #d7cdb8; }
.aim-meter b { position:absolute; top:-7px; left:0; width:8px; height:42px; border-radius:6px; background:var(--navy); box-shadow:0 0 0 3px white; }
.finish-screen { position:relative; overflow:hidden; padding:25px; background:radial-gradient(circle at 50% 30%,#fff5c6,#c7ead9); }
.finish-screen.active { display:grid; place-items:center; }
.confetti { position:absolute; inset:6% 3% auto; color:#e8822c; font-size:34px; letter-spacing:6vw; transform:rotate(-5deg); }
.finish-card { position:relative; z-index:2; width:min(620px,100%); padding:25px clamp(22px,6vw,58px) 28px; border:7px solid white; border-radius:35px; background:#fffdf7; box-shadow:var(--shadow); text-align:center; }
.medal { width:105px; height:105px; margin:auto; display:grid; place-items:center; border-radius:50%; background:#fff1af; box-shadow:0 0 0 13px #ffe68b70; font-size:65px; }
.finish-card .chapter-tag { margin:18px auto 0; }
.finish-card h2 { margin:8px 0 10px; color:var(--navy); font-size:clamp(38px,7vw,58px); line-height:1; }
.finish-card>p { color:#5b6e78; font-weight:700; line-height:1.5; }
.finish-card blockquote { margin:18px 0; padding:15px; border-radius:18px; color:#407145; background:#e9f6e7; font-size:19px; font-weight:900; }
.finish-card cite { display:block; margin-top:5px; font-size:9px; font-style:normal; letter-spacing:.13em; }
.final-score small,.final-score strong { display:block; }
.final-score small { color:#7a7d75; font-size:8px; font-weight:900; letter-spacing:.14em; }
.final-score strong { color:#8b6119; font-size:17px; }
.badge { width:max-content; max-width:100%; margin:14px auto 22px; padding:9px 17px; display:flex; align-items:center; gap:11px; border:2px solid #7fc39d; border-radius:17px; background:#e9f8ed; text-align:left; }
.badge>span { font-size:36px; }
.badge small,.badge strong { display:block; }
.badge small { color:#40805b; font-size:7px; font-weight:900; letter-spacing:.13em; }
.badge strong { color:#2e6446; }
.finish-card .primary-button { margin-right:7px; padding:13px 19px; font-size:11px; }
.secondary-button { border:0; padding:13px 16px; color:#5b6d76; background:transparent; font-size:10px; font-weight:900; cursor:pointer; }
.finish-legal { position:absolute; bottom:12px; left:15px; right:15px; color:#52655e; }

@keyframes spriteFour { 0%,24%{background-position:0 0} 25%,49%{background-position:33.333% 0} 50%,74%{background-position:66.666% 0} 75%,100%{background-position:100% 0} }
@keyframes daviWalk { 0%,24%{background-position:0 0} 25%,49%{background-position:33.333% 0} 50%,74%{background-position:66.666% 0} 75%,100%{background-position:100% 0} }
@keyframes pulse { 50%{transform:translateY(-8px) scale(1.05)} }
@keyframes jump { 0%,100%{bottom:20px} 50%{bottom:135px} }
@keyframes giantReact { 50%{transform:translateX(18px) rotate(3deg)} }

@media (max-width:850px) {
  .home-screen { padding:5px 9px 24px; }
  .brand-bar { height:59px; padding:0 5px; }
  .mini-logo { width:43px; height:43px; }
  .brand-copy strong { font-size:16px; }
  .hero-panel { min-height:760px; border-width:4px; border-radius:26px; }
  .hero-shade { background:linear-gradient(180deg,rgba(255,250,232,.97) 0 57%,rgba(255,246,220,.35) 72%,rgba(40,50,45,.03)); }
  .hero-copy { width:100%; padding:34px 22px 385px; text-align:center; }
  .hero-copy .chapter-tag { margin:auto; }
  .hero-copy>p { margin-left:auto; margin-right:auto; }
  .age-options { justify-content:center; }
  .hero-characters { inset:auto 0 0; height:380px; }
  .davi-preview { left:16%; width:165px; height:330px; }
  .golias-preview { right:10%; width:278px; height:370px; }
  .hero-bubble { right:7%; top:-4px; width:190px; font-size:11px; }
  .benefit-row { grid-template-columns:1fr; gap:1px; padding:0 10px; }
  .benefit-row article { padding:6px 12px; }
  .story-card { grid-template-columns:120px 1fr; margin-bottom:18px; }
  .story-tio { width:83px; height:185px; }
  .story-card>div { padding:15px 14px; }
  .story-card p { font-size:14px; }
  .game-header { height:63px; gap:7px; }
  .game-header .circle-button { width:39px; height:39px; font-size:17px; }
  .game-title strong { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
  .score { padding:5px 7px; }
  .progress>span { display:none; }
  .progress>div { width:65px; }
  .world { height:51vh; min-height:365px; }
  .player { width:89px; height:178px; margin-left:-44px; }
  .giant { width:206px; height:275px; }
  .mission-object>span { width:53px; height:53px; font-size:31px; }
  .obstacle { font-size:48px; }
  .mission-area { grid-template-columns:1fr; gap:7px; padding:9px; }
  .dialog-box { min-height:62px; padding:6px 9px; }
  .dialog-tio { width:23px; height:51px; }
  .dialog-box p { font-size:10px; }
  .quest-list { gap:4px; }
  .quest-list article { padding:4px; }
  .quest-list small { display:none; }
}

@media (max-width:520px) {
  .hero-copy h1 { font-size:39px; }
  .hero-copy { padding-bottom:335px; }
  .hero-panel { min-height:730px; }
  .davi-preview { left:2%; width:143px; height:285px; }
  .golias-preview { right:0; width:236px; height:315px; }
  .hero-bubble { right:6px; }
  .world { min-height:340px; }
  .player { width:74px; height:148px; margin-left:-37px; }
  .giant { width:165px; height:220px; }
  .game-title strong { max-width:120px; }
  .score span { display:none; }
  .mission-object { min-width:58px; }
  .mission-object>span { width:45px; height:45px; font-size:27px; }
  .mission-object small { font-size:7px; }
  .obstacle { font-size:41px; }
  .quest-list strong { display:none; }
  .quest-list article { justify-content:center; }
  .quest-list article>div { display:none; }
  .touch-controls { gap:7px; padding:7px 9px; }
  .touch-controls button { width:51px; height:51px; }
  .touch-controls .action,.touch-controls .jump { width:63px; height:63px; }
  .finish-card .primary-button { margin:0 0 7px; }
  .finish-legal { font-size:8px; }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; }
}
