* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden; background: #5ec8ff;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }

#hud {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; right: 64px;
  display: flex; justify-content: space-between; pointer-events: none; z-index: 5;
}
.pill {
  background: rgba(255,255,255,0.88); color: #2b2d6e; font-weight: 900; font-size: 24px;
  padding: 6px 16px; border-radius: 999px; box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 8px; min-width: 64px; justify-content: center;
}
.coin-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6a8 0 20%, #ffd21f 21% 60%, #e8a400 61%);
  border: 2px solid #c98a00; display: inline-block;
}
.icon-btn {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 6;
  width: 44px; height: 44px; border-radius: 50%; border: none; font-size: 20px;
  background: rgba(255,255,255,0.88); box-shadow: 0 4px 0 rgba(0,0,0,0.15); cursor: pointer;
}

.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 10; padding: 20px; background: rgba(40, 60, 140, 0.25);
}
.panel {
  background: #ffffff; border-radius: 28px; padding: 26px 24px 22px; width: min(360px, 100%);
  text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,0.18), 0 20px 40px rgba(0,0,0,0.2);
  animation: pop 0.35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.logo { display: flex; flex-direction: column; line-height: 0.95; font-size: 64px; font-weight: 900; letter-spacing: 1px; }
.logo span:first-child { color: #ff5a8a; text-shadow: 0 5px 0 #c2305f; }
.logo span:last-child  { color: #ffb400; text-shadow: 0 5px 0 #c97f00; transform: rotate(-3deg); }
.tag { color: #4a4f8c; margin: 14px 0 18px; font-size: 17px; font-weight: 700; }

.big-btn {
  display: block; width: 100%; border: none; cursor: pointer;
  font: inherit; font-size: 30px; font-weight: 900; color: #fff;
  padding: 14px 0; border-radius: 20px; background: #31c95a;
  box-shadow: 0 7px 0 #1f8f3c; transition: transform 0.08s, box-shadow 0.08s;
}
.big-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #1f8f3c; }

.howto { margin-top: 18px; color: #3b3f73; font-size: 15px; display: grid; gap: 4px; }
.howto b { color: #ff5a8a; }
.howto .desk { color: #8a8db8; font-size: 13px; margin-top: 4px; }
.best { margin-top: 12px; color: #8a6d00; font-weight: 800; min-height: 1em; }

.oops { font-size: 48px; font-weight: 900; color: #ff5a8a; text-shadow: 0 4px 0 #c2305f; }
.final-score { font-size: 64px; font-weight: 900; color: #2b2d6e; margin: 6px 0; }
.stats { color: #4a4f8c; font-weight: 700; display: grid; gap: 2px; margin-bottom: 4px; }
.stats span { color: #2b2d6e; font-weight: 900; }
#over .big-btn { margin-top: 14px; }
