:root {
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.64);
  --accent: #7c4dff;
  --accent2: #22c55e;
  --border: rgba(255, 255, 255, 0.10);
  --border2: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 20% 10%, rgba(124, 77, 255, 0.25), transparent 55%),
              radial-gradient(1200px 800px at 80% 10%, rgba(34, 197, 94, 0.18), transparent 55%),
              var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hdr h1 {
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.sub {
  margin: 0 0 18px 0;
  color: var(--muted);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.logo{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(124,77,255,0.85));
  box-shadow: 0 10px 28px rgba(124,77,255,0.25);
}
.brandName{
  font-weight: 800;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.88);
}
.nav{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.nav a{
  color: rgba(255,255,255,0.78);
  text-decoration:none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.nav a:hover{
  border-color: var(--border2);
  background: rgba(255,255,255,0.06);
}

.hero{
  padding: 18px 18px 2px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(900px 420px at 20% 20%, rgba(124,77,255,0.25), transparent 60%),
    radial-gradient(900px 420px at 80% 20%, rgba(34,197,94,0.18), transparent 60%),
    rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after{
  content:"";
  position:absolute;
  inset:-20%;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(2px 2px at 30% 70%, rgba(255,255,255,.30), transparent 60%),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,.20), transparent 60%);
  opacity: .65;
  transform: translateY(0);
  animation: drift 14s linear infinite;
}
.hero::after{
  opacity: .35;
  animation-duration: 22s;
  animation-direction: reverse;
}
@keyframes drift{
  from{ transform: translateY(-2%); }
  to{ transform: translateY(2%); }
}

.chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin: 10px 0 14px;
}
.chip{
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.14);
  padding: 6px 10px;
  border-radius: 999px;
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stat {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 110px;
}
.label { color: var(--muted); font-size: 12px; }
.value { font-size: 22px; font-weight: 750; margin-top: 2px; }

.btn {
  margin-left: auto;
  border: 1px solid rgba(124, 77, 255, 0.55);
  background: rgba(124, 77, 255, 0.18);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 650;
}
.btn:hover { background: rgba(124, 77, 255, 0.26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .7; cursor: not-allowed; }
.btnGhost{
  margin-left: 0;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.btnGhost:hover{ background: rgba(255,255,255,0.06); }

.arena {
  position: relative;
  height: 420px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px 22px;
  text-align: center;
  color: var(--muted);
}

.hintBox{
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.22);
}
.hintTitle{
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.9);
}
.hintText{
  line-height: 1.55;
  margin: 6px 0;
}
.muted2{ color: rgba(255,255,255,0.55); }

.ft { margin-top: 12px; }
.muted { color: var(--muted); font-size: 13px; }

canvas#c{
  width: 100%;
  height: 100%;
  display: block;
}

.mobileControls{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display:none;
  gap: 10px;
  justify-content: space-between;
  pointer-events:none;
}
.mBtn{
  pointer-events:auto;
  width: 64px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.88);
  font-size: 18px;
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
}
.mBtn:active{
  transform: translateY(1px);
  background: rgba(124,77,255,0.14);
  border-color: rgba(124,77,255,0.35);
}
#mFire{
  flex: 1 1 auto;
  max-width: 220px;
}

@media (pointer: coarse){
  .mobileControls{ display:flex; }
}


