:root{
  --bg0:#070A12;
  --bg1:#0B1022;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.08);
  --txt:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --line:rgba(255,255,255,.12);

  --good:#28d17c;
  --bad:#ff4d6d;
  --warn:#ffd166;
  --accent:#6aa7ff;

  --r:18px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --shadow2: 0 10px 30px rgba(0,0,0,.35);
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--txt);
  background: radial-gradient(1100px 700px at 20% -10%, rgba(106,167,255,.18), transparent 60%),
              radial-gradient(900px 600px at 110% 20%, rgba(40,209,124,.12), transparent 60%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

.bg{
  position:fixed; inset:0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.05), transparent 35%),
                    radial-gradient(circle at 80% 70%, rgba(255,255,255,.04), transparent 40%);
  filter: blur(.2px);
  pointer-events:none;
  opacity:.9;
}

.topbar{
  position:sticky; top:0;
  z-index:10;
  backdrop-filter: blur(14px);
  background: rgba(7,10,18,.55);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:44px; height:44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(106,167,255,.9), rgba(40,209,124,.9));
  box-shadow: 0 10px 30px rgba(106,167,255,.22);
}
.title{ font-weight:800; letter-spacing:.2px; }
.subtitle{ color:var(--muted); font-size:13px; }
.good{ color:var(--good); font-weight:800; }

.controls{ display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
.control{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); }
.control input[type="range"]{ width:160px; }
.control input, .control select{
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--txt);
  outline: none;
}
.control.small{ flex-direction:row; align-items:center; gap:8px; }
.control.small select{ padding:8px 10px; border-radius:10px; }

.pill{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--txt);
  font-weight:700;
  width:38px;
}

.btn{
  border:none;
  border-radius: 14px;
  padding: 11px 14px;
  background: rgba(255,255,255,.08);
  color: var(--txt);
  cursor:pointer;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
  user-select:none;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); }
.btn:active{ transform: translateY(0px) scale(.99); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; box-shadow:none; }
.btn.primary{
  background: linear-gradient(135deg, rgba(106,167,255,.9), rgba(40,209,124,.8));
  color: #061022;
  font-weight:900;
}
.btn.ghost{ background: transparent; border:1px solid var(--line); box-shadow:none; }
.btn.small{ padding: 9px 10px; border-radius:12px; font-size:12px; }

.layout{
  max-width: 1200px;
  margin: 18px auto;
  padding: 0 16px 30px;
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 16px;
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .control.small{ justify-content:space-between; width:100%; }
}

.gameCard,.sideCard{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.hud{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  border-bottom:1px solid var(--line);
}
@media (max-width: 540px){
  .hud{ grid-template-columns: repeat(2, 1fr); }
}
.stat{
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.statLabel{ color:var(--muted); font-size:12px; }
.statValue{ font-size:18px; font-weight:900; margin-top:4px; }

.arenaWrap{ padding: 16px; }
.arena{
  position:relative;
  height: 420px;
  border-radius: 18px;
  border:1px solid var(--line);
  background: radial-gradient(900px 400px at 50% 0%, rgba(106,167,255,.10), transparent 55%),
              rgba(255,255,255,.03);
  overflow:hidden;
}
@media (max-width: 540px){
  .arena{ height: 360px; }
}

.target{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  border:none;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--txt);
  font-weight: 900;
  letter-spacing:.2px;
  cursor:pointer;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  will-change: transform;
}
.target:hover{ filter: brightness(1.05); }
.target:active{ transform: translate(-50%,-50%) scale(.985); }
.target.green{
  background: rgba(40,209,124,.22);
  border-color: rgba(40,209,124,.55);
  box-shadow: 0 22px 70px rgba(40,209,124,.14);
}
.target.red{
  background: rgba(255,77,109,.20);
  border-color: rgba(255,77,109,.55);
  box-shadow: 0 22px 70px rgba(255,77,109,.10);
}

#targetText{ display:inline-block; padding: 10px 14px; }

.toast{
  position:absolute;
  left:50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--txt);
  font-weight: 700;
  opacity:0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events:none;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(-2px); }

.actions{
  display:flex;
  gap:10px;
  padding: 0 16px 16px;
}

.tips{
  display:grid;
  gap:8px;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 13px;
}
.tip{ display:flex; gap:10px; align-items:center; }
.dot{
  width:10px; height:10px;
  border-radius:999px;
  background: rgba(106,167,255,.9);
  box-shadow: 0 0 0 6px rgba(106,167,255,.10);
}

.sideHeader{
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.sideTitle{ font-weight:900; font-size:16px; }
.sideSub{ color:var(--muted); font-size:12px; margin-top:2px; }

.tabs{ display:flex; gap:6px; }
.tab{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--txt);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
}
.tab.active{
  background: rgba(106,167,255,.16);
  border-color: rgba(106,167,255,.40);
}

.filters{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.lb{
  list-style:none;
  margin:0;
  padding: 6px 10px 14px;
  display:grid;
  gap: 8px;
}
.lb li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.lb .left{ display:flex; gap:10px; align-items:center; min-width:0; }
.rank{
  width:26px; height:26px;
  border-radius: 10px;
  display:grid; place-items:center;
  font-weight: 900;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  flex: 0 0 auto;
}
.name{
  font-weight: 900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 220px;
}
.meta{ color:var(--muted); font-size:12px; }
.score{
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.lbFootnote{
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 12px;
}

.footer{
  max-width:1200px;
  margin: 0 auto 22px;
  padding: 0 16px;
  color: var(--muted);
  font-size:12px;
}