/* Reset & variables */
:root{
  --bg: #0b1220;
  --bg-soft: #101a33;
  --card: #121e3d;
  --muted: #9aa6bf;
  --text: #e6eefc;
  --brand: #4f46e5;
  --brand-2: #22c55e;
  --danger: #ef4444;
  --ring: rgba(79,70,229,.35);
  --radius: 18px;
  --shadow: 0 14px 30px 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, Helvetica, Arial;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1428 100%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.topbar{
  position:sticky; top:0; z-index:3;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(11,18,32,.85) 0%, rgba(11,18,32,0) 100%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}
.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:34px; height:34px; border-radius:10px;
  background: radial-gradient(60% 60% at 30% 30%, #5eead4 0%, #22c55e 35%, #4f46e5 100%);
  box-shadow: inset 0 0 10px rgba(255,255,255,.25), 0 6px 16px rgba(34,197,94,.25);
}
h1{ font-size: 18px; margin:0 }
.muted{ color: var(--muted); margin: 2px 0 0 0; font-size:12px }

.wrap{
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 24px);
}

.game-card{
  position: relative;
  background: linear-gradient(180deg, var(--card), #0f1a36);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(10px, 1.6vw, 16px);
}

canvas{
  display:block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #071023;
  border:1px solid rgba(255,255,255,.06);
  touch-action: none; /* allow custom swipe */
}

.hud{
  position:absolute; left:12px; top:12px; display:flex; gap:8px; flex-wrap:wrap;
}
.pill{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
}

.controls{
  display:flex; flex-direction: column; align-items:center; gap:8px;
  margin-top: 12px;
}
.controls .hrow{ display:flex; gap:8px; }
.btn{
  cursor:pointer;
  border:none;
  border-radius:12px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  color:white;
  padding: 14px 18px;
  font-weight:600;
  letter-spacing:.2px;
  min-width: 64px;
  min-height: 48px;
  box-shadow: 0 10px 20px rgba(79,70,229,.35);
}
.btn.ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow:none;
}
.btn.success{
  background: linear-gradient(180deg, #34d399, #22c55e);
  box-shadow: 0 10px 20px rgba(34,197,94,.35);
}

.panel{
  display:flex; gap:8px; justify-content: center;
  margin-top: 12px;
}

/* Overlay */
.overlay{
  position: fixed; inset: 0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.hidden{ display:none }
.overlay-card{
  width: min(560px, 92vw);
  background: linear-gradient(180deg, var(--card), #0f1a36);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align:center;
}
.overlay-card h2{ margin-top:0 }
.lead{ color: var(--text); font-size: 16px }
.contact{
  display:flex; flex-direction:column; gap:8px; align-items:center;
  margin: 14px 0;
}
.contact a{ color: #93c5fd; text-decoration: none; }
.overlay-actions{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
