/* Cloudstep — pastel sky/cloud theme, built on the plan33.io harness conventions. */

:root {
  --bg: #bfe3ff;
  --bg2: #eef7ff;
  --fg: #23324a;
  --muted: #55688a;
  --accent: #ff9ecf;
  --accent2: #ffd166;
  --scrim: rgba(30, 46, 74, 0.45);
  --panel: rgba(255, 255, 255, 0.92);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: linear-gradient(to bottom, var(--bg), var(--bg2));
}

/* ---------- corner chrome ---------- */
.chrome {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(8px + env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  z-index: 20;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(35, 50, 74, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--fg);
  font: 600 16px/1 var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.92); }
.icon-btn[aria-pressed="true"] { color: #d6408a; border-color: #d6408a; }

/* ---------- overlays: visibility driven purely by body state class ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  z-index: 30;
}

body.state-menu     .overlay-menu,
body.state-paused   .overlay-paused,
body.state-gameover .overlay-gameover { display: grid; }

.panel {
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid rgba(35, 50, 74, 0.10);
  background: var(--panel);
  text-align: center;
  animation: pop 180ms ease-out;
  box-shadow: 0 12px 32px rgba(35, 50, 74, 0.18);
}

@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }

.panel h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: 0.5px; color: #d6408a; }
.panel h2 { margin: 0 0 14px; font-size: 24px; }
.tagline  { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.score    { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.hi       { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.hint     { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.btn {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #3a0e26;
  font: 700 16px/1 var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(35, 50, 74, 0.24);
}
