/* Lantern Golems. Shares the look of the other Golem games: dark green panels, italic yellow type, round buttons. */
:root{
  --bg:#0b1410; --panel:#12201a; --panel2:#182b22; --line:#2a4436;
  --text:#eef5f0; --muted:#8fa89a; --accent:#ffd23f; --accent2:#3ee08f; --danger:#ff5a5f;
  --fs:1; --safe-b:env(safe-area-inset-bottom,0px); --safe-l:env(safe-area-inset-left,0px); --safe-r:env(safe-area-inset-right,0px); --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:var(--bg);color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;overflow:hidden;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:none;overscroll-behavior:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
.h{font-weight:900;font-style:italic;text-transform:uppercase;letter-spacing:.02em}
.hidden{display:none!important}
#stage{position:fixed;inset:0;display:block}
:focus{outline:none} :focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* ---------- text box ---------- */
#tbox{position:fixed;left:calc(10px + var(--safe-l));right:calc(10px + var(--safe-r));bottom:calc(52px + var(--safe-b));max-width:980px;margin:0 auto;
  min-height:calc(132px * var(--fs));padding:calc(20px * var(--fs)) 22px 18px;border-radius:16px;
  background:linear-gradient(180deg,rgba(14,26,20,.9),rgba(8,14,11,.94));border:1px solid #ffffff22;box-shadow:0 10px 30px #000a,inset 0 1px 0 #ffffff14;
  cursor:pointer;transition:opacity .2s}
#tbox:before{content:"";position:absolute;left:18px;right:18px;top:0;height:2px;background:linear-gradient(90deg,transparent,var(--accent),transparent);opacity:.55}
#tname{position:absolute;left:18px;top:-17px;padding:5px 16px 6px;border-radius:999px;background:#0b1410;border:2px solid var(--nc,#eef5f0);color:var(--nc,#eef5f0);
  font-weight:900;font-style:italic;text-transform:uppercase;font-size:calc(14px * var(--fs));letter-spacing:.05em;box-shadow:0 4px 12px #0008}
#ttext{font-size:calc(18px * var(--fs));line-height:1.5;font-weight:500;color:var(--text);text-wrap:pretty}
#ttext .ghost{color:transparent}
#ttext b.q{color:var(--accent);font-style:italic;font-weight:800}
#tbox.narr #ttext{color:#dfe8e2}
#tbox.think #ttext{color:#cfe0ff}
#tnext{position:absolute;right:16px;bottom:10px;color:var(--accent);font-size:13px;animation:bob 1s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(3px)}}

/* ---------- quick bar ---------- */
#qbar{position:fixed;left:0;right:0;bottom:calc(6px + var(--safe-b));display:flex;justify-content:center;gap:4px;padding:0 8px}
#qbar button{min-width:52px;height:40px;border-radius:12px;background:rgba(8,14,11,.72);border:1px solid #ffffff1a;font-size:15px;line-height:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#dfe8e2}
#qbar button span{font-size:8.5px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
#qbar button.on{background:var(--accent);color:#1a1400;border-color:var(--accent)} #qbar button.on span{color:#5a4a00}
#qbar button:hover{border-color:#ffffff44}
body.hideui #tbox,body.hideui #qbar,body.hideui #choices{opacity:0;pointer-events:none}
body.hideui #tbox{pointer-events:auto}

/* ---------- choices ---------- */
#choices{position:fixed;left:0;right:0;top:calc(10px + var(--safe-t));bottom:calc(200px * var(--fs) + var(--safe-b));display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:0 16px;pointer-events:none}
.opt{pointer-events:auto;width:min(560px,100%);text-align:left;padding:13px 16px 13px 48px;border-radius:14px;position:relative;
  background:linear-gradient(180deg,rgba(24,43,34,.96),rgba(14,26,20,.96));border:1px solid var(--line);box-shadow:0 6px 18px #0009;
  font-size:calc(16px * var(--fs));font-weight:700;line-height:1.35;animation:pop .25s ease-out both}
.opt em{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:13px;font-weight:900;background:#ffffff14;color:var(--accent)}
.opt:not(.lock):hover,.opt:focus-visible{border-color:var(--accent);background:linear-gradient(180deg,#2a3a18,#1a2a12)}
.opt:active{transform:scale(.98)}
.opt.lock{opacity:.5;cursor:default;font-weight:600}
.opt.lock em{background:none}
.opt small{display:block;font-size:11px;color:var(--muted);font-weight:700;margin-top:3px;letter-spacing:.02em}
.opt:nth-child(2){animation-delay:.04s}.opt:nth-child(3){animation-delay:.08s}.opt:nth-child(4){animation-delay:.12s}.opt:nth-child(5){animation-delay:.16s}
@keyframes pop{from{opacity:0;transform:translateY(8px)}}

/* ---------- chapter and ending cards ---------- */
#card{position:fixed;inset:0;display:grid;place-items:center;background:radial-gradient(80% 60% at 50% 50%,#0b1410cc,#000e);animation:fade .5s both;cursor:pointer;padding:20px}
#card.out{animation:fadeout .4s both}
@keyframes fade{from{opacity:0}} @keyframes fadeout{to{opacity:0}}
.ci{text-align:center;max-width:520px}
.ci small{display:block;color:var(--accent);font-weight:900;letter-spacing:.3em;text-transform:uppercase;font-size:12px;margin-bottom:6px}
.ci .h{font-size:clamp(30px,8vw,54px);line-height:1;text-shadow:0 0 30px #ffd23f55}
.ci p{color:var(--muted);margin-top:14px;font-size:14px;line-height:1.5}
.ci.end .row{margin-top:20px}
.ci:after{content:"";display:block;width:60px;height:2px;margin:16px auto 0;background:var(--accent);opacity:.6}

/* ---------- title ---------- */
#title{position:fixed;inset:0;display:flex;overflow:auto;touch-action:pan-y;padding:calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b))}
.tw{margin:auto;width:min(420px,100%);display:flex;flex-direction:column;gap:18px}
.logo{text-align:center;filter:drop-shadow(0 6px 18px #000c)}
.logo .t1,.logo .t2{font-size:clamp(44px,13vw,72px);line-height:.88}
.logo .t2{color:var(--accent);text-shadow:0 0 34px #ffd23f66}
.logo .sub{color:#dfe8e2;font-size:11px;letter-spacing:.42em;margin-top:10px;font-weight:800}
.tm{display:flex;flex-direction:column;gap:8px}
.tg{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.foot{text-align:center;color:#c9d6ce;font-size:10.5px;font-weight:700;letter-spacing:.04em;opacity:.75}
body.land .tw{width:min(760px,100%);flex-direction:row;align-items:center;gap:28px} body.land .logo{flex:1} body.land .tm{flex:1} body.land .foot{display:none}

/* ---------- buttons ---------- */
.btn{display:block;background:rgba(24,43,34,.92);border:1px solid var(--line);border-radius:12px;padding:12px 8px;text-align:center;font-weight:900;font-style:italic;text-transform:uppercase;font-size:14px;letter-spacing:.02em;box-shadow:0 4px 12px #0006}
.btn small{display:block;font-size:9.5px;letter-spacing:.1em;color:var(--accent);font-style:normal;margin-top:3px;text-transform:none;font-weight:800}
.btn.go{background:linear-gradient(180deg,#ffe066,#f0b400);color:#241900;border:0;font-size:17px;box-shadow:0 8px 20px #f0b40044}
.btn.go small{color:#5a4a00}
.btn.sel{background:var(--accent);color:#1a1400;border-color:var(--accent)}
.btn.danger{background:#3a1416;border-color:#7a2a2e;color:#ffb0b2}
.btn.sm{padding:8px 12px;font-size:18px;font-style:normal}
.btn:hover{border-color:#ffffff44} .btn:active{transform:scale(.98)}
.btn.dis,.slot.dis{opacity:.4;pointer-events:none}
.row{display:flex;gap:8px;justify-content:center;margin-top:12px} .row .btn{flex:1;max-width:220px}

/* ---------- panels ---------- */
#panel,#modal{position:fixed;inset:0;display:grid;place-items:center;background:#000a;padding:calc(10px + var(--safe-t)) 10px calc(10px + var(--safe-b));animation:fade .2s both}
#modal{z-index:5;background:#000c}
.pw{width:min(560px,100%);max-height:100%;display:flex;flex-direction:column;background:linear-gradient(180deg,#12201a,#0b1410);border:1px solid var(--line);border-radius:18px;box-shadow:0 20px 50px #000c;overflow:hidden}
.pw.wide{width:min(860px,100%)}
.ph{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid var(--line)}
.ph .h{font-size:22px;color:var(--accent)}
.x{width:36px;height:36px;border-radius:50%;background:#ffffff10;font-size:15px}
.pb{padding:12px 16px 16px;overflow:auto;touch-action:pan-y;-webkit-user-select:text;user-select:text}
.lbl{font-size:11px;font-weight:900;color:var(--muted);letter-spacing:.14em;margin:14px 0 8px;text-transform:uppercase}
.lbl:first-child{margin-top:2px}
.hint{font-size:12px;color:var(--muted);margin-top:10px;line-height:1.45}
.menu{display:grid;grid-template-columns:1fr 1fr;gap:8px} .menu .go{grid-column:1/-1}
.mb{width:min(420px,100%);background:linear-gradient(180deg,#12201a,#0b1410);border:1px solid var(--line);border-radius:18px;padding:18px;text-align:center;box-shadow:0 20px 50px #000c}
.mb p{font-size:15px;line-height:1.45}
.mb .h{font-size:24px;color:var(--accent)}
.namebox{display:flex;gap:8px;margin-top:12px}
.namebox input{flex:1;min-width:0;font:inherit;font-size:22px;font-weight:900;font-style:italic;text-align:center;padding:10px;border-radius:12px;border:2px solid var(--accent);background:#0b1410;color:var(--text);-webkit-user-select:text;user-select:text}

/* save slots */
.slots{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px}
.slot{display:flex;gap:10px;align-items:center;text-align:left;padding:6px;border-radius:12px;background:var(--panel2);border:1px solid var(--line);min-height:72px}
.slot:hover{border-color:var(--accent)}
.slot img,.slot .ni{width:96px;height:54px;border-radius:8px;object-fit:cover;flex:0 0 96px;background:#0b1410}
.slot div{min-width:0} .slot b{display:block;font-size:13px;font-style:italic;text-transform:uppercase}
.slot span{display:block;font-size:11px;color:var(--accent);font-weight:800}
.slot span.q{color:var(--muted);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.slot small{font-size:10px;color:var(--muted)}
.slot.empty b{color:var(--muted)}

/* log */
.log{display:flex;flex-direction:column;gap:10px}
.lr{position:relative;padding-right:40px;font-size:calc(15px * var(--fs));line-height:1.45}
.lr b{display:block;color:var(--nc);font-size:11px;font-style:italic;text-transform:uppercase;letter-spacing:.06em}
.lr.th span{font-style:italic;color:#cfe0ff}
.lr.ch span{color:var(--accent);font-weight:800}
.rb{position:absolute;right:0;top:0;width:32px;height:32px;border-radius:50%;background:#ffffff10;color:var(--muted)}
.rb:hover{color:var(--accent)}

/* journal */
.cast{display:flex;flex-direction:column;gap:8px}
.cc{display:flex;gap:12px;background:var(--panel2);border:1px solid var(--line);border-radius:12px;padding:8px}
.cc canvas{width:72px;height:72px;border-radius:10px;flex:0 0 72px}
.cc b{font-style:italic;text-transform:uppercase;font-size:14px}
.cc small{display:block;font-size:10.5px;color:var(--muted);font-weight:800;letter-spacing:.05em}
.cc p{font-size:12.5px;line-height:1.4;margin-top:4px;color:#d4e0d8}
.lamps{display:flex;gap:4px;margin-top:6px} .lamps i{width:12px;height:16px;border-radius:3px 3px 5px 5px;background:#ffffff14;border:1px solid #ffffff22}
.lamps i.on{background:radial-gradient(circle at 50% 60%,#fff4c0,#ffd23f 50%,#c08a10);border-color:#ffd23f;box-shadow:0 0 8px #ffd23f88}
.clue{font-size:13px;line-height:1.45;margin-bottom:6px;color:#e8f0d0}

/* endings and chapters */
.ends{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.ec{display:flex;gap:10px;background:var(--panel2);border:1px solid var(--line);border-radius:12px;padding:6px;align-items:center}
.ec canvas{width:110px;height:62px;border-radius:8px;flex:0 0 110px}
.ec.lock canvas{filter:grayscale(1) brightness(.4)}
.ec small{font-size:10px;color:var(--muted);font-weight:900;letter-spacing:.12em;text-transform:uppercase}
.ec b{display:block;font-style:italic;text-transform:uppercase;font-size:13.5px;color:var(--accent)}
.ec.lock b{color:var(--muted)}
.ec p{font-size:11.5px;color:var(--muted);line-height:1.35;margin-top:2px}
.chs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.chb small{color:var(--accent)}

/* settings */
.set{display:block;margin:4px 0 12px}
.set span{display:flex;justify-content:space-between;font-size:13px;font-weight:800;margin-bottom:4px} .set b{color:var(--accent)}
.set input{width:100%;accent-color:var(--accent);height:28px;touch-action:pan-x}
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.tog{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:10px 4px;border-bottom:1px solid #ffffff10;font-weight:800;font-size:13.5px}
.tog small{display:block;font-weight:600;color:var(--muted);font-size:11.5px;margin-top:2px}
.tog i{flex:0 0 42px;height:24px;border-radius:12px;background:#ffffff1a;position:relative;transition:background .15s}
.tog i:after{content:"";position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:#dfe8e2;transition:left .15s}
.tog.on i{background:var(--accent2)} .tog.on i:after{left:21px}
.keys p{font-size:12px;color:var(--muted);line-height:1.5} .keys b{color:var(--text)}

#toast{position:fixed;left:50%;top:calc(14px + var(--safe-t));transform:translateX(-50%);background:#0b1410ee;border:1px solid var(--accent);color:var(--text);padding:9px 16px;border-radius:999px;font-size:13px;font-weight:800;z-index:9;box-shadow:0 8px 20px #000a;max-width:90vw;text-align:center}

/* ---------- phones ---------- */
body.port #qbar button.wide{display:none}
body.port #qbar button{min-width:0;flex:1;max-width:64px}
body.port #tbox{min-height:calc(150px * var(--fs));padding:22px 16px 18px}
body.port #ttext{font-size:calc(17px * var(--fs))}
body.land #tbox{bottom:calc(6px + var(--safe-b));right:calc(78px + var(--safe-r));min-height:calc(96px * var(--fs));padding:16px 18px 12px;max-width:none}
body.land #ttext{font-size:calc(15.5px * var(--fs));line-height:1.42}
body.land #qbar{left:auto;right:calc(6px + var(--safe-r));top:calc(6px + var(--safe-t));bottom:calc(6px + var(--safe-b));flex-direction:column;justify-content:flex-end;padding:0;gap:3px}
body.land #qbar button{min-width:66px;height:auto;flex:0 1 34px;max-height:40px} body.land #qbar button.wide{display:none}
body.land #choices{bottom:calc(110px * var(--fs));right:78px}
body.land .opt{padding:9px 14px 9px 44px;font-size:calc(14.5px * var(--fs))}
body.land .pw{max-height:100%}
@media (min-width:900px) and (min-height:600px){
  #tbox{bottom:calc(60px + var(--safe-b));min-height:calc(150px * var(--fs));padding:26px 30px 22px}
  #ttext{font-size:calc(20px * var(--fs))}
  #tname{font-size:calc(16px * var(--fs))}
  #qbar button{min-width:64px;height:44px}
  #choices{bottom:calc(240px * var(--fs))}
  .opt{font-size:calc(17px * var(--fs))}
}

/* ---------- cloud saves line on the title ---------- */
.cloud{display:flex;align-items:center;gap:10px;background:rgba(8,14,11,.82);border:1px solid var(--line);border-radius:12px;padding:8px 8px 8px 12px;font-size:12px;line-height:1.35;color:#dfe8e2}
.cloud span{flex:1;min-width:0} .cloud b{color:var(--accent)}
.cloud .btn{flex:0 0 auto;padding:8px 12px;font-size:12px;text-decoration:none;color:inherit}
