@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700;900&display=swap');

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html,
body{
  width:100%;
  height:100%;
  overflow:hidden;
  background:#03040a;
  color:#fff;
  font-family:'Space Grotesk',sans-serif;
  touch-action:none;
}

body{
  display:flex;
  flex-direction:column;
}

.topbar{
  height:60px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
  background:rgba(0,0,0,.62);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.title{
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:2px;
  text-align:center;
}

.top-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.topbtn{
  border:none;
  background:#151c2f;
  color:#fff;
  padding:10px 13px;
  border-radius:14px;
  text-decoration:none;
  font-weight:800;
  cursor:pointer;
}

.hud{
  height:44px;
  display:flex;
  align-items:center;
  justify-content:space-around;
  background:#0b1020;
  border-bottom:1px solid rgba(255,255,255,.08);
  font-weight:900;
}

.game-wrap{
  flex:1;
  position:relative;
}

canvas{
  width:100%;
  height:100%;
  display:block;
  background:
    radial-gradient(circle at 50% 72%,rgba(70,80,180,.28),transparent 32%),
    radial-gradient(circle at 20% 18%,rgba(41,242,212,.18),transparent 24%),
    radial-gradient(circle at 82% 24%,rgba(255,60,155,.15),transparent 26%),
    linear-gradient(180deg,#02030a 0%,#071126 48%,#02030a 100%);
}

.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.58);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}

.overlay.show{
  display:flex;
}

.card{
  width:min(420px,100%);
  background:rgba(10,16,34,.84);
  border:1px solid rgba(255,255,255,.08);
  border-radius:26px;
  padding:24px;
  text-align:center;
  box-shadow:0 30px 80px rgba(0,0,0,.55);
}

.card h1{
  margin-bottom:14px;
  font-size:2rem;
  font-weight:900;
}

.card p{
  opacity:.82;
  line-height:1.5;
  margin-bottom:18px;
}

.controls{
  display:grid;
  gap:10px;
  margin-bottom:18px;
  font-size:.92rem;
}

.card button,
.menuBtn{
  width:100%;
  border:none;
  background:linear-gradient(135deg,#29f2d4,#7c5cff);
  color:#081018;
  padding:14px;
  border-radius:18px;
  font-weight:900;
  font-size:1rem;
  line-height:1.2;
  margin-top:12px;
  text-decoration:none;
  display:block;
  cursor:pointer;
}

.mobile-controls{
  position:fixed;
  left:0;
  right:0;
  bottom:12px;
  z-index:40;
  display:none;
  justify-content:center;
  gap:10px;
  pointer-events:none;
}

.mobile-controls button{
  width:58px;
  height:58px;
  border:none;
  border-radius:20px;
  background:rgba(21,28,47,.78);
  color:#fff;
  font-size:1.45rem;
  font-weight:900;
  box-shadow:0 12px 40px rgba(0,0,0,.35);
  pointer-events:auto;
}

@media (hover:none), (pointer:coarse){
  .mobile-controls{
    display:flex;
  }
}

@media (max-width:700px){
  .topbar{
    height:56px;
    padding:0 8px;
  }

  .title{
    font-size:.88rem;
    letter-spacing:1px;
  }

  .topbtn{
    padding:8px 9px;
    font-size:.75rem;
  }

  .hud{
    font-size:.82rem;
  }

  .mobile-controls button{
    width:54px;
    height:54px;
  }
}
