@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{--ink:#25392c;--muted:#758274;--green:#2f6343;--deep:#213f2d;--paper:#f2f1e8;--card:#fffef7;--line:#dce0d2;--gold:#efb653;--red:#a24c40;--shadow:0 8px 28px #243c2410;font-family:'DM Sans',system-ui,sans-serif;color:var(--ink);background:var(--paper);font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:not-allowed;opacity:.42}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #d49b37;outline-offset:3px}button,input,select,textarea{border-radius:9px}button{border:1px solid var(--line);background:var(--card);padding:11px 15px;font-weight:600;transition:transform .15s,background .15s}button:hover:not(:disabled){background:#edf0e5;transform:translateY(-1px)}button.primary{background:var(--green);color:white;border-color:var(--green);box-shadow:0 3px 0 #1f4931}button.primary:hover{background:#244e34}button.gold{background:var(--gold);border-color:#d89c39;color:#3d321c;box-shadow:0 3px 0 #be862f}button.quiet{border-color:transparent;background:transparent}button.danger{color:var(--red)}button.small{padding:7px 11px;font-size:13px}input,textarea,select{padding:11px;border:1px solid #cdd4c5;background:#fff;color:var(--ink)}input,textarea{width:100%}input[type=checkbox]{width:auto}label{display:block;font-weight:600;font-size:14px;margin-bottom:7px}textarea{resize:vertical}h1,h2,h3,h4,.brand,.number{font-family:'Space Grotesk',system-ui,sans-serif}h1,h2,h3,h4,p{margin-top:0}h2{font-size:27px;margin-bottom:12px}h3{font-size:19px;margin-bottom:8px}p{line-height:1.6}small,.muted{color:var(--muted)}.eyebrow{text-transform:uppercase;letter-spacing:1.7px;font-size:10px;font-weight:800;color:var(--muted)}.topbar{height:80px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 30px;background:#fffef8;gap:16px}.brand{display:flex;align-items:center;gap:12px;font-weight:700;font-size:25px;letter-spacing:-1px}.brand svg{width:40px}.brand small{display:block;font-family:'DM Sans',sans-serif;letter-spacing:1.9px;font-size:9px;margin-top:1px}.tools{display:flex;gap:7px;align-items:center}.hostbadge{font-size:11px;text-transform:uppercase;letter-spacing:1px;font-weight:800;padding:7px 10px;background:#e9eee3;border-radius:5px;white-space:nowrap}.hostbadge:before{content:'';display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%;background:#508652}.roundbar{display:flex;align-items:center;gap:22px;padding:16px 30px 16px;background:#e9ede2;border-bottom:1px solid #dbe0d2}.roundlabel{white-space:nowrap;font-size:12px}.roundlabel strong{font-size:23px}.timeline{display:flex;gap:5px;flex:1}.tick{height:26px;border-radius:4px;background:#d8dfce;flex:1;text-align:center;color:#829176;font-size:11px;padding-top:6px}.tick.past{background:#7d9c72;color:#fff}.tick.current{background:#2f6343;color:#fff;box-shadow:0 0 0 3px #a6bf8f}.phasepill{padding:7px 11px;border:1px solid #ccd5c0;border-radius:99px;white-space:nowrap;font-size:12px;font-weight:700}.layout{display:grid;grid-template-columns:220px minmax(0,1fr) 284px;gap:22px;max-width:1720px;margin:auto;padding:25px 28px}.sectiontitle{display:flex;align-items:center;justify-content:space-between;margin:0 0 13px}.roster{display:flex;flex-direction:column;gap:9px}.playercard{width:100%;display:flex;gap:11px;padding:13px 11px;text-align:left;align-items:center;border:1px solid #d8ddcf;box-shadow:0 2px 0 #d6ddcc;background:#f9faf2}.playercard.selected{border:2px solid #426d46;padding:12px 10px;background:#f1f5e9;box-shadow:0 3px 0 #426d46}.avatar{flex-shrink:0;width:38px;height:42px;display:flex;align-items:center;justify-content:center;font-weight:800;color:#3b3c28;border-radius:5px;border-bottom:4px solid #0002;font-family:'Space Grotesk';font-size:18px;box-shadow:inset 0 2px #fff7}.playername{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;max-width:140px}.playerinfo{font-size:11px;color:var(--muted);margin-top:6px}.dots{display:inline-flex;gap:4px;vertical-align:middle;margin-right:7px}.dot{display:block;width:7px;height:7px;background:#d2d9ca;border-radius:2px}.dot.on{background:#618657}.rosterfoot{margin-top:17px;font-size:12px;padding:15px;border:1px dashed #bdc7b3;border-radius:9px;line-height:1.7}.panel{background:var(--card);border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow);overflow:hidden}.village-top{padding:22px 24px 10px;display:flex;justify-content:space-between;align-items:start}.village-top h1{font-size:29px;margin:5px 0 4px;letter-spacing:-1px}.village-top p{font-size:13px;color:var(--muted);margin:0}.mini-stats{display:flex;gap:9px}.mini-stat{padding:9px 12px;border:1px solid #e1e5d8;border-radius:8px;font-size:11px;text-align:center;min-width:58px}.mini-stat strong{display:block;font-size:22px;color:#304c34}.scene{height:282px;position:relative;background:linear-gradient(#e8efe1,#eff1df);overflow:hidden}.scene svg{width:100%;height:100%;display:block}.scene-label{position:absolute;left:22px;bottom:16px;font-size:11px;padding:7px 10px;border:1px solid #ffffff99;background:#ffffffe3;border-radius:6px;color:#52704a}.scene-caption{position:absolute;right:20px;top:14px;font-size:11px;color:#6e8660}.actionrow{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:18px 20px}.actiontile{text-align:left;padding:13px 12px;position:relative;border-bottom-width:3px}.actiontile .ico{display:block;font-size:23px;margin-bottom:8px}.actiontile strong{display:block;font-size:14px}.actiontile small{display:block;font-size:10px;margin-top:4px}.actiontile.explore{background:#eff4e7;border-color:#bfd0af}.actiontile.explore:not(:disabled){color:#315d36}.inventory{margin-top:20px}.panel-head{padding:17px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.panel-head h3{font-size:15px;margin:0}.resource-grid{padding:16px 20px;display:grid;grid-template-columns:repeat(7,1fr);gap:8px}.resource{background:#f3f4eb;border:1px solid #e4e7dc;border-radius:8px;text-align:center;padding:9px 3px}.resource.empty{opacity:.53}.resource .ico{font-size:21px;display:block;height:27px}.resource strong{font-family:'Space Grotesk';font-size:20px;display:block;margin:3px 0}.resource small{font-size:10px}.gearstrip{display:flex;flex-wrap:wrap;gap:7px;padding:0 20px 18px}.gear{border:1px solid #e0e3d5;border-radius:5px;padding:6px 9px;font-size:11px}.goal{background:var(--deep);color:#f5f4de;padding:22px;border-radius:13px;position:relative;overflow:hidden}.goal .eyebrow{color:#b2c7a1}.goal h2{font-size:23px;margin:12px 0 10px}.goal p{font-size:12px;color:#c8d7bd}.goal-icon{font-size:38px;float:right;opacity:.9}.goalmetric{display:flex;justify-content:space-between;margin:15px 0 6px;font-size:12px}.track{height:7px;background:#ffffff20;border-radius:20px;overflow:hidden}.track span{display:block;height:100%;background:var(--gold);border-radius:20px}.goal .goal-note{margin-top:14px;margin-bottom:0;font-size:11px}.turnpanel{padding:20px;margin-top:18px}.step{display:flex;gap:11px;margin:17px 0;align-items:start}.stepnum{width:25px;height:25px;background:#edf0e5;color:#788b6a;font-size:12px;border-radius:50%;display:grid;place-items:center;flex-shrink:0}.step.active .stepnum{background:#dce8cc;color:#325536}.step strong{font-size:12px}.step p{font-size:11px;color:var(--muted);margin:4px 0 0}.wide{width:100%}.bonusbar{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;border-top:1px solid var(--line);background:#faf9ef;font-size:12px}.bonusbar p{margin:0}.activity{margin-top:18px}.activity .entry{padding:12px 16px;border-top:1px solid #e8ebdf;font-size:12px;line-height:1.6}.entry small{font-size:10px;display:block;margin-bottom:2px}.bottom-note{text-align:center;font-size:10px;letter-spacing:.3px;color:#82917b;padding:10px 20px 24px}.dialog-back{position:fixed;inset:0;background:#14221988;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:40;padding:24px}.dialog{background:#fffef6;width:min(680px,100%);border:1px solid #d8dece;border-radius:17px;box-shadow:0 24px 100px #14291855;max-height:90vh;overflow:auto;padding:28px;position:relative}.dialog.large{width:min(1000px,100%)}.dialog .close{position:absolute;right:16px;top:15px;border:0;background:transparent;font-size:22px;padding:1px 8px}.dialog h2{padding-right:20px}.dialog-intro{color:var(--muted);font-size:14px}.formrow{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.formgroup{margin-bottom:17px}.dialog-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:22px}.help{font-size:12px;color:var(--muted);margin:7px 0}.notice{padding:12px 15px;background:#edf1e3;border:1px solid #d6dfc6;border-radius:8px;font-size:13px;line-height:1.6;margin:14px 0}.notice.error{background:#f8e9e3;border-color:#e4b9ab;color:#944b3d}.grade-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}.gradecard{text-align:left;padding:20px;min-height:107px;border-bottom-width:4px}.gradecard b{font-family:'Space Grotesk';font-size:24px;display:block}.gradecard small{display:block;margin-top:7px;font-size:12px}.gradecard:nth-child(1){background:#eaf1df}.gradecard:nth-child(2){background:#edece2}.gradecard:nth-child(3){background:#f6edd9}.gradecard:nth-child(4){background:#eee8f5}.mathcard{border:1px dashed #becbb0;background:#f2f5e9;border-radius:12px;padding:23px;text-align:center;margin:18px 0}.mathcard .question{font-family:'Space Grotesk';font-size:29px;margin:14px 0;line-height:1.5}.answerinput{font-family:'Space Grotesk';font-size:27px;text-align:center;padding:15px}.recipe-list{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}.recipecard{border:1px solid var(--line);padding:15px;border-radius:9px;display:flex;flex-direction:column;gap:10px;background:#fafbf3}.recipecard h3{font-size:15px;margin:0}.recipecard p{font-size:12px;color:var(--muted);margin:0;flex:1}.recipecard button{font-size:12px}.grow-row{border:1px solid var(--line);border-radius:10px;padding:15px;margin:10px 0;display:flex;align-items:center;justify-content:space-between;gap:10px}.growthdots{display:flex;gap:5px;margin:6px 0}.growthdots span{width:21px;height:7px;background:#dfe4d4;border-radius:3px}.growthdots .filled{background:#77a75b}.farmgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.resource-pill{display:inline-block;padding:4px 8px;background:#edf0e4;border-radius:6px;font-size:12px;margin:3px}.empty-state{text-align:center;padding:28px 10px;color:var(--muted);font-size:14px}.rulegrid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.rulecard{padding:17px;background:#f3f5eb;border-radius:10px;font-size:13px;line-height:1.7}.rulecard h3{font-size:16px}.rulecard ul{padding-left:18px;margin:0}.welcome{max-width:1150px;margin:0 auto;padding:45px 30px 30px;display:grid;grid-template-columns:1fr 1fr;gap:35px;align-items:center}.welcome h1{font-size:51px;letter-spacing:-2px;line-height:1.12;margin:16px 0 20px}.welcome p{color:var(--muted);font-size:16px;max-width:460px}.welcome .scene{height:390px;background:transparent}.welcome-features{display:flex;gap:18px;margin:25px 0;font-size:12px}.welcome-actions{display:flex;gap:10px}.setup-panel{padding:25px;max-width:750px;margin:0 auto 35px}.setup-panel textarea{height:110px}.intro-strip{display:flex;justify-content:center;gap:32px;font-size:12px;margin-bottom:20px;color:var(--muted)}.result{text-align:center;padding:25px}.result .big{font-size:65px}.result h2{font-size:34px;margin:12px 0}.battle{padding:24px;border:1px solid #ded4be;border-radius:12px;background:#f4eddf;text-align:center}.battle .monster{font-size:66px}.rolls{display:flex;flex-wrap:wrap;gap:7px;margin:13px 0}.die{width:38px;height:38px;border-radius:8px;display:grid;place-items:center;background:#f2e8cf;border:1px solid #dac7a0;font-weight:bold;font-size:21px}.message{padding:30px}.subnav{display:flex;gap:6px;margin-bottom:14px}.tab.active{background:#e4ebd9;border-color:#c0cfae}.savehint{font-size:10px;color:#839279;white-space:nowrap}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(100px);opacity:0;background:#233f2d;color:#fff;padding:14px 24px;border-radius:10px;box-shadow:var(--shadow);transition:.2s;z-index:70;max-width:90vw;font-size:14px}#toast.show{transform:translateX(-50%);opacity:1}.logfull{max-height:58vh;overflow:auto}.logfull .entry{border-bottom:1px solid var(--line);padding:12px 4px}.keygrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.printcard{padding:20px;border:1px solid #bbb;break-inside:avoid}.printcard h2{font-size:20px}.printonly{display:none}.tv .layout{max-width:1900px}.tv{font-size:18px}.tv .playername{font-size:17px}.tv .scene{height:330px}.tv .actiontile strong{font-size:17px}.tv .resource small{font-size:12px}.tv .savehint{display:none}.tv .topbar{height:88px}@media(min-width:1600px){.scene{height:335px}.village-top h1{font-size:34px}.resource-grid{gap:11px}.resource{padding:12px 3px}}@media(max-width:1150px){.layout{grid-template-columns:180px minmax(0,1fr);padding:20px;gap:15px}.rightcol{grid-column:2;display:grid;grid-template-columns:1fr 1fr;gap:14px}.turnpanel{margin:0}.activity{display:none}.resource-grid{grid-template-columns:repeat(7,1fr)}.playername{max-width:110px}.topbar{padding:0 20px}.tools .label{display:none}}@media(max-width:760px){.topbar{height:auto;min-height:74px;padding:12px 15px;align-items:flex-start;gap:8px}.brand{font-size:21px}.brand small{font-size:8px}.brand svg{width:32px}.tools{flex-wrap:wrap;justify-content:flex-end}.tools button{font-size:11px;padding:7px}.hostbadge,.savehint{display:none}.roundbar{padding:12px 15px;gap:10px}.timeline{gap:3px}.tick{font-size:9px;height:22px}.phasepill{display:none}.layout{display:block;padding:15px}.roster{flex-direction:row;overflow:auto;padding-bottom:10px;margin-bottom:12px}.playercard{min-width:158px;width:auto}.rosterfoot,.leftcol .sectiontitle{display:none}.rightcol{display:grid;grid-template-columns:1fr;margin-top:16px}.scene{height:250px}.village-top{padding:17px}.village-top h1{font-size:24px}.mini-stat{min-width:45px;padding:7px;font-size:9px}.mini-stat strong{font-size:19px}.actionrow{grid-template-columns:1fr 1fr;padding:14px}.actiontile{padding:10px}.actiontile .ico{float:left;margin-right:12px}.resource-grid{grid-template-columns:repeat(4,1fr);padding:12px}.resource small{font-size:11px}.bonusbar{padding:12px;font-size:11px}.welcome{display:flex;flex-direction:column;padding:25px 20px;gap:0}.welcome h1{font-size:39px}.welcome .scene{height:245px;width:100%}.intro-strip{flex-wrap:wrap;gap:15px;padding:0 15px}.setup-panel{margin:0 15px 25px}.dialog-back{padding:12px}.dialog{padding:22px;max-height:95vh}.formrow,.rulegrid{grid-template-columns:1fr}.recipe-list{grid-template-columns:1fr 1fr}.farmgrid{grid-template-columns:1fr}.welcome-features{font-size:11px;gap:12px}}@media print{body>*{display:none!important}.printonly{display:block!important}.keygrid{display:grid;grid-template-columns:1fr 1fr}.printcard{min-height:160px}.printonly h1{font-size:24px}.printonly p{font-size:13px}@page{margin:12mm}}

@media(min-width:901px){.roster{max-height:65vh;overflow-y:auto;padding-right:4px;scrollbar-width:thin}}

/* Player setup and one-click exploration. */
.setup-panel{max-width:860px}.setup-player{display:grid;grid-template-columns:minmax(130px,1.3fr) minmax(130px,1fr) minmax(130px,1fr) 36px;gap:12px;align-items:end;padding:15px 0;border-bottom:1px solid var(--line);margin-bottom:10px}.setup-player select{width:100%}.setup-player label{font-size:12px}.remove-player{font-size:23px;padding:5px;height:43px}.setup-goal{margin:23px 0 20px}.player-grade{font-size:10px;font-weight:500;white-space:nowrap}.explore-row{display:flex;align-items:center;gap:16px;padding:16px 20px 0}.explore-default{width:143px;flex-shrink:0}.explore-default .ico{float:left;margin-right:10px;margin-bottom:0}.other-levels{min-width:0}.other-levels>.eyebrow{font-size:9px;display:block;margin-bottom:7px}.level-buttons{display:flex;gap:8px}.level-button{padding:6px 10px;min-width:60px;text-align:center;border-bottom-width:3px}.level-button small{display:block;font-size:9px}.level-button strong{display:block;font-size:18px;line-height:1.2}.level-3{background:#eaf1df}.level-4{background:#edece2}.level-5{background:#f6edd9}.level-6{background:#eee8f5}.actionrow{grid-template-columns:repeat(3,1fr);padding-top:14px}.mathcard .question{font-size:clamp(28px,4vw,42px);overflow-wrap:anywhere}
@media(max-width:760px){.setup-player{grid-template-columns:1fr 1fr 32px}.setup-player>div:first-child{grid-column:1 / 3}.setup-player>div:nth-child(2){grid-column:1}.setup-player>div:nth-child(3){grid-column:2}.remove-player{grid-column:3;grid-row:1 / 3;align-self:center}.explore-row{gap:10px;padding:14px 14px 0}.explore-default{width:120px}.level-buttons{gap:5px}.level-button{min-width:48px;padding:6px}.actionrow{gap:7px}.actiontile .ico{float:none;margin:0 0 5px}.actiontile strong{font-size:12px}.actiontile small{font-size:9px}.explore-default strong{font-size:14px}.setup-player select{font-size:14px;padding:9px}.setup-player label{font-size:11px}}

.explore-default{display:grid;grid-template-columns:24px 1fr;column-gap:9px;text-align:left;align-items:center}.explore-default .ico{grid-row:1 / 3;float:none;margin:0}.explore-default small{grid-column:2;font-size:9px}.explore-default strong{white-space:nowrap}
@media(max-width:400px){.explore-default{width:110px;column-gap:5px;padding:10px 7px}.level-button{min-width:40px}.other-levels>.eyebrow{font-size:8px;letter-spacing:1px}}

.test-toggle{display:flex;align-items:center;gap:10px;margin:20px 0 6px;padding:14px;background:#edf1e3;border-radius:8px}.test-toggle input{width:18px;height:18px;flex-shrink:0}

.action-status{padding:0 20px 14px;color:#64715d;font-size:12px;line-height:1.5}.block-reason{font-size:12px;color:#895f35;line-height:1.5;margin:7px 0 0}.grow-row>button{flex-shrink:0}
.room-code{font-size:clamp(20px,3.2vw,29px);letter-spacing:2px;font-weight:800;background:#eef2e5;padding:18px 12px;border-radius:10px;margin:6px 0 12px;text-align:center}.waiting-label{display:block;color:#8b5618;font-weight:700;font-size:11px}.tools{flex-wrap:wrap}button[hidden]{display:none!important}#room-link{font-size:13px}#join-code{text-transform:uppercase;letter-spacing:1px}

/* On-screen practice: readable word problems and scalable measurement diagrams. */
.mathcard .question{font-size:clamp(1.15rem,2.6vw,1.65rem);line-height:1.45;white-space:normal;overflow-wrap:anywhere}
.math-visual{display:block;width:min(100%,480px);height:auto;margin:18px auto 0;background:#fffdf5;border-radius:10px;padding:6px}
.math-visual.clock-visual{width:min(100%,240px)}
.math-choices{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.math-choices button{flex:1;min-height:44px}

.history-filters{margin-top:16px}.history-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}.history-stats>div{background:#eef2e5;padding:14px;border-radius:12px}.history-stats strong,.history-stats span{display:block}.history-stats strong{font-size:1.3rem}.history-stats span{font-size:.78rem;margin-top:5px;color:#5c6c5a}.history-table-wrap{overflow-x:auto;border:1px solid #dce1d4;border-radius:10px}.history-table{width:100%;border-collapse:collapse;font-size:.85rem}.history-table th,.history-table td{padding:10px;text-align:left;border-bottom:1px solid #dce1d4}.history-table th{background:#f1f4e9}.history-question{border:1px solid #dce1d4;border-radius:10px;padding:12px;margin:10px 0}.history-question summary{cursor:pointer;line-height:1.5}.history-prompt{display:block;font-size:.95rem;margin-top:7px;font-weight:normal}.history-status{display:inline-block;font-size:.75rem;background:#f8edcc;border-radius:6px;padding:2px 7px;margin-left:8px}.history-correct{background:#dcebd7}.history-detail{margin:14px 0 0;border-top:1px solid #dce1d4;padding-top:10px}.history-attempts li{margin:9px 0;overflow-wrap:anywhere}.history-attempts small{display:block;color:#71806c}.submitted-answer{white-space:pre-wrap}.history-pages{justify-content:space-between;align-items:center}@media(max-width:650px){.history-stats{grid-template-columns:repeat(2,1fr)}.history-status{margin:5px 0}.history-table{min-width:560px}}
/* The homestead is the action surface. Large tap targets sit on the landscape. */
.map-layout{grid-template-columns:190px minmax(0,1fr) 245px;max-width:1640px}.homestead-panel{overflow:hidden}.map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-top:1px solid var(--line);background:#f9f9ed;flex-wrap:wrap}.map-toolbar>strong{color:#365b40;font-size:14px}.map-levels{display:flex;align-items:center;gap:5px}.map-levels>span{font-size:12px;margin-right:4px}.map-levels button{padding:7px 10px}.world-scroll{overflow-x:auto;background:#eaf0df}.world-map{position:relative;width:100%;min-width:700px;aspect-ratio:1100/800;background:linear-gradient(170deg,#edf1e2,#e4ebd2)}.world-ground{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.world-node{position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);width:15%;min-height:110px;display:flex;align-items:center;flex-direction:column;background:transparent;border:0;padding:0 2px 6px;box-shadow:none;color:#243d2f;border-radius:16px;cursor:pointer;z-index:2}.world-node svg{width:92%;height:auto;display:block;filter:drop-shadow(0 5px 2px #38543112);transition:transform .16s ease;pointer-events:none}.world-node:hover,.world-node:focus-visible{background:#fff8;box-shadow:0 0 0 2px #56784a;outline:0}.world-node:hover svg{transform:translateY(-5px)}.node-label{display:block;max-width:100%;font-weight:800;font-size:14px;background:#fffbeded;border:1px solid #bdc8a2;padding:3px 8px;border-radius:6px;line-height:1.3}.world-node small{font-size:11px;font-weight:600;line-height:1.3;margin-top:3px;max-width:98%;background:#edf2dce8;padding:2px 4px;border-radius:4px}.world-node.is-locked .node-label{background:#edf0df;color:#4f6254}.world-node.is-locked small{color:#694a32;background:#fbefdae8}.node-lock{position:absolute;right:10%;top:25%;background:#fbf3d9;border-radius:50%;padding:2px 7px;border:1px solid #cfbf99}.world-node.landmark svg{width:110%}.world-node.compact svg{width:65%}.world-region{position:absolute;font-size:11px;font-weight:800;letter-spacing:1.4px;color:#456443;pointer-events:none}.region-forest{left:6%;top:4%}.region-mine{right:7%;top:10%}.world-footer{display:flex;justify-content:space-between;gap:8px;background:#eff3e5;padding:12px 18px;font-size:11px;color:#52674b;flex-wrap:wrap}.homestead-panel>.notice{margin:12px 20px}.map-layout .turnpanel>p{font-size:13px;line-height:1.6}.map-layout .village-top{padding:20px}.map-layout .village-top h1{font-size:27px}
@media(min-width:1600px){.node-label{font-size:16px}.world-node small{font-size:12px}}
@media(max-width:1150px){.map-layout{grid-template-columns:165px minmax(0,1fr)}.map-layout>.rightcol{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr)}.map-layout .world-map{min-width:700px}}
@media(max-width:760px){.map-layout{display:block}.map-layout>.leftcol{margin-bottom:12px}.map-layout .roster{display:flex;overflow-x:auto}.map-layout .playercard{min-width:155px}.map-layout .rosterfoot{display:none}.map-layout>.rightcol{display:block}.map-layout .village-top{padding:16px}.map-layout .village-top h1{font-size:23px}.map-toolbar{padding:10px}.map-levels button{padding:8px}.world-footer:after{content:'Swipe the landscape sideways to reach every place.';font-weight:700}.world-scroll{scrollbar-width:thin}.map-layout .mini-stats{gap:4px}.map-layout .mini-stat{min-width:42px;padding:8px}.map-layout .world-map{min-width:760px}}
@media(prefers-reduced-motion:reduce){.world-node svg{transition:none}}

/* Persistent, editable terrain and item-in-hand controls. */
.holding-bar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;padding:14px 18px 8px;background:#f5f6e9}.held-slot{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 3px;border:1px solid #cbd1b7;background:#fffdf1;min-height:84px;border-radius:8px;color:#3e533a}.held-slot>span{font-size:23px;line-height:1.2}.held-slot>b{font-size:12px}.held-slot>small{font-size:10px;white-space:nowrap}.held-slot.chosen{background:#dde9c6;border:2px solid #557b41;padding:8px 2px;box-shadow:inset 0 0 0 2px #f1f6e7}.holding-help{padding:6px 20px 13px;font-size:12px;line-height:1.5;min-height:49px;background:#f5f6e9;border-bottom:1px solid #d8dfc8;color:#526548}.holding-help b{color:#2e5038}.terrain-scroll{overflow:auto;background:radial-gradient(ellipse at center,#f5f5df,#e6ecd6);min-height:320px}.terrain-map{display:block;width:100%;min-width:690px;height:auto;isolation:isolate}.terrain-tile{cursor:pointer;outline:none}.block-face{stroke:#4c65472e;stroke-width:1;stroke-linejoin:round;transition:filter .1s}.terrain-tile:hover>.block-face,.terrain-tile:focus>.block-face{filter:brightness(1.15);stroke:#fff9cf;stroke-width:2.5}.terrain-tile.plantable>.block-top{fill:#b8cc89;stroke:#66834e;stroke-dasharray:3 3}.terrain-tile.plantable:hover>.block-top,.terrain-tile.plantable:focus>.block-top{fill:#d5e6a8;stroke:#355f38;stroke-dasharray:none}.terrain-object{pointer-events:auto}.grid-coordinate{font-family:inherit;font-size:10px;font-weight:700;fill:#617558;pointer-events:none}.roaming-cow{cursor:pointer;outline:none}.cow-body{filter:drop-shadow(0 2px 0 #27462b20)}.roaming-cow:hover .cow-body,.roaming-cow:focus .cow-body{filter:drop-shadow(0 0 3px #fff7af) drop-shadow(0 0 2px #395738)}.cow-badge{font-family:inherit;font-size:11px;font-weight:800;fill:#3a5d3a;pointer-events:none}.terrain-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:10px 18px;background:#eef2e1;font-size:11px;color:#58704f;border-top:1px solid #d8dfc8}.terrain-footer button{font-size:11px}.terrain-map .roaming-cow>*{pointer-events:auto}@media(max-width:760px){.holding-bar{padding:10px 10px 6px;gap:4px}.held-slot{min-height:76px}.held-slot>b{font-size:10px}.held-slot>small{font-size:9px}.holding-help{padding:6px 12px 10px}.terrain-scroll{min-height:290px}.terrain-map{min-width:650px}}@media(prefers-reduced-motion:reduce){.block-face{transition:none}}

/* The shared board uses the same full-block scene on the welcome page. */
.scene .terrain-scroll{overflow:hidden;background:transparent;border:0}.scene .terrain-map{min-width:0;width:100%;max-height:none}.scene{pointer-events:none}
.depth-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;background:#eeefdf;border-bottom:1px solid #d6dcc5}.depth-controls label{margin:0;font-weight:700}.depth-controls span{font-size:12px;color:#65745b}.depth-controls select{padding:7px 10px}
.world-notices{padding:0 18px}.mob-list{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.mob-list>b{font-size:12px;margin-right:3px}.mob-chip{background:#f6e5dc;border-color:#d9b7a5;color:#754a3d}.mob-chip small{opacity:.75}.tile-reservations{padding:10px 12px;margin-bottom:10px;background:#f7e8b9;border:1px solid #d6b65c;border-radius:7px;display:flex;gap:10px;flex-wrap:wrap;font-size:13px}
.map-object,.world-mob{cursor:pointer;outline:none}.map-object:focus,.world-mob:focus{filter:drop-shadow(0 0 4px #f4b945)}.world-mob:hover{filter:brightness(1.1)}.unexcavated{opacity:.65}.terrain-map{max-height:690px}.terrain-scroll{background:radial-gradient(ellipse at 50% 35%,#f7f6df,#e6ebd5)}

/* Keep the enchantment attached to its equipped tool in both menus. */
.enchantment{color:#69428a;font-weight:700}.gear.enchanted{background:#f3ecfa;border-color:#c8afd9}.gear .enchantment{display:inline-block;margin-left:4px}.held-slot.enchanted:not(.chosen){background:#f3ecfa;border-color:#b99dce}.held-slot>small.enchantment{white-space:normal;line-height:1.35;overflow-wrap:anywhere}

/* Subjects and accessible four-choice questions. */
.subject-setup{display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:18px;background:#eef3e5;border:1px solid #cbd8bd;border-radius:12px;margin-bottom:16px}.subject-setup select{width:100%}.setup-player.mixed-subjects{grid-template-columns:minmax(120px,1.2fr) minmax(110px,1fr) minmax(110px,1fr) minmax(100px,1fr) 32px}.player-subject{display:block;color:#617351;font-size:11px;margin-top:3px}.four-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px}.four-choices button{display:flex;align-items:center;gap:10px;text-align:left;min-height:68px;padding:14px;overflow-wrap:anywhere;font-size:17px}.choice-letter{display:inline-grid;place-items:center;flex:0 0 28px;height:28px;border-radius:7px;background:#e0eacf;color:#375c3d;font-size:13px;font-weight:800}.history-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.map-levels{flex-wrap:wrap}.math-visual{max-height:260px}.dialog .question{font-size:clamp(23px,3vw,34px)}
@media(max-width:760px){.subject-setup{grid-template-columns:1fr}.setup-player.mixed-subjects{grid-template-columns:1fr 1fr 32px}.setup-player.mixed-subjects>div:first-child{grid-column:1 / 3}.setup-player.mixed-subjects>div:nth-child(2){grid-column:1}.setup-player.mixed-subjects>div:nth-child(3){grid-column:2}.setup-player.mixed-subjects>div:nth-child(4){grid-column:1 / 3}.setup-player.mixed-subjects .remove-player{grid-column:3;grid-row:1 / 4}.history-filters{grid-template-columns:1fr}.four-choices{grid-template-columns:1fr}.four-choices button{min-height:54px;font-size:16px}}

/* Shared original creature illustrations, with room for wings and horns. */
.creature-display{width:176px;max-width:100%;margin:0 auto 8px;border-radius:50%;background:radial-gradient(ellipse,#e3e9d5 0%,#f3efdf 57%,transparent 72%)}
.creature-portrait{width:100%;height:auto;display:block;overflow:visible}
.elements-charm{width:25px;height:31px;display:inline-block;vertical-align:middle}.recipecard .elements-charm{width:34px;height:42px}.held-slot b{overflow-wrap:anywhere}
.finale-creature{width:210px}.world-mob .creature-art{pointer-events:visiblePainted}
/* Blob wobbles around its base; its shadow, health badge and target stay still. */
.blob-jelly{transform-box:fill-box;transform-origin:50% 100%;animation:blob-wobble 2.6s ease-in-out infinite}
@keyframes blob-wobble{0%,55%,100%{transform:scale(1,1) skewX(0deg)}62%{transform:scale(1.13,.86) skewX(-4deg)}70%{transform:scale(.92,1.1) skewX(3deg)}78%{transform:scale(1.06,.94) skewX(-2deg)}86%{transform:scale(.98,1.02) skewX(1deg)}94%{transform:scale(1,1) skewX(0deg)}}
/* Original idle movements share the same SVGs on the map, in combat and Help.
   Only the artwork moves; map placement, shadows and health labels stay fixed. */
.creature-motion,.creature-motion>g{transform-box:fill-box;transform-origin:50% 100%}
.creature--bramblekin{animation:creature-sway 3.8s ease-in-out -1.1s infinite}
.creature--bramblekin .creature-arms{transform-origin:50% 0%;animation:creature-arm-swing 3.8s ease-in-out -1.1s infinite}
.creature--bramblekin .creature-leaves{animation:creature-leaf-rustle 2.4s ease-in-out -.6s infinite}
.creature--pebbleback{animation:creature-rock 2.8s ease-in-out -.5s infinite}
.creature--pebbleback .creature-legs{animation:creature-scuttle 1.4s ease-in-out -.5s infinite}
.creature--thornbeak{animation:creature-peck 3.6s ease-in-out -.7s infinite}
.creature--thornbeak .creature-wings{animation:creature-wing-flick 3.6s ease-in-out -.7s infinite}
.creature--dusthorn{animation:creature-stomp 3.4s ease-in-out -.4s infinite}
.creature--dusthorn .creature-head{animation:creature-head-lower 3.4s ease-in-out -.4s infinite}
.creature--cragcrab{animation:creature-rock 3.2s ease-in-out -1.4s infinite}
.creature--cragcrab .creature-legs{animation:creature-scuttle 1.6s ease-in-out -1.4s infinite}
.creature--cragcrab .creature-claws{transform-origin:50% 70%;animation:creature-claw-flex 3.2s ease-in-out -1.4s infinite}
.creature--tunnel-moth{animation:creature-hover 2.8s ease-in-out -1.2s infinite}
.creature--tunnel-moth .creature-wings{transform-origin:50% 55%;animation:creature-moth-flutter .8s ease-in-out -.3s infinite}
.creature--moonray{animation:creature-hover 4s ease-in-out -1.8s infinite}
.creature--moonray .creature-wings{animation:creature-ray-fins 4s ease-in-out -1.8s infinite}
.creature--moonray .creature-tail{transform-origin:50% 0%;animation:creature-tail-swish 4s ease-in-out -1.8s infinite}
.creature--bloomcap{animation:creature-sway 4.6s ease-in-out -2.1s infinite}
.creature--bloomcap .creature-cap{animation:creature-cap-nod 4.6s ease-in-out -2.1s infinite}
.creature--ironbark{animation:creature-heave 4.8s ease-in-out -.9s infinite}
.creature--ironbark .creature-arms{transform-origin:50% 0%;animation:creature-arm-swing 4.8s ease-in-out -.9s infinite}
.creature--sunplume{animation:creature-hover 2.6s ease-in-out -.6s infinite}
.creature--sunplume .creature-wings{animation:creature-wingbeat 1.3s ease-in-out -.6s infinite}
.creature--stormwing{animation:creature-hover 3.6s ease-in-out -1.4s infinite}
.creature--stormwing .creature-wings{animation:creature-wingbeat 1.8s ease-in-out -.7s infinite}
.creature--stormwing .creature-tail{transform-origin:50% 0%;animation:creature-tail-swish 3.6s ease-in-out -1.4s infinite}
@keyframes creature-sway{0%,100%{transform:rotate(-1.5deg)}50%{transform:rotate(1.5deg)}}
@keyframes creature-arm-swing{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(3deg) translateY(1px)}}
@keyframes creature-leaf-rustle{0%,100%{transform:skewX(-2deg)}50%{transform:skewX(3deg)}}
@keyframes creature-rock{0%,100%{transform:rotate(-1deg) translateX(-1px)}50%{transform:rotate(1deg) translateX(1px)}}
@keyframes creature-scuttle{0%,100%{transform:skewX(-3deg)}50%{transform:skewX(3deg) scaleY(.95)}}
@keyframes creature-peck{0%,45%,100%{transform:rotate(0deg)}60%{transform:rotate(4deg) translateY(1px)}72%{transform:rotate(-1deg)}84%{transform:rotate(2deg)}}
@keyframes creature-wing-flick{0%,45%,100%{transform:rotate(0deg)}60%,78%{transform:rotate(-8deg)}69%,88%{transform:rotate(2deg)}}
@keyframes creature-stomp{0%,45%,100%{transform:translateY(0)}58%{transform:translateY(-2px) rotate(-1deg)}65%{transform:translateY(1px)}75%{transform:translateY(0)}}
@keyframes creature-head-lower{0%,40%,100%{transform:rotate(0deg)}55%,70%{transform:rotate(4deg) translateY(1px)}}
@keyframes creature-claw-flex{0%,35%,100%{transform:scale(1)}50%,70%{transform:scale(1.07,1.04) translateY(-2px)}60%{transform:scale(1.02,.98)}}
@keyframes creature-hover{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes creature-moth-flutter{0%,100%{transform:scaleX(1) rotate(-1deg)}50%{transform:scaleX(.79) rotate(1deg)}}
@keyframes creature-ray-fins{0%,100%{transform:scaleY(1) rotate(-1deg)}50%{transform:scaleY(.85) rotate(1deg)}}
@keyframes creature-tail-swish{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(6deg)}}
@keyframes creature-cap-nod{0%,100%{transform:rotate(-1deg)}50%{transform:rotate(2deg) translateY(1px)}}
@keyframes creature-heave{0%,100%{transform:scale(1,1)}50%{transform:scale(1.015,.975)}}
@keyframes creature-wingbeat{0%,100%{transform:scaleY(1) rotate(-1deg)}50%{transform:scaleY(.76) rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.creature-motion,.creature-motion *{animation:none!important}}
@media print{.creature-motion,.creature-motion *{animation:none!important}}
@media(max-width:500px){.creature-display{width:142px}.finale-creature{width:170px}}

/* Compact play surface. Secondary information has its own panel rather than
   pushing the map and next action below the fold. */
html{scrollbar-gutter:stable}body{overflow-x:hidden}#app,.game-shell,.map-layout>main{min-width:0}.game-shell{min-height:100dvh}.board-tabs{display:flex;gap:6px;padding:8px 16px;background:#f8f8ef;border-bottom:1px solid var(--line)}.board-tabs button{min-height:40px;padding:8px 18px;font-size:13px}.board-tabs button[aria-pressed=true],.board-tabs button.active{background:var(--deep);border-color:var(--deep);color:#fff}.game-shell .bottom-note{display:none}.game-shell .topbar{height:60px;padding:8px 18px}.game-shell .brand{font-size:21px}.game-shell .brand svg{width:32px}.game-shell .brand small{font-size:8px;letter-spacing:1.1px}.game-shell .tools{gap:5px}.game-shell .roundbar{padding:9px 18px;gap:16px}.game-shell .roundlabel strong{font-size:20px}.game-shell .tick{height:21px;padding-top:4px}.game-shell .layout{padding:12px 16px;gap:12px}.game-shell .map-layout{grid-template-columns:170px minmax(0,1fr) 230px;max-width:1800px}.game-shell .rosterfoot,.game-shell .activity{display:none}.game-shell .playercard{padding:9px 8px;gap:8px}.game-shell .playercard.selected{padding:8px 7px}.game-shell .playername{max-width:110px}.game-shell .avatar{width:30px;height:34px;font-size:15px}.game-shell .playerinfo{margin-top:4px;font-size:10px}.game-shell .player-subject{font-size:10px}.game-shell .sectiontitle{margin-bottom:8px}.game-shell .roster{gap:7px;max-height:calc(var(--app-height,100dvh) - 190px);overflow:auto}.game-shell .goal{padding:15px}.game-shell .goal h2{font-size:19px;margin:8px 0}.game-shell .goal p{line-height:1.45;margin-bottom:9px}.game-shell .goal-icon{font-size:28px}.game-shell .goalmetric{margin-top:10px}.game-shell .goal-note{display:none}.game-shell .turnpanel{padding:15px;margin-top:12px}.game-shell .turnpanel>p:not(.help){display:none}.game-shell .turnpanel h3{margin-top:6px}.game-shell .turnpanel .help{font-size:11px;line-height:1.45}.game-shell .map-layout .village-top{padding:10px 14px;align-items:center}.game-shell .village-top .eyebrow{display:none}.game-shell .map-layout .village-top h1{font-size:20px;margin:0 0 3px}.game-shell .village-top p{font-size:11px}.game-shell .mini-stat{padding:4px 8px;min-width:42px;font-size:9px}.game-shell .mini-stat strong{font-size:17px}.game-shell .map-toolbar{padding:7px 12px;gap:6px}.game-shell .map-toolbar>strong{font-size:12px}.game-shell .map-levels{gap:4px}.game-shell .map-levels button{padding:5px 8px;min-height:32px;font-size:11px}.game-shell .map-levels>span{font-size:10px}.game-shell .holding-bar{padding:7px 10px 4px;gap:5px}.game-shell .held-slot{min-height:57px;padding:5px 2px;gap:1px}.game-shell .held-slot.chosen{padding:4px 1px}.game-shell .held-slot>span{font-size:19px}.game-shell .held-slot>b{font-size:10px;line-height:1.2}.game-shell .held-slot>small{font-size:9px;line-height:1.2;white-space:normal}.game-shell .holding-help{padding:4px 12px 6px;min-height:0;font-size:11px;line-height:1.35}.game-shell .depth-controls{padding:5px 12px;gap:8px}.game-shell .depth-controls label{font-size:11px}.game-shell .depth-controls select{font-size:11px;padding:4px 7px}.game-shell .depth-controls span{font-size:10px}.game-shell .terrain-scroll{min-height:0;overflow:auto}.game-shell .terrain-map{width:100%;min-width:0;max-height:clamp(190px,calc(var(--app-height,100dvh) - 440px),650px);height:auto;touch-action:manipulation}.game-shell .terrain-footer{padding:5px 10px;font-size:10px}.game-shell .terrain-footer button{font-size:10px;padding:5px}.game-shell .action-status{padding:5px 12px;font-size:10px;line-height:1.35}.game-shell .bonusbar{padding:7px 12px;gap:8px;font-size:11px}.game-shell .bonusbar button{white-space:nowrap;font-size:11px;padding:7px 9px}.game-shell .world-notices{padding:3px 10px}.game-shell .mob-list{gap:4px}.game-shell .mob-list>b{font-size:10px}.game-shell .mob-chip{padding:5px 7px;font-size:10px;min-height:30px}.game-shell .mob-chip small{font-size:9px}.game-shell .homestead-panel>.notice{margin:6px 10px;padding:7px 10px;font-size:11px}.game-shell .inventory{margin-top:0}.map-layout[data-panel=map] main>.inventory,.map-layout[data-panel=team] main>.inventory{display:none}.map-layout[data-panel=backpack] main>.homestead-panel{display:none}.map-layout[data-panel=backpack] .resource-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.map-layout[data-panel=team] main{display:none}.map-layout[data-panel=team]>.rightcol{grid-column:2/-1;display:grid;grid-template-columns:1fr 1fr;align-items:start;gap:14px}.map-layout[data-panel=team] .turnpanel{margin-top:0}
/* Mobile: keep all map edges visible. Zoom is optional and pans inside the
   map only; labeled targets remain accessible without precise map tapping. */
.game-shell .map-zoomed .terrain-map{min-width:850px;max-height:none}.game-shell .map-zoomed .terrain-scroll{max-height:55dvh;overscroll-behavior:contain}.board-tabs{position:relative;z-index:2}
@media(max-width:1150px){.game-shell .map-layout{grid-template-columns:145px minmax(0,1fr) 205px}.game-shell .map-layout>.rightcol{grid-column:auto;display:block}.game-shell .playername{max-width:85px}.game-shell .goal h2{font-size:17px}.game-shell .tools .label{display:none}.game-shell .hostbadge{display:none}.game-shell .layout{padding:10px;gap:10px}}
@media(max-width:900px){.game-shell .map-layout{grid-template-columns:minmax(0,1fr) 210px}.game-shell .leftcol{grid-column:1/-1}.game-shell .leftcol .sectiontitle{display:none}.game-shell .roster{flex-direction:row;max-height:none;overflow:auto;margin:0;padding-bottom:3px;scrollbar-width:thin}.game-shell .playercard{min-width:145px;width:auto}.game-shell .playername{max-width:110px}.game-shell .map-layout[data-panel=team]>.rightcol{grid-column:1/-1}.game-shell .terrain-map{max-height:clamp(180px,calc(var(--app-height,100dvh) - 490px),580px)}}
@media(max-width:640px){html{scrollbar-gutter:auto}.game-shell .topbar{min-height:54px;height:auto;padding:8px 10px;align-items:center}.game-shell .brand{font-size:17px;gap:6px}.game-shell .brand svg{width:26px}.game-shell .brand small{display:none}.game-shell .tools{gap:2px}.game-shell .tools button{padding:7px 6px;font-size:11px;min-height:34px}.game-shell .tools .savehint{display:none}.game-shell .roundbar{padding:7px 10px;gap:10px}.game-shell .timeline{gap:2px}.game-shell .tick{font-size:8px;height:18px;padding-top:3px}.game-shell .roundlabel{font-size:9px}.game-shell .roundlabel strong{font-size:17px}.board-tabs{padding:6px 10px;gap:5px}.board-tabs button{flex:1;padding:7px 4px;min-height:36px;font-size:12px}.game-shell .map-layout{display:flex;flex-direction:column;padding:7px;gap:7px}.game-shell .map-layout>.leftcol{margin:0}.game-shell .map-layout>.rightcol{display:none}.game-shell .map-layout>main{width:100%}.game-shell .playercard{min-width:128px;padding:6px;gap:6px}.game-shell .playercard.selected{padding:5px}.game-shell .avatar{width:26px;height:29px;font-size:13px}.game-shell .playername{font-size:12px;max-width:94px}.game-shell .player-subject{display:none}.game-shell .playerinfo{font-size:9px;margin-top:2px}.game-shell .map-layout .village-top{padding:8px 10px}.game-shell .map-layout .village-top h1{font-size:16px}.game-shell .village-top p{max-width:190px;line-height:1.25;font-size:10px}.game-shell .mini-stats{gap:3px}.game-shell .mini-stat{padding:3px 5px;min-width:32px;font-size:8px}.game-shell .mini-stat strong{font-size:15px}.game-shell .map-toolbar{padding:6px 8px}.game-shell .map-levels{gap:3px}.game-shell .map-levels>span{font-size:9px}.game-shell .map-levels button{padding:4px 6px;min-height:30px;font-size:10px}.game-shell .holding-bar{gap:3px;padding:6px 6px 3px}.game-shell .held-slot{min-height:56px}.game-shell .held-slot>span{font-size:20px}.game-shell .held-slot>b{font-size:9px;line-height:1.15}.game-shell .held-slot>small{font-size:8px}.game-shell .holding-help{padding:4px 8px;font-size:10px}.game-shell .depth-controls{padding:5px 8px}.game-shell .depth-controls span{display:none}.game-shell .terrain-map{max-height:clamp(170px,calc(var(--app-height,100dvh) - 455px),450px);min-width:0}.game-shell .terrain-footer{padding:4px 6px}.game-shell .terrain-footer>span:first-child{display:none}.game-shell .action-status{padding:4px 8px;font-size:10px}.game-shell .bonusbar{padding:6px 8px;font-size:10px}.game-shell .bonusbar p{line-height:1.3}.game-shell .bonusbar button{min-height:36px;font-size:10px}.map-layout[data-panel=team]>.leftcol{display:block}.game-shell .map-layout[data-panel=team]>.rightcol{display:grid;grid-template-columns:1fr;width:100%;gap:10px}.game-shell .map-layout[data-panel=backpack] .resource-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.game-shell .inventory .panel-head{padding:12px;flex-wrap:wrap;gap:5px}.game-shell .inventory .panel-head h3{margin-right:auto}.game-shell .inventory .panel-head button{font-size:11px}.game-shell .resource-grid{padding:10px;gap:6px}.game-shell .gearstrip{padding:0 10px 12px}.dialog-back{padding:8px}.dialog{max-height:calc(var(--app-height,100dvh) - 16px);padding:20px 16px}.dialog.large{width:100%}.dialog h2{font-size:22px}.recipe-list{grid-template-columns:1fr}.formrow{gap:10px}.welcome-actions{flex-wrap:wrap}.history-stats{grid-template-columns:1fr 1fr}.dialog-actions{flex-wrap:wrap}.setup-panel{padding:18px;margin-inline:10px}.setup-player{gap:8px}.setup-player select{min-width:0}.subject-setup{padding:12px}}
/* Questions use four explicit rows: context, prompt/diagram, answer, tools.
   A rare oversized imported prompt may scroll in its own readable region;
   the answer and return controls remain visible. */
body:has(.question-dialog){overflow:hidden}.dialog-back:has(.question-dialog){padding:12px;top:var(--viewport-top,0px);bottom:auto;height:var(--app-height,100dvh)}.question-dialog{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px;width:min(740px,100%);height:min(780px,calc(var(--app-height,100dvh) - 24px));max-height:none;overflow:hidden;padding:20px 24px}.question-header h2{font-size:21px;margin:0 0 4px;padding-right:0}.question-header .dialog-intro{font-size:12px;line-height:1.3;margin:0}.question-body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.question-body .mathcard{border-style:solid;padding:12px;margin:0;height:100%;min-height:min-content;display:flex;flex-direction:column;justify-content:center;gap:8px}.question-body .eyebrow{font-size:9px}.question-dialog .question{font-size:clamp(20px,2.7vw,30px);line-height:1.3;margin:0;white-space:normal;overflow-wrap:anywhere}.question-dialog .math-visual{margin:0 auto;padding:4px;width:min(100%,420px);max-height:240px;min-height:0;object-fit:contain}.question-dialog .math-visual.clock-visual{max-width:210px}.question-controls{min-width:0}.question-controls form{margin:0}.question-controls label{font-size:13px;margin-bottom:5px}.question-controls .answerinput{font-size:24px;padding:9px;min-height:48px}.question-controls .math-choices{margin:0;gap:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.question-controls .math-choices button{font-size:19px;padding:10px;min-height:50px;justify-content:center}.question-controls .four-choices button{text-align:left;justify-content:flex-start;font-size:16px;min-height:58px}.question-controls .choice-letter{height:25px;flex-basis:25px}.question-controls .help{font-size:11px;line-height:1.3;margin:5px 0}.question-controls .notice{font-size:12px;line-height:1.3;padding:7px 10px;margin:6px 0}.question-controls button[type=submit]{margin-top:7px;min-height:44px;padding:9px}.question-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:8px}.question-footer button{font-size:12px;min-height:36px;padding:7px 10px}.question-footer .dialog-actions{margin:0}.visual-question .question-body .mathcard{padding:8px}.visual-question .question{font-family:'Space Grotesk',system-ui,sans-serif;font-size:clamp(32px,5vw,50px);font-weight:700}.visual-question .question-body .math-visual{width:min(100%,480px);max-height:280px}.visual-question .question-controls .math-choices button{font-size:28px;font-weight:700;min-height:60px}.visual-question .question-controls .answerinput{font-size:30px}.visual-question .choice-letter{display:none}
@media(max-width:640px){.dialog-back:has(.question-dialog){padding:6px}.question-dialog{height:calc(var(--app-height,100dvh) - 12px);padding:12px;gap:8px;border-radius:12px}.question-header h2{font-size:17px}.question-header .dialog-intro{font-size:10px}.question-dialog .question{font-size:clamp(18px,4.7vw,24px)}.question-body .mathcard{padding:10px}.question-dialog .math-visual{max-height:220px}.question-controls .math-choices{gap:6px}.question-controls .four-choices button{font-size:14px;min-height:54px;padding:8px;gap:6px}.question-controls .choice-letter{height:21px;flex-basis:21px;font-size:11px}.question-controls .answerinput{font-size:24px;min-height:46px}.question-controls .help{font-size:10px}.question-footer{gap:4px;padding-top:6px}.question-footer button{font-size:11px;padding:7px 8px}.visual-question .question{font-size:clamp(30px,9vw,44px)}.visual-question .question-controls .math-choices button{font-size:25px;min-height:56px}.visual-question .question-body .math-visual{max-height:270px}}
@media(max-height:540px) and (min-width:560px){.question-dialog{width:min(1000px,100%);grid-template-columns:minmax(0,1.1fr) minmax(230px,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:7px 14px;padding:12px 16px;height:calc(var(--app-height,100dvh) - 16px)}.question-header{grid-column:1/-1}.question-body{grid-column:1;grid-row:2}.question-controls{grid-column:2;grid-row:2;align-self:center;max-height:100%;overflow:auto}.question-footer{grid-column:1/-1}.question-header h2{font-size:16px;display:inline;margin-right:10px}.question-header .dialog-intro{font-size:10px;display:inline}.question-dialog .question{font-size:21px}.question-dialog .math-visual,.visual-question .question-body .math-visual{max-height:170px}.question-controls .four-choices button{min-height:42px;font-size:13px}.question-controls .help{font-size:10px}.question-controls .notice{font-size:11px;padding:4px 6px}.question-controls button[type=submit]{min-height:38px;padding:6px}.question-footer button{min-height:32px;padding:5px 8px}.visual-question .question{font-size:32px}.visual-question .question-controls .math-choices button{min-height:45px;font-size:23px}}
@media(max-height:420px) and (max-width:559px){.question-dialog{padding:8px;gap:5px}.question-header h2{font-size:15px}.question-header .dialog-intro{display:none}.question-dialog .question{font-size:20px}.question-dialog .math-visual{max-height:105px}.question-controls .help{display:none}.question-controls .answerinput{font-size:20px;min-height:38px;padding:5px}.question-controls .math-choices button{min-height:38px;font-size:17px;padding:5px}.question-controls button[type=submit]{min-height:36px;padding:5px}.question-footer button{min-height:30px;padding:4px 7px}.question-body .mathcard{padding:5px}}
/* Teacher-facing topic and review lists remain scannable on smaller screens. */
.teacher-settings{display:grid;gap:14px}.teacher-settings select{max-width:100%}.topic-group{border:1px solid var(--line);border-radius:10px;background:#f8faf0;padding:12px}.topic-group summary{font-weight:700;cursor:pointer;min-height:32px}.topic-group h3{font-size:16px}.topic-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}.topic-checklist label,.topic-option{display:flex;align-items:flex-start;gap:9px;padding:10px;border:1px solid #d6deca;border-radius:8px;background:#fffef7;margin:0;font-weight:500;font-size:13px;line-height:1.4;cursor:pointer}.topic-checklist input,.topic-option input{flex:0 0 18px;height:18px;width:18px;margin:1px 0}.topic-checklist small,.topic-option small{display:block;font-size:11px;margin-top:3px}.topic-actions{display:flex;flex-wrap:wrap;gap:7px;margin:9px 0}.question-feedback label{margin-top:10px}.question-feedback textarea{min-height:82px}.teacher-review{display:grid;gap:10px}.feedback-entry{border:1px solid var(--line);border-radius:9px;padding:12px;background:#f9faf2;overflow-wrap:anywhere}.feedback-entry p{font-size:13px;margin:7px 0}.feedback-entry .math-visual{max-height:160px}.teacher-review-actions{display:flex;gap:6px;flex-wrap:wrap}.teacher-settings .dialog-actions{position:sticky;bottom:-20px;padding:12px 0;background:#fffef6;border-top:1px solid var(--line)}@media(max-width:640px){.topic-checklist{grid-template-columns:1fr}.topic-group{padding:10px}.teacher-settings .dialog-actions{bottom:-20px}.teacher-review-actions button{font-size:11px;padding:7px}}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.answer-status{font-size:12px;font-weight:700;color:#934f34;min-height:16px;margin-top:4px;text-align:center}.visual-question .answer-status{font-size:22px;min-height:26px;line-height:1}.question-help{font-size:11px;color:#5b6d53;margin-top:4px;max-height:13dvh;overflow:auto}.question-help summary{cursor:pointer;padding:4px 0}.question-help p{line-height:1.35;margin:4px 0}.question-controls .math-choices button{touch-action:manipulation}.game-shell .board-tabs{flex-wrap:wrap}.game-shell .board-tabs button{white-space:nowrap}@media(max-width:400px){.game-shell .board-tabs{gap:3px;padding:5px 7px}.game-shell .board-tabs button{font-size:10px;min-height:34px;padding:6px 3px}.game-shell .map-toolbar .map-levels{width:100%}.game-shell .map-levels>span{margin-right:auto}.game-shell .holding-help{line-height:1.25}.game-shell .bonusbar p{max-width:160px}.game-shell .village-top p{max-width:158px}}
/* Keep the compact question usable when a mobile keyboard shortens the screen. */
.answer-status:empty{display:none}.visual-question .math-choices button{justify-content:center;text-align:center}.teacher-settings>.dialog-actions:not(:last-of-type){position:static}
@media(max-height:420px) and (max-width:559px){.question-dialog:not(.visual-question) .question{font-size:16px;line-height:1.25}.visual-question .question-body .math-visual{max-height:70px}.visual-question .question{font-size:26px;line-height:1.1}.question-controls label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.question-controls .four-choices button{font-size:13px;line-height:1.2;min-height:38px}.question-controls .math-choices{gap:5px}.question-header h2{margin:0}.question-body .mathcard{gap:4px}}
/* The active board occupies the screen; secondary panels scroll independently. */
.game-shell{height:var(--app-height,100dvh);min-height:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);overflow:hidden}.game-shell .layout{height:100%;min-height:0;margin:0;width:100%;max-width:none}.game-shell .layout>main{height:100%;min-height:0;overflow:auto}.game-shell .homestead-panel{height:100%;min-height:0;display:flex;flex-direction:column}.game-shell .homestead-panel>*{flex-shrink:0}.game-shell .homestead-panel>.terrain-scroll{flex:1;min-height:80px;overflow:hidden;display:flex;align-items:center}.game-shell .terrain-map{height:100%;max-height:none;min-height:0;min-width:0;object-fit:contain}.game-shell .homestead-panel.map-zoomed>.terrain-scroll{overflow:auto;display:block;max-height:none}.game-shell .map-zoomed .terrain-map{height:auto;min-width:850px}.game-shell .rightcol{height:100%;min-height:0;overflow:auto}.game-shell .holding-help,.game-shell .action-status,.game-shell .world-notices .help{display:none}.game-shell .world-notices{padding:4px 8px}.game-shell .mob-list{flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;max-width:100%;scrollbar-width:thin}.game-shell .mob-chip{flex-shrink:0}.game-shell .mob-list>b{display:none}.game-shell .tile-reservations{max-height:45px;overflow:auto;padding:4px 6px;margin-bottom:4px}.game-shell .map-levels label{font-size:12px;margin:0}.game-shell .map-levels select{font-size:14px;padding:5px 8px;min-height:32px;max-width:180px}.game-shell .map-toolbar{flex-wrap:nowrap}.game-shell .map-layout .village-top{padding:6px 10px}.game-shell .village-top p{display:none}.game-shell .terrain-footer{padding:2px 8px}.game-shell .terrain-footer>span{display:none}.game-shell .bonusbar{padding:5px 8px}.game-shell .bonusbar p{font-size:10px}.game-shell .topbar{height:48px}.game-shell .roundbar{padding:5px 14px}.board-tabs{padding:4px 12px}.board-tabs button{min-height:34px;padding:5px 12px}.game-shell .leftcol{min-height:0;overflow:auto}.game-shell .roster{max-height:100%}.game-shell .map-layout[data-panel=team]>.rightcol{display:grid}.game-shell .map-layout[data-panel=backpack] main{overflow:auto}.game-shell .map-layout[data-panel=backpack] .inventory{min-height:100%}
@media(max-width:900px){.game-shell .map-layout{grid-template-rows:auto minmax(0,1fr)}.game-shell .leftcol{max-height:68px}.game-shell .roster{margin:0;padding-bottom:3px}.game-shell .map-layout>main{min-height:0}}
@media(max-width:640px){.game-shell .map-layout{display:grid;grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);padding:5px;gap:5px}.game-shell .topbar{min-height:46px;padding:5px 8px}.game-shell .map-layout .village-top{display:none}.game-shell .map-toolbar{padding:4px 7px}.game-shell .map-levels select{font-size:16px;min-height:32px;max-width:155px}.game-shell .holding-bar{padding:4px;gap:2px}.game-shell .held-slot{min-height:51px}.game-shell .held-slot>small{display:none}.game-shell .depth-controls{padding:3px 7px}.game-shell .depth-controls select{min-height:30px}.game-shell .terrain-footer button{min-height:30px}.game-shell .bonusbar p{font-size:9px;max-width:170px}.game-shell .map-layout[data-panel=team]>.rightcol{grid-row:2;max-height:100%;overflow:auto}.game-shell .leftcol{max-height:57px}.game-shell .playercard{min-width:120px}.game-shell .roster{padding-bottom:2px}.board-tabs button{font-size:12px;padding:5px 3px;min-height:34px}.game-shell .roster .playerinfo{font-size:9px}.game-shell .bonusbar button{min-height:32px}.game-shell .map-zoomed .terrain-map{max-height:none}}
.question-body .mathcard{min-height:0}.question-body .question{flex:0 0 auto}.question-body .math-visual{flex:0 1 auto;min-height:0;height:auto;object-fit:contain}.question-body .mathcard:has(.math-visual){justify-content:center}
.game-shell .topbar{min-height:48px}.game-shell .roster{margin-bottom:0}.game-shell .roster .playercard{flex-shrink:0}.game-shell .map-layout>.leftcol{overflow-x:auto;overflow-y:hidden}.game-shell .roster{padding-bottom:3px}
@media(min-width:901px){.game-shell .map-layout>.leftcol{overflow-y:auto;overflow-x:hidden}}
/* Map-first board: tools occupy the empty corners, not rows above the world. */
.game-shell.map-first{grid-template-rows:auto auto minmax(0,1fr)}.map-first .topbar{height:46px;min-height:46px;padding:5px 16px}.map-commandbar{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#f8f8ef;padding-right:18px;gap:12px}.map-first .board-tabs{border:0;background:none;padding:4px 12px}.round-compact{font-size:12px;white-space:nowrap;color:#50684b}.round-compact b{font-size:19px;color:var(--ink);margin:0 3px}.game-shell.map-first .map-layout{grid-template-columns:190px minmax(0,1fr);gap:10px;padding:8px 10px}.game-shell.map-first.large-party .map-layout{grid-template-columns:350px minmax(0,1fr)}.map-first .map-layout>.rightcol{display:none}.map-first .map-layout[data-panel=team]>.rightcol{display:grid;grid-column:2;grid-template-columns:1fr 1fr;height:auto;max-height:100%;overflow:auto}.map-first .map-layout[data-panel=map]>main{overflow:hidden}.map-first .homestead-panel{position:relative;display:block;height:100%;background:radial-gradient(ellipse at 50% 40%,#f5f5df,#e5ecd4);border:0;box-shadow:none}.game-shell.map-first .homestead-panel>.terrain-scroll{position:absolute;inset:0;display:block;min-height:0;background:transparent;overflow:hidden}.game-shell.map-first .terrain-map{width:100%;height:100%;max-height:none;min-width:0;touch-action:manipulation}.game-shell.map-first .homestead-panel.map-zoomed>.terrain-scroll{overflow:auto;display:block;inset:0;max-height:none}.game-shell.map-first .map-zoomed .terrain-map{min-width:1400px;min-height:900px;height:auto;max-height:none}.map-first .world-notices{position:absolute;left:12px;top:12px;z-index:3;max-width:42%;padding:0}.map-first .mob-list{display:flex;flex-direction:column;align-items:flex-start;max-height:150px;overflow:auto;gap:5px;white-space:normal}.map-first .mob-chip{font-size:11px;min-height:32px;white-space:normal;text-align:left;box-shadow:0 2px 5px #3046280c}.map-first .tile-reservations{font-size:10px;margin:0 0 6px;background:#fff4d8ee}.map-first .world-notices .help{display:none}.game-shell.map-first .holding-bar{position:absolute;z-index:3;left:12px;bottom:12px;grid-template-columns:repeat(4,minmax(0,1fr));width:300px;gap:5px;padding:7px;background:#fafbf0eb;border:1px solid #d6dec5;border-radius:12px;box-shadow:0 3px 15px #314b1c10}.map-first .held-slot{min-height:53px;padding:5px 2px;gap:2px}.map-first .held-slot.chosen{padding:4px 1px}.map-first .held-slot>small{display:none}.map-first .held-slot>b{font-size:10px}.map-first .held-slot>span{font-size:22px}.map-first .holding-help{display:none}.game-shell.map-first .depth-controls{position:absolute;right:12px;top:12px;z-index:3;display:flex;gap:7px;flex-wrap:nowrap;padding:6px 8px;background:#fffdf0e8;border:1px solid #d6dec5;border-radius:9px}.map-first .depth-controls span{display:none}.map-first .depth-controls select{font-size:12px;padding:5px;max-width:130px}.map-first .depth-controls label{font-size:11px}.game-shell.map-first .terrain-footer{position:absolute;z-index:3;right:12px;bottom:62px;background:#fffdf0e8;border:1px solid #d6dec5;border-radius:9px;padding:3px}.map-first .terrain-footer span{display:none}.game-shell.map-first .bonusbar{position:absolute;z-index:3;right:12px;bottom:12px;background:none;border:0;padding:0}.map-first .bonusbar button{background:#fffdf0f2;min-height:40px;box-shadow:0 2px 8px #314b1c10}.map-penalty{position:absolute;z-index:4;left:50%;top:10px;transform:translateX(-50%);background:#fff3d7;padding:7px 12px;border-radius:8px;font-size:12px;margin:0}.map-resume{position:absolute;z-index:4;top:58px;right:12px;max-width:240px}.map-resume .notice{margin:0;padding:6px;background:#fff7dfee}.map-resume .notice p{display:none}.map-resume .notice button{font-size:11px;padding:6px;min-height:32px}.map-first .sectiontitle{margin-bottom:7px}.game-shell.map-first .leftcol{height:100%;max-height:none;overflow:auto}.game-shell.map-first .roster{display:grid;grid-template-columns:1fr;gap:7px;max-height:none;padding:0 2px 4px 0;overflow:visible}.game-shell.map-first.large-party .roster{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.player-tile{min-width:0;position:relative;border:1px solid #d5ddc7;border-radius:11px;background:#f9faf2;box-shadow:0 2px 0 #d6ddcc;overflow:hidden}.player-tile.selected{border:2px solid #426d46;background:#f1f5e9;box-shadow:0 2px 0 #426d46}.game-shell.map-first .playercard,.game-shell.map-first .playercard.selected{display:flex;flex-direction:column;align-items:stretch;width:100%;min-width:0;border:0;border-radius:0;box-shadow:none;padding:8px;background:transparent;gap:7px}.player-heading{display:flex;align-items:center;gap:8px;min-width:0}.map-first .playername{display:block;max-width:none;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:13px}.playername>small{display:block;font-size:10px;font-weight:500;color:#62745b;line-height:1.4}.map-first .avatar{width:28px;height:31px;font-size:15px}.player-stats{display:flex;justify-content:space-between;gap:6px;font-size:12px;color:#3e5838}.player-stats>span{white-space:nowrap}.game-shell.map-first .playerinfo{display:flex!important;align-items:center;justify-content:space-between;gap:4px;margin:0;font-size:10px}.map-first .dots{gap:4px;margin-right:0}.map-first .dot{width:9px;height:9px}.card-grade{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:5px 7px;border-top:1px solid #d6dfc7}.card-grade label{margin:0;font-size:10px;font-weight:500}.card-grade select{min-width:0;max-width:104px;padding:4px;font-size:11px;min-height:29px}.map-first .inventory{height:auto}.map-first .rightcol>.turnpanel h3,.map-first .rightcol>.turnpanel .eyebrow{display:none}
@media(max-width:1100px) and (min-width:901px){.game-shell.map-first.large-party .map-layout{grid-template-columns:300px minmax(0,1fr)}.game-shell.map-first .holding-bar{width:245px}.card-grade{flex-wrap:wrap}.card-grade select{max-width:100%}}
@media(max-width:900px){.game-shell.map-first .map-layout,.game-shell.map-first.large-party .map-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:6px;padding:6px}.game-shell.map-first .leftcol{grid-column:1;height:112px;max-height:112px;overflow-x:auto;overflow-y:hidden}.map-first .sectiontitle{display:none}.game-shell.map-first .roster,.game-shell.map-first.large-party .roster{display:flex;gap:6px;max-height:none;height:auto;width:max-content;padding-bottom:3px}.player-tile{width:156px;flex-shrink:0}.game-shell.map-first .playercard,.game-shell.map-first .playercard.selected{padding:6px;gap:4px}.game-shell.map-first .playerinfo{font-size:9px}.player-stats{font-size:11px}.card-grade{padding:3px 5px}.card-grade label{font-size:9px}.card-grade select{font-size:12px;min-height:26px;max-width:90px}.map-first .map-layout[data-panel=team]>.rightcol{grid-column:1;grid-row:2;grid-template-columns:1fr}.game-shell.map-first .holding-bar{width:220px;grid-template-columns:repeat(4,minmax(0,1fr));left:7px;bottom:7px;padding:4px;gap:3px}.map-first .held-slot{min-height:45px}.map-first .held-slot>span{font-size:19px}.map-first .held-slot>b{font-size:9px}.map-first .world-notices{left:7px;top:7px;max-width:44%}.map-first .mob-list{max-height:90px}.map-first .mob-chip{font-size:9px;min-height:28px;padding:4px}.game-shell.map-first .depth-controls{right:7px;top:7px;padding:4px;gap:4px}.map-first .depth-controls label{font-size:10px}.map-first .depth-controls select{font-size:11px;max-width:100px}.game-shell.map-first .terrain-footer{right:7px;bottom:53px}.game-shell.map-first .bonusbar{right:7px;bottom:7px}.map-first .terrain-footer button,.map-first .bonusbar button{font-size:10px;padding:6px}.map-first .map-resume{right:7px;top:49px;max-width:180px}}
@media(max-width:540px){.game-shell.map-first .topbar{padding:4px 7px;min-height:42px;height:42px}.map-first .brand{font-size:15px}.map-first .tools button{font-size:10px;padding:5px}.map-commandbar{padding-right:7px;gap:4px}.map-first .board-tabs{padding:3px 5px;gap:3px;flex:1}.map-first .board-tabs button{font-size:10px;min-height:30px;flex:initial;padding:5px 7px}.round-compact{font-size:9px}.round-compact b{font-size:14px}.game-shell.map-first .holding-bar{width:calc(100% - 14px);grid-template-columns:repeat(7,minmax(0,1fr));bottom:7px;left:7px}.map-first .held-slot{min-height:44px}.map-first .held-slot>b{font-size:8px}.map-first .held-slot>span{font-size:18px}.game-shell.map-first .homestead-panel>.terrain-scroll{bottom:93px;top:30px}.game-shell.map-first .terrain-footer{left:7px;right:auto;bottom:63px;padding:0}.game-shell.map-first .bonusbar{bottom:62px}.map-first .terrain-footer button{font-size:9px;min-height:27px;padding:4px}.map-first .bonusbar button{font-size:9px;min-height:29px;padding:4px}.game-shell.map-first .depth-controls label{display:none}.map-first .mob-list{max-height:60px}.map-first .world-notices{max-width:55%}.map-first .map-zoomed .terrain-map{min-width:950px;min-height:650px}.map-first .map-resume{top:40px}.map-first .map-penalty{font-size:10px;padding:4px;top:40px;max-width:50%}}
@media(max-width:900px){.game-shell.map-first .leftcol{height:130px;max-height:130px}.game-shell.map-first .player-tile{align-self:flex-start}}
@media(min-width:901px){.map-first .held-slot{min-height:61px}.map-first .held-slot>small{display:block;font-size:9px;line-height:1.15;white-space:normal}.map-first .held-slot:first-child>small{display:none}}
/* Workshop: select an illustrated recipe, then use the fixed detail panel. */
.item-art{display:block;width:48px;height:48px;flex-shrink:0}.dialog-back:has(.workshop-dialog){top:var(--viewport-top,0px);bottom:auto;height:var(--app-height,100dvh);padding:12px}.workshop-dialog{width:min(960px,100%);height:min(700px,calc(var(--app-height,100dvh) - 24px));max-height:none;overflow:hidden;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:12px;padding:20px}.workshop-header{display:flex;justify-content:space-between;align-items:start;gap:10px}.workshop-header h2{font-size:25px;padding:0;margin:0 0 4px}.workshop-header p{font-size:12px;margin:0;color:#68795e}.workshop-header>button{font-size:18px;min-width:36px;min-height:36px;padding:4px}.workshop-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.workshop-toolbar nav{display:flex;gap:6px}.workshop-toolbar nav button{font-size:13px;padding:8px 14px;min-height:36px}.workshop-toolbar button[aria-pressed=true]{background:#315f40;color:#fff;border-color:#315f40}.workshop-material{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;font-weight:500}.workshop-material select{font-size:14px;padding:7px;min-height:36px;max-width:150px}.workshop-xp{font-size:11px;color:#6c785e}.workshop-grid{min-height:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:9px}.workshop-item{min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:9px;background:#f5f7eb;border:1px solid #d5dfc7;box-shadow:0 2px 0 #d6dec9}.workshop-item[aria-pressed=true]{background:#e4efd5;border:2px solid #547644;box-shadow:0 2px 0 #547644;padding:8px}.workshop-item .item-art,.workshop-item .elements-charm{width:64px;height:64px;max-height:60%;min-height:0;flex:0 1 auto;object-fit:contain;margin:0}.workshop-item>span{font-size:14px;line-height:1.15;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%}.workshop-item>small{font-size:10px;color:#71608c}.workshop-item.applied{background:#f0eaf8}.workshop-detail{display:grid;grid-template-columns:72px minmax(0,1fr) 170px;gap:12px;align-items:center;background:#f0f3e5;border:1px solid #d4dec4;border-radius:12px;padding:14px;min-height:138px}.workshop-detail-icon .item-art,.workshop-detail-icon .elements-charm{width:70px;height:70px;margin:0}.workshop-detail h3{font-size:18px;margin:0 0 5px;line-height:1.2}.workshop-detail-copy>p{font-size:12px;line-height:1.4;margin:0 0 7px}.workshop-cost{display:flex;align-items:center;gap:3px;flex-wrap:wrap;font-size:11px;line-height:1.3}.workshop-cost b{margin-left:3px}.cost-icon .item-art{width:22px;height:22px}.workshop-confirm{text-align:center}.workshop-confirm>button{min-height:42px;width:100%;font-size:15px}.workshop-reason{font-size:11px;line-height:1.35;margin:7px 0 0;color:#79543b;overflow-wrap:anywhere}.workshop-confirm .primary:disabled{opacity:.6}.map-backpack{position:absolute;z-index:3;left:12px;top:12px;width:310px;max-width:34%;padding:9px;background:#fffdf1e8;border:1px solid #d5ddc6;border-radius:12px;box-shadow:0 2px 10px #30462809}.map-backpack-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.map-backpack-head>b{font-size:12px}.map-backpack-head button{padding:0 5px;min-width:28px;min-height:24px;border:0;background:transparent;font-size:18px}.map-pack-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.map-pack-item{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:3px;padding:4px;background:#edf1e3;border:1px solid #e1e5d5;border-radius:5px;min-width:0}.map-pack-item .item-art{width:22px;height:22px}.map-pack-item>span{font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.map-pack-item>b{font-size:11px}.map-pack-item.empty{opacity:.48}.map-first .world-notices:empty{display:none}.map-first .world-notices:has(.tile-reservations){left:50%;top:7px;transform:translateX(-50%);max-width:35%}
@media(max-width:900px){.map-backpack{left:7px;top:7px;width:260px;max-width:39%;padding:6px}.map-pack-grid{gap:3px}.map-pack-item{grid-template-columns:19px minmax(0,1fr) auto;padding:3px;gap:2px}.map-pack-item .item-art{width:19px;height:19px}.map-pack-item>span{font-size:9px}.map-pack-item>b{font-size:10px}}
@media(max-width:640px){.dialog-back:has(.workshop-dialog){padding:6px}.workshop-dialog{height:calc(var(--app-height,100dvh) - 12px);padding:12px;gap:8px;border-radius:12px}.workshop-header h2{font-size:22px}.workshop-header p{font-size:11px}.workshop-toolbar{gap:6px}.workshop-toolbar nav{gap:4px}.workshop-toolbar nav button{font-size:12px;padding:7px 9px;min-height:34px}.workshop-material{font-size:0;gap:0}.workshop-material select{font-size:14px;padding:5px;max-width:115px;min-height:34px}.workshop-xp{font-size:10px;max-width:90px}.workshop-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.workshop-item,.workshop-item[aria-pressed=true]{padding:5px;gap:3px}.workshop-item .item-art,.workshop-item .elements-charm{width:54px;height:54px;max-height:60%;flex:0 1 auto}.workshop-item>span{font-size:12px}.workshop-item>small{font-size:9px}.workshop-detail{grid-template-columns:44px minmax(0,1fr);gap:6px 8px;padding:10px;min-height:0}.workshop-detail-icon .item-art,.workshop-detail-icon .elements-charm{width:42px;height:42px}.workshop-detail h3{font-size:15px;margin-bottom:3px}.workshop-detail-copy>p{font-size:11px;line-height:1.3;margin-bottom:5px}.workshop-cost{font-size:10px;gap:2px}.cost-icon .item-art{width:17px;height:17px}.workshop-confirm{grid-column:1/-1;display:grid;grid-template-columns:110px minmax(0,1fr);align-items:center;gap:8px;text-align:left}.workshop-confirm>button{min-height:38px;font-size:14px;padding:6px}.workshop-reason{margin:0;font-size:10px;line-height:1.25}.map-backpack{max-width:43%;padding:5px}.map-backpack-head{margin-bottom:3px}.map-backpack-head>b{font-size:10px}.map-backpack-head button{font-size:15px;min-height:21px;min-width:21px}.map-pack-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.map-pack-item{grid-template-columns:18px auto;justify-content:space-between;padding:3px}.map-pack-item>span{display:none}.map-pack-item .item-art{width:18px;height:18px}.map-pack-item>b{font-size:10px}}
@media(max-height:540px) and (min-width:560px){.workshop-dialog{height:calc(var(--app-height,100dvh) - 16px);width:min(1000px,100%);padding:10px 14px;gap:7px;grid-template-columns:minmax(0,1fr) 290px;grid-template-rows:auto auto minmax(0,1fr)}.workshop-header{grid-column:1/-1}.workshop-header h2{font-size:19px;display:inline;margin-right:10px}.workshop-header p{display:inline;font-size:11px}.workshop-toolbar{grid-column:1/-1}.workshop-toolbar nav button{min-height:30px;padding:5px 10px}.workshop-material select{min-height:30px;padding:4px}.workshop-grid{grid-column:1;grid-row:3;gap:6px}.workshop-detail{grid-column:2;grid-row:3;display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:10px;min-height:0}.workshop-detail-icon{display:none}.workshop-detail h3{font-size:16px}.workshop-detail-copy>p{font-size:11px;line-height:1.25}.workshop-confirm{margin-top:auto}.workshop-confirm>button{min-height:36px;padding:5px}.workshop-reason{font-size:10px;margin-top:5px}.workshop-item{padding:5px;gap:3px}.workshop-item>span{font-size:12px}.workshop-item .item-art,.workshop-item .elements-charm{width:44px;height:44px}.workshop-cost{font-size:10px}}
/* Guided practice keeps the coach beside the actual game controls. */
.tutorial-launch{font-size:12px;font-weight:700;color:#315f40;padding:7px;text-decoration:none;white-space:nowrap}.tutorial-mode #app{margin-right:290px}.tutorial-mode .dialog-back{right:290px}.tutorial-mode .tutorial-launch{display:none}.tutorial-mode .savehint,.tutorial-mode .hostbadge{display:none}#tutorial-guide{position:fixed;z-index:1100;right:0;top:0;bottom:0;width:290px;background:#fbf9eb;border-left:2px solid #b9c899;padding:20px 17px;overflow:auto;box-sizing:border-box;color:#263c2e}.tutorial-label{font-size:10px;font-weight:800;letter-spacing:1px;color:#6a7856}#tutorial-guide h2{font-size:22px;line-height:1.15;margin:12px 0}#tutorial-guide p{font-size:14px;line-height:1.5}#tutorial-guide ol{padding-left:18px;font-size:13px;line-height:1.8}.tutorial-party{display:grid;gap:5px;font-size:11px;background:#eef1e1;border-radius:8px;padding:10px;margin:15px 0}.tutorial-links{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0 12px}.tutorial-links a{font-size:12px;color:#315f40;font-weight:700}#tutorial-guide small{font-size:10px;color:#738066}#tutorial-guide details{font-size:13px;background:#f2e5bd;border-radius:8px;padding:8px}#tutorial-guide details b{display:block;margin-top:8px}.tutorial-target{outline:3px solid #e4a836!important;outline-offset:2px}.terrain-map .tutorial-target{outline:none!important;filter:drop-shadow(0 0 5px #ffb500) drop-shadow(0 0 3px #ffb500)}.tutorial-mode #toast{z-index:1300}.tutorial-mode .welcome{display:none}.tutorial-mode .setup-panel{margin-top:15px}.tutorial-mode #setup>.muted{display:none}
@media(max-width:1000px){.tutorial-mode #app{margin-right:0;padding-top:180px}.tutorial-mode .game-shell{height:calc(var(--app-height,100dvh) - 180px)!important;min-height:0}.tutorial-mode .dialog-back{right:0;top:180px!important;height:calc(var(--app-height,100dvh) - 180px)!important}.tutorial-mode .workshop-dialog{height:calc(var(--app-height,100dvh) - 195px)}#tutorial-guide{width:100%;height:180px;bottom:auto;border-left:0;border-bottom:2px solid #b9c899;padding:10px 14px}#tutorial-guide h2{font-size:17px;margin:4px 0}#tutorial-guide p{font-size:12px;line-height:1.35;margin:4px 0}.tutorial-party{display:none}.tutorial-links{margin:6px 0;gap:12px}#tutorial-guide ol{display:none}#tutorial-guide details{position:absolute;right:12px;top:12px;max-width:145px}#tutorial-guide:has(details) p{padding-right:145px}#tutorial-guide small{display:none}.tutorial-mode .question-dialog{max-height:100%}.tutorial-mode .brand small{display:none}}
@media(max-width:1000px){.tutorial-mode.question-open #tutorial-guide{height:76px}.tutorial-mode.question-open #tutorial-guide p,.tutorial-mode.question-open #tutorial-guide .tutorial-links{display:none}.tutorial-mode.question-open #tutorial-guide h2{max-width:55%;font-size:15px}.tutorial-mode.question-open #tutorial-guide details{top:8px;max-width:42%;padding:5px}.tutorial-mode.question-open .dialog-back{top:76px!important;height:calc(var(--app-height,100dvh) - 76px)!important}.tutorial-mode.question-open .question-dialog{height:calc(var(--app-height,100dvh) - 96px);max-height:100%}}
@media(max-height:540px) and (min-width:560px){.tutorial-mode.question-open .question-controls .math-choices{gap:5px;margin-bottom:5px}.tutorial-mode.question-open .question-controls .math-choices button{min-height:32px;font-size:14px;padding:5px}.tutorial-mode.question-open .question-controls .answerinput{min-height:34px;font-size:19px;padding:5px;margin:0 0 5px}.tutorial-mode.question-open .question-controls button[type=submit]{min-height:32px;padding:5px;font-size:13px}.tutorial-mode.question-open .question-controls label{font-size:11px;margin-bottom:4px}.tutorial-mode.question-open .answer-status:empty{display:none}}
/* The same searchable guide is used in the game and on the printable help page. */
.help-dialog{width:min(1120px,100%);height:calc(var(--app-height,100dvh) - 32px);max-height:none;padding:20px;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:14px;overflow:hidden}.guide-header{display:flex;justify-content:space-between;align-items:start;gap:12px}.guide-header h2{font-size:25px;margin:0 0 4px}.guide-header p{font-size:12px;color:#6b7a62;margin:0}.guide-header button{min-width:38px;min-height:38px;font-size:18px}.guide-close{font-size:13px;white-space:nowrap;color:#315f40}.guide-search{display:flex;gap:12px;align-items:center}.guide-search input{flex:1;min-width:0;font-size:14px;padding:10px}.guide-search>div{display:flex;align-items:center;gap:10px}.guide-search a,.guide-search button{font-size:11px;color:#315f40;white-space:nowrap}.guide-search button{padding:8px}.guide-layout{min-height:0;display:grid;grid-template-columns:170px minmax(0,1fr);gap:18px}.guide-nav{display:flex;flex-direction:column;gap:3px;overflow:auto;padding:0 5px 4px 0;border-right:1px solid #dce2d1}.guide-nav button{text-align:left;font-size:12px;padding:9px 8px;border-color:transparent;background:transparent;min-height:34px;line-height:1.25}.guide-nav button:hover{background:#e8efda}.help-scroll{min-height:0;overflow:auto;padding:0 10px 22px 2px;scrollbar-gutter:stable}.guide-section{scroll-margin-top:8px;padding:18px 0;border-bottom:1px solid #dce2d1;line-height:1.55;font-size:14px}.guide-section:first-of-type{padding-top:8px}.guide-section h2{font-size:23px;margin:0 0 12px}.guide-section h3{font-size:17px;margin:20px 0 8px}.guide-section p{margin:0 0 12px;line-height:1.6}.guide-section li{margin-bottom:9px}.guide-section ul,.guide-section ol{padding-left:21px}.guide-count,#help-empty{font-size:12px;color:#6d795f;margin:0 0 5px}.guide-section a{color:#315f40}.guide-tutorial{font-weight:700}.guide-table{max-width:100%;overflow-x:auto;margin:12px 0 16px;border:1px solid #dce2d1;border-radius:8px}.guide-table table{width:100%;border-collapse:collapse;font-size:12px}.guide-table th{background:#eaf0dd;text-align:left;padding:9px;font-size:11px}.guide-table td{padding:9px;border-top:1px solid #e0e5d8;vertical-align:top}.guide-table tr:nth-child(even){background:#f7f8ef}.guide-item{display:flex;gap:7px;align-items:center;min-width:90px}.guide-item .item-art,.guide-item .elements-charm{width:29px;height:29px;margin:0}.guide-feature{display:flex;align-items:start;gap:14px}.guide-feature>.elements-charm{width:65px;height:75px;flex-shrink:0;margin:0}.guide-creatures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.guide-creature{border:1px solid #dce2d1;background:#f6f7ed;border-radius:10px;padding:12px;display:grid;grid-template-columns:70px minmax(0,1fr);gap:10px;break-inside:avoid}.guide-creature .creature-portrait{display:block;width:70px;height:90px;margin:0}.guide-creature h3{margin:0 0 7px;font-size:18px}.guide-creature p{font-size:11px;line-height:1.5;margin:0 0 8px}.guide-creature .guide-story{font-style:italic;color:#758066;margin:0}.guide-jump{display:none}.guide-topics{border:1px solid #dce2d1;padding:10px;border-radius:8px;margin:9px 0}.guide-topics summary{cursor:pointer;font-weight:700}.guide-topics p{font-size:12px;margin:10px 0}.standalone-help{padding:16px}.standalone-help #help-page{max-width:1120px;margin:auto}.standalone-help .help-dialog{height:calc(var(--app-height,100dvh) - 32px);margin:auto;background:#fffef7;border:1px solid #dce2d1;border-radius:14px}.tutorial-mode .help-dialog{height:calc(var(--app-height,100dvh) - 32px)}
@media(max-width:700px){.dialog-back:has(.help-dialog){padding:6px}.help-dialog{height:calc(var(--app-height,100dvh) - 12px);padding:12px;gap:9px;border-radius:12px}.guide-header h2{font-size:21px}.guide-header p{font-size:10px}.guide-search{gap:7px}.guide-search input{font-size:13px;padding:8px}.guide-search>div{flex-direction:column;gap:4px}.guide-search a,.guide-search button{font-size:10px}.guide-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px}.guide-nav{display:none}.guide-jump{display:flex;align-items:center;gap:8px;margin:0;font-size:10px}.guide-jump select{flex:1;min-width:0;font-size:12px;padding:6px}.help-scroll{padding-right:5px}.guide-section{font-size:13px;padding:14px 0}.guide-section h2{font-size:20px}.guide-section h3{font-size:16px}.guide-creatures{grid-template-columns:minmax(0,1fr)}.guide-creature{grid-template-columns:64px minmax(0,1fr)}.guide-creature .creature-portrait{width:64px;height:84px}.guide-table th,.guide-table td{padding:7px}.guide-item{min-width:68px;gap:4px;font-size:11px}.guide-item .item-art{width:24px;height:24px}.standalone-help{padding:6px}.standalone-help .help-dialog{height:calc(var(--app-height,100dvh) - 12px)}.tutorial-mode .help-dialog{height:calc(var(--app-height,100dvh) - 192px)}}
@media(min-width:701px) and (max-width:1000px){.tutorial-mode .help-dialog{height:calc(var(--app-height,100dvh) - 200px)}}
@media print{.standalone-help{background:white;padding:0}.standalone-help .help-dialog{display:block;height:auto;max-height:none;overflow:visible;padding:0;border:0}.standalone-help .guide-search,.standalone-help .guide-nav,.standalone-help .guide-jump,.standalone-help .guide-close,.standalone-help .guide-count{display:none}.standalone-help .guide-layout{display:block}.standalone-help .help-scroll{overflow:visible;padding:0}.standalone-help .guide-section{display:block!important;break-inside:auto}.standalone-help .guide-section h2,.standalone-help .guide-section h3{break-after:avoid}.standalone-help .guide-creatures{display:block}.standalone-help .guide-creature{margin-bottom:10px}.standalone-help .guide-table{overflow:visible}.standalone-help .guide-topics{display:block}.standalone-help .guide-topics>p{display:block}.standalone-help .guide-header{margin-bottom:20px}}

/* Keep round advancement beside the round counter on every game panel. */
.round-controls{display:flex;align-items:center;gap:14px;flex-shrink:0}.round-next{font-size:12px;min-height:34px;padding:7px 14px;white-space:nowrap}.round-next:disabled{opacity:.55}
@media(max-width:640px){.map-commandbar{flex-wrap:wrap;gap:0;padding:0 7px 5px}.map-first .board-tabs{width:100%;flex-basis:100%;padding:3px 0}.round-controls{width:100%;justify-content:space-between;gap:8px}.round-next{font-size:11px;min-height:34px;padding:6px 12px}.round-compact{font-size:10px}}

.question-instruction{font-size:clamp(17px,2.2vw,22px);line-height:1.3;margin:0;text-align:center;font-weight:600}.question-dialog .question.question-text{font-family:inherit;font-size:clamp(20px,2.7vw,28px);line-height:1.3}.visual-question .question.question-text{font-size:clamp(20px,3vw,30px)}
@media(max-width:640px){.question-instruction{font-size:17px}.question-dialog .question.question-text{font-size:20px}}
@media(max-height:420px){.question-instruction{font-size:15px}.question-dialog .question.question-text{font-size:18px}}

.card-reading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0;padding:4px 7px;border-top:1px solid #d6dfc7;font-size:10px;font-weight:500;min-height:29px;cursor:pointer}.card-reading input{width:18px;height:18px;min-height:0;padding:0;margin:0;accent-color:#315f40;cursor:pointer}
@media(max-width:900px){.game-shell.map-first .leftcol{height:160px;max-height:160px}.card-reading{padding:3px 5px;min-height:27px}}

.defense-list{display:grid;gap:6px;margin:12px 0;font-size:12px;text-align:left}.defense-list>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:7px;border:1px solid #ffffff35;border-radius:6px}.defense-list b{overflow-wrap:anywhere}.defense-list span{white-space:nowrap}.defense-list .ready{font-weight:800}.result .defense-list{max-width:460px;margin:14px auto}.result .defense-list>div{border-color:var(--line);background:#f0f4e8}

/* Ten supplies, grouped into rows of 3, 3, 2 and 2. */
.map-pack-grid,.game-shell .inventory .resource-grid,.game-shell .map-layout[data-panel=backpack] .resource-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.map-pack-item,.inventory .resource{grid-column:span 2}.map-pack-item:nth-child(n+7),.inventory .resource:nth-child(n+7){grid-column:span 3}

.grade-perk{display:block;padding:0 10px 8px;color:#52634d;font-size:.72rem}.dots b{font-size:.7rem;margin-left:3px}

.round-question-label{font-size:.8rem;font-weight:700;color:#486b3f;margin:0 0 5px}.map-resume>small{display:block;margin-top:4px}

/* Wildborn's title shares the original creature palette and block geometry. */
.topbar .brand{font-size:18px;letter-spacing:-.5px;line-height:1.05;flex-shrink:0}.topbar .brand small{font-size:10px;letter-spacing:4.3px;color:#6b805d;margin-top:6px}.topbar .brand svg{width:35px;flex-shrink:0}
body:not(.game-active):not(.tutorial-mode) .topbar{min-height:72px;height:auto;padding-top:12px;padding-bottom:12px}
.wildborn-screen{position:relative;height:calc(var(--app-height,100svh) - 72px);min-height:440px;max-height:1080px;isolation:isolate;overflow:hidden;background:radial-gradient(ellipse at 50% 14%,#fffdf0 0%,#f2f1dd 46%,#e6ebd1 100%)}
.title-world{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none}.title-landscape{position:absolute;bottom:0;left:0;width:100%;height:75%;opacity:.95}.title-creature{position:absolute;left:var(--cast-x);bottom:var(--cast-y);width:var(--cast-size);height:auto;max-width:15%;overflow:visible;transform:translateX(-50%);filter:drop-shadow(0 5px 3px #34452d18)}
.title-content{position:relative;width:min(1080px,88%);margin:0 auto;padding-top:clamp(27px,5.5vh,70px);text-align:center}.title-kicker{font-size:10px;font-weight:700;letter-spacing:3.6px;color:#687e57;margin:0 0 15px}.title-heading{margin:0;line-height:0}.wildborn-wordmark{display:block;width:100%;height:auto;overflow:visible}.title-tagline{font-family:'Space Grotesk',system-ui,sans-serif;font-weight:500;font-size:clamp(17px,2vw,25px);letter-spacing:-.4px;color:#405b40;margin:9px 0 0}.title-actions{display:flex;justify-content:center;gap:12px;margin-top:25px}.title-actions button{min-height:53px;border-radius:8px;padding:13px 25px;font-size:15px;font-weight:700}.title-actions .title-start{background:#294e37;border-color:#294e37;color:#fff9df;box-shadow:0 4px 0 #173824,0 9px 20px #344b2920}.title-start span{display:inline-block;margin-left:20px}.title-actions .title-start:hover{background:#365e3e;transform:translateY(-2px)}.title-actions .title-demo{background:#fffdf0e8;border-color:#cbd3b7;box-shadow:0 3px 0 #c4cdb1;color:#40583c}.title-promise{margin:19px 0 0;font-size:11px;color:#64794e;font-weight:700;letter-spacing:1.4px}.title-footnote{position:absolute;bottom:15px;left:0;right:0;display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap;padding:0 15px;font-size:10px;color:#30492e;font-weight:600}.title-footnote a{color:#30492e;text-underline-offset:3px}.title-footnote a:hover{color:#142f20}.setup-panel{scroll-margin-top:20px}
@media(min-width:1500px){.title-creature{width:calc(var(--cast-size) * 1.22)}}
@media(max-width:760px){body:not(.game-active):not(.tutorial-mode) .topbar{min-height:90px;padding:10px 14px;gap:10px;flex-wrap:wrap}body:not(.game-active):not(.tutorial-mode) .topbar .brand{font-size:16px}body:not(.game-active):not(.tutorial-mode) .topbar .tools{gap:4px}.wildborn-screen{height:calc(var(--app-height,100svh) - 108px);min-height:430px}.title-content{width:94%;padding-top:38px}.title-kicker{font-size:8px;letter-spacing:2.3px;margin-bottom:16px}.title-tagline{margin-top:12px;font-size:18px}.title-actions{gap:9px;margin-top:23px}.title-actions button{min-height:49px;font-size:13px;padding:12px 17px}.title-start span{margin-left:12px}.title-promise{font-size:9px;letter-spacing:.9px;margin-top:18px}.title-landscape{height:65%;width:155%;left:-28%}.title-creature{width:calc(var(--cast-size) * .7);max-width:20%}.title-thornbeak,.title-dusthorn,.title-moth,.title-moonray,.title-sunplume,.title-stormwing{display:none}.title-bramblekin{--cast-y:10%!important}.title-ironbark{--cast-y:9%!important}.title-bloomcap{--cast-y:7%!important}.title-blob{--cast-y:13%!important}.title-footnote{font-size:9px;gap:5px;bottom:11px;flex-direction:column}}
@media(max-height:650px) and (min-width:761px){.title-content{padding-top:15px;width:min(760px,76%)}.title-kicker{margin-bottom:5px;font-size:9px}.title-tagline{font-size:18px;margin-top:2px}.title-actions{margin-top:14px}.title-actions button{min-height:45px;padding:10px 19px;font-size:13px}.title-promise{margin-top:12px}.title-creature{width:calc(var(--cast-size) * .8)}.wildborn-screen{min-height:420px}}
@media(max-height:480px){.wildborn-screen{height:calc(var(--app-height,100svh) - 72px);min-height:290px}.title-content{padding-top:8px;width:min(580px,67%)}.title-kicker,.title-promise,.title-footnote>span{display:none}.title-tagline{font-size:15px;margin-top:0}.title-actions{margin-top:10px}.title-actions button{min-height:39px;padding:8px 14px;font-size:12px}.title-creature{max-width:12%;bottom:0}.title-footnote{bottom:7px}}

.topbar a.brand{color:var(--ink);text-decoration:none}.title-resume{display:inline-block;margin-top:17px;color:#34553b;font-size:12px;font-weight:700;text-underline-offset:3px}.title-resume+.title-promise{margin-top:11px}

/* One resource per gesture; targets and ghost survive shared-room rerenders. */
[data-transfer-resource]{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;position:relative}
[data-transfer-resource]:hover,[data-transfer-resource]:focus-visible{background:#e2edce;outline:2px solid #749759;outline-offset:1px}
[data-transfer-resource].resource-picked{background:#e2edce;outline:2px solid #73954f;outline-offset:1px}
.resource-dragging,.resource-dragging *{cursor:grabbing!important;user-select:none!important}
[data-resource-recipient]{position:relative}
.resource-drop-ready .playercard{outline:2px dashed #88a56d;outline-offset:-4px}
.resource-drop-hover .playercard,.resource-drop-hover .playercard.selected{background:#dcebbf;border-color:#426c38;outline:3px solid #729c4d;outline-offset:-3px}
.resource-drop-hover:after{content:attr(data-resource-drop-label);position:absolute;right:7px;top:5px;z-index:2;max-width:85%;padding:4px 7px;background:#294c30;color:#fffbe9;font-size:10px;font-weight:700;border-radius:5px;pointer-events:none;box-shadow:0 2px 7px #243f2928}
.resource-drag-ghost{position:fixed;z-index:110;display:flex;align-items:center;gap:8px;padding:9px 12px;border:2px solid #8fa878;border-radius:10px;background:#fffdf2;box-shadow:0 5px 18px #25432c35;color:#2d4933;pointer-events:none;font-size:13px;font-weight:700;white-space:nowrap}
.resource-drag-ghost svg{width:27px;height:27px;flex-shrink:0}.resource-drag-ghost>b{display:grid;place-items:center;background:#e4ecd5;border-radius:5px;min-width:22px;height:24px}.resource-drag-ghost.can-give{border-color:#406d38;background:#f0f7e6}

/* Pictures stay legible inside the same four-answer routine. */
.question-controls .math-choices .picture-choice{padding:5px;justify-content:center;min-height:88px;overflow:hidden}
.question-controls .picture-choice .math-visual{width:100%;max-width:240px;height:80px;max-height:80px;padding:0;margin:0}
.audio-question .choice-letter{display:flex;flex-shrink:0;align-items:center;justify-content:center}
.audio-question .question-controls .math-choices button{font-size:17px;font-weight:600;min-height:60px;text-align:left;justify-content:flex-start;gap:8px;overflow-wrap:anywhere}
@media(max-width:640px){.question-controls .math-choices .picture-choice{min-height:76px}.question-controls .picture-choice .math-visual{height:66px;max-height:66px}.audio-question .question-controls .math-choices button{font-size:15px;min-height:62px}.audio-question .question.question-text{font-size:21px}}
@media(max-height:540px){.question-controls .math-choices .picture-choice{min-height:48px}.question-controls .picture-choice .math-visual{height:43px;max-height:43px}.audio-question .question-controls .math-choices button{min-height:42px;font-size:14px}}

.teacher-settings>p,.teacher-settings>.formrow{margin-bottom:0}
.teacher-settings fieldset.topic-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0;min-width:0}
.teacher-settings fieldset.topic-group>.dialog-actions{grid-column:1/-1;position:static;padding:3px 0 7px;margin:0;border-top:0;background:transparent}
.teacher-settings fieldset.topic-group>.dialog-actions button{padding:7px 10px;font-size:12px}
@media(max-width:640px){.teacher-settings fieldset.topic-group{grid-template-columns:1fr}}

/* Host device assignments */
.device-controls{margin-top:24px}.device-card{padding:16px;margin:12px 0;background:#f4f6ec;border:1px solid #cbd5be;border-radius:14px}.device-heading{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.device-heading span{font-size:.88rem;color:#486447}.device-card>input{width:100%;margin:4px 0 12px}.device-card fieldset{border:0;padding:0;margin:0}.device-card legend{font-weight:650;margin-bottom:8px}.device-players{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.device-players label{display:flex;align-items:center;gap:8px;margin:0;min-height:42px;padding:6px;background:#fffef7;border-radius:8px}.device-players input{width:20px;height:20px;flex-shrink:0}.device-card .dialog-actions{flex-wrap:wrap}.device-card .dialog-actions button{flex:1 1 160px}.device-summary{margin-top:20px;padding:16px;border:1px solid #cbd5be;border-radius:12px}.playercard[aria-disabled="true"]{opacity:.6;cursor:default}

/* The final battle fills the viewport, with four players per page. */
body.stormwing-open{overflow:hidden}
.dialog-back.stormwing-backdrop{padding:0;inset:var(--viewport-top,0px) 0 auto;height:var(--app-height,100dvh);overflow:hidden;overscroll-behavior:contain;background:#e8edda}
.dialog.stormwing-dialog{width:100%;max-width:none;height:100%;max-height:none;min-height:0;padding:clamp(12px,2vw,28px);border-radius:0;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:14px;background:radial-gradient(ellipse at 15% 45%,#d9e5d2,transparent 55%),#f7f8ee;box-sizing:border-box}
.stormwing-header{display:flex;align-items:center;gap:20px;min-width:0}.stormwing-header h2{font-size:clamp(24px,3.3vw,42px);line-height:1.1;margin:3px 0 0}.stormwing-header .eyebrow{font-size:10px}.stormwing-header>button{margin-left:auto;flex-shrink:0;min-height:44px}.stormwing-totals{margin:0;color:#51684e;font-size:16px}.stormwing-totals b{font-size:1.5em;color:#264c38}.stormwing-totals span{white-space:nowrap}
.stormwing-arena{display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,1.7fr);gap:24px;min-height:0;min-width:0}.stormwing-boss{min-height:0;min-width:0;display:grid;grid-template-rows:minmax(0,1fr) auto;align-items:center}.stormwing-portrait{position:relative;height:100%;min-height:0;display:grid;place-items:center;background:radial-gradient(ellipse,#cbdde3aa,transparent 67%)}.stormwing-portrait .creature-portrait{position:absolute;inset:0;margin:auto;min-height:0;min-width:0;height:100%;width:100%;max-height:100%;max-width:440px;display:block}.stormwing-health{display:grid;justify-items:center;gap:3px;padding:10px;line-height:1.15}.stormwing-health strong{font-size:clamp(34px,5vw,64px);color:#294e59}.stormwing-health span{font-size:14px;color:#596f68}.stormwing-health progress{height:12px;width:min(100%,280px);accent-color:#497d8d;margin-top:8px}
.stormwing-party{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(var(--party-rows),minmax(0,1fr));gap:14px;min-height:0;min-width:0}.stormwing-player{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px;min-height:0;min-width:0;padding:clamp(10px,1.5vw,20px);border:1px solid #c8d3bb;border-radius:16px;background:#fffef6;box-shadow:0 3px 0 #cad5bd55}.stormwing-player-heading{display:flex;align-items:center;gap:9px;min-width:0}.stormwing-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:var(--player-color,#d4dfbd);font-weight:800;flex-shrink:0}.stormwing-player h3{font-size:clamp(16px,1.7vw,24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.stormwing-attack{font-size:14px;line-height:1.3;margin:0;display:flex;justify-content:space-between;gap:4px;flex-wrap:wrap}.stormwing-attack span{color:#718266}.stormwing-rolls{display:flex;align-items:center;justify-content:center;gap:12px;min-height:0}.stormwing-roll{width:72px;height:min(100%,78px);min-height:28px;border-radius:10px;border:1px solid #c4cfb7;display:flex;flex-direction:column;justify-content:center;align-items:center;line-height:1.1}.stormwing-roll b{font-size:clamp(22px,3.2vw,38px)}.stormwing-roll small{font-size:11px;margin-top:3px}.stormwing-roll.empty{border-style:dashed;color:#97a78a}.stormwing-roll.used{background:#e6efd8;color:#315641}.stormwing-player>button{width:100%;min-height:44px;margin:0;font-size:16px;padding:9px;line-height:1.15}
.stormwing-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}.stormwing-footer p{margin:0;color:#687b5d;font-size:12px}.stormwing-pages{display:flex;align-items:center;gap:10px;font-size:12px}.stormwing-pages span{white-space:nowrap}.stormwing-pages button{min-height:42px;font-size:13px;padding:8px 12px;white-space:nowrap}
@media(max-width:640px) and (orientation:portrait){.dialog.stormwing-dialog{padding:10px;gap:8px}.stormwing-header{gap:6px;flex-wrap:wrap;position:relative;padding-right:102px}.stormwing-header h2{font-size:25px}.stormwing-header .eyebrow{font-size:8px;letter-spacing:1px}.stormwing-header>button{position:absolute;right:0;top:0;padding:8px;font-size:11px}.stormwing-totals{font-size:11px;flex-basis:100%}.stormwing-totals b{font-size:1em}.stormwing-arena{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(92px,.55fr) minmax(0,1.45fr);gap:8px}.stormwing-boss{grid-template-columns:minmax(0,1fr) 110px;grid-template-rows:minmax(0,1fr)}.stormwing-portrait .creature-portrait{max-width:220px}.stormwing-health{padding:0 4px}.stormwing-health strong{font-size:38px}.stormwing-health span{font-size:11px}.stormwing-health progress{height:9px;margin-top:4px}.stormwing-party{gap:8px}.stormwing-player{padding:9px;gap:5px;border-radius:12px}.stormwing-player-heading{gap:5px}.stormwing-avatar{width:24px;height:24px;font-size:13px;border-radius:5px}.stormwing-player h3{font-size:15px}.stormwing-attack{font-size:11px;gap:2px}.stormwing-player>button{font-size:13px;min-height:40px;padding:7px 4px}.stormwing-rolls{gap:6px}.stormwing-roll{width:52px;max-height:62px}.stormwing-roll b{font-size:26px}.stormwing-roll small{font-size:9px}.stormwing-footer{flex-direction:column;gap:5px}.stormwing-footer p{font-size:10px}.stormwing-pages{width:100%;justify-content:space-between;gap:6px;font-size:10px}.stormwing-pages button{font-size:11px;min-height:36px;padding:6px 8px}}
@media(max-height:500px) and (orientation:landscape){.dialog.stormwing-dialog{padding:8px 12px;gap:6px}.stormwing-header{gap:12px}.stormwing-header h2{font-size:24px}.stormwing-header .eyebrow{display:none}.stormwing-totals{font-size:12px}.stormwing-header>button{padding:6px 10px;min-height:36px;font-size:11px}.stormwing-arena{grid-template-columns:minmax(130px,.6fr) minmax(0,1.7fr);gap:12px}.stormwing-boss{grid-template-columns:minmax(0,1fr) 74px;grid-template-rows:minmax(0,1fr)}.stormwing-health{padding:2px}.stormwing-health strong{font-size:30px}.stormwing-health span{font-size:10px}.stormwing-health progress{height:8px;margin-top:3px}.stormwing-party{gap:6px}.stormwing-player{padding:6px 8px;gap:3px;border-radius:10px}.stormwing-avatar{width:22px;height:22px;font-size:12px}.stormwing-player h3{font-size:14px}.stormwing-attack{font-size:10px}.stormwing-player>button{min-height:34px;font-size:12px;padding:5px}.stormwing-rolls{gap:5px}.stormwing-roll{max-height:42px;width:44px;min-height:23px;border-radius:6px}.stormwing-roll b{font-size:21px}.stormwing-roll small{font-size:8px;margin-top:0}.stormwing-footer p{font-size:10px}.stormwing-pages{font-size:10px;gap:6px}.stormwing-pages button{min-height:30px;font-size:10px;padding:5px 8px}}

.creature-display.small-blob{width:88px}.world-mob.small-blob:focus-visible{outline:0;filter:drop-shadow(0 0 3px #d59b29)}
@media(max-width:500px){.creature-display.small-blob{width:71px}}

/* Stormwing victory: sunlight and a banner replace the storm. */
.victory-sky{position:relative;overflow:hidden;height:165px;max-width:520px;margin:0 auto 18px;border-radius:18px;background:linear-gradient(#89cad5,#eef3cc);isolation:isolate}
.victory-sun{position:absolute;left:calc(50% - 40px);top:2px;color:#eab64f;font-size:76px;line-height:1.1;animation:victory-sunrise 1.8s ease-out both}
.victory-cloud{position:absolute;width:150px;height:55px;top:20px;border-radius:50%;background:#7b8b9e;box-shadow:25px 8px 0 #91a0ae,-20px 12px 0 #8293a1;animation:victory-clear 2s ease-out both}
.cloud-left{left:5%;--cloud-slide:-220px}.cloud-right{right:5%;--cloud-slide:220px}
.victory-banner{position:absolute;bottom:20px;left:7%;right:7%;padding:12px 6px;background:#2d614a;color:#fff5d5;font-size:clamp(13px,3vw,20px);font-weight:800;letter-spacing:.08em;clip-path:polygon(0 0,100% 0,96% 50%,100% 100%,0 100%,4% 50%);animation:victory-banner 1.8s ease-out both}
@keyframes victory-clear{to{transform:translateX(var(--cloud-slide));opacity:0}}
@keyframes victory-sunrise{from{transform:translateY(70px);opacity:0}to{transform:translateY(0);opacity:1}}
@keyframes victory-banner{from{transform:translateY(35px);opacity:0}60%{transform:translateY(35px);opacity:0}to{transform:translateY(0);opacity:1}}
@media(prefers-reduced-motion:reduce){.victory-cloud{display:none}.victory-sun,.victory-banner{animation:none}}

/* Room details scroll between a fixed heading and an always-visible exit. */
.dialog.room-dialog{display:flex;flex-direction:column;overflow:hidden;max-height:calc(var(--app-height,100dvh) - 32px)}
.room-dialog>h2{flex-shrink:0;padding-right:36px}
.room-dialog-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:8px}
.room-dialog-footer{flex-shrink:0;display:flex;justify-content:flex-end;border-top:1px solid var(--line);margin-top:16px;padding-top:12px}
.room-dialog-footer>button{min-width:120px;min-height:44px}

/* Popup headings and display controls stay outside long reference lists. */
.dialog.standard-dialog{display:flex;flex-direction:column;overflow:hidden;max-height:calc(var(--app-height,100dvh) - 24px);padding:20px}
.popup-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;margin-bottom:16px}
.popup-header h2{font-size:25px;margin:0;min-width:0}
[data-popup-tools]{display:flex;align-items:center;gap:7px;flex-shrink:0}
[data-popup-tools]>button,[data-popup-tools]>.guide-close{position:static;min-height:36px;font-size:13px;white-space:nowrap;padding:7px 10px}
[data-popup-zoom][aria-pressed=true]{background:#e2ead7;border-color:#91a775}
.popup-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:6px}
.standard-dialog .result{padding:12px}.standard-dialog .result .big{font-size:46px}.standard-dialog .result h2{font-size:28px}.standard-dialog .result p{font-size:14px}
.question-header{position:relative;padding-right:74px}.question-header>[data-popup-tools]{position:absolute;top:0;right:0}
.workshop-header>[data-popup-tools]>button{font-size:13px;padding:6px 8px}
.stormwing-header>[data-popup-tools]{margin-left:auto}.guide-header>[data-popup-tools]{align-self:start}
/* All encounters share the same responsive layout and a pinned roll button. */
.dialog-back.encounter-backdrop{top:var(--viewport-top,0px);bottom:auto;height:var(--app-height,100dvh);padding:12px}
.dialog.encounter-dialog{width:min(900px,100%);height:min(600px,calc(var(--app-height,100dvh) - 24px));max-height:none;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:16px;padding:22px}
.encounter-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.encounter-header h2{font-size:23px;margin:0}
.encounter-body{min-height:0;display:grid;grid-template-columns:minmax(180px,.8fr) minmax(0,1.2fr);gap:24px;background:#f3eddf;border:1px solid #dfd5be;border-radius:14px;padding:18px}
.encounter-hero{min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px}
.encounter-portrait{min-height:0;flex:0 1 180px;width:180px;display:flex;align-items:center;justify-content:center}.encounter-portrait .creature-portrait{width:100%;height:100%;max-height:190px;margin:0}.encounter-portrait.small-blob .creature-portrait{width:50%;height:50%}
.encounter-creature .eyebrow{font-size:10px}.encounter-creature h3{font-size:28px;line-height:1.1;margin:5px 0 10px}.encounter-hp{display:inline-block;background:#fff9e9;border:1px solid #d7c99e;border-radius:8px;font-size:19px;padding:5px 12px}.encounter-creature p{font-size:12px;line-height:1.3;color:#6b755d;margin:8px 0 0}
.encounter-details{min-width:0;align-self:center;display:flex;flex-direction:column;gap:14px}.encounter-details h4{font-size:16px;margin:0 0 5px}.encounter-details p{font-size:14px;line-height:1.4;margin:0}
.encounter-loot-items{display:flex;flex-wrap:wrap;gap:6px 10px;margin-top:8px}.encounter-loot-items>span{display:flex;align-items:center;gap:4px;font-size:13px}.encounter-loot-items .item-art{width:25px;height:25px}
.encounter-effect{border-left:3px solid #93a86b;padding:8px 10px;background:#edf0df;border-radius:0 7px 7px 0}.encounter-defense{border-top:1px solid #d9d6bf;padding-top:10px}.encounter-defense .encounter-food{margin-top:8px;font-size:12px;color:#67735c}
.encounter-footer{min-height:0}.encounter-footer>p{margin:0 0 9px;font-size:15px;line-height:1.35;text-align:center;overflow-wrap:anywhere}.encounter-footer small{font-size:11px}.encounter-buttons{display:grid;grid-template-columns:minmax(120px,1fr) minmax(180px,2fr);gap:10px}.encounter-buttons>button{min-height:46px}
@media(max-width:600px) and (orientation:portrait){
 .dialog.encounter-dialog{height:calc(var(--app-height,100dvh) - 16px);padding:14px;gap:10px;border-radius:12px}.dialog-back.encounter-backdrop{padding:8px}.encounter-header h2{font-size:20px}.encounter-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(105px,.65fr) auto;gap:14px;padding:14px}.encounter-hero{display:grid;grid-template-columns:minmax(80px,.8fr) minmax(0,1.2fr);gap:10px;text-align:left}.encounter-portrait{width:100%;height:100%;max-height:160px}.encounter-portrait .creature-portrait{max-height:160px}.encounter-creature h3{font-size:25px;margin:4px 0 8px}.encounter-hp{font-size:17px}.encounter-details{gap:12px}.encounter-details p{font-size:14px;line-height:1.35}.encounter-loot-items{gap:5px 10px;margin-top:5px}.encounter-loot-items .item-art{width:22px;height:22px}.encounter-buttons{grid-template-columns:minmax(105px,1fr) minmax(150px,1.5fr);gap:8px}.encounter-buttons>button{font-size:14px;padding:9px 6px}
}
@media(max-height:650px) and (orientation:portrait){
 .dialog.encounter-dialog{padding:10px;gap:8px}.encounter-header h2{font-size:18px}.encounter-body{grid-template-rows:85px auto;padding:10px;gap:9px}.encounter-portrait{max-height:85px}.encounter-portrait .creature-portrait{max-height:85px}.encounter-creature h3{font-size:21px;margin:2px 0 4px}.encounter-hp{font-size:15px;padding:3px 8px}.encounter-creature p{font-size:10px;margin-top:4px}.encounter-details{gap:9px}.encounter-details p{font-size:12px;line-height:1.3}.encounter-details h4{font-size:14px;margin-bottom:3px}.encounter-effect{padding:5px 8px}.encounter-defense{padding-top:6px}.encounter-defense .encounter-food{font-size:11px;margin-top:5px}.encounter-loot-items>span{font-size:12px}.encounter-footer>p{font-size:13px;margin-bottom:6px}.encounter-footer small{font-size:10px}.encounter-buttons>button{min-height:42px}
}
@media(max-height:500px) and (orientation:landscape){
 .dialog.encounter-dialog{height:calc(var(--app-height,100dvh) - 16px);padding:10px 14px;gap:8px}.encounter-header h2{font-size:18px}.encounter-body{grid-template-columns:minmax(130px,.7fr) minmax(0,1.3fr);gap:14px;padding:10px}.encounter-hero{display:grid;grid-template-columns:minmax(65px,.8fr) minmax(0,1fr);gap:6px;text-align:left}.encounter-portrait{width:100%;max-height:135px}.encounter-portrait .creature-portrait{max-height:135px}.encounter-creature h3{font-size:20px;margin:4px 0 6px}.encounter-hp{font-size:15px;padding:3px 6px}.encounter-creature p{font-size:10px}.encounter-details{gap:7px}.encounter-details h4{font-size:13px;margin-bottom:3px}.encounter-details p{font-size:12px;line-height:1.25}.encounter-effect{padding:5px 8px}.encounter-loot-items{gap:3px 8px;margin-top:3px}.encounter-loot-items>span{font-size:11px}.encounter-loot-items .item-art{width:20px;height:20px}.encounter-defense{padding-top:5px}.encounter-defense .encounter-food{font-size:10px;margin-top:4px}.encounter-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1.3fr);align-items:center;gap:12px}.encounter-footer>p{font-size:12px;margin:0;text-align:left}.encounter-footer small{font-size:10px}.encounter-buttons>button{font-size:13px;min-height:38px;padding:6px}.encounter-buttons{grid-template-columns:1fr 1.4fr;gap:7px}
}
@media(max-width:640px){.popup-header{gap:8px;margin-bottom:12px}.popup-header h2{font-size:20px}.dialog.standard-dialog{padding:14px}.popup-header [data-popup-tools]{gap:4px}.popup-header [data-popup-tools]>button{padding:6px 8px;font-size:12px}.question-header>[data-popup-tools]>button{min-height:32px;padding:4px 7px;font-size:11px}.guide-header>[data-popup-tools]{gap:3px}.guide-header>[data-popup-tools]>button{font-size:11px;padding:6px;min-width:32px}.stormwing-header{padding-right:170px}.stormwing-header>[data-popup-tools]{position:absolute;right:0;top:0;gap:4px}.stormwing-header>[data-popup-tools]>button{font-size:11px;padding:7px 6px}.workshop-header>[data-popup-tools]{gap:4px}}
/* Enlarged view deliberately allows scrolling; Fit restores the compact layout. */
.dialog.popup-zoomed{display:block!important;height:auto!important;max-height:calc(var(--app-height,100dvh) - 24px)!important;overflow:auto!important}
.popup-zoomed>header{position:sticky;top:-1px;z-index:5;background:#fffef6;padding:8px 0;margin-bottom:14px}
.popup-zoomed>.popup-scroll,.popup-zoomed>.room-dialog-content,.popup-zoomed>.encounter-body,.popup-zoomed>.question-body,.popup-zoomed>.question-controls,.popup-zoomed>.workshop-toolbar,.popup-zoomed>.workshop-grid,.popup-zoomed>.workshop-detail,.popup-zoomed>.guide-search,.popup-zoomed>.guide-layout,.popup-zoomed>.stormwing-arena{zoom:1.25;overflow:visible;max-height:none;min-height:0;margin-bottom:12px}
.popup-zoomed>.encounter-body{display:block}.popup-zoomed .encounter-hero{display:flex;flex-direction:row;margin-bottom:18px;justify-content:center}.popup-zoomed .encounter-portrait{width:150px;height:170px;flex:0 0 150px}.popup-zoomed .encounter-details{gap:14px}.popup-zoomed .encounter-details p{font-size:15px;line-height:1.45}.popup-zoomed .encounter-footer{display:block;position:sticky;bottom:-1px;background:#fffef6;padding:10px 0 0;margin-top:12px}.popup-zoomed .encounter-footer>p{text-align:center}
.popup-zoomed .question-body .math-visual{max-height:none}.popup-zoomed .question-body .mathcard{overflow:visible}.popup-zoomed .question-controls .math-choices button{min-height:50px}.popup-zoomed .question-footer{position:sticky;bottom:-1px;background:#fffef6;padding-top:8px;z-index:5}
.popup-zoomed .workshop-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(115px,auto);margin-top:12px}.popup-zoomed .workshop-detail{margin-top:16px}.popup-zoomed .workshop-item{min-height:110px}.popup-zoomed .workshop-item>span{display:block;-webkit-line-clamp:unset;overflow:visible}.popup-zoomed .workshop-item .item-art{width:56px;height:56px}
.popup-zoomed .guide-layout{display:block}.popup-zoomed .guide-nav{display:none}.popup-zoomed .guide-jump{display:flex;gap:8px;align-items:center}.popup-zoomed .help-scroll{overflow:visible}.popup-zoomed .room-dialog-footer{position:sticky;bottom:-1px;background:#fffef6;padding-bottom:3px}
.popup-zoomed .stormwing-arena{display:block}.popup-zoomed .stormwing-boss{display:flex;justify-content:center;gap:16px;height:190px;margin-bottom:16px}.popup-zoomed .stormwing-party{grid-auto-rows:minmax(170px,auto);gap:10px}.popup-zoomed .stormwing-footer{margin-top:12px}
@media print{[data-popup-tools]{display:none!important}}

@media(max-height:520px) and (orientation:portrait){
 .encounter-body{grid-template-rows:75px auto;gap:5px;padding:8px}.encounter-details{gap:6px}.encounter-loot-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;margin-top:4px}.encounter-loot-items>span{font-size:11px;gap:2px}.encounter-loot-items .item-art{width:16px;height:16px}.encounter-effect{padding:4px 6px}.encounter-defense{padding-top:4px}.encounter-defense .encounter-food{display:none}
}
.popup-zoomed .encounter-defense .encounter-food{display:block}.popup-zoomed .encounter-loot-items{display:flex;flex-wrap:wrap;gap:6px 10px}.popup-zoomed .encounter-loot-items>span{font-size:13px}.popup-zoomed .encounter-loot-items .item-art{width:25px;height:25px}

@media(max-height:650px){
 .standard-dialog .result{padding:6px}.standard-dialog .result .big{font-size:32px;line-height:1.15}.standard-dialog .result h2{font-size:23px;line-height:1.15;margin:8px 0}.standard-dialog .result p{font-size:12px;line-height:1.35;margin-bottom:12px}.standard-dialog .result>button{min-height:40px;padding:8px 12px;font-size:13px}.standard-dialog .result .victory-sky{height:110px;margin-bottom:10px}.standard-dialog .result .victory-sun{font-size:50px}.standard-dialog .result .victory-banner{font-size:11px;padding:8px 4px;bottom:10px}
 #trade-form .formrow{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#trade-form input,#trade-form select{padding:7px;font-size:13px;min-height:36px}#trade-form label{font-size:12px;margin-bottom:4px}#trade-form>button{min-height:42px}
}
.popup-zoomed .result{zoom:1.1}

/* Direct creature selection stays separate from starting an attack. */
.creature-picker{position:absolute;z-index:4;right:12px;top:62px;width:max-content;max-width:52%;display:grid;grid-template-columns:minmax(0,max-content) auto;gap:5px;padding:6px;background:#fffdf0f2;border:1px solid #d6dec5;border-radius:9px}
.creature-picker select{width:auto;max-width:100%;min-width:0;font-size:12px;padding:6px;min-height:36px;text-overflow:ellipsis}.creature-picker button{min-height:36px;padding:6px 12px}
.map-first .map-resume{top:119px}
.encounter-buttons.can-cancel{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.5fr)}
.encounter-buttons.can-cancel>button{font-size:13px;padding:7px 5px;min-width:0;line-height:1.2}
@media(max-width:900px){.creature-picker{right:7px;top:49px;padding:4px}.map-first .map-resume{top:104px}}
@media(max-width:540px){.creature-picker{top:42px;max-width:50%;grid-template-columns:minmax(0,1fr);gap:3px}.creature-picker select{font-size:12px;min-height:34px;padding:4px}.creature-picker button{min-height:32px;padding:4px;font-size:12px}.map-first .map-resume{top:126px}.encounter-buttons.can-cancel{gap:5px}.encounter-buttons.can-cancel>button{font-size:11px;min-height:42px}}

/* Target preview stays above the scene without changing its depth or hit areas. */
.world-mob.targeted,.world-mob.targeted:hover,.world-mob.targeted:focus{filter:drop-shadow(0 0 2px #fff9d0) drop-shadow(0 0 4px #e9a21c)}
.creature-target-marker{display:none}.creature-target-marker.is-selected{display:inline;filter:drop-shadow(0 1px 2px #293c2580)}
.creature-target-marker .target-ring{fill:#ffd25d40;stroke:#fff5bd;stroke-width:5;stroke-linejoin:round;paint-order:stroke fill}
.creature-target-marker .target-pointer{fill:none;stroke:#ffc449;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.creature-target-marker rect{fill:#ffe19a;stroke:#8b601b;stroke-width:1.5}.creature-target-marker text{font-family:inherit;font-size:11px;font-weight:800;fill:#493819}
