:root{
  --bg1:#07102a;
  --bg2:#1b0f3a;
  --bg3:#0a2a2d;

  --fg:#ffffff;
  --muted:rgba(255,255,255,.78);

  --panel: rgba(255,255,255,.10);
  --panel2: rgba(255,255,255,.16);
  --bd: rgba(255,255,255,.18);

  --accent: rgba(255,220,140,1);
  --accent2: rgba(120,220,255,1);
  --accent3: rgba(255,120,220,1);

  --shadow: 0 18px 45px rgba(0,0,0,.35);
  --r: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }

body{
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow:hidden;
  color: var(--fg);
  background:
    radial-gradient(1000px 600px at 15% 15%, rgba(255,120,220,.25), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(120,220,255,.24), transparent 60%),
    radial-gradient(900px 700px at 60% 85%, rgba(255,220,140,.22), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 45%, var(--bg3));
}

#app{
  height:100vh;
  height:100dvh;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--bd);
  background:
    linear-gradient(90deg, rgba(255,120,220,.12), rgba(120,220,255,.12), rgba(255,220,140,.10));
  backdrop-filter: blur(6px);
}

.brand{ min-width: 240px; }
.title{
  font-weight:900;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:8px;
}
.title::before{
  content:"🎈";
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.25));
}
.sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn{
  border:1px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.08);
  color: var(--fg);
  padding:9px 11px;
  border-radius: 14px;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(1px) scale(.99); }

.btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  box-shadow:none;
}

.btn.primary{
  border-color: rgba(255,220,140,.65);
  background: rgba(255,220,140,.18);
}

.stage{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  display:flex;
}

#game{
  width:100%;
  height:100%;
  display:block;
  touch-action:none;
  filter: saturate(1.12) contrast(1.04);
}

.hud{
  position:absolute;
  left:10px;
  top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  z-index: 5;
  pointer-events:none;
}

.hudBox{
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding:8px 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events:none;
}

.hudBox.hint{
  max-width: 380px;
  color: rgba(255,255,255,.80);
}

.footer{
  padding:8px 12px;
  border-top:1px solid var(--bd);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}

.muted{ color: var(--muted); }

.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.62);
  z-index: 20;
}

.overlay.hidden{ display:none; }

.panel{
  width: min(580px, 92vw);
  background:
    radial-gradient(900px 500px at 20% 15%, rgba(255,120,220,.22), transparent 60%),
    radial-gradient(800px 600px at 85% 20%, rgba(120,220,255,.18), transparent 60%),
    rgba(10,14,28,.92);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
}

.big{
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
}
.small{
  font-size: 13px;
  color: rgba(255,255,255,.82);
  margin-bottom: 14px;
}

.legend{
  font-size: 13px;
  color: rgba(255,255,255,.88);
  border:1px dashed rgba(255,255,255,.22);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.35;
}

.fireBtn{
  position:absolute;
  right: 14px;
  bottom: 14px;
  z-index: 12;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: var(--fg);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 18px;
  opacity: .92;
  box-shadow: 0 16px 35px rgba(0,0,0,.25);
}

.fireBtn:disabled{ opacity:.35; box-shadow:none; }

.hidden{ display:none !important; }

@media (max-width: 900px){
  .btn{ padding:10px 12px; border-radius: 16px; }
  .hudBox{ font-size: 14px; }
  .brand{ min-width: 190px; }
}
