*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#0d2a3f;font-family:Pretendard,-apple-system,system-ui,sans-serif;color:#10202c}
#scene{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}
button{font:inherit;cursor:pointer;border:0;border-radius:999px;padding:10px 14px;background:rgba(255,255,255,.88);color:#10202c;font-weight:600;font-size:14px;box-shadow:0 2px 10px rgba(0,0,0,.18);backdrop-filter:blur(8px)}
button.primary{background:#0f6b8f;color:#fff}
button.on{background:#10202c;color:#fff}

.boot{position:fixed;inset:0;z-index:30;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;
  background:radial-gradient(120% 80% at 50% 110%,#1f6f8f 0%,#0d2a3f 60%,#081a28 100%);color:#e8f4f8;transition:opacity .6s}
.boot.hide{opacity:0;pointer-events:none}
.boot .fin{width:84px;color:#9fd3e6;animation:bob 3s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-6px)}}
.boot h1{font-size:28px;margin:14px 0 4px;letter-spacing:-.02em}
.boot .sub{margin:0 0 22px;opacity:.75;font-size:14px}
#boot-msg{font-size:13px;opacity:.8;min-height:18px}
.boot .primary{margin-top:10px;padding:14px 28px;font-size:16px;background:#e8f4f8;color:#0d2a3f}
.boot .tiny{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));font-size:12px;opacity:.6;margin:0 20px}

#hud{position:fixed;top:0;left:0;right:0;z-index:10;display:flex;justify-content:space-between;align-items:flex-start;padding:max(12px,env(safe-area-inset-top)) 12px 0;pointer-events:none}
#hud>*{pointer-events:auto}
.brand{background:rgba(255,255,255,.88);backdrop-filter:blur(8px);border-radius:16px;padding:8px 14px;box-shadow:0 2px 10px rgba(0,0,0,.15);display:flex;flex-direction:column}
.brand b{font-size:15px}.brand span{font-size:12px;color:#33586b}
#b-info{width:40px;height:40px;padding:0;font-size:18px}

#dock{position:fixed;left:50%;transform:translateX(-50%);bottom:max(14px,env(safe-area-inset-bottom));z-index:10;display:flex;gap:8px;flex-wrap:nowrap}
#dock button{white-space:nowrap}
@media(max-width:420px){#dock button{padding:9px 11px;font-size:13px}}

#minimap{position:fixed;right:12px;top:calc(max(12px,env(safe-area-inset-top)) + 52px);z-index:9;width:132px;height:132px;border-radius:14px;box-shadow:0 2px 12px rgba(0,0,0,.25);background:#9cc8e0;cursor:crosshair}
@media(min-width:800px){#minimap{width:200px;height:200px}}

#joy{position:fixed;left:20px;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 64px);width:110px;height:110px;border-radius:50%;background:rgba(255,255,255,.25);border:2px solid rgba(255,255,255,.6);z-index:11;touch-action:none}
#joy .knob{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;background:rgba(255,255,255,.85)}

#labels{position:fixed;inset:0;pointer-events:none;z-index:5;overflow:hidden}
.lbl{position:absolute;transform:translate(-50%,-100%);white-space:nowrap;font-size:12px;font-weight:600;color:#fff;background:rgba(16,32,44,.72);padding:3px 8px;border-radius:8px;transition:opacity .2s}
.lbl.shark{background:#0f6b8f;font-size:13px}
.lbl::after{content:"";position:absolute;left:50%;bottom:-4px;margin-left:-4px;border:4px solid transparent;border-bottom:0;border-top-color:rgba(16,32,44,.72)}
.lbl.shark::after{border-top-color:#0f6b8f}

#toast{position:fixed;left:50%;top:40%;transform:translate(-50%,-50%);z-index:20;background:rgba(16,32,44,.85);color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;opacity:0;transition:opacity .3s;pointer-events:none;text-align:center;max-width:80vw}
#toast.show{opacity:1}

.sheet{position:fixed;z-index:25;right:12px;top:calc(max(12px,env(safe-area-inset-top)) + 52px);bottom:calc(max(14px,env(safe-area-inset-bottom)) + 56px);width:min(380px,calc(100vw - 24px));overflow:auto;background:rgba(255,255,255,.96);border-radius:18px;box-shadow:0 8px 30px rgba(0,0,0,.25);padding:16px 18px 20px;font-size:14px;line-height:1.55}
.sheet .close{position:absolute;right:10px;top:10px;width:32px;height:32px;padding:0;box-shadow:none;background:#eef3f6}
.tabs{display:flex;gap:6px;margin:0 40px 10px 0}
.tabs button{box-shadow:none;background:#eef3f6;padding:7px 12px;font-size:13px}
.tabs button.on{background:#10202c;color:#fff}
.sheet h2{font-size:19px;margin:6px 0 8px}.sheet h2 small{font-size:12px;color:#557;font-weight:500;margin-left:6px}
.sheet h3{font-size:15px;margin:16px 0 6px}
.facts{padding-left:0;list-style:none;margin:8px 0}.facts li{margin:6px 0}.facts b{display:inline-block;min-width:64px;color:#0f6b8f}
.tl{list-style:none;padding:0;margin:0;border-left:2px solid #cfe3ec}.tl li{position:relative;padding:3px 0 3px 14px}
.tl li::before{content:"";position:absolute;left:-6px;top:10px;width:10px;height:10px;border-radius:50%;background:#0f6b8f}
.tl time{display:inline-block;min-width:62px;font-weight:700;color:#10202c}
.note{font-size:12px;color:#5a6b75;background:#f3f7f9;border-radius:10px;padding:8px 10px}

#online{font-size:12px;color:#0b7a4b;font-weight:600}#online:empty{display:none}
.langsel{font:inherit;font-size:13px;border:0;border-radius:12px;padding:6px 8px;background:rgba(255,255,255,.9);box-shadow:0 2px 8px rgba(0,0,0,.15);max-width:110px}
.boot .langsel{margin-top:14px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin:10px 0 14px}
.kpis div{background:#eef6fa;border-radius:12px;padding:10px;display:flex;flex-direction:column;align-items:flex-start}
.kpis b{font-size:22px;color:#0f3d52}.kpis span{font-size:12px;color:#4a6b7b}
.primary.wide{width:100%;margin-bottom:10px}
ol.cc{list-style:none;padding:0;margin:6px 0 12px;display:flex;flex-direction:column;gap:4px}
ol.cc li{display:flex;justify-content:space-between;gap:8px;font-size:14px;padding:4px 2px;border-bottom:1px solid #e5eef2}
ol.cc li i{font-style:normal;color:#0f3d52;font-weight:600}
.cheer-pop{position:fixed;left:50%;bottom:120px;font-size:34px;pointer-events:none;animation:cheerUp 1.6s ease-out forwards;z-index:30}
@keyframes cheerUp{from{transform:translate(-50%,0);opacity:1}to{transform:translate(-50%,-160px);opacity:0}}
#hud .btns{display:flex;gap:6px;flex-wrap:nowrap;align-items:center;flex-shrink:0}
#hud .brand{min-width:0;flex:1 1 auto;margin-right:8px;max-width:60vw}
#hud .brand span{white-space:normal}
@media (max-width:480px){.langsel{max-width:78px;font-size:12px;padding:6px 4px}}
#status.live{color:#d0342c;font-weight:700}
.lbl.bang{background:#ffd23f;color:#3b1d00;font-size:15px;font-weight:900;padding:1px 7px;border-radius:10px}
.lbl.bang::after{border-top-color:#ffd23f}
.lbl.bang.pop{animation:bang .9s ease-out}
@keyframes bang{0%{scale:.3}35%{scale:1.25}60%{scale:1}100%{scale:1}}

/* 로딩: KTX 미니 여행 */
.trip{width:min(340px,86vw);margin-bottom:6px;filter:drop-shadow(0 6px 18px rgba(0,0,0,.25))}
.trip-svg{width:100%;height:auto;display:block;overflow:visible}
.tg-lbl{font-weight:600;font-size:9px;font-family:inherit;fill:#cfe6ef;opacity:.55;transition:opacity .3s,fill .3s}
.tg-st.on .tg-lbl{opacity:1;fill:#ffd166}
.tg-st circle{transition:fill .3s}
.tg-st.on circle{fill:#ffd166}
.tg-park-lbl{opacity:.8;font-size:8.5px}
.tg-park.arrived .tg-park-lbl{fill:#ffd166;opacity:1}
.tg-fin{transform-box:fill-box;transform-origin:50% 100%;animation:tgfin 2.4s ease-in-out infinite}
@keyframes tgfin{0%,100%{transform:translateX(-3px) scaleY(.75)}50%{transform:translateX(3px) scaleY(1.05)}}
.tg-waves path{animation:tgwave 3s ease-in-out infinite}
.tg-waves path:nth-child(2n){animation-delay:-1.5s}
@keyframes tgwave{50%{transform:translateX(3px)}}
#boot-msg.pop{animation:msgpop .35s ease-out}
@keyframes msgpop{from{transform:translateY(5px) scale(.97)}to{transform:none}}
#king{position:fixed;left:12px;top:calc(max(12px,env(safe-area-inset-top)) + 52px);z-index:11;display:flex;flex-direction:column;gap:6px;background:rgba(20,16,4,.78);padding:8px;border-radius:14px;border:1px solid #e7b93c;box-shadow:0 2px 12px rgba(0,0,0,.3)}
#king b{color:#ffd45a;text-align:center;font-size:18px}
#king button{background:#2b2410;color:#ffe9a8;border:1px solid #6b5520;border-radius:10px;padding:7px 10px;font-size:13px;white-space:nowrap}
#king button.on{background:#e7b93c;color:#2b2410}
[hidden] { display: none !important; }

#ver { position: fixed; left: 6px; bottom: 4px; font: 10px/1 system-ui, sans-serif; color: #fff; opacity: .45; pointer-events: none; z-index: 5; text-shadow: 0 1px 2px #000; }

/* 뛰기 체력 게이지: 버튼 아래쪽이 남은 체력만큼 차오른다 */
#b-run.gauge{position:relative;overflow:hidden}
#b-run.gauge::after{content:'';position:absolute;left:0;bottom:0;height:4px;width:calc(var(--st,1)*100%);background:var(--stc,#4cd17a);transition:width .2s}
#b-run.on{outline:2px solid #ffd54a}
#b-run.tired{opacity:.55}
#b-rec.on{background:#e53935;color:#fff}
@media(max-width:420px){#dock{gap:5px}#dock button{padding:9px 9px}}
#dock{max-width:96vw;flex-wrap:wrap;justify-content:center}
#b-rec.ready{background:#1f8f5a;color:#fff;animation:pulse 1s infinite alternate}
@keyframes pulse{to{transform:scale(1.08)}}
.boot-ver{margin-top:14px;font-size:12px;opacity:.6;letter-spacing:.05em}
