:root{color-scheme:dark}*{box-sizing:border-box}body{margin:0;font:16px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;background:#0d1530;color:#f5f6ff}button,select{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #79e7dd;outline-offset:3px}a{color:#b6d9ff}.top{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:19px max(22px,calc((100vw - 1200px)/2));background:#151e42;border-bottom:1px solid #384268}.top a{text-decoration:none}.top>span{color:#b5c5e6;font-size:14px}.brand{font-size:23px;font-weight:800;color:white}.brand span{color:#7ee5da}main{max-width:1250px;margin:auto;padding:25px}.hero{background:linear-gradient(125deg,#1d2a57,#25255a 58%,#17606a);border:1px solid #425583;border-radius:26px;padding:clamp(24px,5vw,55px);margin-bottom:26px}.hero h1{font-size:clamp(36px,5vw,62px);line-height:1.1;margin:8px 0 15px;letter-spacing:-.04em}.hero p{color:#d4def4;max-width:740px}.eyebrow{font-size:12px;letter-spacing:.14em;font-weight:800;color:#7ce1d8}.metrics{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.metrics span{background:#ffffff17;border:1px solid #ffffff30;border-radius:50px;padding:7px 13px;font-size:13px}.toolbar{display:flex;justify-content:space-between;align-items:end;gap:20px;margin:35px 0 20px}.toolbar h2{margin:3px 0;font-size:29px}.toolbar label{font-size:13px;color:#cbd5ef;display:flex;flex-direction:column;gap:8px}.toolbar select{padding:12px;border-radius:12px;background:#1c274d;color:white;border:1px solid #65749d;min-width:210px}.catalog{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.quest-card,.mastery,.mission-info,.scene{border:1px solid #3b466d;background:#1a2448;border-radius:22px;padding:25px}.quest-card{display:flex;flex-direction:column;gap:10px;min-height:270px}.quest-card h3{font-size:23px;margin:0}.quest-card p{margin:0;color:#c0cce8}.quest-card .level{font-size:12px;color:#80e8d8;font-weight:750;text-transform:uppercase;letter-spacing:.1em}.quest-card .icon{font-size:32px}.quest-card .bottom{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:10px}.quest-card small{color:#a9badb}.primary{background:linear-gradient(110deg,#7963ff,#35b7c5);color:white;border:0;border-radius:12px;padding:12px 18px;font-weight:750}.subtle{background:#25325c;border:1px solid #67769f;color:#edf2ff;border-radius:12px;padding:10px 15px;font-weight:650}.mastery{display:grid;grid-template-columns:1fr 2fr;gap:25px;margin-top:25px}.mastery h2{margin:0}.mastery p{color:#c4d0eb}.skills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.skill{padding:12px;background:#101a38;border-radius:12px}.skill strong{display:block}.skill span{color:#c7d3ec;font-size:12px}.track,.meter{height:9px;background:#34426b;border-radius:20px;overflow:hidden;margin:8px 0}.track div,.meter div{height:100%;background:linear-gradient(90deg,#6e62fa,#38d0c4)}.playhead{display:flex;align-items:center;justify-content:space-between;margin:25px 0;gap:15px}.quest-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:20px;align-items:start}.mission-info{position:sticky;top:20px}.mission-info h2{font-size:26px;margin:8px 0}.mission-info p{color:#c7d1e9}.mission-emoji{font-size:43px}.scene{min-height:460px}.scene h2{font-size:clamp(23px,3vw,32px);margin:12px 0 24px}.dialogue{background:#121b3b;border:1px solid #435381;padding:23px;border-radius:18px;font-size:19px;line-height:1.6}.dialogue .speaker{font-size:12px;letter-spacing:.1em;color:#83e4d9;font-weight:800;margin-bottom:8px}.prompt{font-size:19px;font-weight:650;margin:24px 0 12px}.choices{display:grid;gap:12px}.choice{background:#222f58;border:1px solid #52628e;border-radius:14px;padding:18px;text-align:left;color:#fff;font-weight:550}.choice:hover:not(:disabled){background:#2b3d70}.choice:disabled{cursor:default}.choice.chosen{border-color:#8be8db;background:#263c62}.choice.correct{border-color:#5bd7a4}.choice.incorrect{border-color:#e6a09b}.feedback{border-radius:14px;padding:18px;margin:20px 0 0;border:1px solid #537ba0;background:#1b3553}.feedback strong{color:#a6f2d9}.feedback p{margin:8px 0;color:#e1e9f7}.feedback .outcome{font-style:italic;color:#bbd7f4}.scene-actions{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;margin-top:25px}.summary{padding:10px}.summary h2{font-size:32px}.summary .score{font-size:45px;font-weight:800;color:#8ce8d9}.summary .miss{margin:10px 0;padding:13px;border:1px solid #495a87;border-radius:12px}.muted{color:#afbedc}footer{padding:40px 10px;text-align:center;color:#93a5c8;font-size:13px}[hidden]{display:none!important}@media(max-width:980px){.catalog{grid-template-columns:repeat(2,minmax(0,1fr))}.quest-layout{grid-template-columns:1fr}.mission-info{position:static}.mastery{grid-template-columns:1fr}}@media(max-width:630px){.catalog,.skills{grid-template-columns:1fr}.toolbar{align-items:stretch;flex-direction:column}.toolbar select{width:100%}.top>span{display:none}main{padding:14px}.quest-card{min-height:0}}

.quest-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:15px 0 18px}.quest-tools label{font-weight:650}.quest-tools input{background:#151f40;color:#fff;border:1px solid #63749e;border-radius:12px;padding:13px;min-width:230px;flex:1}.quest-tools button{min-height:44px}.transfer{background:#1b294c;border:1px solid #52658f;border-radius:16px;margin:20px 0;padding:22px}.transfer h3{margin:0 0 8px}.transfer label{display:block;margin:14px 0 8px;font-weight:650}.transfer textarea{display:block;width:100%;border:1px solid #63749e;background:#111b38;color:#fff;border-radius:12px;padding:14px;margin-bottom:14px;font:inherit}.transfer textarea:focus-visible,.quest-tools input:focus-visible{outline:3px solid #8ce8d9;outline-offset:2px}.transfer #transferGuide{color:#d5e4fa;line-height:1.6}@media(max-width:650px){.quest-tools{align-items:stretch;flex-direction:column}.quest-tools input,.quest-tools button{width:100%}}

.branch-notice,.repair,.constructed{margin:17px 0;padding:20px;border:1px solid #5c6fa4;border-radius:15px;background:#172449}.branch-notice{border-left:4px solid #7ddaca}.repair{border-left:4px solid #ffcb87}.branch-notice p,.repair p,.constructed p{line-height:1.65}.constructed label{display:block;margin:10px 0 7px;font-weight:700}.constructed input,.constructed textarea{display:block;width:100%;background:#111b38;color:white;border:1px solid #778bb9;border-radius:10px;padding:13px;font:inherit;margin:10px 0}.constructed button,.repair button{margin:5px 8px 5px 0}.tokens{display:flex;flex-wrap:wrap;gap:9px;margin:12px 0}.tokens button{padding:10px 14px}.build-target{min-height:58px;border:2px dashed #7a91c1;border-radius:10px;padding:14px;margin:10px 0}.learning-note{background:#26335b;border-radius:10px;padding:14px;margin:12px 0}.quest-card .level{font-size:12px}.transfer{margin-top:20px}

/* Phase 16 branching story routes */
.repair .choices{display:grid;gap:10px;margin:14px 0}
.repair .choices button{display:block;width:100%;text-align:left;white-space:normal;padding:15px;line-height:1.5}
.summary .eyebrow{color:#9cebdc}
.summary .score{margin:14px 0}
.branch-notice{animation:branch-appear .25s ease-out}
@keyframes branch-appear{from{opacity:.3;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.branch-notice{animation:none}}

/* Phase 17 authored story chapters */
#sceneBody .dialogue{line-height:1.7;white-space:pre-wrap}
#constructed textarea{display:block;width:100%;min-height:95px;margin:12px 0;border-radius:12px;padding:12px}
#branchNotice{margin:14px 0;padding:16px;border-left:3px solid #56b8b3}
#choiceArea button{white-space:normal;text-align:left}

/* Phase 18: character-led narrative and optional missions */
.character-card{margin-top:22px;padding:16px;background:#f1effb;border:1px solid #d8d0f4;border-radius:16px}.character-card strong{font-size:18px;color:#302a6d}.character-card .eyebrow{font-size:11px}.character-card p:last-child{margin:6px 0 0}.scene .choices .subtle{margin-top:12px}.scene .constructed textarea{width:100%;min-height:95px}

/* Phase 19: relationship continuity */
.memory-note{border-left:4px solid #6d56bb;background:#f2effa;color:#302a6d;padding:13px 16px;border-radius:10px;margin:14px 0;line-height:1.6}.scene .choice{white-space:normal;line-height:1.5}.scene .dialogue{line-height:1.7}.scene .constructed textarea{width:100%;min-height:125px}

/* Phase 20 */
.memory-note{border-left:3px solid #9b8bea;padding:12px;margin:10px 0}.dialogue{line-height:1.6}.choice{white-space:normal;text-align:left}

/* Phase 21: evidence-led adventure chapters */
.evidence-card{border:1px solid rgba(120,120,180,.25);border-radius:14px;padding:14px;margin:12px 0;background:rgba(122,108,190,.06)}
.evidence-card strong{display:block;margin-bottom:7px}
.evidence-card p{margin:0;line-height:1.6}

/* Phase 22: multi-stage investigations */
.evidence-card{border-left:3px solid #7868cb}
.scene .evidence-card strong{font-weight:750}
.scene .learning-note,.scene .feedback{line-height:1.55}
@media(max-width:700px){.evidence-card{padding:12px}}

/* Phase 23: consequences bridge */
.scene .dialogue{line-height:1.65}
.scene .choice{white-space:normal}
.scene .learning-note{margin-top:14px}
