:root{
  color-scheme:dark;
  --ink:#eff1fa;
  --muted:#b0b8cd;
  --gold:#f3cc7a;
  --teal:#78dfce;
  --panel:#171e33;
  --line:#35415d;
  --bad:#ffa7a0;
  font-family:Segoe UI,system-ui,sans-serif;
  background:#0c1120;
  color:var(--ink)
}
*{
  box-sizing:border-box
}
body{
  margin:0
}
button,textarea{
  font:inherit
}
button{
  cursor:pointer;
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--ink);
  background:#202a43;
  padding:10px 15px;
  min-height:42px;
  transition:background .15s,transform .15s
}
button:hover{
  background:#303e5d
}
button:active{
  transform:translateY(1px)
}
button:focus-visible,textarea:focus-visible{
  outline:3px solid var(--gold);
  outline-offset:3px
}
button:disabled{
  opacity:.55;
  cursor:default
}
.quiet{
  background:transparent;
  font-size:13px;
  padding:7px 12px;
  min-height:36px
}
.primary{
  background:var(--gold);
  border-color:var(--gold);
  color:#171b2d;
  font-weight:750
}
.primary:hover{
  background:#ffdf9f
}
[hidden]{
  display:none!important
}
#game{
  height:100dvh;
  min-height:540px;
  max-width:1800px;
  margin:auto;
  display:grid;
  grid-template-rows:76px 36px minmax(0,1fr) 52px;
  padding:0 24px
}
.masthead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--line)
}
.brand{
  display:flex;
  gap:13px;
  align-items:center
}
.brand-mark{
  font-size:36px;
  color:var(--gold)
}
.eyebrow,.tiny{
  font-size:10px;
  font-weight:750;
  letter-spacing:2px;
  color:var(--gold)
}
h1{
  font-size:24px;
  margin:3px 0;
  font-family:Georgia,serif;
  font-weight:normal
}
h1 span{
  font:12px Segoe UI,sans-serif;
  color:var(--muted);
  margin-left:14px
}
.trail{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color:var(--muted)
}
#supplies{
  color:var(--teal)
}
#save-status{
  font-size:11px
}
.adventure{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
  gap:24px
}
.stage{
  position:relative;
  min-height:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:15px;
  background:#101629
}
canvas{
  width:100%;
  height:100%;
  display:block
}
.stage-caption{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  background:linear-gradient(transparent,#101529 45%);
  padding:55px 25px 22px;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  gap:5px
}
.stage-caption strong{
  font:30px Georgia,serif
}
.stage-caption>span:last-child{
  font-size:12px;
  color:var(--muted)
}
.intro{
  position:absolute;
  inset:0;
  background:linear-gradient(100deg,#101529e8,#10152980);
  padding:6vh 35px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:12px
}
.sigil{
  font-size:38px;
  color:var(--gold)
}
.intro h2{
  font:clamp(32px,4.5vw,64px)/1.05 Georgia,serif;
  margin:0;
  color:#fff4da
}
.intro p{
  max-width:370px;
  line-height:1.6;
  margin:6px 0;
  color:#d5d9e7
}
.intro .intro-foot{
  font-size:11px;
  max-width:340px;
  color:var(--muted)
}
.intro~.stage-caption{
  display:none
}
.quest{
  min-height:0;
  display:flex;
  flex-direction:column;
  padding:14px 0 12px;
  gap:12px
}
.scene-copy{
  flex-shrink:0
}
.scene-kicker{
  display:flex;
  align-items:center;
  justify-content:space-between
}
#ending-badge{
  color:var(--teal);
  font-size:12px
}
h2{
  font:clamp(23px,2.5vw,34px)/1.15 Georgia,serif;
  margin:10px 0 12px
}
#story{
  font-size:clamp(14px,1.25vw,17px);
  line-height:1.55;
  margin:0;
  color:#d8ddeb
}
.objective{
  font-size:13px;
  line-height:1.45;
  color:var(--gold);
  border-top:1px solid var(--line);
  padding-top:12px;
  margin:15px 0 0
}
.lesson{
  background:#1e2c3c;
  border-left:3px solid var(--teal);
  padding:10px 12px;
  font-size:13px;
  line-height:1.5;
  color:#d1e9e5
}
.choices{
  display:grid;
  gap:9px;
  margin-top:auto
}
.choice{
  text-align:left;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 15px
}
.choice .number{
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:26px;
  height:26px;
  border-radius:50%;
  background:#35415d;
  color:var(--gold);
  font-size:12px
}
.choice .choice-body{
  display:flex;
  flex-direction:column;
  gap:3px
}
.choice small{
  color:var(--muted);
  font-size:12px;
  line-height:1.35
}
#puzzle{
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:auto
}
label{
  font-size:12px;
  font-weight:bold;
  color:var(--teal)
}
label span{
  font-weight:normal;
  color:var(--muted);
  float:right
}
textarea{
  width:100%;
  height:140px;
  min-height:80px;
  resize:none;
  background:#0c1323;
  border:1px solid var(--line);
  border-radius:8px;
  color:#e4f6f5;
  padding:12px;
  font:15px/1.5 Consolas,monospace;
  tab-size:2
}
.puzzle-tools{
  display:flex;
  justify-content:space-between;
  gap:10px
}
#feedback{
  padding:10px 12px;
  border-radius:8px;
  background:#17372f;
  color:#bbf3db;
  font-size:13px;
  line-height:1.4
}
#feedback.error{
  background:#3b2533;
  color:#ffcbc5
}
#feedback.hint{
  background:#2f2d26;
  color:#ffdf9f
}
.continue{
  width:100%
}
footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.voice-tools{
  display:flex;
  align-items:center;
  gap:6px
}
#voice-status{
  font-size:11px;
  color:var(--muted);
  max-width:300px
}
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
dialog{
  max-width:620px;
  width:90%;
  max-height:80dvh;
  overflow:auto;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  color:var(--ink);
  line-height:1.5
}
dialog::backdrop{
  background:#050916bb
}
.dialog-head{
  display:flex;
  justify-content:space-between;
  align-items:center
}
.dialog-head h2{
  font-size:28px
}
dialog p,dialog li{
  font-size:14px;
  color:#d2daea
}
dialog li{
  margin-bottom:10px
}
@media(min-width:1050px) and (max-height:790px){
  #game{
    grid-template-rows:64px 30px minmax(0,1fr) 44px
  }
  .quest{
    gap:8px;
    padding-top:7px
  }
  h2{
    margin:7px 0;
    font-size:27px
  }
  #story{
    font-size:14px;
    line-height:1.45
  }
  .objective{
    margin-top:10px;
    padding-top:8px
  }
  .choice{
    padding:8px 12px;
    min-height:42px
  }
  .choices{
    gap:7px
  }
  .lesson{
    padding:7px 10px;
    font-size:12px
  }
  textarea{
    height:115px
  }
  #feedback{
    font-size:12px;
    padding:8px
  }
}
@media(max-width:760px){
  #game{
    padding:0 12px;
    grid-template-rows:57px 29px minmax(0,1fr) 45px;
    min-height:600px
  }
  .brand{
    gap:8px
  }
  .brand-mark{
    font-size:27px
  }
  .eyebrow{
    font-size:8px;
    letter-spacing:1.2px
  }
  h1{
    font-size:20px
  }
  h1 span{
    display:none
  }
  .masthead>.quiet{
    font-size:12px;
    padding:5px 8px
  }
  .trail{
    font-size:10px;
    gap:4px
  }
  #save-status{
    display:none
  }
  #supplies{
    font-size:10px
  }
  .adventure{
    grid-template-columns:1fr;
    grid-template-rows:minmax(110px,25%) minmax(0,1fr);
    gap:8px
  }
  .stage{
    border-radius:10px
  }
  .stage-caption{
    padding:25px 12px 10px;
    gap:1px
  }
  .stage-caption .tiny,.stage-caption>span:last-child{
    display:none
  }
  .stage-caption strong{
    font-size:20px
  }
  .intro{
    padding:12px 18px;
    gap:5px;
    display:grid;
    grid-template-columns:1fr auto;
    align-items:center
  }
  .intro .sigil,.intro .intro-foot{
    display:none
  }
  .intro h2{
    font-size:25px;
    grid-row:1/3
  }
  .intro p{
    display:none
  }
  .intro button{
    grid-column:2;
    grid-row:1/3;
    max-width:135px;
    font-size:13px;
    padding:10px
  }
  .quest{
    padding:4px 0 0;
    gap:7px
  }
  h2{
    font-size:23px;
    margin:5px 0 7px
  }
  .tiny{
    font-size:8px;
    letter-spacing:1.4px
  }
  #story{
    font-size:13px;
    line-height:1.4
  }
  .objective{
    font-size:11px;
    padding-top:7px;
    margin-top:8px
  }
  .lesson{
    padding:7px 9px;
    font-size:11px;
    line-height:1.35
  }
  .choices{
    gap:6px
  }
  .choice{
    padding:7px 10px;
    gap:9px;
    font-size:13px;
    min-height:40px
  }
  .choice .number{
    width:23px;
    height:23px;
    font-size:11px
  }
  .choice small{
    font-size:10px
  }
  .puzzle-tools button{
    font-size:12px;
    min-height:35px;
    padding:6px 12px
  }
  label{
    font-size:10px
  }
  label span{
    display:none
  }
  textarea{
    height:90px;
    min-height:65px;
    font-size:12px;
    line-height:1.35;
    padding:8px
  }
  #feedback{
    font-size:11px;
    line-height:1.3;
    padding:7px 9px
  }
  .continue{
    min-height:35px;
    font-size:12px;
    padding:6px
  }
  .voice-tools{
    gap:0
  }
  .voice-tools .quiet,footer>.quiet{
    font-size:10px;
    min-height:32px;
    padding:4px 7px
  }
  #voice-status{
    font-size:9px;
    max-width:104px;
    line-height:1.2
  }
  #ending-badge{
    font-size:10px
  }
}
@media(max-width:760px) and (max-height:720px){
  .adventure{
    grid-template-rows:105px minmax(0,1fr)
  }
  #game{
    min-height:600px;
    grid-template-rows:50px 25px minmax(0,1fr) 38px
  }
  .quest{
    gap:5px
  }
  h2{
    font-size:21px
  }
  #story{
    font-size:12px;
    line-height:1.3
  }
  .objective{
    font-size:10px;
    padding-top:5px;
    margin-top:6px
  }
  .lesson{
    font-size:10px;
    padding:5px 8px
  }
  .choice{
    min-height:35px;
    padding:6px 8px;
    font-size:12px
  }
  .choices{
    gap:4px
  }
  .choice small{
    font-size:9px
  }
  textarea{
    height:75px;
    font-size:12px
  }
  .scene-kicker .tiny{
    font-size:7px
  }
  .intro h2{
    font-size:22px
  }
}
@media(max-width:760px) and (max-height:720px){
  #game.has-feedback .adventure{
    grid-template-rows:55px minmax(0,1fr)
  }
  #game.has-feedback .stage-caption{
    padding-top:8px;
    padding-bottom:6px
  }
  #game.has-feedback .stage-caption strong{
    font-size:15px
  }
}
@media(prefers-reduced-motion:reduce){
  *{
    transition:none!important;
    scroll-behavior:auto!important
  }
}
