:root {
  --bg: #f6f2ff;
  --surface: #ffffff;
  --ink: #1d1236;
  --muted: #6b6386;
  --brand: #5b2bd6;
  --brand-2: #8a5cff;
  --lime: #b8f34a;
  --green: #22c55e;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #ef4444;
  --shop: #ee4d2d;
  --line: #e6defa;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(61, 25, 150, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #130b26;
    --surface: #1e1438;
    --ink: #f3efff;
    --muted: #a99fc7;
    --line: #34275a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 520px; width: 100%; margin: 0 auto;
}
.logo {
  font-family: "Baloo 2", cursive; font-weight: 800; font-size: 34px; margin: 0;
  color: var(--brand); letter-spacing: -1px;
}
.logo span { color: var(--brand-2); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer;
}
main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 16px 24px; }
.screen { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.tag {
  margin: 8px 0 0; padding: 4px 12px; border-radius: 99px; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 13px;
}
.big { font-family: "Baloo 2", cursive; font-size: 44px; line-height: 1; margin: 4px 0; }
.lead { font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0; }
.lead b { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.cta {
  width: 100%; border: 0; border-radius: 16px; padding: 16px; font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; cursor: pointer;
  box-shadow: 0 6px 0 #3d1a99; transition: transform .08s, box-shadow .08s;
}
.cta:active { transform: translateY(4px); box-shadow: 0 2px 0 #3d1a99; }
.cta:disabled { opacity: .6; }
.ghost {
  width: 100%; border: 2px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 16px; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.streak-pill { font-weight: 700; color: var(--brand); min-height: 1em; }
.blob {
  width: 80px; height: 80px; border-radius: 50%; margin-top: 60px;
  background: linear-gradient(135deg, var(--brand), var(--lime)); animation: goo 1.4s infinite ease-in-out;
}
@keyframes goo {
  0%,100% { border-radius: 50% 50% 50% 50%; transform: scale(1); }
  50% { border-radius: 60% 40% 55% 45%; transform: scale(1.12) rotate(20deg); }
}
.progress { display: flex; gap: 8px; width: 100%; }
.progress span { flex: 1; height: 8px; border-radius: 99px; background: var(--line); }
.progress span.done { background: var(--brand); }
.progress span.now { background: var(--brand-2); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.card {
  width: 100%; background: var(--surface); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow);
}
.img-wrap {
  width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.card h3 { font-size: 17px; line-height: 1.35; margin: 12px 4px 4px; }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.tries { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.try {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font-weight: 700;
  animation: pop .25s ease-out;
}
.try.ok { border-color: var(--green); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
#guess-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.money {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 16px;
  border: 3px solid var(--brand-2); padding: 6px 16px;
}
.money input::placeholder { font-size: 18px; font-weight: 600; color: var(--muted); }
.money span { font-weight: 800; font-size: 22px; color: var(--muted); }
.money input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-size: 30px; font-weight: 800; padding: 8px 0; min-width: 0; font-family: inherit;
}
.reveal { width: 100%; display: flex; flex-direction: column; gap: 10px; animation: pop .3s ease-out; }
.reveal-label { margin: 0; font-weight: 800; font-size: 18px; }
.reveal-price { margin: 0; font-family: "Baloo 2", cursive; font-size: 54px; line-height: 1; color: var(--brand); }
.shop-btn {
  display: block; text-decoration: none; background: var(--shop); color: #fff; font-weight: 800;
  padding: 16px; border-radius: 16px; font-size: 18px;
}
.grid { font-size: 38px; letter-spacing: 6px; }
.stats-row { display: flex; gap: 10px; width: 100%; justify-content: center; }
.stat { flex: 1; background: var(--surface); border-radius: 16px; padding: 12px 6px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; font-family: "Baloo 2", cursive; }
.stat small { color: var(--muted); font-size: 12px; }
.section-title { margin: 12px 0 0; font-size: 18px; align-self: flex-start; }
.product-list { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.product-list li {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 10px;
  text-align: left; box-shadow: var(--shadow);
}
.product-list img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #fff; flex: none; }
.product-list .info { flex: 1; min-width: 0; }
.product-list .info p { margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-list .info b { color: var(--brand); }
.product-list a {
  flex: none; background: var(--shop); color: #fff; text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 10px 12px; border-radius: 12px;
}
.foot { max-width: 520px; margin: 0 auto; padding: 16px; font-size: 12px; color: var(--muted); text-align: center; }
dialog {
  border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 420px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 8, 50, .5); }
dialog ol { text-align: left; padding-left: 20px; line-height: 1.6; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700;
  transition: transform .25s, opacity .25s; z-index: 10; opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.confetti { position: fixed; top: -20px; font-size: 24px; pointer-events: none; animation: fall 1.6s linear forwards; z-index: 20; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
