/* Merge Tap — mobile-web spec styling.
   Portrait, touch-only, safe-area aware, no page scroll/zoom/select. */

:root {
  --bg: #0e1116;
  --bg-2: #161b22;
  --fg: #e6edf3;
  --muted: #8b949e;
  --accent: #7c5cff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;            /* spec §1: no scroll */
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* spec §2: game surface must not behave like a scrollable page */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;              /* spec §1: dynamic viewport height, not 100vh */
  width: 100%;
  /* spec §1: safe-area insets so UI clears notch + home indicator */
  padding:
    max(8px, var(--safe-top))
    max(8px, var(--safe-right))
    max(8px, var(--safe-bottom))
    max(8px, var(--safe-left));
  background: radial-gradient(120% 80% at 50% 0%, #1b2230 0%, var(--bg) 60%);
}

/* HUD */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 48px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.stat .label {
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.stat > span:not(.label) {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}
.stat.next > span:not(.label) { color: var(--accent); }

/* Play field */
#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Overlay panels */
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: blur(2px);
}
.panel[hidden] { display: none; }

.panel h1 { font-size: 34px; margin: 0; letter-spacing: 0.02em; }
.panel h2 { font-size: 28px; margin: 0; }
.tagline { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0; }
.result { font-size: 18px; margin: 0; }
.result strong { font-size: 22px; color: var(--accent); }
.result.sub { color: var(--muted); }
.result.sub strong { color: var(--fg); }

/* Big thumb-friendly CTA (spec §2/§4: >=44px, here 56px) */
.cta {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-height: 56px;
  min-width: 200px;
  padding: 0 28px;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #0e1116;
  background: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.06s ease, filter 0.12s ease;
}
.cta:active { transform: scale(0.96); filter: brightness(1.08); }
