@font-face{font-family:Game;src:url("assets/fonts/Nunito.ttf") format("truetype");font-weight:200 1000;font-display:swap}
:root{font-family:Game,"Avenir Next",system-ui,sans-serif;color:#39263b;background:#241b2b;font-synthesis:none;--cream:#fff3d8;--ink:#39263b;--gold:#ffd05a;--mint:#96dcca}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation;border:2px solid #513349;border-radius:14px;padding:12px 22px;background:#fff1d6;color:var(--ink);font-weight:800;box-shadow:0 4px 0 #513349;transition:transform .15s,background .15s,box-shadow .15s}button:hover{transform:translateY(-2px);background:#fff9e9}button:active{transform:translateY(3px);box-shadow:0 1px 0 #513349}button:focus-visible,input:focus-visible,select:focus-visible{outline:4px solid #31ae9d;outline-offset:3px}button:disabled{cursor:default;opacity:.5;transform:none}.primary{background:linear-gradient(#ffe493,#ffc24a);border-color:#75482d;box-shadow:0 5px 0 #75482d}.quiet,.text-button{background:transparent;box-shadow:none;border-color:#51334944}.round{padding:9px 15px;border-radius:50%}.hidden{display:none!important}
.boot{min-height:100dvh;display:flex;align-items:center;justify-content:center;flex-direction:column;color:var(--cream);background:radial-gradient(ellipse at center,#604158,#21182b);padding:30px}.boot img{width:min(65vw,570px);animation:float 3s ease-in-out infinite}.boot progress{width:300px;accent-color:var(--gold);height:12px}.boot p{font-weight:700}.home{min-height:100dvh;background:url(assets/brand/menu.png) center/cover;position:relative;display:grid;place-items:center;isolation:isolate}.home-vignette{position:absolute;inset:0;background:linear-gradient(90deg,#2c193a33,transparent 25% 75%,#2c193a33),linear-gradient(0deg,#26172cba,transparent 35%);z-index:-1}.home-content{width:min(540px,90vw);text-align:center;padding:30px 10px 80px}.game-logo{width:100%;filter:drop-shadow(0 10px 10px #46263d44);animation:float 6s ease-in-out infinite}.home-subtitle{font-size:19px;font-weight:800;margin:10px 0 22px;color:#4a2735}.home-actions{display:grid;gap:13px;max-width:340px;margin:auto}.home-actions>button{font-size:19px}.menu-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.menu-pair button{padding:11px 8px;font-size:15px}.home-progress{font-size:13px;font-weight:800;margin:24px 0 8px}.home footer{position:absolute;bottom:17px;color:#fff2dc;font-size:12px;letter-spacing:.06em}
.page{background:#f6eedf;min-height:100dvh;padding:26px max(24px,calc((100vw - 1240px)/2)) 60px}.page-header{display:flex;align-items:center;gap:22px;padding-bottom:25px;border-bottom:1px solid #a59a8a50}.page-header>div{flex:1}.page-header h1{font-size:clamp(23px,3vw,36px);margin:0;letter-spacing:-.04em}.page-header p{margin:6px 0 0;color:#78667a}.page-header .round{margin-left:auto}.chapter{padding-top:30px}.chapter-heading{display:flex;align-items:baseline;gap:18px}.chapter-heading h2{font-size:22px;margin:0 0 16px}.chapter-heading p{color:#78667a;font-size:14px}.level-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:15px}.level-tile{min-height:165px;padding:13px;text-align:left;background:linear-gradient(160deg,#fff8e7 35%,var(--zone));display:flex;flex-direction:column;gap:6px}.level-number{font-size:25px;color:#513c50}.level-name{font-size:14px;line-height:1.2;min-height:33px}.level-tile small{font-size:11px;font-weight:500}.stars{font-size:20px;color:#94652c;margin-top:auto;letter-spacing:3px}.locked{filter:grayscale(.7);opacity:.45}.brief{display:grid;grid-template-columns:1fr 1fr;gap:25px;padding:26px 0}.brief h2{font-size:23px;margin:10px 0}.brief p{line-height:1.5;color:#6f596a}.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;color:#806675}.intel{display:flex;align-items:center;justify-content:flex-end;gap:8px}.intel>span{text-align:center;max-width:140px}.intel small{display:block;font-size:11px}.selection-heading{display:flex;align-items:center;gap:12px;padding:15px 0}.selection-heading h2{margin-right:auto;font-size:20px}.selection-heading h2 span{font-weight:400;color:#8d7985;font-size:15px}.card-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}.card{padding:10px 7px;display:flex;align-items:center;flex-direction:column;min-height:186px;background:#fffbf0;border-color:#cbbbaf;box-shadow:0 4px 0 #cbbbaf}.card strong{font-size:13px;min-height:32px;line-height:1.2}.card small{font-size:10px;font-weight:500;margin-top:5px;color:#806779}.card.picked{background:#e4f5dd;border-color:#42877b;box-shadow:0 4px 0 #42877b}.cost{color:#855622;font-size:14px;margin-top:4px}.sprite{display:inline-block;flex-shrink:0;width:86px;height:86px;background-size:calc(var(--sprite-frames,8) * 100%) 100%;background-repeat:no-repeat;animation:idle var(--idle-duration,1s) steps(var(--idle-frames,4)) infinite}.sprite:nth-child(2n){animation-delay:-.2s}@keyframes idle{to{background-position:var(--idle-end,57.142857%) 0}}@keyframes float{50%{transform:translateY(-7px)}}
.play{max-width:1400px;margin:auto;padding:14px 24px 25px;color:#fff0d8;background:radial-gradient(ellipse at top,#624859,#281c31);min-height:100dvh}.hud{display:flex;gap:20px;align-items:center;margin-bottom:12px}.energy{display:flex;align-items:center;gap:11px;border:2px solid #c5a9a4;border-radius:17px;background:#331f34;padding:8px 20px;min-width:140px;box-shadow:0 3px 0 #161321}.energy>span{color:#ffce52;font-size:45px;line-height:1}.energy small{display:block;color:#e9c594;font-size:11px;letter-spacing:.13em}.energy strong{font-size:29px}.mission-heading{display:flex;flex-direction:column;gap:3px;flex:1}.mission-heading small{font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--zone)}.mission-heading strong{font-size:20px}.mission-heading #wave{font-size:12px;color:#d5bcc6}.health{color:#ff9cab;white-space:nowrap;font-size:20px}.deck-bar{display:flex;justify-content:center;gap:10px;margin-bottom:10px;min-height:108px}.deck-card{position:relative;width:145px;padding:1px 6px 6px;border-radius:13px;box-shadow:0 3px 0 #1e1424;overflow:hidden;display:flex;flex-direction:column;align-items:center;border-color:#442a41;font-size:11px;line-height:1.15}.deck-card .sprite{width:62px;height:62px}.deck-card>span:not(.sprite){min-height:24px;display:grid;place-items:center}.deck-card strong{font-size:13px;color:#8d5b23;margin-top:3px}.deck-card kbd{position:absolute;left:7px;top:6px;color:#8e7183;font-size:10px}.deck-card i{position:absolute;inset:auto 0 0;background:#392e4166;pointer-events:none}.selected{background:#ffe18b!important;outline:2px solid #ffd877}.deck-card.unaffordable{filter:saturate(.25);opacity:.75}.field-wrap{position:relative;border:3px solid #1d152a;border-radius:22px;overflow:hidden;box-shadow:0 7px 20px #140c2044;background:#aa6d7b}canvas{width:100%;display:block;touch-action:none}.tools{display:flex;gap:8px;flex-wrap:wrap;padding:13px 0 6px;align-items:center}.tools button,.tools select{padding:9px 11px;font-size:12px;border-radius:9px}.tools select{max-width:145px;background:#f7ead0;color:#44243b;border:2px solid #44243b}.play-bottom{display:flex;gap:20px;justify-content:space-between;font-size:12px;color:#dec3cd;align-items:center}.play-bottom p{max-width:850px;line-height:1.4;margin:7px 0}.play-bottom>span{white-space:nowrap;font-size:10px;color:#9fc5b1}.report{position:absolute;right:15px;bottom:15px;width:330px;padding:17px;border-radius:17px;background:#fff4ddee;color:#412b3f;box-shadow:0 6px 0 #412b3f;border:2px solid #412b3f;backdrop-filter:blur(8px);z-index:2}.report-top{display:flex;gap:10px;align-items:center;justify-content:space-between}.report-top .round{padding:4px 10px}.report small{font-size:10px;color:#816c7a}.report p{font-size:13px}.result-list{margin:12px 0;font-size:11px}.result-list>div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid #9e7d8b33}.good{color:#207c64}.bad{color:#b44158}.phage-result{background:#d6ecd3;padding:10px;border-radius:8px}.overlay{position:fixed;inset:0;display:grid;place-items:center;background:#1e142ac9;backdrop-filter:blur(7px);z-index:10;padding:20px;overflow:auto}.modal{max-width:470px;width:100%;border-radius:24px;background:#fcf1db;color:#412e41;border:3px solid #594258;padding:30px;box-shadow:0 10px 0 #20172a;display:flex;flex-direction:column;gap:12px;text-align:center;max-height:95dvh;overflow:auto}.modal h2{font-size:29px;margin:2px 0}.modal p{margin:4px 0 12px;line-height:1.4}.medals{font-size:50px;color:#cf972d;letter-spacing:7px}.result-stats{display:flex;justify-content:space-around;gap:10px;margin:10px 0}.result-stats span{font-size:12px;color:#846b79}.result-stats b{display:block;color:#412e41;font-size:26px}.small{font-size:12px;color:#8d7382}.settings-panel{max-width:500px;margin:35px auto;display:flex;flex-direction:column;gap:18px}.settings label,.settings-panel label{display:flex;justify-content:space-between;align-items:center;gap:20px}.settings input[type=range],.settings-panel input[type=range]{accent-color:#9f6684;width:55%}.check{justify-content:flex-start!important}.file-button{border:2px dashed #ac91a0;padding:14px;display:block!important;text-align:center;border-radius:12px;cursor:pointer;font-size:14px}.file-button input{display:none}.tabs{display:flex;gap:12px;margin:25px 0}.catalog-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.catalog-card{padding:18px;background:#fffaf0;border-radius:18px;border:1px solid #dbcbbb;display:flex;align-items:center;gap:12px}.catalog-card h2{font-size:16px;margin:0 0 8px}.catalog-card p{font-size:12px;color:#786777;line-height:1.4}.catalog-card small{font-size:10px;color:#957a89}.science-note{font-size:12px;line-height:1.6;color:#826b7d;margin-top:28px}.guide{max-width:680px;margin:30px auto;line-height:1.8}.guide li{padding:6px 0}.guide h2{margin-top:25px}.challenge-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:40px}.challenge-grid article{padding:30px;background:#fff9ec;border:2px solid #ddcdbb;border-radius:22px;display:flex;flex-direction:column;gap:15px}.challenge-grid h2{font-size:26px;margin:0}.lab-tools{display:flex;align-items:center;gap:10px;margin-top:14px;flex-wrap:wrap}.lab-tools select{max-width:380px;padding:9px;border-radius:8px}.lab-tools button{padding:9px;font-size:12px}.lab-tools label{font-size:12px}.lab-tools label select{margin-left:10px}
#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;z-index:30;background:#fff2d8;color:#402f42;border:2px solid #674d60;border-radius:14px;box-shadow:0 5px 18px #22182b55;padding:13px 22px;font-weight:700;max-width:min(90vw,600px);text-align:center;font-size:14px;transition:.2s}#toast.show{transform:translate(-50%,0);opacity:1}
@media(max-width:900px){.page{padding:18px}.level-grid{grid-template-columns:repeat(4,1fr)}.card-grid{grid-template-columns:repeat(4,1fr)}.catalog-grid{grid-template-columns:repeat(2,1fr)}.play{padding:10px}.deck-card{width:120px}.mission-heading strong{font-size:16px}.brief{grid-template-columns:1fr}.intel{justify-content:flex-start}.health{font-size:17px}.tools button{font-size:10px}.report{width:280px;padding:12px}}
@media(max-width:600px){.home-content{padding-top:65px}.home-subtitle{font-size:15px}.page-header{gap:10px}.page-header>button{padding:9px}.page-header p{font-size:12px}.level-grid{grid-template-columns:repeat(3,1fr);gap:10px}.level-tile{min-height:150px;padding:10px}.chapter-heading{display:block}.chapter-heading p{margin-top:0}.card-grid{grid-template-columns:repeat(3,1fr);gap:10px}.selection-heading{flex-wrap:wrap}.selection-heading h2{width:100%;margin:0}.card{min-height:165px}.catalog-grid{grid-template-columns:1fr}.catalog-card .sprite{width:75px;height:75px}.tabs{gap:7px;flex-wrap:wrap}.tabs button{font-size:12px;padding:10px}.hud{gap:10px}.energy{min-width:90px;padding:7px;gap:4px}.energy>span{font-size:29px}.energy strong{font-size:23px}.health{font-size:13px}.mission-heading strong{font-size:13px}.mission-heading #wave{font-size:10px}.deck-bar{gap:4px;min-height:82px}.deck-card{flex:1;min-width:0;padding:2px 2px 4px;border-width:1px;font-size:8px}.deck-card .sprite{width:45px;height:45px}.deck-card kbd{display:none}.deck-card strong{font-size:10px}.field-wrap{border-radius:12px}.tools{gap:5px}.tools button,.tools select{padding:9px 7px;font-size:10px}.play-bottom{display:block}.report{right:5px;bottom:5px;width:230px;padding:9px}.report-top strong{font-size:12px}.report .result-list{font-size:9px;margin:5px 0}.report small{font-size:8px}.report p{font-size:10px}.challenge-grid{grid-template-columns:1fr}.lab-tools select{max-width:250px}.sprite{width:75px;height:75px}}
@media(max-width:600px){.report{position:fixed;inset:auto 12px 12px;width:auto;max-height:55dvh;overflow:auto;padding:16px;z-index:8}.report-top strong{font-size:15px}.report .result-list{font-size:12px;margin:12px 0}.report small{font-size:11px}.report p{font-size:13px}}
@media(prefers-reduced-motion:reduce){.game-logo,.boot img{animation:none}button{transition:none}}
/* Expanded animation controls, brand and educational collection. */
.game-menu-button{display:flex;gap:9px;align-items:center;padding:10px 16px;font-size:15px;background:#e8d9f1}
.match-menu{max-width:540px}.menu-tools{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:5px 0 12px}.menu-tools button{padding:12px 6px;display:flex;flex-direction:column;gap:6px;align-items:center}.menu-tools b{font-size:28px}.menu-tools span{font-size:13px}.menu-tools small{font-size:10px;font-weight:500;color:#79647b}
.mode-note{padding:9px 14px;background:#f9dca3;color:#493243;font-size:12px;font-weight:800;border-radius:12px;margin:0 0 9px}.heart{display:inline-block;margin:0 2px;font-size:24px;filter:drop-shadow(0 2px 1px #1d1024)}.heart.empty,.heart.lost{color:#715d78}.heart.lost{animation:heart-loss 1.2s ease-out}.health small{display:block;font-size:10px}.is-paused .sprite,.is-paused .heart{animation-play-state:paused}
@keyframes heart-loss{0%{color:#ff739b;transform:scale(1.5);filter:drop-shadow(0 0 12px #ff4d72)}25%{transform:rotate(-15deg) scale(1.25)}50%{transform:rotate(12deg) scale(.8)}100%{transform:scale(1);color:#715d78}}
.atp-flight{position:fixed;z-index:25;width:44px;height:44px;display:grid;place-items:center;pointer-events:none;background:#ffd14f;color:#5e3922;font-weight:1000;font-size:15px;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);box-shadow:0 0 20px #ffe990}
.cm-brand{width:140px;height:auto;object-fit:contain;border-radius:8px;display:block;flex-shrink:0}.home footer{display:flex;align-items:center;gap:16px;left:0;right:0;justify-content:center}.home footer .cm-brand{width:142px}.modal>.cm-brand,.settings-panel>.cm-brand{align-self:center;width:145px;margin:0 auto 10px}.boot img.boot-brand{width:170px;margin:20px 0 4px;animation:none;filter:none}.page-header>.cm-brand{width:120px}
.catalog-card{text-align:left;box-shadow:0 3px 0 #d5c6bb;transition:transform .15s}.catalog-card>div{min-width:0}.learn-link{display:block;color:#227c7d;font-size:11px;font-weight:900;margin-top:10px}.catalog-grid{align-items:stretch}.lesson-modal{max-width:680px;text-align:left;padding:25px;gap:8px}.lesson-top{display:flex;justify-content:space-between;align-items:center}.lesson-top .cm-brand{width:120px}.lesson-hero{display:flex;align-items:center;gap:20px;margin:12px 0}.lesson-hero .sprite{width:145px;height:145px}.lesson-modal h2{font-size:27px}.lesson-modal h3{font-size:16px;margin:15px 0 3px;color:#6c4165}.lesson-modal p{font-size:15px;line-height:1.65;margin:0 0 6px}.lesson-modal a{color:#1d7777;font-size:13px;margin:10px 0}.lesson-modal>small{font-size:11px;color:#8a7587;line-height:1.5;margin-bottom:12px}.learning-note{padding:16px;background:#e5efdf;border:1px solid #cbdac2;border-radius:14px;margin-top:12px}.learning-note strong{font-size:13px;color:#356c58}
@media(max-width:600px){.game-menu-button{padding:8px 10px}.game-menu-button span{display:none}.heart{font-size:17px;margin:0 1px}.page-header>.cm-brand{display:none}.home footer{flex-direction:column;gap:8px}.home footer .cm-brand{width:130px}.home-content{padding-bottom:110px}.modal{padding:20px}.menu-tools{gap:6px}.menu-tools button{padding:12px 3px}.menu-tools small{font-size:9px}.lesson-hero{gap:8px}.lesson-hero .sprite{width:100px;height:100px}.lesson-modal h2{font-size:21px}.lesson-modal p{font-size:14px}.mode-note{font-size:11px}}
.menu-game-logo{width:135px;object-fit:contain;flex-shrink:0}.page{position:relative;padding-bottom:145px}.page-brand{position:absolute;bottom:26px;left:0;right:0;display:flex;flex-direction:column;align-items:center;gap:7px}.page-brand span{font-size:11px;color:#806d7d}.modal>.menu-game-logo,.settings-panel>.menu-game-logo{width:200px;align-self:center;margin:0 auto 3px}.modal-brand{display:flex;justify-content:center;margin-top:14px;padding-top:16px;border-top:1px solid #aa91a344}.modal-brand .cm-brand{width:125px}.home footer{bottom:14px;flex-direction:column;gap:7px}.home footer>span{font-size:11px}.home-content{padding-bottom:115px}
@media(max-width:600px){.page-header{flex-wrap:wrap}.page-header>.menu-game-logo{width:90px;order:-1}.page-header>div{flex-basis:45%}.page-header>button:first-child{order:3;padding:8px 12px;font-size:12px}.page-header>.round{order:4}.page-brand .cm-brand{width:125px}.home footer>span{font-size:10px}.boot small{text-align:center;font-size:11px}}
@media(max-width:600px){.page-header{display:grid;grid-template-columns:84px 1fr 42px;gap:12px}.page-header>.menu-game-logo{grid-column:1;grid-row:1;width:84px}.page-header>div{grid-column:2/4;grid-row:1}.page-header>button:first-child{grid-column:1/3;grid-row:2;justify-self:start}.page-header>.round{grid-column:3;grid-row:2;justify-self:end;margin:0}}
