:root{
  --bg:#070a12;
  --fg:#eaf0ff;
  --muted:rgba(234,240,255,.62);
  --card: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);
  --accent:#7ef3ff;
  --bad:#ff5a5a;
}
*{box-sizing:border-box; -webkit-tap-highlight-color: transparent;}
html,body{height:100%}
body{margin:0; font-family:Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif; background:var(--bg); color:var(--fg)}

.top{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--stroke); background:rgba(0,0,0,.35); position:sticky; top:0; z-index:5}
.logo{font-weight:800; letter-spacing:-.4px}
.muted{color:var(--muted); font-size:13px; margin-top:2px}
.top__actions{display:flex; gap:10px; flex-wrap:wrap}
.btn{padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.18); background:rgba(126,243,255,.12); color:var(--fg); font-weight:700; cursor:pointer}
.btn--ghost{background:rgba(255,255,255,.06)}

.wrap{display:grid; grid-template-columns: 1fr 1fr; gap:14px; padding:14px; max-width:1100px; margin:0 auto}
.left,.right{display:flex; flex-direction:column; gap:14px}
.card{border:1px solid var(--stroke); background:var(--card); border-radius:16px; padding:12px}
.card__title{font-weight:800; margin-bottom:10px}

.viewport{border:1px solid rgba(255,255,255,.10); border-radius:14px; overflow:hidden; background:radial-gradient(1100px 450px at 60% 40%, rgba(126,243,255,.10), rgba(0,0,0,0));}
#scene{width:100%; height:320px; display:block; touch-action: manipulation;}

.stats{display:flex; flex-direction:column; gap:10px}
.stat{border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:10px; background:rgba(0,0,0,.18); cursor:pointer}
.stat__top{display:flex; justify-content:space-between; align-items:center; gap:10px}
.stat__name{font-weight:800}
.stat__val{color:rgba(234,240,255,.75); font-size:13px}
.bar{height:10px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden; margin-top:8px}
.bar > div{height:100%; background:linear-gradient(90deg, rgba(126,243,255,.92), rgba(126,243,255,.45)); width:0%}
.substats{margin-top:10px; display:none; gap:8px; flex-direction:column}
.stat.open .substats{display:flex}
.sub{display:flex; justify-content:space-between; font-size:13px; color:rgba(234,240,255,.78)}
.sub b{color:rgba(234,240,255,.95)}

.today{font-size:13px; color:rgba(234,240,255,.78); line-height:1.45}
.log{display:flex; flex-direction:column; gap:8px; max-height:320px; overflow:auto}
.item{border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:10px; background:rgba(0,0,0,.18)}
.item__t{font-weight:700}
.item__m{color:var(--muted); font-size:12px; margin-top:4px}
.small{font-size:12px; line-height:1.35}
.link{color:var(--accent)}
.link:visited{color:var(--accent)}

.modal{position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(0,0,0,.55); backdrop-filter: blur(6px); z-index:10}
.modal.hidden{display:none}
.modal__card{max-width:720px; width:100%; border:1px solid var(--stroke); border-radius:18px; background:rgba(0,0,0,.55); padding:16px}
.modal__title{font-weight:900; font-size:18px; margin-bottom:12px}
.grid{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-bottom:10px}
.field__label{color:var(--muted); font-size:12px; margin-bottom:6px}
.select,.input{width:100%; padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.14); background:rgba(0,0,0,.2); color:var(--fg)}
.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px}

@media (max-width: 900px){
  .wrap{grid-template-columns: 1fr}
  #scene{height:300px}
  .grid{grid-template-columns: 1fr}
}
