/* Shared look for the game shelf and the little games. The emoji hunt predates
   this file and keeps its own styles. */
:root {
  --sky1: #b9e6ff; --sky2: #ffeec2;
  --ink: #2b2140;
  --card: #fff;
  --pink: #ff5d8f; --green: #23c16b; --yellow: #ffc93c; --purple: #7c5cff; --blue: #17a2d6;
  --shadow: 0 12px 0 rgba(43,33,64,.10), 0 22px 44px rgba(43,33,64,.16);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body {
  background: linear-gradient(180deg, var(--sky1) 0%, #e8f6ff 45%, var(--sky2) 100%);
  color: var(--ink);
  font: 800 16px/1.3 ui-rounded, "SF Pro Rounded", "Nunito", "Baloo 2", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
body.game { overflow: hidden; }

/* ---------------- the ask, across the top ---------------- */
.ask {
  position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 28;
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border-radius: 30px; box-shadow: var(--shadow);
  padding: 14px 32px 16px 24px; max-width: calc(100vw - 32px);
}
.ask .icon { font-size: 58px; line-height: 1; animation: nod 2.4s ease-in-out infinite; }
@keyframes nod { 50% { transform: translateY(-7px) rotate(6deg); } }
.ask .words { font-size: clamp(24px, 4.2vw, 42px); letter-spacing: -.02em; white-space: nowrap; }
.ask .words b { color: var(--pink); }
.replay {
  border: 0; background: #f2effa; color: var(--purple); width: 46px; height: 46px;
  border-radius: 50%; font-size: 22px; cursor: pointer; flex: none;
}
.replay:active { transform: scale(.92); }

/* ---------------- stars: rounds finished ---------------- */
.stars {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); right: calc(22px + env(safe-area-inset-right)); z-index: 30;
  display: flex; gap: 6px; font-size: 34px; line-height: 1;
}
.stars i { filter: grayscale(1) opacity(.3); transition: transform .4s cubic-bezier(.2,1.6,.4,1), filter .4s; font-style: normal; }
.stars i.on { filter: none; transform: scale(1.22) rotate(-8deg); }

/* ---------------- back to the shelf ---------------- */
.home {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); left: calc(16px + env(safe-area-inset-left)); z-index: 31;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.95); box-shadow: 0 5px 0 rgba(43,33,64,.12); font-size: 26px;
  display: grid; place-items: center; text-decoration: none;
}
.home:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43,33,64,.12); }

/* ---------------- toast ---------------- */
.msg {
  position: fixed; left: 50%; bottom: calc(46px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 29;
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  padding: 12px 26px; font-size: 22px; opacity: 0; transition: all .28s ease; pointer-events: none;
  max-width: calc(100vw - 40px); text-align: center;
}
.msg.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- sparkles ---------------- */
.sparkle { position: fixed; font-size: 44px; pointer-events: none; z-index: 40; animation: sparkle .9s ease-out forwards; }
@keyframes sparkle { to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(180deg); opacity: 0; } }

/* ---------------- overlays ---------------- */
.veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(233,246,255,.86); backdrop-filter: blur(10px); }
.veil[hidden] { display: none; }
.panel { background: var(--card); border-radius: 40px; box-shadow: var(--shadow); padding: 44px 50px; text-align: center; width: min(600px, calc(100vw - 28px)); }
.panel .hero { font-size: 86px; line-height: 1; }
.panel h1 { margin: 10px 0 6px; font-size: clamp(34px, 6vw, 54px); letter-spacing: -.03em; }
.panel p { margin: 0; font-size: 22px; font-weight: 700; color: #5b4f78; }
.play {
  margin-top: 26px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 29px;
  padding: 19px 54px; color: #fff; background: var(--green); box-shadow: 0 9px 0 #16964f;
}
.play:active { transform: translateY(6px); box-shadow: 0 3px 0 #16964f; }
.panel .back { display: inline-block; margin-top: 18px; font-size: 19px; color: #5b4f78; text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) {
  .ask { gap: 10px; padding: 10px 18px; } .ask .icon { font-size: 38px; }
  .stars { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); right: auto; left: 50%; transform: translateX(-50%); font-size: 24px; }
  .msg { bottom: calc(74px + env(safe-area-inset-bottom)); font-size: 18px; }
  .panel { padding: 32px 26px; }
  .home { width: 42px; height: 42px; font-size: 20px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: calc(10px + env(safe-area-inset-left)); }
}
