/* Cute cheat toggle button */
.cheat-toggle{
  position: fixed;
  top: 150px; /* placed under the radar and its label */
  right: 16px; /* align with sound toggle margin */
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, #ffe4e6, #fbcfe8);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15), 0 0 0 2px rgba(255,255,255,0.6) inset;
  color: #7c2d12;
  font-size: 18px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  z-index: 20;
}
.cheat-toggle:hover{ transform: translateY(-1px); }
.cheat-toggle.active{
  box-shadow: 0 6px 14px rgba(16,185,129,0.3), 0 0 0 2px rgba(16,185,129,0.5) inset;
  animation: cheatPulse 1.2s ease-in-out infinite;
}
@keyframes cheatPulse{
  0%{ filter: drop-shadow(0 0 0 rgba(16,185,129,0.0)); }
  50%{ filter: drop-shadow(0 0 8px rgba(16,185,129,0.6)); }
  100%{ filter: drop-shadow(0 0 0 rgba(16,185,129,0.0)); }
}
html, body {
  height: 100%;
  margin: 0;
  background: #0c1118;
  color: #1d2a2f;
  font-family: 'LongToday', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden;
  user-select: none;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(160deg, #b8fff3 0%, #fff7e6 42%, #ffe6cf 100%);
}

.hud {
  position: fixed;
  left: 0; right: 0; top: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  color: #093a36;
  font-weight: 600;
  pointer-events: none;
}
.hud .chip {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  border-radius: 999px;
  padding: 6px 12px;
}

.overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(255,255,255,.55), rgba(255,255,255,.25)), rgba(255,255,255,.35);
  backdrop-filter: blur(10px);
  text-align: center;
  color: #143e3a;
  transition: opacity .3s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  width: min(680px, 92vw);
  background: #ffffffd9;
  border: 1px solid #e5f2f0;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.15);
}
.panel h1 { margin: 0 0 8px; font-weight: 700; }
.panel p { margin: 6px 0 18px; color: #305a56; }
.overlay .panel .credits{ color:#083a30; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  pointer-events: auto;
  appearance: none; border: 1px solid #0f766e; background: #159e91; color: #fff;
  border-radius: 12px; font-weight: 700; letter-spacing: .2px;
  padding: 10px 16px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.12); background: #128d82; }
.btn.secondary { background: #fbbf24; border-color: #f59e0b; color:#1c1917; }
.btn.ghost { background: #fff; border-color: #e2e8f0; color:#0f172a; }

.toggles { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; background: #fff; border:1px solid #e2e8f0; border-radius: 999px; padding: 6px 10px; }
.toggle input { accent-color: #10b981; }

.cta-ribbon {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px;
}
.cta-ribbon a { text-decoration: none; color: #0f2e2a; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 9px 10px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.cta-ribbon a:hover { box-shadow: 0 12px 28px rgba(0,0,0,.08); transform: translateY(-1px); }

.mobile-controls { position: fixed; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; pointer-events: none; }
.mobile-controls .btn { padding: 12px 18px; border-radius: 16px; font-size: 16px; pointer-events: auto; }

/* Toast message for stage transitions */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20; background: rgba(255,255,255,.9); border:1px solid #e2e8f0; color:#0f2e2a; border-radius: 12px; padding: 8px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.12); transition: opacity .25s ease; }
.toast.hidden { opacity: 0; pointer-events:none; }

/* Sound toggle button */
.sound-toggle{
  position:fixed;
  right:16px;
  bottom:84px;
  width:44px;
  height:44px;
  border-radius:50%;
  border:none;
  background:rgba(0,0,0,.55);
  color:#fff;
  font-size:20px;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
  cursor:pointer;
  z-index:30;
}
.sound-toggle:hover{ background:rgba(0,0,0,.7); }
.sound-toggle.muted{ background:rgba(30,30,30,.7); color:#bbb; }

@media (max-width: 640px) {
  .panel h1 { font-size: 24px; }
}
