
:root{
  --bg:#0b0f14;
  --panel:#121a24;
  --panel2:#0f1620;
  --text:#e8f0ff;
  --muted:#93a4bc;
  --accent:#7aa2ff;
  --danger:#ff5c7a;
  --ok:#54d38a;
  --border:#223044;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background: radial-gradient(1200px 700px at 20% 10%, #13233a 0%, var(--bg) 60%);
}
a{color:var(--accent); text-decoration:none}
.container{max-width:1100px; margin:0 auto; padding:24px}
.row{display:flex; gap:16px; flex-wrap:wrap}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}
.card.pad{padding:18px}
h1,h2,h3{margin:0 0 10px 0}
.muted{color:var(--muted)}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  gap:8px;
}
.btn:hover{border-color:#2d415e; background: rgba(255,255,255,.06)}
.btn.primary{border-color: rgba(122,162,255,.55); background: rgba(122,162,255,.12)}
.btn.danger{border-color: rgba(255,92,122,.55); background: rgba(255,92,122,.10)}
.btn:disabled{opacity:.55; cursor:not-allowed}
.input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:16px}
@media (max-width: 860px){ .grid2{grid-template-columns:1fr} }

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 18px;
}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(0,0,0,.22);
  color: var(--muted);
  font-family: var(--mono);
  font-size:12px;
}
.hr{height:1px; background: var(--border); margin:14px 0}
.kpi{display:flex; gap:14px; flex-wrap:wrap}
.kpi .box{padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:rgba(0,0,0,.18)}
.kpi .box b{display:block; font-size:18px; color:var(--text)}
.small{font-size:12px}
.notice{padding:10px 12px; border:1px solid rgba(122,162,255,.35); background: rgba(122,162,255,.08); border-radius:12px}
.error{padding:10px 12px; border:1px solid rgba(255,92,122,.35); background: rgba(255,92,122,.10); border-radius:12px}
.success{padding:10px 12px; border:1px solid rgba(84,211,138,.35); background: rgba(84,211,138,.10); border-radius:12px}

.modal{
  position:fixed; inset:0; display:none;
  background: rgba(0,0,0,.55);
  align-items:center; justify-content:center;
  padding:20px;
}
.modal.open{display:flex}
.modal .panel{
  width:min(980px, 100%);
  max-height: 86vh;
  overflow:auto;
  background: linear-gradient(180deg, rgba(18,26,36,.98), rgba(12,18,28,.98));
  border:1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal .panel .head{
  position:sticky; top:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background: rgba(10,14,20,.82);
  backdrop-filter: blur(6px);
}
.map{
  padding:14px;
}
.node{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,.18);
}
.node.locked{opacity:.55}
.node.done{border-color: rgba(84,211,138,.55); background: rgba(84,211,138,.06)}
.node.available{border-color: rgba(122,162,255,.6); background: rgba(122,162,255,.06)}
.node h4{margin:0 0 6px 0}
.node .meta{display:flex; gap:8px; flex-wrap:wrap}
.node .meta span{font-family:var(--mono); font-size:12px; color:var(--muted)}
.questlist{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 980px){ .questlist{grid-template-columns:1fr 1fr} }
@media (max-width: 640px){ .questlist{grid-template-columns:1fr} }

.gameStage{
  min-height: 360px;
  border:1px dashed rgba(147,164,188,.35);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0,0,0,.14);
}
.timer{
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}
