:root {
  --ink: #1AAADC;
  --ink-dark: #0E7E9E;
  --paper: #ffffff;
  --warm-gray: #7d8b91;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--paper); color: var(--ink);
  font-family: "Baloo 2", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overscroll-behavior: none;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
button { touch-action: manipulation; }
#app { position: fixed; inset: 0; overflow: hidden; background: var(--paper); }
#scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: pointer;
  z-index: 0;
}

.doodles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.doodle { position: absolute; opacity: .14; animation: floaty 5s ease-in-out infinite; }
.doodle.d1 { width: 44px; top: 20%; left: 9%; }
.doodle.d2 { width: 28px; top: 30%; right: 10%; animation-delay: -2s; }
.doodle.d3 { width: 80px; bottom: 26%; left: -12px; animation-delay: -3.5s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.hud-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 0;
  pointer-events: none;
}
.brand {
  font-weight: 800; letter-spacing: .3em; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); opacity: .85;
  padding-left: .3em;
}
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.hidden { display: none !important; }

.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 26px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  pointer-events: none;
}
.hud-bottom .btn { pointer-events: auto; }
.timer {
  font-size: 34px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-height: 34px;
}
.timer:empty { display: none; }
.actions { display: flex; gap: 10px; justify-content: center; }
.actions:empty { display: none; }
.btn {
  border: 3px solid var(--ink); cursor: pointer;
  border-radius: 18px 22px 16px 24px;
  padding: 11px 24px; font-size: 16px; font-weight: 800;
  font-family: inherit;
  min-height: 50px;
  box-shadow: 3px 4px 0 rgba(26,170,220,.25);
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 rgba(26,170,220,.25); }
.btn.ghost {
  background: #fff; color: var(--ink);
  border-width: 2px; box-shadow: none; opacity: .8;
  padding: 7px 18px; font-size: 14px; min-height: 40px;
}

#flash {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at 50% 42%, rgba(150,220,245,.8), rgba(26,170,220,.25) 45%, transparent 70%);
  opacity: 0;
}
#flash.go { animation: flashAnim .45s ease-out; }
@keyframes flashAnim { 0% { opacity: .9; } 100% { opacity: 0; } }

.toast {
  position: absolute; left: 50%; bottom: 30%; z-index: 4;
  transform: translateX(-50%);
  background: #fff; border: 3px solid var(--ink);
  color: var(--ink); font-weight: 800; font-size: 16px;
  padding: 10px 20px; border-radius: 18px 20px 16px 22px;
  pointer-events: none; white-space: nowrap;
  box-shadow: 3px 4px 0 rgba(26,170,220,.25);
  animation: toastUp 2s ease forwards;
}
@keyframes toastUp {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

@media (min-width: 700px) {
  .hud-bottom { max-width: 520px; margin: 0 auto; }
}
