:root{
  --bg-0:#0b0e17;
  --bg-1:#121728;
  --bg-2:#1b2140;
  --line:#2e3660;
  --neon-green:#3dffa0;
  --neon-purple:#b586ff;
  --gold:#ffd23f;
  --red:#ff5d6c;
  --text:#eef1ff;
  --text-dim:#8892b8;
}

*{box-sizing:border-box; -webkit-tap-highlight-color:transparent; user-select:none;}
html,body{margin:0; padding:0; height:100%;}
body{
  background:
    radial-gradient(circle at 20% 0%, #1a2145 0%, transparent 55%),
    radial-gradient(circle at 90% 10%, #1a1035 0%, transparent 45%),
    var(--bg-0);
  color:var(--text);
  font-family:'Noto Sans KR', sans-serif;
  overflow-x:hidden;
  min-height:100vh;
}

#app{
  max-width:640px;
  margin:0 auto;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding-bottom:28px;
}

/* ---------- Topbar ---------- */
#topbar{
  padding:14px 16px 10px;
  position:sticky; top:0; z-index:20;
  background:linear-gradient(180deg, var(--bg-0) 75%, transparent);
}
.brand{
  display:flex; align-items:center; gap:8px;
  margin-bottom:8px;
}
.brand-icon{ font-size:20px; filter:drop-shadow(0 0 6px var(--gold)); }
.brand-title{
  font-family:'Press Start 2P', monospace;
  font-size:10.5px;
  letter-spacing:0.5px;
  color:var(--neon-green);
  text-shadow:0 0 8px rgba(61,255,160,0.5);
  flex:1;
}
.turn-chip{
  font-size:12px; font-weight:900;
  background:var(--bg-2); border:1px solid var(--line);
  border-radius:20px; padding:4px 12px;
  color:var(--gold);
}

.statbar{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:6px;
  margin-top:10px;
}
.stat-meter{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  font-size:9px; color:var(--text-dim);
}
.stat-ico{ font-size:13px; }
.stat-name{ font-size:9px; white-space:nowrap; }
.stat-track{
  width:100%; height:6px; border-radius:4px;
  background:var(--bg-1); border:1px solid var(--line);
  overflow:hidden;
}
.stat-fill{
  height:100%; width:50%;
  background:linear-gradient(90deg, var(--neon-purple), var(--neon-green));
  transition:width .5s ease;
}
.stat-fill.low{ background:linear-gradient(90deg, #7a2f3a, var(--red)); }
.stat-meter.pulse .stat-track{ animation:statpulse .6s ease; }
@keyframes statpulse{
  0%{ box-shadow:0 0 0 rgba(255,210,63,0); }
  40%{ box-shadow:0 0 10px rgba(255,210,63,0.8); }
  100%{ box-shadow:0 0 0 rgba(255,210,63,0); }
}

/* ---------- Office diorama ---------- */
#stage-root{ flex:1; padding:4px 16px 10px; display:flex; flex-direction:column; align-items:center; gap:14px; }
#office-wrap{ display:flex; flex-direction:column; align-items:center; gap:6px; width:100%; }
.office-canvas{
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  width:min(100%, 340px); height:auto;
  aspect-ratio:64/40;
  background:#0e1226;
  border:2px solid var(--line);
  border-radius:10px;
}
.office-caption{ font-size:11px; color:var(--text-dim); min-height:14px; text-align:center; }

/* ---------- Cards ---------- */
.card{
  width:100%; max-width:420px;
  background:var(--bg-1); border:2px solid var(--line);
  border-radius:14px; padding:20px;
  display:flex; flex-direction:column; gap:12px;
  animation:card-in .3s ease;
}
@keyframes card-in{ from{opacity:0; transform:translateY(10px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);} }
.card-kicker{
  font-size:10px; font-weight:900; letter-spacing:1px;
  color:var(--neon-purple); text-transform:uppercase;
}
.card-title{ font-size:17px; font-weight:900; margin:0; line-height:1.4; }
.card-body{ font-size:13px; color:var(--text); line-height:1.7; margin:0; white-space:pre-line; }

.pick-row{ display:flex; gap:14px; flex-wrap:wrap; justify-content:center; }
.pick-group{ display:flex; flex-direction:column; align-items:center; gap:8px; flex:1; min-width:150px; }
.pick-label{ font-size:11px; color:var(--text-dim); font-weight:700; }
.pick-options{ display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.pick-opt{
  padding:7px 10px;
  background:var(--bg-2); border:2px solid var(--line);
  border-radius:8px; font-size:12px; font-weight:700; cursor:pointer;
  transition:all .15s ease;
}
.pick-opt:hover{ border-color:var(--neon-purple); }
.pick-opt.selected{
  background:linear-gradient(135deg, var(--neon-purple), #7d4fe0);
  border-color:transparent; color:#fff;
  box-shadow:0 0 12px rgba(181,134,255,0.5);
}
.combo-hint{ font-size:12px; color:var(--text-dim); text-align:center; line-height:1.6; min-height:20px; }
.combo-hint.good{ color:var(--neon-green); }
.combo-hint.risky{ color:var(--gold); }

.choice-options{ display:flex; flex-direction:column; gap:8px; }
.choice-btn{
  display:flex; flex-direction:column; gap:3px;
  text-align:left;
  background:var(--bg-2); border:2px solid var(--line);
  border-radius:10px; padding:11px 14px;
  cursor:pointer; transition:all .15s ease;
  font-family:'Noto Sans KR', sans-serif; color:var(--text);
}
.choice-btn:hover{ border-color:var(--gold); transform:translateX(2px); }
.choice-btn:active{ transform:scale(0.98); }
.choice-label{ font-size:13.5px; font-weight:700; }
.choice-sub{ font-size:11px; color:var(--text-dim); }
.choice-hints{ font-size:12px; letter-spacing:2px; }

.delta-row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; font-size:12px; }
.delta-chip{
  background:var(--bg-2); border:1px solid var(--line); border-radius:8px;
  padding:4px 9px; font-weight:700;
}
.delta-chip.up{ color:var(--neon-green); border-color:var(--neon-green); }
.delta-chip.down{ color:var(--red); border-color:var(--red); }

.btn-primary{
  font-family:'Noto Sans KR', sans-serif;
  font-size:14px; font-weight:900;
  padding:12px 22px;
  border:none; border-radius:10px;
  background:linear-gradient(135deg, var(--neon-green), #1fd98a);
  color:#052014;
  cursor:pointer;
  box-shadow:0 4px 0 #14a86b, 0 0 16px rgba(61,255,160,0.4);
  transition:transform .1s ease;
  align-self:center;
}
.btn-primary:active{ transform:translateY(3px); box-shadow:0 1px 0 #14a86b; }
.btn-primary:disabled{
  background:var(--bg-2); color:var(--text-dim);
  box-shadow:none; cursor:not-allowed;
}

/* ---------- Ending ---------- */
.ending{ align-items:center; text-align:center; }
.ending .card-title{ font-size:19px; }
.ending-stats{
  display:grid; grid-template-columns:repeat(2,1fr); gap:6px;
  font-size:12px; color:var(--text-dim); width:100%;
}
.ending-stats b{ color:var(--text); }
.ending-debts{ font-size:12px; color:var(--gold); line-height:1.7; }

/* ---------- Toasts ---------- */
#toast-container{
  position:fixed; top:10px; left:50%; transform:translateX(-50%);
  z-index:100; display:flex; flex-direction:column; gap:6px;
  align-items:center; pointer-events:none; width:100%; max-width:420px; padding:0 12px;
}
.toast{
  background:var(--bg-2); border:2px solid var(--neon-green);
  color:var(--text); font-size:12px; font-weight:700;
  padding:8px 14px; border-radius:20px;
  box-shadow:0 4px 14px rgba(0,0,0,0.4);
  animation:toast-in .25s ease, toast-out .3s ease 2.8s forwards;
}
.toast.bad{ border-color:var(--red); }
@keyframes toast-in{ from{opacity:0; transform:translateY(-10px);} to{opacity:1; transform:translateY(0);} }
@keyframes toast-out{ to{opacity:0; transform:translateY(-6px);} }

.shake{ animation:shake .35s ease; }
@keyframes shake{
  0%,100%{ transform:translateX(0); }
  20%{ transform:translateX(-6px); }
  40%{ transform:translateX(6px); }
  60%{ transform:translateX(-4px); }
  80%{ transform:translateX(4px); }
}

@media (max-width:420px){
  .brand-title{ font-size:9px; }
  .card-title{ font-size:15.5px; }
  .stat-name{ display:none; }
}
