:root{
  --bg:#0b0d10;
  --panel:#11151b;
  --panel2:#0f1217;
  --txt:#e8edf5;
  --mut:#9aa6b2;
  --line:#223042;
  --pri:#7c5cff;
  --pri2:#2de2e6;
  --ok:#2ce6a2;
  --danger:#ff4d6d;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124,92,255,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 20%, rgba(45,226,230,.18), transparent 55%),
              var(--bg);
  color:var(--txt);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.hdr{
  position:sticky; top:0; z-index:50;
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
  background: linear-gradient(180deg, rgba(11,13,16,.92), rgba(11,13,16,.72));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(34,48,66,.65);
}

.brand{display:flex; gap:12px; align-items:center}
.sigil{
  width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(45,226,230,.75));
  color:#07080a;font-weight:900;
  box-shadow: 0 10px 30px rgba(124,92,255,.25);
}
.title .k{font-weight:900; letter-spacing:-.2px}
.title .s{font-size:12px;color:var(--mut); margin-top:2px}

.hdrBtns{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

.wrap{max-width:1100px;margin:0 auto;padding:16px 16px 40px}

.stage{
  position:relative;
  border:1px solid rgba(34,48,66,.75);
  border-radius:22px;
  overflow:hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(17,21,27,.7), rgba(15,18,23,.7));
}

.hud{
  position:absolute; inset:0 0 auto 0;
  display:flex; justify-content:space-between; gap:16px;
  padding:14px 14px 0 14px;
  pointer-events:none;
}
.hudLeft{display:flex; flex-direction:column; gap:10px}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  background: rgba(15,18,23,.65);
  border:1px solid rgba(34,48,66,.65);
  padding:8px 10px; border-radius:999px;
  font-size:12px; color:var(--mut);
  width:max-content;
}
.dot{
  width:8px;height:8px;border-radius:99px;background:var(--ok);
  box-shadow: 0 0 18px rgba(44,230,162,.8);
}
.meter{
  width:280px;
  background: rgba(15,18,23,.65);
  border:1px solid rgba(34,48,66,.65);
  border-radius:16px;
  padding:10px 12px;
}
.meterLabel{font-size:12px;color:var(--mut); margin-bottom:8px}
.bar{height:10px;border-radius:999px;background:rgba(34,48,66,.6); overflow:hidden}
.fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--pri), var(--pri2));
}
.meterVal{margin-top:8px;font-size:12px;color:var(--mut)}

.kbd{
  width:240px;
  background: rgba(15,18,23,.65);
  border:1px solid rgba(34,48,66,.65);
  border-radius:16px;
  padding:10px 12px;
}
.kbdTitle{font-size:12px;color:var(--mut); margin-bottom:8px}
.kbdRow{display:flex;justify-content:space-between; align-items:center; font-size:12px; padding:4px 0}
.key{
  font-weight:800;
  border:1px solid rgba(34,48,66,.8);
  background: rgba(17,21,27,.65);
  border-radius:8px;
  padding:2px 8px;
  color:var(--txt);
}
.desc{color:var(--mut)}

.window{
  height:520px;
  position:relative;
  overflow:hidden;
  border-radius:22px;
}

.sky{
  position:absolute; inset:0;
  background:
    radial-gradient(900px 500px at 35% 0%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(700px 450px at 80% 10%, rgba(45,226,230,.18), transparent 55%),
    linear-gradient(180deg, rgba(8,10,13,1), rgba(11,13,16,1));
}

.mist{
  position:absolute; inset:-30px;
  background: radial-gradient(closest-side at 30% 20%, rgba(255,255,255,.08), transparent 65%),
              radial-gradient(closest-side at 70% 40%, rgba(255,255,255,.06), transparent 60%);
  filter: blur(14px);
  opacity:.9;
  transform: translateZ(0);
}

.layer{
  position:absolute; left:-20vw; right:-20vw;
  height:70%;
  bottom:18%;
  background-repeat: repeat-x;
  background-size: 420px 220px;
  opacity:.9;
  transform: translateZ(0);
}
.layer.far{
  bottom:28%;
  height:55%;
  opacity:.55;
  filter: blur(1px);
  background-image:
    linear-gradient(transparent 60%, rgba(0,0,0,.0) 60%),
    radial-gradient(60px 40px at 60px 160px, rgba(255,255,255,.08), transparent 70%),
    radial-gradient(80px 45px at 220px 150px, rgba(255,255,255,.06), transparent 70%),
    linear-gradient(180deg, transparent 30%, rgba(124,92,255,.12) 100%);
}
.layer.mid{
  bottom:22%;
  height:62%;
  opacity:.75;
  background-image:
    radial-gradient(120px 60px at 80px 170px, rgba(255,255,255,.10), transparent 70%),
    radial-gradient(140px 70px at 240px 165px, rgba(255,255,255,.09), transparent 72%),
    linear-gradient(180deg, transparent 25%, rgba(45,226,230,.10) 100%);
}
.layer.near{
  bottom:18%;
  height:65%;
  opacity:1;
  background-image:
    radial-gradient(220px 90px at 100px 190px, rgba(255,255,255,.12), transparent 70%),
    radial-gradient(240px 95px at 280px 190px, rgba(255,255,255,.10), transparent 72%),
    linear-gradient(180deg, transparent 15%, rgba(0,0,0,.25) 100%);
  filter: saturate(1.1);
}

.rail{
  position:absolute; left:0; right:0; bottom:0;
  height:28%;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.45));
}
.railLine{
  position:absolute; left:-10%; right:-10%;
  height:6px; border-radius:999px;
  background: rgba(200,220,255,.18);
  bottom:42%;
  transform: skewX(-10deg);
  box-shadow: 0 0 20px rgba(124,92,255,.10);
}
.railLine:nth-child(2){bottom:28%; opacity:.75}

.train{
  position:absolute;
  left:14%;
  bottom:14%;
  width:330px;
  height:140px;
  transform: translateZ(0);
}
.chimney{
  position:absolute;
  left:210px; top:-40px;
  width:120px; height:120px;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,.26), transparent 60%),
              radial-gradient(circle at 60% 60%, rgba(255,255,255,.18), transparent 65%),
              radial-gradient(circle at 50% 50%, rgba(124,92,255,.18), transparent 70%);
  filter: blur(0px);
  opacity:.0;
}
.body{
  position:absolute; left:0; bottom:0;
  width:100%; height:100%;
  background: rgba(17,21,27,.65);
  border:1px solid rgba(34,48,66,.85);
  border-radius:22px;
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.nose{
  position:absolute; left:0; top:0; bottom:0;
  width:28%;
  background: linear-gradient(135deg, rgba(124,92,255,.65), rgba(45,226,230,.25));
  border-right:1px solid rgba(34,48,66,.85);
  border-radius:22px 0 0 22px;
}
.cab{
  position:absolute; right:18px; top:16px;
  width:110px; height:46px;
  border:1px solid rgba(34,48,66,.85);
  border-radius:14px;
  background: rgba(15,18,23,.75);
}
.wheel{
  position:absolute; bottom:-14px;
  width:44px;height:44px;border-radius:999px;
  border:2px solid rgba(200,220,255,.25);
  background: rgba(11,13,16,.8);
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
}
.w1{left:64px}
.w2{left:152px}
.w3{left:240px}

.proclaim{
  position:absolute;
  left:18px; bottom:16px;
  max-width:72%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(34,48,66,.7);
  background: rgba(15,18,23,.55);
  backdrop-filter: blur(10px);
}
.proclaim .p1{font-weight:900; font-size:18px; letter-spacing:-.2px}
.proclaim .p2{margin-top:6px; color:var(--mut); font-size:13px; line-height:1.45}

.panel{
  position:absolute;
  left:16px; right:16px; bottom:16px;
  display:flex; gap:10px; flex-wrap:wrap;
  justify-content:flex-end;
}

.btn{
  appearance:none; border:1px solid rgba(34,48,66,.8);
  background: rgba(17,21,27,.65);
  color:var(--txt);
  padding:10px 12px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(45,226,230,.75));
  color:#07080a;
  border-color: rgba(255,255,255,.0);
}
.btn.ghost{
  background: rgba(15,18,23,.35);
}

.cards{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
  margin-top:12px;
}
.card{
  grid-column: span 4;
  border:1px solid rgba(34,48,66,.75);
  border-radius:18px;
  background: rgba(15,18,23,.55);
  box-shadow: var(--shadow);
  padding:12px 14px;
}
.cardTitle{font-weight:900; margin-bottom:8px}
.cardBody{color:var(--mut); font-size:13px; line-height:1.6}
.cardBody.small{font-size:12.5px}
.toggle{display:flex; gap:10px; align-items:center; margin:8px 0}
.toggle input{transform: scale(1.1)}
.genBox{
  border:1px dashed rgba(34,48,66,.85);
  border-radius:14px;
  padding:10px 12px;
  color:var(--txt);
  background: rgba(17,21,27,.35);
  min-height:66px;
}
.genBtns{display:flex; gap:10px; margin-top:10px}

.arrive{
  position:absolute; inset:0;
  background: rgba(0,0,0,.45);
  display:grid; place-items:center;
}
.arriveBox{
  width:min(540px, calc(100% - 24px));
  border-radius:22px;
  border:1px solid rgba(34,48,66,.85);
  background: rgba(15,18,23,.78);
  box-shadow: var(--shadow);
  padding:16px 16px 14px;
}
.arriveTitle{font-weight:1000; font-size:22px; letter-spacing:-.3px}
.arriveSub{color:var(--mut); margin-top:8px; line-height:1.55}
.arriveBtns{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
.arriveFoot{margin-top:10px; color:var(--mut); font-size:12.5px}

.dlg{
  border:1px solid rgba(34,48,66,.85);
  border-radius:18px;
  background: rgba(15,18,23,.92);
  color:var(--txt);
  padding:0;
  width:min(680px, calc(100% - 24px));
}
.dlgTop{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 14px;
  border-bottom:1px solid rgba(34,48,66,.7);
}
.dlgTitle{font-weight:1000}
.dlgBody{padding:12px 14px; color:var(--mut); line-height:1.7}
.dlgBody .small{font-size:12.5px}
.dlg::backdrop{background: rgba(0,0,0,.55)}

@media (max-width: 900px){
  .kbd{display:none}
  .meter{width:220px}
  .card{grid-column: span 12}
  .proclaim{max-width: calc(100% - 36px)}
  .window{height:520px}
}
@media (max-width: 520px){
  .meter{width:190px}
  .title .s{display:none}
  .btn{padding:10px 10px}
  .train{left:10%; width:290px}
}

/* ===== Route UI (정차역) ===== */
.routeBox{
  width: min(560px, 80vw);
  background: rgba(15,18,23,.65);
  border:1px solid rgba(34,48,66,.65);
  border-radius:16px;
  padding:10px 12px;
}
.routeTop{
  display:flex; justify-content:space-between; gap:12px; align-items:baseline;
}
.routeTitle{font-size:12px;color:var(--mut); font-weight:900}
.routeNow{font-size:12px;color:var(--txt); opacity:.95}
.routeLine{
  margin-top:10px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.stop{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(34,48,66,.8);
  background: rgba(17,21,27,.55);
  color: var(--mut);
}
.stop.done{color: rgba(44,230,162,.95); border-color: rgba(44,230,162,.35)}
.stop.now{
  color:#07080a;
  border-color: rgba(255,255,255,0);
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(45,226,230,.75));
  font-weight:900;
}
.stop.next{color: var(--txt); border-color: rgba(124,92,255,.45)}

/* ===== Stop Toast (모달 대신 작은 알림) ===== */
.toast{
  position:absolute;
  right:18px;
  bottom:86px;
  max-width:min(520px, calc(100% - 36px));
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(34,48,66,.8);
  background: rgba(15,18,23,.72);
  backdrop-filter: blur(10px);
  color: var(--txt);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font-weight:900;
  letter-spacing:-.2px;
  transform: translateY(6px);
  opacity:0;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show{
  opacity:1;
  transform: translateY(0px);
}
.toast .sub{
  margin-top:6px;
  font-weight:600;
  color: var(--mut);
  font-size:12.5px;
}

