/* Side quests share the existing cockpit, fixed tabs and native game renderer. */
#tabs button{min-width:0;flex:1;padding-inline:5px;font-size:clamp(13px,3.3vw,18px);white-space:normal;line-height:1.12}
.side-quests{width:min(100%,560px);margin:22px auto 0;padding:0 14px calc(100px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:18px}
.side-quests h1{font-size:24px;letter-spacing:2px;text-align:center;margin:0 0 8px}
.quest-card{width:100%;min-height:265px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;padding:22px 24px;border:1px solid #65c0cf;border-radius:18px;background:radial-gradient(ellipse at 50% 22%,#25576c80,transparent 70%),linear-gradient(145deg,#102c3c,#07121f);box-shadow:inset 0 0 24px #69cce012,0 10px 25px #0005;text-align:center}
.quest-card strong{font-size:34px;letter-spacing:3px;line-height:1.05}.quest-card small{color:#92afc0;font-size:13px;letter-spacing:1px}.quest-subtitle{max-width:360px;color:#d8eaf0;font-size:16px;line-height:1.35;letter-spacing:.4px}.quest-icon{display:block;width:78px;height:84px}.quest-icon svg{width:100%;height:100%}
.fuego-card{border-color:#d28b50;background:radial-gradient(ellipse at 50% 24%,#9d3c263f,transparent 68%),linear-gradient(145deg,#302127,#07121f)}
.fuego-word,.fuego-intro h2{color:#ffcf80;text-shadow:0 -3px 8px #fb752c,0 -10px 18px #e23e1680;animation:fuego-text 2.4s ease-in-out infinite alternate}
.fuego-intro,.casual-intro{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:28px}.fuego-intro h2,.casual-intro h2{order:0;margin:0;font-size:clamp(48px,14vw,90px)}.fuego-intro .special-description,.casual-intro .special-description{order:1;max-width:500px;line-height:1.5;padding:0 25px;text-align:center}.fuego-intro .special-continue,.casual-intro .special-continue{order:2}.fuego-intro .special-error,.casual-intro .special-error{order:3}
.fuego-intro h2{position:relative;isolation:isolate}.fuego-intro h2::before{content:"";position:absolute;z-index:-1;inset:-35px -15px 10px;background:radial-gradient(ellipse at 20% 80%,#ff590a80,transparent 38%),radial-gradient(ellipse at 50% 65%,#ffb21e80,transparent 35%),radial-gradient(ellipse at 80% 80%,#ff590a80,transparent 38%);filter:blur(8px);animation:fuego-flare 1.7s ease-in-out infinite alternate}
.fuego-entering .hatch-panel::after{content:"";position:absolute;inset:20% 0 0;background:radial-gradient(ellipse at 28% 100%,#ff9a3270,transparent 52%),radial-gradient(ellipse at 72% 100%,#ff4d2870,transparent 52%);mix-blend-mode:screen;pointer-events:none;animation:fuego-flare 1.6s ease-in-out infinite alternate}
.casual-entering .hatch-top::after{content:"CASUAL";position:absolute;bottom:18%;left:0;right:0;text-align:center;font-size:clamp(35px,12vw,80px);letter-spacing:5px;color:#11232b;text-shadow:0 1px #d6e4e78c,0 -1px #000a;opacity:.8}
.fuego-shell,.casual-shell{isolation:isolate}.fuego-shell .game-hud,.casual-shell .game-hud{display:flex;align-items:center;gap:12px}.fuego-shell .game-hud strong,.casual-shell .game-hud strong{flex:1;text-align:center;letter-spacing:2px;font-size:24px}.fuego-back,.casual-back{width:46px;height:46px;font-size:34px;padding:0;flex:none}.fuego-lives{min-width:46px;text-align:center}.fuego-shell .board-canvas{height:calc(100% - 86px)}
.fuego-score{position:absolute;right:22px;bottom:max(15px,env(safe-area-inset-bottom));text-align:right;display:grid;grid-template-columns:auto auto;column-gap:12px;align-items:center;pointer-events:none}.fuego-score small{font-size:14px;color:#e6bb8d;letter-spacing:1.5px}.fuego-score strong{font-size:48px;line-height:1}.fuego-score span{grid-column:1/3;font-size:14px;color:#b9bec9;margin-top:4px}
.fuego-flames{position:absolute;inset:15% -10% 0;z-index:-1;pointer-events:none;opacity:.20;background:radial-gradient(ellipse at 8% 100%,#ff6328 0,transparent 40%),radial-gradient(ellipse at 50% 130%,#ff962b 0,transparent 48%),radial-gradient(ellipse at 92% 100%,#de351e 0,transparent 42%);animation:fuego-flare 3.5s ease-in-out infinite alternate}
.casual-shell .balance{display:flex;align-items:center;gap:5px;font-size:19px}.casual-shell .balance img{width:23px;height:23px;object-fit:contain}.casual-reward{position:absolute;top:40%;left:0;right:0;text-align:center;font-size:clamp(24px,7vw,40px);pointer-events:none;color:#e8faff;text-shadow:0 0 18px #55c9f7}
@keyframes fuego-text{from{text-shadow:0 -2px 7px #fb752c,0 -8px 15px #e23e1680}to{text-shadow:0 -4px 9px #ffa62e,0 -14px 23px #d83e1680}}
@keyframes fuego-flare{from{transform:translateY(3px) scaleX(.96);opacity:.15}to{transform:translateY(-10px) scaleX(1.04);opacity:.30}}
@media(max-width:350px){.quest-card{padding:18px;min-height:250px}.quest-subtitle{font-size:14px}.fuego-shell .game-hud strong,.casual-shell .game-hud strong{font-size:20px}.casual-shell .balance{font-size:16px}.fuego-score strong{font-size:42px}}
@media(prefers-reduced-motion:reduce){.fuego-word,.fuego-intro h2,.fuego-intro h2::before,.fuego-flames,.fuego-entering .hatch-panel::after{animation:none}}
.casual-intro h2,.casual-entering .hatch-top::after{font-family:DIN,sans-serif;font-weight:700}
@font-face{font-family:CasualSlab;src:url('assets/fonts/CasualSlab.ttf') format('truetype');font-weight:900;font-display:swap}
.casual-intro h2,.casual-card strong,.casual-shell .game-hud strong,.casual-entering .hatch-top::after{font-family:CasualSlab,Georgia,serif;font-weight:900;letter-spacing:-1px;transform:scaleX(.83)}
.fuego-vfx{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none;contain:layout paint}
.fuego-ember{position:absolute;width:var(--flame-size);height:calc(var(--flame-size)*1.5);border-radius:65% 35% 55% 45%;background:radial-gradient(ellipse at 50% 75%,#fff3b0 0 12%,#ffb32d 30%,#ff581b 55%,transparent 74%);transform-origin:50% 90%;animation:fuego-drag-ember .5s ease-out forwards;opacity:.8}
.fuego-ember.burn{animation:fuego-burn-ember 1.2s ease-out forwards}
.fuego-burning{animation:fuego-scorch 1.25s ease-in forwards}
@keyframes fuego-drag-ember{0%{transform:translate(-50%,-70%) scale(.8)}100%{transform:translate(calc(-50% + var(--lean)),calc(-70% - 18px)) scale(.15);opacity:0}}
@keyframes fuego-burn-ember{0%{transform:translate(-50%,-50%) scale(.2);opacity:0}20%{opacity:.9}60%{transform:translate(calc(-50% + var(--lean)),-100%) scale(1.1);opacity:.85}100%{transform:translate(-50%,-150%) scale(.25);opacity:0}}
@keyframes fuego-scorch{0%{filter:none}35%{filter:sepia(.8) saturate(3) brightness(1.2)}100%{filter:sepia(1) saturate(2) brightness(.3)}}
@media(prefers-reduced-motion:reduce){.fuego-vfx{display:none}.fuego-burning{animation:none}}
/* The Side Quests menu occupies exactly the space between cockpit and tabs. */
body:has(.side-quests){height:100dvh;overflow:hidden}
body:has(.side-quests) #app{padding-bottom:0!important}
body:has(.side-quests) #content{min-height:0}
body:has(.side-quests) #streak,body:has(.side-quests) #app>footer{display:none}
.side-quests{position:fixed;top:calc(var(--cockpit-bottom,220px) + 8px);bottom:calc(var(--tabs-height,76px) + var(--tabs-viewport-bottom,0px) + 8px);left:0;right:0;width:min(100%,560px);margin:0 auto;padding:0 14px;display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;container-type:size}
.side-quests .quest-card{min-height:0;height:100%;gap:clamp(3px,1.5cqh,10px);padding:clamp(6px,2cqh,16px) 12px}
.side-quests .quest-icon{width:clamp(22px,12cqh,65px);height:clamp(22px,12cqh,65px);flex:none}
.side-quests .quest-card strong{font-size:clamp(18px,5cqh,30px)}
.side-quests .quest-subtitle{font-size:clamp(11px,3cqh,15px);line-height:1.15}
.side-quests .quest-card small{font-size:clamp(10px,2.4cqh,12px);line-height:1.1}
.fuego-ember.burn{filter:drop-shadow(0 0 4px #ff841c80)}
@media(max-height:480px){body:has(.side-quests) #app>header .panel-identity,body:has(.side-quests) #app>header .panel-progress{display:none}body:has(.side-quests) #app>header .panel-actions{display:none}}
.fuego-shell .game-hud{gap:6px}.fuego-shell .fuego-hint{padding:8px 6px;font-size:13px;white-space:nowrap}.fuego-shell .fuego-hint img{width:18px;height:18px;vertical-align:middle;object-fit:contain}.fuego-shell .balance{font-size:18px;white-space:nowrap;display:flex;align-items:center;gap:3px}.fuego-shell .balance img{width:22px;height:22px;object-fit:contain}.fuego-shell .game-lives{margin-left:auto}.fuego-name{position:absolute;left:22px;bottom:max(26px,env(safe-area-inset-bottom));font-size:26px;letter-spacing:2px;pointer-events:none}.fuego-shell .game-moves{font-size:16px;white-space:nowrap}.fuego-shell .game-lives .life-refill{display:none}
@media(max-width:350px){.fuego-shell .fuego-back{width:36px;min-width:36px}.fuego-shell .game-hud{gap:4px}.fuego-shell .balance{font-size:16px}.fuego-shell .fuego-hint{font-size:11px;padding-inline:4px}.fuego-name{left:16px;font-size:22px}.fuego-score{right:16px}}
.fuego-back,.casual-back{display:grid;place-items:center}.fuego-back svg,.casual-back svg{width:30px;height:32px;fill:none;stroke:currentColor;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}
.fuego-ember:not(.burn){animation-duration:.6s;opacity:.9}
.fuego-entering .hatch-panel::after{inset:0;background:radial-gradient(ellipse at 25% 100%,#ffc355cc,transparent 65%),radial-gradient(ellipse at 75% 100%,#ff4d28bb,transparent 65%);animation:fuego-door-glow 1.1s ease-in-out infinite alternate}
.fuego-entering .hatch-panel::before{content:"";position:absolute;z-index:2;left:2%;right:2%;bottom:0;height:58%;pointer-events:none;mix-blend-mode:screen;background:linear-gradient(0deg,#fff0a0 0%,#ff9b26 30%,#ff4a12aa 75%,#ff2c1600);clip-path:polygon(0 100%,5% 65%,10% 85%,16% 20%,20% 70%,28% 45%,32% 85%,40% 8%,45% 70%,52% 35%,60% 80%,68% 0,74% 65%,82% 35%,88% 78%,94% 15%,100% 100%);transform-origin:bottom;animation:fuego-door-flames 1.3s ease-in-out infinite alternate}
@keyframes fuego-door-glow{from{opacity:.4}to{opacity:.75}}
@keyframes fuego-door-flames{from{opacity:.42;transform:scaleY(.8) translateX(-1%)}to{opacity:.68;transform:scaleY(1) translateX(1%)}}
@media(prefers-reduced-motion:reduce){.fuego-entering .hatch-panel::before,.fuego-entering .hatch-panel::after{animation:none;opacity:.45}}
:is(.fuego-intro,.casual-intro) .special-intro-back{width:46px;height:46px;display:grid;place-items:center;padding:5px}
:is(.fuego-intro,.casual-intro) .special-intro-back svg{width:30px;height:32px;fill:none;stroke:currentColor;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}

/* Keep progress prominent at the card foot while centering its mode content. */
.side-quests .quest-card-content{min-height:0;flex:1;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(3px,1.3cqh,9px)}
.side-quests .quest-card small.quest-progress{flex:none;width:100%;margin-top:auto;font-size:clamp(14px,4cqh,22px);font-weight:700;line-height:1.1;letter-spacing:.5px;color:#d8edf5}
@media(max-height:480px){.side-quests .quest-card-content{gap:3px}.side-quests .quest-icon{width:clamp(18px,10cqh,48px);height:clamp(18px,10cqh,48px)}}

.fuego-score strong.personal-best{color:#ffd66b;text-shadow:0 0 10px #ffb02e70}

.fuego-record-banner{position:absolute;left:4%;right:4%;top:42%;z-index:7;text-align:center;font-size:clamp(25px,5.6vw,54px);font-weight:700;letter-spacing:clamp(1px,.45vw,5px);white-space:nowrap;color:#ffd66b;text-shadow:0 2px 2px #431c00,0 0 20px #ffb02e90;pointer-events:none}
