:root{color-scheme:dark;--page:#0e1723;--surface:#172638;--text:#f2f4f6;--muted:#b8c4d1;--rune:#d3b575;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--page);color:var(--text)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}button{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible{outline:3px solid var(--rune);outline-offset:2px}
.app-shell{position:relative;height:100vh;height:100svh;display:grid;grid-template-rows:clamp(50px,5.2vh,58px) minmax(0,1fr);background:#0a121c}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0 clamp(12px,1.2vw,24px);border-bottom:1px solid #3b4d60;background:#101b29;min-width:0}.identity{display:flex;align-items:baseline;gap:clamp(8px,1vw,18px);white-space:nowrap}.identity .series{font-size:clamp(11px,1vw,16px);font-weight:850;letter-spacing:.16em;color:var(--rune)}.identity strong{font-family:Georgia,serif;font-size:clamp(16px,1.5vw,26px);font-weight:500}.prototype-tag{color:#acbbca;font-size:clamp(9px,.75vw,12px);letter-spacing:.08em}.teacher-controls{display:flex;align-items:center;gap:8px}.teacher-controls button,.top-link{border:1px solid #52667c;border-radius:7px;background:#1e2f42;color:#edf2f7;text-decoration:none;padding:8px 12px;font-size:clamp(11px,.85vw,14px);font-weight:650;white-space:nowrap;cursor:pointer}.teacher-controls button:hover,.top-link:hover{background:#2a4057}.pointer-count{font-size:11px;color:#b9c9d9;letter-spacing:.06em;white-space:nowrap}.pointer-count strong{font-size:18px;color:#fff}
.split{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;min-height:0;background:var(--rune)}.rift{position:absolute;left:calc(50% - 1px);top:0;bottom:0;width:2px;background:#f5dc9a;pointer-events:none;z-index:3}.team{--accent:#61b7f2;min-width:0;min-height:0;display:grid;grid-template-rows:clamp(54px,6.4vh,76px) clamp(118px,16vh,180px) minmax(75px,1fr) clamp(52px,5.7vh,62px) clamp(204px,22.5vh,240px) clamp(76px,9vh,108px);background:#142233}.team-b{--accent:#ef927d;background:#231e29}
.hud{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 clamp(12px,2vw,32px);background:#182839;border-bottom:1px solid #405267}.team-b .hud{background:#2b2631}.team-title{display:flex;align-items:center;gap:11px;min-width:0}.team-mark{display:grid;place-items:center;color:var(--accent);font-size:clamp(23px,2.3vw,38px);width:32px}.team-title strong{display:block;color:var(--accent);font-size:clamp(17px,1.6vw,27px);line-height:1.1;white-space:nowrap}.team-title small{font-size:clamp(9px,.75vw,12px);letter-spacing:.12em;color:#b5c3d0}.hud-values{display:flex;align-items:center;gap:clamp(8px,1vw,20px)}.hud-values span{font-size:clamp(9px,.72vw,12px);color:#bbcad8;letter-spacing:.08em}.hud-values strong{display:block;color:#fff;font-size:clamp(15px,1.2vw,21px);text-align:center}
.prompt{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:10px clamp(14px,2.3vw,42px);background:linear-gradient(110deg,#203449,#182839 75%);min-width:0}.team-b .prompt{background:linear-gradient(110deg,#382c35,#251f2c 75%)}.prompt-label{font-size:clamp(11px,.9vw,16px);color:var(--accent);font-weight:850;letter-spacing:.12em}.prompt-instruction{margin:5px 0 0;font-size:clamp(13px,1.1vw,19px);color:#d7e2ed}.base-form{display:block;font-size:clamp(45px,4vw,78px);line-height:1.02;letter-spacing:-.05em}.prompt-note{text-align:right;border-left:1px solid #718294;padding-left:14px;font-size:clamp(10px,.7vw,13px);line-height:1.5;letter-spacing:.1em;color:#9eafc0}.prompt-note strong{font-size:clamp(18px,1.3vw,24px);color:#dbe7f2;letter-spacing:0}
.world{position:relative;overflow:hidden;isolation:isolate;background:radial-gradient(circle at 65% 30%,#354657 0,#233548 35%,#162534 75%);border-block:1px solid #536477;pointer-events:none}.team-b .world{background:radial-gradient(circle at 65% 30%,#594447 0,#3b323e 35%,#24232f 75%)}.world:before{content:"";position:absolute;left:-8%;right:-8%;bottom:-22%;height:46%;background:linear-gradient(15deg,#3e4b50,#707170 52%,#35484f);transform:skewY(-2deg);box-shadow:0 -8px 20px #94aab12b}.world-caption{position:absolute;top:12px;left:clamp(14px,2vw,30px);font-size:clamp(10px,.8vw,13px);font-weight:800;letter-spacing:.18em;color:#ece3d2}.world-caption span{color:#b6c1cd;font-weight:500}.route{position:absolute;left:16%;right:19%;bottom:25%;display:flex;justify-content:space-between;align-items:center;z-index:1}.route i{width:clamp(8px,1vw,17px);height:clamp(8px,1vw,17px);border:2px solid #d0be93;border-radius:50%;background:#172838}.route .portal-step{background:var(--rune);box-shadow:0 0 16px #d3b575}.world-figure{position:absolute;left:15%;bottom:18%;width:clamp(26px,3vw,54px);height:clamp(60px,10vh,125px);z-index:2;filter:drop-shadow(0 4px 8px #0008)}.figure-head{position:absolute;left:28%;top:0;width:44%;aspect-ratio:1;border:2px solid var(--accent);border-radius:50%;background:#344657}.figure-body{position:absolute;left:8%;right:8%;top:30%;bottom:0;clip-path:polygon(35% 0,65% 0,100% 100%,0 100%);border:2px solid var(--accent);background:linear-gradient(90deg,#334858,#172939)}.team-b .figure-body{background:linear-gradient(90deg,#5d3f47,#2b2634)}.world-portal{position:absolute;right:12%;bottom:18%;width:clamp(34px,5vw,90px);height:clamp(65px,12vh,145px);border:clamp(6px,.9vw,14px) solid #988b75;border-radius:50% 50% 12% 12%;box-shadow:inset 0 0 15px var(--accent),0 0 16px #d3b5756e;background:#32486155;z-index:2}.world-note{position:absolute;bottom:10px;right:14px;color:#b1bac3;font-size:clamp(9px,.7vw,12px);font-style:italic}
.answer-panel{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:1fr auto;align-items:center;gap:0 14px;padding:4px clamp(14px,2vw,32px);background:#112235;border-block:1px solid #576b7c;min-width:0}.answer-panel>span{grid-row:1/3;color:#a7b9ca;font-size:clamp(10px,.75vw,13px);font-weight:750;letter-spacing:.12em}.answer-panel output{font-size:clamp(22px,2.2vw,38px);font-weight:700;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}.answer-panel output.empty{color:#7290aa}.answer-panel small{grid-column:2;color:var(--accent);font-size:clamp(9px,.7vw,12px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.keyboard{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:5px;padding:7px clamp(10px,1.5vw,26px);background:#101e2d;min-height:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.team-b .keyboard{background:#211e2a}.key-row{display:flex;justify-content:center;gap:clamp(3px,.45vw,7px);min-height:0}.key-row button{flex:1;min-width:0;min-height:0;border:1px solid #64778a;border-radius:7px;background:linear-gradient(#30465d,#23384e);color:#f4f7fa;font-size:clamp(18px,1.5vw,29px);font-weight:750;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}.team-b .key-row button{background:linear-gradient(#4e3d49,#382e3c)}.key-row button:active{background:var(--accent);color:#0b1723}.key-row .function-key{flex:1.7;font-size:clamp(10px,.8vw,15px);padding:2px;white-space:nowrap}.key-row .enter-key{border:2px solid var(--accent);color:var(--accent)}
.power-panel{display:grid;grid-template-columns:clamp(82px,9vw,150px) minmax(0,1fr);align-items:stretch;gap:clamp(5px,.8vw,12px);padding:7px clamp(10px,1.5vw,26px);background:#142538;border-top:1px solid #43596d;min-height:0}.team-b .power-panel{background:#2a2531}.charge{display:flex;flex-direction:column;justify-content:center;gap:7px;color:#e6d7b4;font-size:clamp(10px,.85vw,15px);font-weight:750}.charge strong{white-space:nowrap}.charge-pips{display:flex;gap:4px}.charge-pips i{display:block;flex:1;height:clamp(11px,1.4vh,18px);border:1px solid #d3b575;border-radius:2px}.power-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(4px,.6vw,9px)}.power-buttons button{min-width:0;border:1px solid #71808c;border-radius:7px;background:#2a3849;color:#d9e1e9;font-size:clamp(12px,1vw,18px);font-weight:800}.power-buttons button small{display:block;color:#aab8c7;font-size:clamp(9px,.65vw,12px);font-weight:450}.power-buttons button:disabled{opacity:.68;cursor:not-allowed}
[hidden]{display:none!important}.teacher-controls button:disabled,.key-row button:disabled{opacity:.48;cursor:not-allowed}.charge-pips i.filled{background:var(--rune);box-shadow:0 0 9px #d3b57580}.charge>small{font-size:clamp(9px,.7vw,12px);color:#b8c4d1}.world-figure{transition:left .35s ease}.team.pressure .world{box-shadow:inset 0 0 45px #d3b57550}.team.pressure .hud-values span:last-child strong{color:#f3c27b}.team.hexed .world-figure{filter:drop-shadow(0 0 12px #a568e5)}.team.shielded .world-figure:after{content:"";position:absolute;inset:-9px;border:3px solid var(--accent);border-radius:50%;opacity:.8}.task-history{position:absolute;left:clamp(14px,2vw,30px);bottom:12px;max-width:60%;font-size:clamp(9px,.75vw,12px);color:#e0e6ec;background:#101b29c9;padding:5px 7px;border-radius:4px;z-index:2}.task-history:empty{display:none}.task-history span{display:block;white-space:nowrap}.phase-overlay{position:absolute;z-index:8;inset:0;display:grid;place-items:center;background:#07111bdc;padding:20px}.phase-card{width:min(720px,90vw);text-align:center;border:1px solid #8a9aad;border-radius:15px;padding:clamp(20px,3vw,46px);background:#192b3d;box-shadow:0 20px 80px #0009}.phase-card>p{margin:0 0 12px;color:var(--rune);font-size:13px;letter-spacing:.18em;font-weight:800}.phase-card h2{margin:0 0 12px;font-size:clamp(38px,5vw,80px);line-height:1.05}.phase-card #phaseDetails{font-size:clamp(16px,1.5vw,24px);line-height:1.5;color:#d5e0e9;white-space:pre-line}
.setup-overlay{position:absolute;z-index:10;inset:0;display:grid;place-items:center;padding:20px;background:#09131dea}.setup-card{width:min(710px,96vw);max-height:calc(100svh - 40px);overflow:auto;border:1px solid #7b8da0;border-radius:16px;background:#192a3b;padding:clamp(18px,2.3vw,36px);box-shadow:0 26px 90px #000b}.setup-kicker{margin:0;color:var(--rune);font-size:13px;font-weight:800;letter-spacing:.16em}.setup-card h2{font-family:Georgia,serif;font-size:clamp(32px,3vw,48px);font-weight:500;margin:6px 0 10px}.setup-intro{margin:0 0 18px;color:#c5d1dc;line-height:1.45}.setup-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.setup-grid label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:700;color:#e6edf3}.setup-grid input,.setup-grid select{width:100%;min-height:48px;border:1px solid #738398;border-radius:8px;background:#0f1d2a;color:#fff;font:inherit;padding:8px 11px}.setup-wide{grid-column:1/-1}.setup-time{color:#e7d5a8;font-weight:800;margin:18px 0 12px}.start-button{width:100%;min-height:58px;border:1px solid #e5ce99;border-radius:9px;background:var(--rune);color:#152333;font-size:18px;font-weight:850;cursor:pointer}.start-button:hover{background:#e9d39f}.setup-footnote{color:#aebcca;font-size:12px;text-align:center;margin:12px 0 0}
.phase-card #phaseAction{margin-top:24px;min-width:220px;min-height:58px;border:1px solid #e5ce99;border-radius:9px;background:var(--rune);color:#152333;font-size:20px;font-weight:800;cursor:pointer}
.team.portal-reached .world-portal{box-shadow:inset 0 0 30px var(--accent),0 0 32px var(--rune);background:#d3b57533}
.phase-state{display:inline-block;margin-right:12px;padding:5px 10px;border:1px solid var(--accent);border-radius:5px;color:#091623;background:var(--accent);font-size:clamp(12px,1.05vw,18px);font-weight:900;letter-spacing:.08em}.team[data-phase="VORBEREITUNG"] .phase-state{background:transparent;color:var(--accent)}.team[data-phase="ERGEBNIS"] .phase-state{background:#d3b575;border-color:#d3b575}.team[data-phase="WARTEN"] .phase-state,.team[data-phase="GRUPPENWECHSEL"] .phase-state{background:#354253;border-color:#69788a;color:#d5dde5}.team[data-phase="AKTION"] .prompt{box-shadow:inset 0 0 0 3px var(--accent)}.team[data-phase="VORBEREITUNG"] .prompt{box-shadow:inset 0 0 0 2px #d3b5758a}.prompt-note{white-space:pre-line}.prompt-note span{display:block}.prompt-note span+span{margin-top:5px}.prompt-label{display:inline-block}.team.final-pair .world{box-shadow:inset 0 0 45px #d3b57550}.section-choice{margin:0;border:1px solid #738398;border-radius:8px;padding:9px 12px}.section-choice legend{padding:0 5px;font-size:14px;font-weight:700}.section-choice>div{display:flex;flex-wrap:wrap;gap:7px}.section-choice label{display:flex;flex-direction:row;align-items:center;gap:7px;padding:7px 10px;border:1px solid #536b81;border-radius:6px;background:#102134;font-size:12px}.section-choice input{width:18px;height:18px;min-height:0;padding:0;margin:0}.setup-error{color:#ffb8a8;font-weight:700;margin:8px 0}.key-row button:disabled{opacity:.28}.power-buttons button:disabled{opacity:.35}
@media(max-width:1200px){.prototype-tag,.prompt-note{display:none}.hud-values{gap:6px}.hud-values span{font-size:9px}.team-title small{display:none}.teacher-controls .pointer-count{display:none}}
@media(max-width:850px){.identity strong{display:none}.teacher-controls{gap:4px}.teacher-controls button,.top-link{padding:6px;font-size:10px}.team{grid-template-rows:50px 110px minmax(65px,1fr) 48px 190px 72px}.hud{padding:0 8px}.hud-values span:nth-child(2){display:none}.prompt{padding:7px 10px}.base-form{font-size:42px}.keyboard{padding:5px 6px}.key-row{gap:2px}.key-row button{font-size:14px}.key-row .function-key{font-size:9px}.power-panel{grid-template-columns:54px 1fr;padding:4px;gap:3px}.charge{font-size:8px}.power-buttons button{font-size:9px}.power-buttons button small{display:none}.answer-panel{padding:3px 8px;gap:5px}}
@media(max-height:650px){.app-shell{grid-template-rows:44px minmax(0,1fr)}.team{grid-template-rows:45px 95px minmax(45px,1fr) 42px 170px 63px}.topbar{padding:0 8px}.prototype-tag,.top-link{display:none}.world-note{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.world-figure{bottom:13%;width:clamp(86px,10vw,145px);height:clamp(95px,17vh,165px);filter:drop-shadow(0 7px 7px #000a);transition:left .35s ease}
.world-figure img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom}
.world-portal{right:9%;bottom:11%;width:clamp(90px,11vw,160px);height:clamp(100px,18vh,175px);border:0;border-radius:0;box-shadow:none;background:none;filter:drop-shadow(0 0 13px #d3b57565)}
.world-portal img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom}
.team.portal-reached .world-portal{background:none;box-shadow:none;filter:drop-shadow(0 0 23px var(--accent)) brightness(1.18)}
.team.shielded .world-figure:after{inset:7% 12% 3%;border:3px solid var(--accent);border-radius:50%;box-shadow:0 0 17px var(--accent)}
.team.hexed .world-figure{filter:drop-shadow(0 0 14px #a568e5)}
@media(max-height:650px){.world-figure{height:95px}.world-portal{height:95px}}

.world-portal:before{content:"";position:absolute;z-index:0;inset:15% 16% 19%;border-radius:50%;background:radial-gradient(ellipse at 50% 55%,transparent 8%,var(--accent) 87%,transparent 100%);opacity:.46;filter:blur(6px);pointer-events:none}
.world-portal img{position:relative;z-index:1}
.team.portal-reached .world-portal:before{opacity:.92;filter:blur(7px) brightness(1.4)}

/* Ancient Grove: fixed input surfaces, independent presentation timelines. */
.world.world-art,.team-b .world.world-art{background-image:linear-gradient(180deg,#08132070,transparent 42%,#0c151928),url('../media/ancient-grove-concept.png');background-position:center;background-size:cover;background-color:#233630}
.world{--baseline:14%;--sprite:clamp(110px,19vh,224px)}
.world-figure{bottom:var(--baseline);width:var(--sprite);height:var(--sprite);transform:translate(-50%,10%);transition:none;filter:drop-shadow(0 3px 2px #0008)}
.character-sprite{position:absolute;inset:0;background-repeat:no-repeat}
.character-sprite img{width:100%;height:100%;object-fit:contain;animation:none!important}
.team[data-cue] .world-figure img{animation:none!important;transform:none}
.world-figure:before{content:'';position:absolute;left:34%;right:34%;bottom:8%;height:4%;background:#05100980;border-radius:50%;filter:blur(3px);z-index:-1}
.world-portal{left:84%;right:auto;bottom:var(--baseline);width:calc(var(--sprite)*1.12);height:calc(var(--sprite)*1.12);transform:translate(-50%,10%);filter:drop-shadow(0 0 8px #d3b57544)}
.world-portal:before{inset:17% 29% 15%;opacity:.22;filter:blur(5px)}
.team[data-world-action='portal'] .world-portal:before{opacity:.95}
.team[data-world-action='portal'] .world-portal{filter:drop-shadow(0 0 17px var(--accent))}
.route{left:14%;right:16%;bottom:calc(var(--baseline) - 1px);height:0;display:block;z-index:0;opacity:.65}
.route i{position:absolute;left:calc(var(--step)*100%/6);top:-2px;transform:translateX(-50%);width:clamp(12px,2.2vw,30px);height:5px;border:1px solid #b5ad8c75;border-radius:50%;background:#9b9980;box-shadow:0 2px 5px #0007}
.world-caption{z-index:4;text-shadow:0 1px 5px #000}
.world-note{z-index:4;font-style:normal;color:#e0e3d9;background:#07131b99;border-radius:4px;padding:3px 6px}
.task-history{bottom:10px;max-width:57%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team.shielded .world-figure:after{inset:13% 26% 9%;border:2px solid var(--accent);box-shadow:inset 0 0 12px #86cafa44,0 0 10px var(--accent)}
.team.hexed .world-figure:after{content:'';position:absolute;inset:50% 31% 12%;border:3px double #c3a1e3;border-radius:45%;box-shadow:0 0 12px #9c65ca;pointer-events:none}
.team[data-cue='dash'] .character-sprite{filter:drop-shadow(-12px 0 4px var(--accent))}
.team[data-cue='cast'] .character-sprite,.team[data-cue='block'] .character-sprite{filter:drop-shadow(0 0 7px var(--accent))}
.team[data-character-failed='true'] .character-sprite:has(img:not([hidden])):after{content:'◆';position:absolute;inset:35% 35% 10%;display:grid;place-items:center;border:1px solid var(--accent);border-radius:50%;color:var(--accent);background:#152731;}
.team[data-motion='reduced'] .world-figure,.team[data-motion='reduced'] .world-portal{filter:none}
.team[data-motion='reduced'] .world *{animation:none!important;transition:none!important}
@media(max-height:800px){.teacher-controls button,.top-link{padding:7px 9px}.world-caption{font-size:10px;letter-spacing:.12em}.task-history,.world-note{font-size:9px}.world-note{max-width:39%}.identity .prototype-tag{display:none}}
.team[data-cue='wrong'] .character-sprite{filter:grayscale(.65) brightness(.7)}
.team[data-motion='reduced'] .character-sprite{filter:none}
