:root{
  --bg:#071018;
  --panel:#13202b;
  --panel-2:#1a2a36;
  --line:#ffd54f;
  --text:#eef4fa;
  --muted:#bccbda;
  --danger:#c0392b;
  --accent:#ffb703;
  --border:#304555;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:radial-gradient(circle at top,#0b1823,#061018 72%);
  color:var(--text);
}

.app{
  max-width:1500px;
  margin:0 auto;
  padding:10px;
}

.topbar{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.logo{
  max-width:320px;
  width:100%;
  height:auto;
  display:block;
  background:#fff;
  border-radius:16px;
  padding:10px;
}

.stats{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.pill{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px 14px;
  font-size:15px;
}

.layout{
  display:grid;
  grid-template-columns:minmax(420px, 980px) 1fr;
  gap:14px;
  align-items:start;
}

#game{
  width:100%;
  height:auto;
  display:block;
  border-radius:20px;
  border:2px solid var(--border);
  background:#5ab870;
  box-shadow:0 12px 30px rgba(0,0,0,.35);
  touch-action:none;
}

.sidebar{
  display:grid;
  gap:12px;
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
}

.card h2{
  margin:0 0 10px;
  font-size:22px;
}

.card p{
  margin:8px 0;
}

.muted{
  color:var(--muted);
}

.legend{
  display:grid;
  gap:8px;
  margin-top:10px;
}

.dot{
  display:inline-block;
  width:14px;
  height:14px;
  border-radius:50%;
  margin-right:8px;
  vertical-align:middle;
}

.blue{ background:#2196f3; }
.green{ background:#2ecc71; }
.yellow{ background:#ffca28; }
.orange{ background:#ff8f00; }

.shop-item{
  background:var(--panel-2);
  border:1px solid #3a5164;
  border-radius:14px;
  padding:12px;
  margin-bottom:10px;
}

.shop-item h3{
  margin:0 0 8px;
  font-size:18px;
}

.meta{
  color:var(--muted);
  font-size:14px;
  margin:4px 0;
}

button{
  appearance:none;
  border:none;
  border-radius:14px;
  padding:12px 14px;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}

.buy-btn{
  width:100%;
  margin-top:8px;
  background:var(--accent);
  color:#231700;
}

.buy-btn[disabled]{
  background:#5e6a76;
  color:#dde5ec;
  cursor:not-allowed;
}

.danger{
  width:100%;
  background:var(--danger);
  color:#fff;
}

.controls{
  position:sticky;
  bottom:0;
  padding:10px 0 calc(10px + env(safe-area-inset-bottom));
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.controls-row{
  display:flex;
  gap:10px;
}

.ctrl{
  width:82px;
  height:62px;
  font-size:28px;
  background:#eef4f8;
  color:#0d1820;
  border:2px solid #c8d2da;
}

@media (max-width: 1200px){
  .layout{
    grid-template-columns:1fr;
  }

  .logo{
    max-width:260px;
  }
}
