@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(fonts/lilitaone-latin.woff2) format("woff2");
}
html, body {
  margin: 0;
  height: 100%;
  background: #b9477d;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game {
  display: block;
  touch-action: none;
  cursor: pointer;
  outline: none;
}
#ui {
  --u: 0.5px;               /* CSS pixels per design unit (720 wide), set by game.js */
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: "Lilita One", "Arial Rounded MT Bold", Arial, sans-serif;
  color: #6a2446;
  pointer-events: none;
}
#ui > * { pointer-events: auto; }

.round {
  position: absolute;
  width: calc(78 * var(--u));
  height: calc(78 * var(--u));
  border-radius: 50%;
  border: calc(5 * var(--u)) solid #fff;
  background: radial-gradient(circle at 35% 30%, #ffd1ea, #d8307a 70%);
  box-shadow: 0 calc(5 * var(--u)) 0 rgba(90, 20, 50, 0.35);
  cursor: pointer;
  padding: 0;
}
.round:active { transform: translateY(calc(3 * var(--u))); box-shadow: none; }
.pause { left: calc(12 * var(--u)); top: calc(8 * var(--u)); }
.aihint { right: calc(33 * var(--u)); bottom: calc((0.69 * var(--hud, 190) - 29) * var(--u)); }
.aihint.busy { animation: aithink 0.8s ease-in-out infinite alternate; }
@keyframes aithink { to { filter: brightness(1.35); transform: scale(1.08); } }
.bulb::before {
  content: ""; position: absolute; left: 31%; top: 18%; width: 38%; height: 38%; background: #fff; border-radius: 50%;
}
.bulb::after {
  content: ""; position: absolute; left: 41%; top: 54%; width: 18%; height: 22%; background: #fff;
  border-radius: 0 0 calc(4 * var(--u)) calc(4 * var(--u)); box-shadow: inset 0 calc(3 * var(--u)) 0 #f6a6cd;
}
.bars2::before, .bars2::after {
  content: ""; position: absolute; top: 28%; width: 16%; height: 44%; background: #fff; border-radius: 2px;
}
.bars2::before { left: 30%; }
.bars2::after { right: 30%; }
.maptop { position: absolute; right: calc(16 * var(--u)); top: calc(16 * var(--u)); display: flex; gap: calc(14 * var(--u)); }
.maptop .round { position: relative; }
.cup { position: absolute; left: 28%; top: 22%; width: 44%; height: 36%; background: #ffd52e; border-radius: 0 0 50% 50%; box-shadow: inset 0 calc(-4 * var(--u)) 0 #d99500; }
.cup::after { content: ""; position: absolute; left: 30%; top: 100%; width: 40%; height: 60%; background: #ffd52e; border-bottom: calc(6 * var(--u)) solid #d99500; }
.note { position: absolute; left: 30%; top: 24%; width: 40%; height: 52%; }
.note::before { content: "\266B"; position: absolute; inset: 0; color: #fff; font-size: calc(40 * var(--u)); line-height: 1; text-align: center; }
.snd.off .note::after { content: ""; position: absolute; left: -10%; top: 45%; width: 120%; height: calc(6 * var(--u)); background: #fff; transform: rotate(-45deg); border-radius: 3px; }

.veil {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60, 10, 40, 0.45);
  animation: fadein 0.2s ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin { from { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.05); } to { transform: scale(1); opacity: 1; } }
.popup {
  position: relative;
  width: calc(560 * var(--u));
  padding: calc(34 * var(--u)) calc(34 * var(--u)) calc(30 * var(--u));
  border-radius: calc(34 * var(--u));
  background: linear-gradient(#fff9ee, #f6e3cf);
  border: calc(8 * var(--u)) solid #fff;
  box-shadow: 0 0 0 calc(4 * var(--u)) #e0578f, 0 calc(14 * var(--u)) 0 rgba(60, 10, 40, 0.3);
  text-align: center;
  animation: popin 0.35s ease-out;
}
.popup h2 {
  margin: 0 0 calc(10 * var(--u));
  font-weight: 400;
  font-size: calc(56 * var(--u));
  color: #e0357f;
  text-shadow: 0 calc(3 * var(--u)) 0 #fff, 0 0 calc(8 * var(--u)) rgba(255,255,255,0.8);
}
.popup .goal { margin: calc(14 * var(--u)) 0; font-size: calc(30 * var(--u)); color: #6a2446; line-height: 1.25; }
.popup .x {
  position: absolute; right: calc(-18 * var(--u)); top: calc(-18 * var(--u));
  width: calc(66 * var(--u)); height: calc(66 * var(--u)); border-radius: 50%;
  border: calc(5 * var(--u)) solid #fff; background: radial-gradient(circle at 35% 30%, #ff9a8a, #d62a2a);
  color: #fff; font: inherit; font-size: calc(44 * var(--u)); line-height: 1; cursor: pointer; padding: 0;
}
.row { display: flex; gap: calc(18 * var(--u)); justify-content: center; margin-top: calc(18 * var(--u)); }
.btn {
  font: inherit; font-size: calc(34 * var(--u)); color: #fff;
  min-width: calc(190 * var(--u)); padding: calc(14 * var(--u)) calc(28 * var(--u));
  border-radius: calc(40 * var(--u)); border: calc(5 * var(--u)) solid #fff;
  background: linear-gradient(#7ec9ff, #2a82d6);
  box-shadow: 0 calc(6 * var(--u)) 0 rgba(20, 40, 90, 0.45);
  text-shadow: 0 calc(2 * var(--u)) 0 rgba(0,0,0,0.3);
  cursor: pointer;
}
.btn:active { transform: translateY(calc(3 * var(--u))); box-shadow: 0 calc(2 * var(--u)) 0 rgba(20,40,90,0.45); }
.btn.pink { background: linear-gradient(#ff9ad6, #d02a8a); box-shadow: 0 calc(6 * var(--u)) 0 rgba(110, 10, 60, 0.45); }
.btn.play { margin-top: calc(10 * var(--u)); min-width: calc(260 * var(--u)); font-size: calc(46 * var(--u)); }
.btn.small { font-size: calc(24 * var(--u)); min-width: 0; padding: calc(8 * var(--u)) calc(20 * var(--u)); }

.stars { display: flex; justify-content: center; gap: calc(10 * var(--u)); margin: calc(6 * var(--u)) 0; }
.star {
  width: calc(90 * var(--u)); height: calc(86 * var(--u));
  background: #c9c3cf;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 1px #fff);
}
.star.s1 { transform: translateY(calc(-14 * var(--u))) scale(1.12); }
.star.on.s0 { background: radial-gradient(circle at 40% 35%, #ffc07a, #e2461b 70%); }
.star.on.s1 { background: radial-gradient(circle at 40% 35%, #fff4a0, #f0b000 70%); }
.star.on.s2 { background: radial-gradient(circle at 40% 35%, #b8ff9a, #2aa84a 70%); }
.stars .star.on { animation: popin 0.4s ease-out both; }
.stars .star.on.s1 { animation-delay: 0.35s; }
.stars .star.on.s2 { animation-delay: 0.7s; }

.target {
  display: flex; align-items: center; justify-content: center; gap: calc(12 * var(--u));
  margin: calc(12 * var(--u)) auto; padding: calc(8 * var(--u)) calc(26 * var(--u));
  width: fit-content; border-radius: calc(12 * var(--u));
  background: linear-gradient(#5ab8ff, #1c78d0); color: #fff; font-size: calc(34 * var(--u));
}
.tstar { width: calc(44 * var(--u)); height: calc(42 * var(--u)); background: radial-gradient(circle at 40% 35%, #ffc07a, #e2461b 70%);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.scorelbl { font-size: calc(32 * var(--u)); color: #e0357f; margin-top: calc(8 * var(--u)); }
.scorebox {
  margin: calc(6 * var(--u)) auto; width: fit-content; min-width: calc(260 * var(--u));
  padding: calc(8 * var(--u)) calc(26 * var(--u)); border-radius: calc(12 * var(--u));
  background: linear-gradient(#5ab8ff, #1c78d0); color: #fff; font-size: calc(46 * var(--u));
}
.hs {
  margin-top: calc(24 * var(--u)); padding: calc(14 * var(--u));
  border-radius: calc(18 * var(--u)); background: #fff3e2; border: calc(3 * var(--u)) solid #e8c7a0;
  display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--u));
}
.hs-title { font-size: calc(30 * var(--u)); color: #8a2350; }
.hs-me { font-size: calc(24 * var(--u)); color: #6a4a3a; }
.total {
  position: absolute; left: calc(16 * var(--u)); top: calc(24 * var(--u));
  padding: calc(8 * var(--u)) calc(22 * var(--u)) calc(8 * var(--u)) calc(64 * var(--u));
  border-radius: calc(30 * var(--u)); border: calc(4 * var(--u)) solid #fff;
  background: linear-gradient(#ff9ad6, #d02a8a); color: #fff; font-size: calc(30 * var(--u));
  box-shadow: 0 calc(4 * var(--u)) 0 rgba(90, 20, 50, 0.35);
  pointer-events: none;
}
.total::before {
  content: ""; position: absolute; left: calc(14 * var(--u)); top: 50%; transform: translateY(-50%);
  width: calc(38 * var(--u)); height: calc(36 * var(--u)); background: #ffd52e;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
