:root{--bg:#0B0D12;--up:#171A22;--up2:#222733;--line:#6B7488;--ink:#F6F1E7;--soft:#A4ABBA;--on:#FF7A33;--on2:#FF9158;--night:#0E1220;--bad:#FF9D8F;--r:12px;--ease:cubic-bezier(.2,0,0,1)}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100dvh;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font:1rem/1.4 system-ui,sans-serif;padding:0 max(16px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px,env(safe-area-inset-left));-webkit-tap-highlight-color:transparent}
header,main,footer{width:100%;max-width:68rem;margin:0 auto}
header{display:flex;align-items:center;gap:4px;min-height:64px;padding-top:env(safe-area-inset-top)}
h1{font-size:1.25rem;font-weight:700;margin:0;overflow-wrap:anywhere}
h1:focus{outline:none}
.home-page h1{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body:not(.home-page) #logo{display:none}
h2{font-size:1rem;margin:24px 0 0}
main{flex:1}
footer{padding:32px 0 16px;color:var(--soft);font-size:.75rem}
button,select,input{font:inherit;color:inherit}
button,select,label[for],input[type=checkbox],input[type=radio]{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
button{min-height:48px;padding:0 18px;background:var(--up2);border:0;border-radius:var(--r);font-weight:600;transition:background .12s,transform .12s var(--ease)}
button:hover:not(:disabled){background:#2E3545}
button:active:not(:disabled){transform:scale(.97)}
button.main{background:var(--on);color:var(--night)}
button.main:hover:not(:disabled){background:var(--on2)}
button.danger{color:var(--bad)}
button.plain{background:none}
button.plain:hover:not(:disabled){text-decoration:underline}
:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
#up{width:48px;padding:0;margin-left:-12px;background:none;display:grid;place-items:center}
#up svg{width:24px}
.note{color:var(--soft);margin:0}
.wide{width:100%}
.tile{display:grid;place-items:center;overflow:hidden;border-radius:16px}
.tile{position:relative}
.tile svg{display:block;position:relative;width:100%;height:100%}
.tile .ground{position:absolute;inset:0}
#art .ground{display:none}
.hero .tile{aspect-ratio:16/10;max-height:56dvh;width:100%;border-radius:20px}
.meta{display:flex;justify-content:space-between;gap:12px;margin:12px 2px;color:var(--soft);font-size:.875rem}
.acts{display:flex;gap:10px}
.acts .main{flex:1;min-height:60px;font-size:1.25rem;font-weight:700}
.acts button:not(.main){min-height:60px}
.shelf{display:flex;gap:12px;margin:24px -16px 0;padding:6px 16px 10px;overflow-x:auto;scroll-snap-type:x proximity;scroll-padding:16px;scrollbar-width:none;list-style:none}
.shelf::-webkit-scrollbar{display:none}
.shelf li{flex:none;width:148px;scroll-snap-align:start}
.pick{display:block;width:100%;min-height:0;padding:0;background:none;border-radius:16px}
.pick:hover:not(:disabled){background:none}
.pick .tile{aspect-ratio:16/10}
.pick:hover:not(:disabled) .tile{filter:brightness(1.12)}
.pick[aria-pressed=true] .tile{box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--ink)}
.plus{background:var(--up);color:var(--ink)}
.plus svg{width:32px;height:32px;fill:currentColor}
.page{max-width:34rem;margin:0 auto;display:grid;gap:14px}
label.field{font-weight:600;display:flex;justify-content:space-between;margin-top:6px;margin-bottom:-6px}
label.field span{color:var(--soft);font-weight:400;font-variant-numeric:tabular-nums}
select,input[type=text],input[type=search],input[type=email]{width:100%;min-height:52px;padding:0 14px;background:var(--up);border:1px solid var(--line);border-radius:var(--r);font-size:1rem}
fieldset{border:0;margin:0;padding:0;min-width:0}
legend{font-weight:600;padding:0;margin-bottom:8px}
.colors div{display:grid;grid-template-columns:repeat(8,1fr);gap:8px}
.colors label{position:relative;display:block;min-width:0}
.colors input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0}
.colors span{display:block;height:44px;border-radius:10px;border:1px solid var(--line)}
.colors input:checked+span{box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--ink)}
.colors input:focus-visible+span{outline:3px solid var(--on);outline-offset:6px}
.preview .tile{aspect-ratio:16/10;max-height:34dvh;width:100%}
.check{display:flex;align-items:center;gap:12px;min-height:48px;font-weight:600}
.check input{width:24px;height:24px;accent-color:var(--on);margin:0}
.check:has(input:disabled){color:var(--soft);cursor:not-allowed}
.list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.list li{display:flex;align-items:center;gap:12px;min-height:72px;padding:10px 12px;background:var(--up);border-radius:var(--r)}
.list img,.list .noimg{width:44px;height:44px;border-radius:10px;background:var(--up2);flex:none}
.list .text{flex:1;min-width:0;overflow-wrap:anywhere}
.list .text b{display:block}
.list .text span{font-size:.875rem;color:var(--soft);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.row{display:flex;gap:10px;justify-content:flex-end;margin-top:20px}
#say:not(:empty){position:fixed;left:16px;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));max-width:32rem;margin:auto;padding:14px 16px;background:var(--ink);color:var(--night);border-radius:var(--r);z-index:20}
dialog{background:var(--up);color:var(--ink);border:1px solid var(--line);border-radius:16px;max-width:min(24rem,calc(100vw - 32px));padding:20px}
dialog::backdrop{background:rgba(0,0,0,.7)}
dialog p{margin:0;overflow-wrap:anywhere}
.empty{display:grid;gap:20px;justify-items:center;text-align:center;padding-top:22dvh}
.empty img{width:min(80%,340px);height:auto}

/* Launch: the save fills the screen and stays there until the game is really running. */
body.launching{overflow:hidden}
#launch[hidden]{display:none}
#launch{position:fixed;inset:0;z-index:10;display:grid;grid-template-rows:1fr auto auto auto auto;justify-items:center;gap:18px;padding:24px 24px calc(28px + env(safe-area-inset-bottom));background:var(--bg);transition:background-color .4s var(--ease)}
#art{width:100%;display:grid;place-items:center;min-height:0}
#art .tile{width:100%;max-width:640px;max-height:100%;aspect-ratio:16/10;background:none!important;border-radius:0}
.bar{position:relative;width:min(220px,60vw);height:6px;border-radius:3px;overflow:hidden;background:rgba(246,241,231,.22)}
/* Eases in and out at both ends, and stretches through the fast middle. Only transform moves, so it stays smooth while the game loads. */
.bar i{position:absolute;inset:0 auto 0 0;width:30%;border-radius:3px;background:var(--ink);animation:sweep 1.15s cubic-bezier(.7,0,.3,1) infinite alternate,stretch 1.15s ease-in-out infinite}
@keyframes sweep{from{translate:0}to{translate:233.4%}}
@keyframes stretch{0%,100%{scale:1 1}50%{scale:1.4 1}}
#launch.bad .bar{display:none}
/* The line in blocks, like the ground on every save. */
.line{display:flex;gap:6px;justify-content:center;height:22px;align-items:flex-end}
.line i{width:16px;height:16px;background:rgba(246,241,231,.45)}
.line .on{background:var(--ink)}
.line .more{background:rgba(246,241,231,.18)}
.line .you{background:var(--on);box-shadow:0 0 0 2px var(--ink);animation:hop 1.15s cubic-bezier(.3,0,.3,1) infinite alternate}
@keyframes hop{to{translate:0 -6px}}
#step{margin:0;font-size:1.125rem;font-weight:600;text-align:center;color:var(--ink)}
.under{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.under button:not(.main){background:rgba(11,13,18,.55)}
.under button:not(.main):hover{background:rgba(11,13,18,.75)}
@media (min-width:760px){
  .home{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:32px;align-items:start}
  .shelf{flex-wrap:wrap;margin:0;padding:6px;overflow:visible}
  .shelf li{width:calc(50% - 6px)}
}
@media (max-height:480px){header{min-height:52px}.hero .tile{max-height:46dvh}#launch{gap:8px;padding:12px 24px}}
@media (prefers-reduced-motion:reduce){*{transition-duration:.01ms!important}.bar i{animation:none;translate:116.7%}.line .you{animation:none}}
.install{display:grid;justify-items:center;gap:20px;padding-top:10dvh;text-align:center}
.install img:first-child{width:min(76%,280px);height:auto}
.install h2{margin:0;font-size:1.25rem}
.install button{min-height:56px;min-width:200px;font-size:1.125rem}
.install ol{list-style:none;margin:0;padding:0;display:grid;gap:10px;width:100%;max-width:22rem}
.install li{display:flex;align-items:center;gap:16px;min-height:64px;padding:10px 16px;background:var(--up);border-radius:var(--r);text-align:left;font-weight:600}
.install .pic{width:32px;height:32px;flex:none;display:grid;place-items:center;color:var(--on)}
.install .pic svg{width:28px;height:28px;fill:currentColor}
.install .pic img{width:32px;height:32px;border-radius:8px}
.gate #logo{display:none}
#me{margin-left:auto;width:48px;padding:0;background:none;display:grid;place-items:center}
#me svg{width:24px;fill:currentColor}
.signin{display:grid;gap:28px;padding-top:12dvh;max-width:26rem;width:100%;margin:0 auto}
.signin .page,form.page{width:100%;max-width:none;margin:0}
.signin img{justify-self:center;width:min(76%,280px);height:auto}
input.code{font-size:1.75rem;letter-spacing:.3em;text-align:center;font-variant-numeric:tabular-nums;min-height:64px}
.who{margin:0;font-weight:600;overflow-wrap:anywhere}
.use{display:grid;gap:8px;width:100%;min-height:0;padding:16px;background:var(--up);border-radius:var(--r);text-align:left;font-weight:400;font-size:.875rem}
button.use{margin-top:20px}
.use .top,.use .under{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.use .top b{font-size:1rem}
.use .under{color:var(--soft);font-variant-numeric:tabular-nums}
.use .fill{display:block;height:10px;border-radius:5px;overflow:hidden;background:var(--bg);box-shadow:inset 0 0 0 1px var(--line)}
.use .fill i{display:block;height:100%;background:var(--on);border-radius:5px}
.use .fill i.low{background:var(--bad)}
@media (min-width:760px){button.use{margin:16px 6px 0;width:calc(100% - 12px)}}
.legal{font-size:.75rem;margin-top:24px}
.parts{max-width:34rem;margin:0 auto;display:grid;gap:36px;padding-top:8px}
.part{display:grid;gap:12px}
.part h2{margin:0;color:var(--soft);font-size:.9375rem;font-weight:600}
.card{display:grid;gap:16px;padding:16px;background:var(--up);border-radius:var(--r)}
.person{display:flex;align-items:center;gap:16px;min-height:56px}
.person .text{flex:1;min-width:0}
.person .text b{display:block;font-size:1.125rem;overflow-wrap:anywhere;line-height:1.3}
.person .text span{color:var(--soft);font-size:.875rem}
.face{flex:none;border-radius:8px;background:var(--up2);image-rendering:pixelated}
.face.blank{display:block;width:56px;height:56px;border:2px dashed var(--line);background:none}
.linking{display:grid;justify-items:center;gap:28px;max-width:24rem;margin:0 auto;padding-top:9dvh;text-align:center}
.linking img{width:min(60%,220px);height:auto}
.bigcode{margin:0;font-size:clamp(2rem,11vw,2.75rem);font-weight:800;letter-spacing:.14em;margin-right:-.14em;line-height:1.1;font-variant-numeric:tabular-nums;user-select:all;-webkit-user-select:all}
.bigcode:empty{display:none}
.linking .wait{display:grid;justify-items:center;gap:14px}
.state{margin:0;font-weight:600}
.aside{margin:0;color:var(--soft);font-size:.875rem;max-width:19rem;line-height:1.5}
.linking .plain{margin-top:-12px}
body.no-foot footer{display:none}
