:root { 
  --header-h: 56px; 
  --bg-start: #d7f6d2; 
  --bg-end: #ecf7c8; 
  --accent: #6bb86f; 
  --accent2: #a5d67e; 
  --text: #274b2f; 
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  height: 100dvh;
  width: 100vw;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans SC", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: fixed; top:0; left:0; right:0; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  background: rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: saturate(120%) blur(10px);
}
.brand { font-weight: 700; letter-spacing: .5px; }
.score { font-weight: 600; }
.actions button {
  background: var(--accent2); border: none; color: #1e3c27;
  border-radius: 999px; padding: 6px 12px; margin-left: 8px;
  font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.actions button:active { transform: translateY(1px); }

.game-wrap { position: absolute; inset: var(--header-h) 0 0 0; }
#game {
  width: 100vw; height: calc(100dvh - var(--header-h));
  display: block; touch-action: none; cursor: crosshair;
}

.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(240, 250, 236, 0.6);
  backdrop-filter: blur(6px);
}
.overlay.hide { display: none; }
.panel {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px; padding: 16px;
  width: min(420px, 92vw); text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.panel h1, .panel h2 { margin: 6px 0 8px; }
.panel p { margin: 4px 0; }
.panel button {
  background: var(--accent); color: #fff; border: none;
  border-radius: 12px; padding: 10px 16px; font-size: 16px; margin-top: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.panel button:active { transform: translateY(1px); }