:root {
  --ink: #2b1d3f;
  --violet: #7b4bd1;
  --pink: #ff6fae;
  --cream: #fff7ec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1d1330;
  font-family: 'Fredoka', 'Comic Sans MS', system-ui, sans-serif;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 72px;
}

#message {
  background: rgba(255, 247, 236, 0.92);
  border: 4px solid var(--violet);
  border-radius: 999px;
  padding: 10px 26px;
  font-size: clamp(17px, 2.6vw, 28px);
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 0 rgba(43, 29, 63, 0.35);
  transition: transform 0.25s ease;
}

#message.pop { animation: pop 0.45s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.round {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--violet);
  background: var(--cream);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(43, 29, 63, 0.35);
}

#hand {
  position: fixed;
  left: 0;
  top: 0;
  font-size: 56px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -10%);
  transition: opacity 0.3s;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4));
}

#hand.visible { opacity: 1; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(29, 19, 48, 0.55);
  transition: opacity 0.4s;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.card {
  background: var(--cream);
  border: 6px solid var(--violet);
  border-radius: 36px;
  padding: 28px 36px 32px;
  max-width: 520px;
  text-align: center;
  box-shadow: 0 10px 0 rgba(43, 29, 63, 0.45);
  animation: card-in 0.5s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes card-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.card .emoji { font-size: 72px; line-height: 1; }

.card h1 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 5vw, 40px);
  color: var(--violet);
}

.card p {
  margin: 0 0 22px;
  font-size: clamp(17px, 3vw, 22px);
  line-height: 1.4;
}

button.big {
  font-family: inherit;
  font-size: 26px;
  font-weight: 700;
  color: white;
  background: var(--pink);
  border: none;
  border-radius: 999px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: 0 6px 0 #c2407c;
}

button.big:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #c2407c;
}

/* Phones in landscape: keep the scene visible under the message. */
@media (max-height: 500px) {
  #message { padding: 6px 18px; font-size: 15px; border-width: 3px; }
  .round { width: 42px; height: 42px; font-size: 19px; }
  .card { padding: 14px 24px 18px; border-width: 4px; }
  .card .emoji { font-size: 44px; }
  .card h1 { font-size: 24px; margin: 4px 0; }
  .card p { font-size: 15px; margin-bottom: 12px; }
  button.big { font-size: 20px; padding: 10px 30px; }
}
