:root {
  --bg: #7ec8ff;
  --ground: #d2b48c;
  --pipe: #3ea33e;
  --pipe-dark: #2c7a2c;
  --ui: #0f172a;
  --ui-ghost: #0f172a99;
  --accent: #ffd166;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(#8fd3ff, var(--bg));
  color: var(--ui);
  display: grid;
  place-items: center;
}
.wrap {
  width: min(92vw, 520px);
  aspect-ratio: 3/4;              /* keeps canvas nicely sized on phones & desktop */
  position: relative;
}
canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  border-radius: 16px;
  box-shadow: 0 20px 45px #0000001a, 0 8px 18px #0000001a;
  background: var(--bg);
}
.hud {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  pointer-events: none; /* let touches go to canvas */
  padding: 12px;
}
.topbar {
  display: flex; justify-content: space-between; align-items: start;
  gap: 8px; font-weight: 700; text-shadow: 0 2px 0 #ffffff99;
}
.score { font-size: 18px; }
.best { font-size: 14px; opacity: .9; }
.footer { text-align: center; font-size: 12px; opacity: .7; margin-top: 8px; }

.floating {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.panel {
  pointer-events: auto;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
  border: 1px solid #0000000f;
  border-radius: 14px;
  padding: 18px 20px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 10px 30px #0000001a;
}
.title { font-size: 28px; margin: 0 0 10px; }
.muted { color: var(--ui-ghost); margin: 0 0 12px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
button {
  pointer-events: auto;
  appearance: none; border: 0;
  background: var(--ui);
  color: white; padding: 10px 14px; border-radius: 10px;
  font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px #0000002a;
}
button.secondary { background: #334155; }
kbd {
  background: #e2e8f0; border-radius: 6px; padding: 2px 6px; font-weight: 700;
  box-shadow: inset 0 -2px 0 #cbd5e1;
}