:root{
  --bg:#0b1220;
  --card:#0f1b34;
  --card2:#122246;
  --text:#e8f0ff;
  --muted:#9fb3d6;
  --accent:#5eead4;
  --danger:#fb7185;
  --shadow:0 18px 40px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1200px 600px at 30% 0%, #1a2b57 0%, var(--bg) 55%, #070b14 100%);
  color:var(--text);
}
#app{max-width:1100px;margin:0 auto;padding:14px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 12px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);
  border-radius:16px;box-shadow:var(--shadow);
}
.brand{font-weight:900;letter-spacing:.5px}
.stats{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center}
.chip{
  font-size:12px;color:var(--muted);
  padding:6px 10px;border-radius:999px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);
}
.actions{display:flex;gap:8px}
.btn{
  cursor:pointer;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:8px 10px;border-radius:12px;
  font-weight:700;
}
.btn:hover{background:rgba(255,255,255,.10)}
.btn.primary{
  background:linear-gradient(135deg, rgba(94,234,212,.25), rgba(94,234,212,.12));
  border-color:rgba(94,234,212,.35);
}
.btn.ghost{background:transparent}
.btn.danger{border-color:rgba(251,113,133,.5);background:rgba(251,113,133,.12)}
.stage{position:relative;margin-top:14px}
canvas#game{
  width:100%;
  max-width:100%;
  display:block;
  background:linear-gradient(#58d6ff,#7ce7ff 45%, #8de6ff 45%, #65b7ff 100%);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  box-shadow:var(--shadow);
}
.overlay{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.45);
  border-radius:18px;
}
.hidden{display:none !important}
.card{
  width:min(520px,92vw);
  padding:18px 18px 14px;
  background:linear-gradient(180deg, rgba(15,27,52,.95), rgba(8,14,28,.95));
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:var(--shadow);
}
.card h2{margin:0 0 8px}
.card p{margin:0 0 14px;color:var(--muted)}
.row{display:flex;gap:10px;flex-wrap:wrap}
.fineprint{margin-top:12px;color:rgba(255,255,255,.7);font-size:12px;line-height:1.45}
.toast{
  position:absolute;left:50%;top:12px;transform:translateX(-50%);
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.12);
  padding:8px 12px;border-radius:999px;
  font-weight:800;font-size:12px;
}
.modal-back{
  position:fixed;inset:0;background:rgba(0,0,0,.55);
}
.modal{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(720px,92vw);
  z-index:50;
}
.modal-card{
  background:linear-gradient(180deg, rgba(15,27,52,.98), rgba(8,14,28,.98));
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;
  background:rgba(255,255,255,.04);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modal-title{font-weight:900}
.modal-body{padding:14px}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width:800px){.grid{grid-template-columns:1fr}}
.shop-item{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:12px;
}
.shop-item .name{font-weight:900;margin-bottom:6px}
.shop-item .desc{color:var(--muted);font-size:12px;margin-bottom:10px}
.shop-item .price{font-size:12px;margin-bottom:10px;color:rgba(255,255,255,.8)}
.shop-item .meta{margin-top:10px;color:rgba(255,255,255,.7);font-size:12px}
.note{margin-top:12px;color:rgba(255,255,255,.7);font-size:12px;line-height:1.45}
.switch{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:rgba(255,255,255,.85)}
.switch input{width:18px;height:18px}
.how{margin:0;padding-left:18px;color:rgba(255,255,255,.85);line-height:1.8}
.bigline{font-size:18px;font-weight:900;margin-bottom:10px}
.missions{display:flex;flex-direction:column;gap:10px}
.mission{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.mission .left{display:flex;flex-direction:column;gap:2px}
.mission .title{font-weight:900}
.mission .sub{font-size:12px;color:rgba(255,255,255,.7)}
.mission .right{display:flex;align-items:center;gap:10px}
.badge{font-size:12px;padding:4px 8px;border-radius:999px;background:rgba(94,234,212,.16);border:1px solid rgba(94,234,212,.30)}
.adbox{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;height:160px;
  background:rgba(255,255,255,.04);border:1px dashed rgba(255,255,255,.18);border-radius:14px}
.spinner{width:28px;height:28px;border-radius:999px;border:3px solid rgba(255,255,255,.25);border-top-color:rgba(94,234,212,.9);animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}


.sep{ border:0; height:1px; background:rgba(255,255,255,.12); margin:14px 0; }
.section-title{ font-weight:800; letter-spacing:.2px; margin:10px 0 6px; }
.section-title.small{ font-size:13px; opacity:.95; margin-top:14px; }
.subtle{ opacity:.75; font-size:12px; margin-bottom:10px; }
