:root{color-scheme:dark;font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",sans-serif;background:#101c24;color:#fff9e9;--yellow:#ffda52;--dark:#152127;--mint:#92e8c4}
*{box-sizing:border-box}
body{margin:0;overscroll-behavior:none}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
button:focus-visible{outline:3px solid white;outline-offset:4px}
[hidden]{display:none!important}
#app{position:relative;isolation:isolate;width:100%;height:100vh;height:100dvh;overflow:hidden;background:#1d3b40;touch-action:none}
#scene,#look,.vignette,.shell,#hud,#flash,.end{position:absolute;inset:0}
#scene{width:100%;height:100%;display:block}
#look{left:40%;display:none}
[data-mode=play] #look{display:block}
.vignette{pointer-events:none;background:radial-gradient(ellipse at 55% 48%,transparent 44%,#101b2575 100%)}
[data-mode=title] .vignette{background:radial-gradient(ellipse at 50% 45%,#fff5d555 0%,#fff5d522 48%,#f5dfa855 100%),linear-gradient(0deg,#f8e8bf99,transparent 35%,transparent 75%,#fff7de66)}
.shell{padding:clamp(16px,4vw,60px);display:flex;flex-direction:column;pointer-events:none}
.mast{display:flex;justify-content:space-between;align-items:center;font:700 clamp(9px,1.25vw,14px)/1 system-ui;letter-spacing:.16em}
.brand{display:flex;align-items:center;gap:.75em}.brand strong{color:var(--yellow)}
.bolt{background:var(--yellow);color:var(--dark);display:grid;place-items:center;width:34px;height:34px;font-size:24px;border-radius:7px;transform:rotate(-7deg)}
.version,.foot{color:#fcf8e0b8}.version{border:1px solid #fff5;padding:10px 12px;border-radius:3px;background:#17262c83}
i{display:inline-block}.version i,.foot i{width:5px;height:5px;border-radius:50%;background:var(--mint);margin:0 5px 2px}
.foot{margin-top:auto}.foot b{font-size:1.4em;color:var(--yellow)}
#title{display:flex;align-items:center;justify-content:center;flex:1;gap:12px}
.title-copy{padding-left:clamp(0px,3.4vw,54px)}
.chapter{display:flex;align-items:center;gap:.8em;color:var(--mint);font-size:clamp(10px,1.25vw,15px);font-weight:800;letter-spacing:.11em}
.chapter b{background:var(--mint);color:var(--dark);padding:.35em .75em;border-radius:2px}
h1{font-size:clamp(53px,8.25vw,134px);line-height:.99;letter-spacing:-.09em;margin:.18em 0 .22em;font-weight:1000;text-shadow:4px 5px #071418}
h1 span{display:block;color:var(--yellow)}
p{font-size:clamp(12px,1.4vw,19px);line-height:1.75;margin:0 0 1.4em;color:#edece4}
.primary,.sub{pointer-events:auto;font-weight:850;border-radius:5px;padding:.7em 1em}
.primary{background:var(--yellow);color:var(--dark);border:1px solid var(--yellow);box-shadow:0 4px #a67c24}
.primary span,.sub span{margin-left:1.1em}.primary:hover{background:#fff19c}
.sub{background:#14222bd9;border:1px solid #fff4;color:#fff4d9}.sub:hover{background:#304b55}
#help{margin-left:.45em}
.slate{align-self:flex-end;margin-bottom:2.3em;padding:12px 16px;border-right:3px solid var(--yellow);text-align:right;background:#14222bbd;box-shadow:0 5px 20px #0002;border-radius:3px}
.slate span{display:block;color:var(--yellow);font:800 11px system-ui;letter-spacing:.18em;margin-bottom:5px}.slate strong{font-size:clamp(12px,2vw,24px);white-space:nowrap}
[data-mode]:not([data-mode=title]) #title{visibility:hidden}
[data-mode]:not([data-mode=title]) .shell{display:none}
#hud{pointer-events:none;padding:clamp(12px,2.3vw,30px)}
.hud-top{display:flex;justify-content:space-between;align-items:start;gap:.75em}
.gauge,#objective{background:#11232bee;border:1px solid #ffffff36;padding:.6em .75em;border-radius:5px;font-weight:800;box-shadow:0 4px 12px #0004}
.gauge{width:clamp(130px,25vw,255px);font-size:clamp(11px,2vw,15px)}
.gauge div{display:flex;justify-content:space-between}
progress{appearance:none;border:0;background:#314149;width:100%;height:8px;border-radius:6px;overflow:hidden}
progress::-webkit-progress-bar{background:#314149}
progress::-webkit-progress-value{background:var(--mint)}
progress::-moz-progress-bar{background:var(--mint)}
#objective{font-size:clamp(10px,1.7vw,14px);text-align:center;color:#fff4cf}
.guide{position:absolute;right:clamp(12px,2.3vw,30px);top:84px;border:1px solid #fff7;background:#11232bda;border-radius:50%;width:34px;height:34px;pointer-events:auto}
#cue,#toast,.track{position:absolute;left:50%;transform:translateX(-50%);text-align:center;white-space:pre-line;font-weight:850;text-shadow:0 2px 4px #061723}
#cue{bottom:9%;font-size:clamp(11px,1.5vw,16px);width:min(45%,420px)}
#toast{top:25%;width:90%;font-size:clamp(20px,5.5vw,65px);color:var(--yellow);filter:drop-shadow(2px 3px #152127)}
.track{top:17%;background:#12242ccb;border:1px solid #fff7;border-radius:20px;padding:4px 12px;font-size:12px;pointer-events:auto}
#stick{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));left:max(18px,env(safe-area-inset-left));width:clamp(76px,17vh,136px);aspect-ratio:1;border:2px solid #fff7;background:#1023308c;border-radius:50%;display:grid;place-items:center;pointer-events:auto;touch-action:none}
#stick span{width:43%;aspect-ratio:1;background:#d9f6e8bf;border:2px solid white;border-radius:50%;pointer-events:none}
.moves{position:absolute;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,auto);gap:6px;justify-items:end}
.moves button{pointer-events:auto;min-height:44px;background:#13242def;border:1px solid #fff7;border-radius:5px;padding:0 .65em;font-weight:800;font-size:clamp(10px,1.6vw,15px)}
.moves .attack{background:var(--yellow);color:var(--dark)}#item{color:var(--mint)}
#event{position:absolute;top:53%;left:50%;transform:translate(-50%,-50%);width:min(360px,50vw);background:#131f2af5;border:1px solid var(--yellow);border-radius:8px;padding:clamp(8px,2vw,20px);text-align:center;box-shadow:0 0 50px #101f2c}
#eventLabel{color:var(--yellow);font:800 10px system-ui;letter-spacing:.2em}
#eventTitle{display:block;margin:.35em 0;font-size:clamp(12px,2.4vw,22px)}
.timing{position:relative;height:12px;background:#45505a;margin:12px 0;border-radius:2px}
.timing i,.timing b{position:absolute;height:100%;top:0}.timing i{background:var(--mint)}.timing b{width:4px;top:-3px;height:18px;background:white;box-shadow:0 0 4px #000}
#eventHit{pointer-events:auto;padding:.4em .8em;font-size:14px}
#flash{pointer-events:none;background:#fff0b5;opacity:0}
#flash.burst{animation:burst .45s ease-out}
#actionFx{position:absolute;inset:0;pointer-events:none;opacity:0}
#actionFx[data-kind=hit],#actionFx[data-kind=special],#actionFx[data-kind=dodge]{
  background:repeating-conic-gradient(from 6deg,#fff2a3 0deg 1deg,transparent 1.2deg 16deg, #ffdd7960 16.4deg 17deg,transparent 17.5deg 31deg);
  mask-image:radial-gradient(ellipse,transparent 53%,#0003 68%,#000 110%)
}
#actionFx[data-kind=special]{background-color:#ffda524d;mask-image:radial-gradient(ellipse,transparent 48%,#000 98%)}
#actionFx[data-kind=dodge]{background-color:#67c6fc66;mask-image:radial-gradient(ellipse,transparent 45%,#000 105%)}
#actionFx[data-kind=miss]{background:radial-gradient(ellipse,transparent 48%,#ef665c 110%)}
@media(prefers-reduced-motion:reduce){#actionFx{display:none}#flash.burst{animation:none}}
@keyframes burst{from{opacity:.68}to{opacity:0}}
.end{display:grid;place-items:center;padding:12px;background:#0c1926a0}
.card,dialog{background:#14242d;border:1px solid #ffffff46;border-top:4px solid var(--yellow);border-radius:8px;padding:clamp(15px,3vw,35px);width:min(600px,96vw);box-shadow:0 20px 65px #020b13aa}
h2{font-size:clamp(22px,4vw,40px);margin:.25em 0;color:var(--yellow)}
dl{display:grid;grid-template-columns:auto 1fr;gap:.32em 1em;font-size:clamp(11px,1.7vw,15px);margin:.75em 0}dt{color:var(--mint);font-weight:800}dd{margin:0;overflow-wrap:anywhere}
.result-actions{display:flex;flex-wrap:wrap;gap:7px}
dialog{color:#fff9e9;max-height:94dvh}dialog::backdrop{background:#071623b5}dialog form{margin-top:1em}
#error{position:absolute;inset:auto 5% 6%;background:#641e21;padding:1em;z-index:2}
@media(max-height:520px){.shell{padding:14px 22px}.title-copy{padding-left:3vw}h1{font-size:clamp(45px,9vw,74px);margin:.12em 0}.title-copy p{margin-bottom:.65em}.primary,.sub{font-size:12px}.slate{margin-bottom:.7em}.guide{top:65px}.card{padding:10px 15px}}
@media(max-width:560px) and (orientation:portrait){#title{align-items:end;padding-bottom:14vh}.title-copy{padding-left:0}.slate{display:none}h1{font-size:19vw}#cue{bottom:25%;width:80%}.track{top:13%}}
@supports(padding:max(0px)){
  #hud{padding-left:max(clamp(12px,2.3vw,30px),env(safe-area-inset-left));padding-right:max(clamp(12px,2.3vw,30px),env(safe-area-inset-right))}
  .guide{right:max(clamp(12px,2.3vw,30px),env(safe-area-inset-right))}
}
#crouch[aria-pressed=true]{color:var(--dark);background:var(--mint)}
/* Illustrated title logo */
#title .title-copy{width:min(58vw,740px);padding-left:0;text-align:center}
#title .game-logo{margin:0 0 14px;line-height:0;text-shadow:none}
.game-logo img{display:block;width:100%;height:min(59dvh,530px);object-fit:contain;filter:drop-shadow(0 8px 12px #07141870)}
.shell .foot{justify-content:flex-end;color:#4b6655}
@media(max-height:520px){
  #title .title-copy{width:min(59vw,650px)}
  #title .game-logo{margin:0 0 8px}
  .game-logo img{height:61dvh}
}
@media(max-width:560px) and (orientation:portrait){
  #title{align-items:center;padding-bottom:3vh}
  #title .title-copy{width:100%}
  .game-logo img{height:auto;max-height:60dvh}
}

.brand img{display:block;width:clamp(130px,19vw,220px);height:clamp(34px,6vh,54px);object-fit:contain;object-position:left center}
#title #help{background:#fff7e8eb;color:#334d43;border-color:#657c6680;box-shadow:0 3px 8px #5b623a20}
#title .title-copy{margin-inline:auto}
.victory{position:absolute;inset:0;overflow:hidden;display:grid;align-items:end;justify-items:center;background:#f7e7bd;z-index:3}
.victory-art{position:absolute;width:100%;height:100%;object-fit:cover;object-position:center 42%;animation:victory-reveal 7s ease-out both}
.victory::after{content:"";position:absolute;inset:45% 0 0;background:linear-gradient(transparent,#322b2170);pointer-events:none}
.victory-caption{z-index:1;position:relative;text-align:center;padding:12px 20px max(16px,env(safe-area-inset-bottom));animation:victory-caption .6s .3s both}
.victory-caption h2{color:#fff2a4;font-size:clamp(26px,5vw,64px);line-height:1.16;text-shadow:2px 3px #253b42,-1px -1px #253b42;margin:0 0 12px}
.confetti{position:absolute;inset:0;pointer-events:none;z-index:1}
.confetti i{position:absolute;top:-12%;width:9px;height:17px;background:#ffdb55;left:8%;animation:celebrate-fall 2.7s linear infinite}
.confetti i:nth-child(3n){background:#ed8674}.confetti i:nth-child(3n + 1){background:#8dd7ba}
.confetti i:nth-child(2){left:16%;animation-delay:-1.3s}.confetti i:nth-child(3){left:25%;animation-delay:-.5s}.confetti i:nth-child(4){left:33%;animation-delay:-2s}
.confetti i:nth-child(5){left:42%;animation-delay:-.8s}.confetti i:nth-child(6){left:50%;animation-delay:-1.7s}.confetti i:nth-child(7){left:58%;animation-delay:-.2s}
.confetti i:nth-child(8){left:66%;animation-delay:-2.4s}.confetti i:nth-child(9){left:75%;animation-delay:-1.1s}.confetti i:nth-child(10){left:83%;animation-delay:-1.9s}
.confetti i:nth-child(11){left:91%;animation-delay:-.6s}.confetti i:nth-child(12){left:96%;animation-delay:-1.5s}
@keyframes celebrate-fall{to{transform:translate(35px,115dvh) rotate(540deg)}}
@keyframes victory-reveal{from{transform:scale(1.05)}to{transform:scale(1)}}
@keyframes victory-caption{from{transform:translateY(16px);opacity:0}to{transform:translateY(0);opacity:1}}
@media(max-height:520px){.victory-caption{padding-bottom:12px}.victory-caption h2{font-size:clamp(24px,4vw,38px);margin-bottom:8px}}
@media(prefers-reduced-motion:reduce){.victory-art,.victory-caption,.confetti i{animation:none}.confetti{display:none}}
/* Separate movement, view and action controls. */
#lookStick{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));right:max(18px,env(safe-area-inset-right));width:clamp(76px,17vh,136px);aspect-ratio:1;border:2px solid #fff7;background:#1023308c;border-radius:50%;display:grid;place-items:center;pointer-events:auto;touch-action:none}
#lookStick span{width:43%;aspect-ratio:1;background:#ffe4a8bf;border:2px solid white;border-radius:50%;pointer-events:none}
#stick{bottom:max(22px,env(safe-area-inset-bottom))}
#stick b,#lookStick b{position:absolute;bottom:-17px;font-size:10px;letter-spacing:.1em;color:#fff8df;text-shadow:0 1px 3px #152127;pointer-events:none}
.moves{left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 250px);max-width:530px;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px}
.moves button{min-height:44px;max-width:100%;padding:0 .65em}
#cue{bottom:132px}
@media(max-width:640px){.moves{width:calc(100% - 210px);gap:4px}.moves button{font-size:10px;padding:0 .45em;min-height:40px}#cue{bottom:160px;font-size:11px}}
#result .card{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
#stats{line-height:1.8}
#stats dd{white-space:pre-wrap}
#share{display:inline-flex;align-items:center;text-decoration:none;cursor:pointer}
.result-actions{align-items:stretch}
.shell .foot{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;min-height:44px}
.studio-link{grid-column:2;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:4px 10px;pointer-events:auto;color:#243b31;text-decoration:none;font:800 11px/1.2 system-ui;letter-spacing:.08em;border-radius:8px;background:rgba(255,255,255,.65)}
.studio-link img{display:block;width:clamp(138px,20vw,192px);height:34px;object-fit:contain}
.studio-link:hover{background:rgba(255,255,255,.85)}
.studio-link:focus-visible{outline:3px solid #426950;outline-offset:3px}
.orientation-note{grid-column:3;justify-self:end;white-space:nowrap}
@media(max-height:520px){.game-logo img{height:54dvh}}
@media(max-width:420px){.studio-link{font-size:10px;gap:5px}.orientation-note{font-size:9px}}

#endingTitle{white-space:pre-line}
.victory.is-defeat{background:#616e79}
.victory.is-defeat .confetti{display:none}
.victory.is-defeat .victory-caption h2{color:#e9eef0;text-shadow:2px 3px #253342}

/* Touch combat and world commands */
.moves .icon-action{width:56px;height:56px;padding:10px;border-radius:50%;position:relative;flex:0 0 56px;display:grid;place-items:center;min-height:56px}
.icon-action svg{width:100%;height:100%;pointer-events:none}.moves .special-action{color:#ffd85b;background:#344768}
.moves .icon-action:disabled{opacity:.32;cursor:default}.special-action:not(:disabled){box-shadow:0 0 15px #ffe06999;border-color:#ffe069}
#specialCount{position:absolute;bottom:-5px;right:-3px;background:#20343f;border-radius:10px;font-size:11px;padding:2px 5px;color:white;pointer-events:none}
#targets{position:absolute;inset:0;pointer-events:none}.world-target{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;min-height:44px;min-width:48px;padding:7px 10px;border:2px solid #fff4bd;background:#193d43cf;color:#fffbe7;border-radius:14px;font-size:11px;box-shadow:0 2px 8px #0005;touch-action:manipulation}
.item-commands{position:absolute;z-index:20;left:50%;top:45%;transform:translate(-50%,-50%);width:min(300px,82vw);padding:16px;border:2px solid #fff2ad;border-radius:18px;background:#fef8eefa;color:#233f45;pointer-events:auto;box-shadow:0 6px 35px #173d4570}
.command-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.command-head button{color:#233f45;background:transparent;border:0;font-size:24px;width:44px;height:44px}
#commandList{display:grid;gap:8px}#commandList button{min-height:46px;background:#2d6467;color:white;border:0;border-radius:10px;font-weight:bold}#commandList button:disabled{opacity:.45}
@media(max-width:640px){.moves{gap:6px;width:calc(100% - 190px)}.moves .icon-action{width:48px;height:48px;min-height:48px;flex-basis:48px;padding:8px}}

/* A clear, uninterrupted view of the slow-motion dodge. */
[data-cinematic=dodge] .moves,[data-cinematic=dodge] #stick,[data-cinematic=dodge] #lookStick,[data-cinematic=dodge] #toast{visibility:hidden}
[data-cinematic=dodge]::before,[data-cinematic=dodge]::after{content:"";position:absolute;left:0;right:0;height:clamp(12px,5vh,34px);background:#091a20;z-index:2;pointer-events:none}
[data-cinematic=dodge]::before{top:0}[data-cinematic=dodge]::after{bottom:0}
[data-cinematic=dodge] #cue{bottom:12%;color:#c8fff5;letter-spacing:.12em;font-size:clamp(11px,1.8vw,16px);width:90%}

/* Acquired tools occupy the former score space. */
.inventory-panel{flex:none;background:#11232bee;border:1px solid #ffffff36;padding:5px 7px 7px;border-radius:10px;box-shadow:0 4px 12px #0004}
.inventory-label{display:block;font-size:9px;letter-spacing:.12em;color:#fff1bf;margin-bottom:3px;text-align:center}
.inventory-slots{display:flex;gap:5px}.inventory-slot{pointer-events:auto;position:relative;width:56px;height:61px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;border:1px solid #8caa9c;background:#f6ecd8;border-radius:8px;padding:2px;color:#263f41}
.inventory-slot svg{display:block;width:43px;height:43px;flex:none}.inventory-name{font-size:9px;font-weight:800;white-space:nowrap;line-height:12px}.inventory-slot.equipped{border:2px solid #ffdc5c;box-shadow:0 0 0 1px #ffdc5c55}.inventory-slot.empty{background:#ffffff0b;border:1px dashed #ffffff40;color:#ffffff60;pointer-events:none}.inventory-slot:disabled{opacity:.5;cursor:default}
.command-art{width:96px;height:96px;margin:0 auto 12px;border-radius:20px;background:#e9efdf;display:grid;place-items:center}.command-art svg{width:86px;height:86px}
.guide{top:108px}
[data-cinematic=dodge] .inventory-panel{visibility:hidden}
@media(max-width:560px){.hud-top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px}.hud-top .gauge{width:min(100%,210px)}.hud-top .inventory-panel{grid-column:2;grid-row:1 / 3}.hud-top #objective{grid-column:1;grid-row:2;font-size:10px;padding:4px}.inventory-slot{width:49px;height:58px}.inventory-slot svg{width:39px;height:39px}.inventory-panel{padding:4px 5px 6px}.inventory-name{font-size:8px}}
@media(max-height:480px){.command-art{width:64px;height:64px;margin-bottom:8px}.command-art svg{width:60px;height:60px}.item-commands{padding:10px;top:46%}.command-head{margin-bottom:4px}#commandList{gap:5px}#commandList button{min-height:40px}}

/* Reserve space between title actions and the studio link on short landscape screens. */
@media (orientation:landscape) and (max-height:520px){
  .shell>.mast{flex-shrink:0}
  #title{min-height:0}
  .shell .foot{margin-top:24px;flex-shrink:0;grid-template-rows:auto}
  .shell .foot .studio-link{grid-column:2;grid-row:1}
  .shell .foot #title-analytics{grid-column:1;grid-row:1;justify-self:start}
  .shell .foot .orientation-note{grid-column:3;grid-row:1}
  #title .game-logo img{height:min(52dvh,calc(100dvh - 184px))}
}

/* Illustrated victory lettering matches the faceted celebration art. */
.victory-lettering{display:block;width:min(76vw,640px,68dvh);height:auto;margin:0 auto 12px;filter:drop-shadow(0 3px 3px #532d2450)}
@media(orientation:landscape) and (max-height:520px){.victory-lettering{width:min(58vw,82dvh);margin-bottom:8px}}

.defeat-lettering{filter:drop-shadow(0 3px 3px #24334255)}
