@font-face{font-family:Barlow Display;src:local("Barlow Condensed ExtraBold"),url("./assets/fonts/BarlowCondensed-ExtraBold.ttf") format("truetype");font-weight:800;font-display:swap}
:root{color-scheme:dark;--bg:#090e15;--line:#29333e;--dim:#a7b3c2;--amber:#ffc473;--cyan:#8ce2ff;--mono:"IBM Plex Mono",Consolas,monospace;--display:"Barlow Display","Arial Narrow",Impact,sans-serif;font-family:Inter,"Segoe UI",sans-serif;color:#f4f7fa;background:var(--bg)}
*{box-sizing:border-box}
body{margin:0;min-height:100svh;display:flex;flex-direction:column}
button,a,select,input{font:inherit}button{cursor:pointer;color:inherit;background:none;border:0}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--amber);outline-offset:4px}button:disabled{cursor:wait;opacity:.65}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}.symbols{width:0;height:0;position:absolute;overflow:hidden}
header{height:66px;flex:none;display:flex;align-items:center;gap:clamp(24px,4vw,78px);padding:0 clamp(18px,3.1vw,68px);border-bottom:1px solid var(--line);background:#0b111a}
.brand{display:inline-flex;align-items:center;gap:10px;color:#f8f7f3;text-decoration:none;font-family:var(--display);font-weight:800;font-size:26px;letter-spacing:.035em;white-space:nowrap}.brand-icon{width:30px;height:35px;color:var(--amber);stroke:none}
.brand span{text-transform:uppercase}
#donate{align-self:center;display:inline-flex;align-items:center;min-height:28px;padding:2px 9px;border:1px solid #795b33;border-radius:4px;color:var(--amber);font-size:13px;font-weight:650;text-decoration:none}
#donate:hover{border-color:var(--amber);background:#302518;color:#ffe6bb}
nav{display:flex;height:100%;gap:clamp(15px,2.2vw,38px)}.nav{font-weight:550;font-size:14px;color:#a5b1bf;padding:0 1px;position:relative}.nav:hover,.nav.active{color:#fff}.nav.active:after{content:"";position:absolute;bottom:0;height:2px;background:var(--amber);left:0;right:0}
.tools{margin-left:auto;display:flex;gap:10px}.icon-button{display:grid;place-items:center;width:38px;height:38px;border:1px solid #303b49;background:#101822;border-radius:5px;color:#c3cdd7}.icon-button:hover,.secondary:hover{background:#22303e;color:#fff;border-color:#718394}
main{flex:1;display:grid;place-items:center;background:#050a10;overflow:hidden;min-height:0;position:relative}
#stage{position:relative;isolation:isolate;container-type:inline-size;width:min(100%,calc((100svh - 120px)*16/9));aspect-ratio:16/9;background:#0c1626;outline:none;overflow:hidden}
#stage:focus-visible{outline:1px solid #627e91;outline-offset:-1px}
#scene,#labels,.ready-shade{position:absolute;inset:0;width:100%;height:100%}#labels{pointer-events:none;z-index:2}
.ready-shade{background:linear-gradient(90deg,rgba(6,13,26,.5),rgba(7,14,28,.19) 37%,transparent 62%);pointer-events:none}
.intro{position:absolute;left:6.2%;top:9%;z-index:3}.eyebrow,.foot-label{font:600 11px var(--mono);letter-spacing:.14em;text-transform:uppercase}
.eyebrow{display:flex;align-items:center;gap:.8em;color:var(--amber);font-size:clamp(10px,.95cqw,16px);line-height:1.4}.eyebrow i{width:2.1em;height:2px;background:var(--amber)}.eyebrow span{color:#748391}
h1,h2{font:800 62px/.9 var(--display);text-transform:uppercase;letter-spacing:-.02em;margin:0}h1{font-size:clamp(50px,8.5cqw,175px);line-height:.8;letter-spacing:-.022em;margin:.16em 0 .13em -.024em;text-shadow:0 2px 14px #09142530}h1 em{font-style:normal;color:#ffc477}p{line-height:1.5}
.intro p{font-size:clamp(14px,1.25cqw,23px);margin:.8em 0 1.15em;color:#e0e7ed}
.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:.75em;border-radius:4px;padding:.76em 1.15em;font-weight:700;font-size:clamp(14px,1.15cqw,20px);min-height:42px}
.primary{background:#ffc473;color:#1b1b1d;border:1px solid #ffdcaa;box-shadow:0 4px 18px #070a1040}.primary:hover{background:#ffd296}.primary svg{width:1.15em;height:1.15em}.primary kbd{margin-left:1em;color:#47331f;border-color:#9c784b;background:#ffcf8d}.secondary{border:1px solid var(--line);background:#18212ddd}
kbd{display:inline-block;border:1px solid #455160;border-radius:3px;padding:2px 5px;font:500 11px var(--mono);line-height:1.15;color:#d0d8df;background:#141d27}
footer{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:54px;padding:9px clamp(18px,3.1vw,68px);background:#0c121a;border-top:1px solid var(--line);font-size:12px;color:#9cabbc}
footer>div{display:flex;align-items:center;gap:10px}footer svg{width:16px;height:16px;color:var(--amber)}footer strong{font:600 12px var(--mono);color:#d7e2eb}.foot-label{font-size:10px;letter-spacing:.09em}.foot-help{gap:7px}.foot-help i,#hud i{width:1px;height:13px;background:#384653;margin:0 4px}#integrity{display:inline-flex;gap:3px}#integrity i{display:block;background:#78c9c3;width:5px;height:11px;transform:skewX(-9deg)}#integrity i.lost{background:#36414c}#integrity i.hurt{background:#c19a62}
.emp-control{display:inline-flex;align-items:center;gap:7px;color:#c3edff;font-weight:650;font-size:12px;padding:4px 8px;border:1px solid #38516a;border-radius:4px;background:#122132}
.emp-control strong{color:var(--cyan);font-variant-numeric:tabular-nums}
.emp-control:disabled{cursor:default;opacity:.53}
#emp-award,#practice-change{font-size:14px;color:var(--cyan);margin:.75em 0}
.word {
  --rim: #55d4ff;
  --halo: #0077ff;
  --glass: #071632;
  --notch: .30em;
  position: absolute;
  color: white;
  font: italic 700 clamp(10px,1.48cqw,32px)/1.08 Arial, sans-serif;
  white-space: nowrap;
  filter: drop-shadow(0 0 .11em var(--halo)) drop-shadow(0 0 .24em var(--halo));
}
.plate {
  display: flex;
  justify-content: center;
  position: relative;
  isolation: isolate;
  padding: .17em .99em .22em;
  min-width: calc(2.38em + var(--letters, 5) * .53em);
  clip-path: polygon(var(--notch) 0,calc(100% - var(--notch)) 0,100% var(--notch),100% calc(100% - var(--notch)),calc(100% - var(--notch)) 100%,var(--notch) 100%,0 calc(100% - var(--notch)),0 var(--notch));
  background: linear-gradient(145deg,#edffff,var(--rim) 14%,#2084ff 48%,var(--rim) 76%,#b8faff);
  text-shadow: 0 0 .18em #4fabea;
}
.plate::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: max(1px,.073em);
  clip-path: inherit;
  background: linear-gradient(180deg,#193858,var(--glass) 23%,#051125 77%,#143758);
  box-shadow: inset 0 0 .32em var(--rim);
}
.word b { color: #81f1ff; }
.word.locked { --rim: #ffb032; --halo: #ff6500; }
.word.locked .plate { background: linear-gradient(135deg,#ffdc83,#ff9b14 30%,#fff4bb 65%,#ff8a00); text-shadow: 0 0 .18em #f68635; }
.word.locked .plate::before { background: linear-gradient(180deg,#63370d,#291506 25%,#2c1507 75%,#85460e); }
.word.locked b { color: #ffd078; }
.word.locked::before {
  content: "";
  position: absolute;
  inset: -.95em -.54em;
  background:
    linear-gradient(var(--rim),var(--rim)) left top / .58em .095em,
    linear-gradient(var(--rim),var(--rim)) left top / .095em .52em,
    linear-gradient(var(--rim),var(--rim)) right top / .58em .095em,
    linear-gradient(var(--rim),var(--rim)) right top / .095em .52em,
    linear-gradient(var(--rim),var(--rim)) left bottom / .58em .095em,
    linear-gradient(var(--rim),var(--rim)) left bottom / .095em .52em,
    linear-gradient(var(--rim),var(--rim)) right bottom / .58em .095em,
    linear-gradient(var(--rim),var(--rim)) right bottom / .095em .52em;
  background-repeat: no-repeat;
}
.word.heavy { font-size: clamp(12px,1.86cqw,39px); }
.miss .word.locked { --rim: #ff7755; }
#start { min-height: 32px; padding: .43em 1em; font-size: 14px; }
#intro { gap: 18px; }
@media(max-width:980px) { .start-hint { display:none } }
@media(max-width:500px) { #start { font-size:12px; padding:.4em .55em } #intro {gap:0} }
#hud{display:flex;align-items:center;gap:10px;color:#d5e1eb;font:600 12px var(--mono);letter-spacing:.07em}.wave-mark{display:block;width:6px;height:6px;background:var(--amber);border-radius:50%}
.interlude{position:absolute;z-index:4;left:50%;top:40%;transform:translate(-50%,-50%);width:min(90%,540px);padding:clamp(18px,2.7cqw,43px);background:#0c1623f5;border:1px solid #3c4d5e;border-top:2px solid var(--amber);border-radius:5px;box-shadow:0 12px 60px #01040b77}
.interlude h2,dialog h2{font-size:clamp(35px,4.2cqw,67px);line-height:1;margin:.15em 0 .3em}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:13px 10px;margin:16px 0 23px}.stats span{display:block;color:#b0bdc9;font-size:12px}.stats b{display:block;font:600 18px var(--mono);margin-top:3px}.actions{display:flex;gap:10px}
dialog{background:#101a27;color:#f4f7fa;border:1px solid #435164;border-radius:6px;width:min(520px,92vw);max-height:85svh;padding:25px 32px 32px;box-shadow:0 18px 80px #0008}dialog::backdrop{background:#030812b8}dialog h2{font-size:45px}.panel-top{display:flex;align-items:center;justify-content:space-between}.panel-top .eyebrow{font-size:11px}dt{font-weight:650;color:#f0f5fa;margin-top:16px}dd{margin:5px 0 0;color:#beccd9;font-size:14px;line-height:1.5}
.setting{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0;border-bottom:1px solid var(--line);font-size:15px}.setting input{width:18px;height:18px;accent-color:var(--amber)}select{color:#e5edf4;background:#182533;border:1px solid #415363;border-radius:3px;padding:6px}table{width:100%;border-collapse:collapse;font-size:14px}th,td{text-align:left;border-bottom:1px solid #344250;padding:9px 4px}th{color:#a9b7c5}#history p{color:#bfccd9}
.message{position:absolute;inset:15% 10% auto;padding:24px;background:#121e2d;border:1px solid var(--amber);z-index:8}
[hidden]{display:none!important}.sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:730px){header{height:50px;gap:20px;padding:0 12px}.brand{font-size:19px;gap:5px}.brand-icon{width:22px;height:27px}.tools{gap:5px}.icon-button{width:31px;height:31px}.nav{font-size:12px}nav{gap:12px}footer{padding:9px 12px;gap:8px;min-height:44px}.foot-help{display:none}.foot-label{font-size:9px}#stage{width:min(100%,calc((100svh - 94px)*16/9))}.intro p{margin:.55em 0}.primary,.secondary{min-height:30px;padding:.5em .8em}.interlude{top:48%;padding:12px}.stats{gap:5px;margin:8px 0}.stats span{font-size:10px}.stats b{font-size:13px}}
@media(max-width:500px) and (orientation:portrait){header{gap:10px}.brand span{display:none}.brand-icon{width:28px;height:32px}nav{gap:16px}.intro{top:5%;left:4%}.intro h1{font-size:11cqw;line-height:.82}.intro .eyebrow{font-size:8px}.intro p{font-size:11px;margin:5px 0}.intro .primary{font-size:12px}.primary kbd{display:none}.foot-label{display:none}.interlude h2{font-size:25px}main{background:linear-gradient(#07101c,#0e1b2c 50%,#07101c)}}
@media(max-height:600px) and (orientation:landscape){header{height:38px}.brand{font-size:18px}.brand-icon{height:26px}.icon-button{height:29px;width:29px}footer{min-height:31px;padding-block:5px}#stage{width:min(100%,calc((100svh - 69px)*16/9))}.intro .primary{min-height:26px}.intro p{margin:5px 0 8px}}

.training-controls{display:flex;align-items:center;gap:9px;margin-left:auto;min-width:0}
.training-controls label{color:var(--dim);font-size:12px}
.training-controls select{font-size:13px;max-width:23ch;min-width:0;height:32px;cursor:pointer}
.training-controls button{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:13px;font-weight:600;padding:7px 8px;border-radius:4px;color:#d4deea}
.training-controls button:hover,.training-controls button.in-use{background:#1a2a39;color:var(--cyan)}
.training-controls svg{width:16px;height:16px}.training-controls+.tools{margin-left:0}
#my-words-form{margin-top:16px}#my-words-form>label:first-child{font-weight:650}
#my-words-form p{color:#bccad7;font-size:14px;line-height:1.45;margin:5px 0 12px}
#custom-words{display:block;width:100%;min-height:74px;max-height:28svh;resize:vertical;border:1px solid #536477;border-radius:4px;background:#0b121d;color:#f4f7fa;font:15px/1.5 var(--mono);padding:9px 12px}
#custom-words:focus-visible{outline:2px solid var(--amber);outline-offset:2px}#custom-words[aria-invalid=true]{border-color:#ffad9b}
#word-feedback{color:var(--dim);font-size:13px;min-height:22px;margin:8px 0 13px;overflow-wrap:anywhere}#word-feedback.invalid{color:#ffb8a7}
.use-custom{display:flex;align-items:center;gap:9px;font-size:15px}.use-custom input{width:17px;height:17px;margin:0;accent-color:var(--amber)}
#my-words-form .word-scope{font-size:13px;margin:5px 0 20px 26px}.word-actions{display:flex;gap:10px;justify-content:space-between}
@media(min-width:1001px) and (max-width:1250px){header{gap:22px;padding-inline:22px}.training-controls{gap:5px}}
@media(max-width:1000px){
 header{display:grid;grid-template-areas:"brand nav tools" "training training training";grid-template-rows:1fr auto;grid-template-columns:auto 1fr auto;gap:0 15px;height:87px;padding:0 14px 5px}
 header .brand{grid-area:brand}header nav{grid-area:nav;justify-self:start}header .tools{grid-area:tools}
 .training-controls{grid-area:training;justify-self:start;margin:0;max-width:100%}.training-controls select{max-width:28ch;height:28px;padding:2px 5px}
 .training-controls button{padding-block:4px}#stage{width:min(100%,calc((100svh - 141px)*16/9))}
}
@media(max-width:730px){header{height:78px;gap:0 8px;padding:0 9px 5px}.training-controls{gap:6px}#stage{width:min(100%,calc((100svh - 122px)*16/9))}}
@media(max-width:385px){header nav{gap:9px}.training-controls label{font-size:11px}.training-controls select{max-width:22ch}.training-controls svg{display:none}.training-controls button{padding-inline:4px}dialog{padding:15px 18px 20px}}
@media(max-width:350px){
 header{padding-inline:7px;column-gap:4px}
 header nav{gap:4px}
 header .tools{gap:2px}
}
@media(max-width:385px) and (orientation:portrait){footer{padding-inline:7px;gap:4px}footer>div{gap:5px}#integrity{gap:2px}}
@media(max-width:500px) and (orientation:portrait){
 footer:has(#emp:not([hidden])){display:grid;grid-template-areas:"district hud" "emp best";grid-template-columns:auto auto;justify-content:space-between;row-gap:4px}
 footer .district{grid-area:district}footer #hud{grid-area:hud;justify-self:end}footer #emp{grid-area:emp;justify-self:start}footer .best{grid-area:best;justify-self:end}
 #stage:has(#interlude:not([hidden])){overflow:visible}#stage:has(#interlude:not([hidden])) #labels{overflow:hidden}
 .interlude{top:50%;max-height:calc(100svh - 152px);overflow-y:auto}
}
@media(max-width:1000px) and (max-height:600px) and (orientation:landscape){header{height:64px;padding-bottom:2px}.training-controls select{height:23px}#stage{width:min(100%,calc((100svh - 95px)*16/9))}}

.city-dialog{width:min(760px,94vw);padding:20px clamp(16px,3vw,32px) 24px}
#city-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin:18px 0}
#city-choices button{overflow:hidden;border:1px solid #42556b;border-radius:4px;background:#101b28;text-align:left;padding:0;color:#e0ebf3}
#city-choices button:hover{border-color:#8ed8f1}
#city-choices button[aria-pressed=true]{border-color:var(--amber);box-shadow:0 0 0 1px var(--amber)}
#city-choices img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#172a38}
#city-choices span{display:block;padding:6px 7px 8px;font:600 13px/1.18 system-ui,sans-serif}
#city-feedback{min-height:1.4em;color:#c6d6e3;font-size:14px}
@media(max-width:655px){#city-choices{grid-template-columns:repeat(3,minmax(0,1fr))}.city-dialog{max-height:90svh}}
@media(max-width:1150px) and (min-width:1001px){header{gap:14px;padding-inline:14px}header nav{gap:12px}.brand{font-size:20px}.training-controls label{position:absolute;clip-path:inset(50%)}}

/* The hosted page adds a fixed 197 × 64 px attribution frame. Reserve that
   corner only when it exists, leaving the entire 16:9 scene above the footer. */
body:has(> #nl-badge-frame){height:100svh}
body:has(> #nl-badge-frame) main{container-type:size}
body:has(> #nl-badge-frame) #stage{width:min(100cqw,177.77778cqh)}
@media(min-width:576px){
 body:has(> #nl-badge-frame) footer{padding-inline-end:205px;min-height:64px}
}
@media(min-width:576px) and (max-width:1200px){
 body:has(> #nl-badge-frame) #city-hint{display:none}
}
@media(min-width:576px) and (max-width:800px){
 body:has(> #nl-badge-frame) footer .foot-label,
 body:has(> #nl-badge-frame) #start kbd{display:none}
 body:has(> #nl-badge-frame) footer:has(#emp:not([hidden])){
  display:grid;grid-template-columns:auto auto;justify-content:space-between;gap:2px 8px
 }
 body:has(> #nl-badge-frame) footer :is(#hud,.best){justify-self:end}
}
@media(max-width:575px){
 body:has(> #nl-badge-frame) footer{padding-bottom:72px}
 header{height:103px;grid-template-areas:"brand tools" "nav nav" "training training";grid-template-columns:minmax(0,1fr) auto;grid-template-rows:1fr 1fr auto;row-gap:2px;padding-block:3px 5px}
 header nav{justify-self:stretch;align-items:stretch;justify-content:space-between;gap:6px}
 header .brand span{display:inline}header .brand{font-size:19px;gap:6px}header .brand-icon{width:22px;height:25px}
 #donate{min-height:23px;padding:1px 8px;font-size:12px}
 #stage{width:min(100%,calc((100svh - 147px)*16/9))}
}
