/* Retail Therapy for Eda — candy-shop arcade. Fredoka for headings, Nunito for text. */

:root {
  --cream: #fff7fb;
  --pink: #ff5fa2;
  --pink-deep: #e0407f;
  --lemon: #ffe66d;
  --mint: #7ee8c7;
  --lavender: #c7b8ff;
  --sky: #8fd3ff;
  --ink: #3b2a3a;
  --muted: #8a6f86;
  --line: #ffd6e8;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 230, 109, 0.35) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 12%, rgba(199, 184, 255, 0.4) 0 120px, transparent 121px),
    radial-gradient(circle at 80% 85%, rgba(126, 232, 199, 0.35) 0 140px, transparent 141px),
    radial-gradient(circle at 10% 90%, rgba(143, 211, 255, 0.35) 0 110px, transparent 111px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--pink-deep); text-decoration: none; }
button { font-family: inherit; }

/* nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  flex-wrap: wrap;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--pink-deep); display: flex; align-items: center; gap: 0.4rem; margin-right: auto; }
.brand span { font-size: 1.5rem; }
.nav a.link {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.92rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.nav a.link:hover { transform: translateY(-2px) rotate(-1deg); }
.nav a.link.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.nav a.home { color: var(--muted); font-size: 0.85rem; font-weight: 700; padding: 0.45rem 0.6rem; }

/* page */
.page { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1rem 1.2rem 2rem; text-align: center; }
h1 {
  margin: 0.4rem 0 0.2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  color: var(--ink);
}
h1 .wob { display: inline-block; color: var(--pink); animation: wob 2.2s ease-in-out infinite; }
@keyframes wob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.sub { margin: 0.3rem 0 1.2rem; color: var(--muted); font-weight: 700; }

/* buttons */
.big-btn {
  border: 0;
  border-radius: 999px;
  padding: 1rem 2.2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  background: var(--pink);
  box-shadow: 0 8px 0 var(--pink-deep), 0 18px 30px -18px rgba(224, 64, 127, 0.7);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--pink-deep); }
.big-btn.mint { background: #33c79a; box-shadow: 0 8px 0 #22996f, 0 18px 30px -18px rgba(34, 153, 111, 0.7); }
.big-btn.mint:active { box-shadow: 0 2px 0 #22996f; }
.big-btn.lemon { background: #f5c400; color: var(--ink); box-shadow: 0 8px 0 #c79c00, 0 18px 30px -18px rgba(199, 156, 0, 0.7); }
.big-btn.lemon:active { box-shadow: 0 2px 0 #c79c00; }
.big-btn.grey { background: #cfc4d3; color: #6f6274; box-shadow: 0 8px 0 #a99aae; cursor: wait; }
.big-btn.huge { font-size: 2.2rem; padding: 1.3rem 3rem; }
.small-btn { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 0.45rem 1rem; font-weight: 800; color: var(--ink); cursor: pointer; }

/* cards */
.card {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 28px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 20px 50px -30px rgba(224, 64, 127, 0.5);
  max-width: 560px;
  width: 100%;
}
.card h2 { font-family: var(--display); margin: 0 0 0.4rem; font-size: 1.7rem; }
.card p { margin: 0.3rem 0; }
.stat { font-family: var(--display); font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--pink-deep); }
.stat small { font-size: 1rem; color: var(--muted); font-family: var(--body); font-weight: 800; display: block; margin-top: 0.2rem; }
.row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-block; background: var(--lemon); color: var(--ink); border-radius: 999px; padding: 0.2rem 0.75rem; font-weight: 800; font-size: 0.9rem; }

/* ---------------- Tap frenzy ---------------- */
.arena {
  position: relative;
  width: 100%;
  max-width: 900px;
  flex: 1;
  min-height: 420px;
  border-radius: 32px;
  background: linear-gradient(180deg, #ffffff, #fff0f7);
  border: 3px dashed var(--line);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.arena.live { border-style: solid; border-color: var(--pink); }
.counter { font-family: var(--display); font-weight: 700; font-size: clamp(5rem, 18vw, 11rem); line-height: 1; color: var(--pink); text-shadow: 0 8px 0 #ffd6e8; pointer-events: none; }
.counter-label { font-weight: 800; color: var(--muted); pointer-events: none; }
.ring { position: absolute; top: 14px; right: 14px; width: 74px; height: 74px; pointer-events: none; }
.ring circle { fill: none; stroke-width: 8; }
.ring .bg { stroke: #ffe1ee; }
.ring .fg { stroke: var(--pink); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.2s linear; }
.ring text { font-family: var(--display); font-weight: 700; font-size: 22px; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.fly { position: absolute; font-size: 2rem; pointer-events: none; animation: fly 0.9s ease-out forwards; }
@keyframes fly { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; } 100% { transform: translate(-50%, -260%) scale(1.3) rotate(20deg); opacity: 0; } }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; background: rgba(255, 247, 251, 0.88); backdrop-filter: blur(4px); padding: 1rem; }
.overlay.hidden { display: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: drop 2.2s linear forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; } }

/* ---------------- Flash sale ---------------- */
.product { width: min(320px, 70vw); border-radius: 24px; border: 4px solid #fff; box-shadow: 0 20px 40px -24px rgba(59, 42, 58, 0.5); transition: transform 0.2s ease, filter 0.2s ease; }
.product.sold { filter: grayscale(1) brightness(0.9); transform: rotate(-4deg) scale(0.96); }
.price { font-family: var(--display); font-size: 1.6rem; color: var(--muted); }
.price s { color: #c9b6c6; margin-right: 0.4rem; }
.price b { color: var(--pink-deep); }
.cart { position: absolute; top: 0.9rem; right: 1.2rem; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 800; }
.result { min-height: 3.6rem; font-weight: 800; margin-top: 0.8rem; }
.result .ms { font-family: var(--display); font-size: 2.4rem; color: var(--pink-deep); display: block; line-height: 1.1; }
.flash { animation: flash 0.35s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255, 230, 109, 0.9); } 100% { box-shadow: 0 0 0 40px rgba(255, 230, 109, 0); } }
.ladder { text-align: left; margin: 1rem auto 0; max-width: 420px; font-size: 0.9rem; color: var(--muted); }
.ladder li { margin-bottom: 0.15rem; }

/* ---------------- Cart catch ---------------- */
canvas.game { width: 100%; max-width: 720px; aspect-ratio: 4 / 3; border-radius: 28px; background: #fff; border: 3px solid var(--line); touch-action: none; display: block; box-shadow: 0 20px 50px -30px rgba(224, 64, 127, 0.5); }
.hud { display: flex; gap: 1.2rem; justify-content: center; font-weight: 800; color: var(--muted); margin: 0.6rem 0; flex-wrap: wrap; }
.hud b { color: var(--ink); font-family: var(--display); font-size: 1.2rem; }

/* about */
.poem { font-family: var(--display); font-size: 1.35rem; line-height: 1.6; max-width: 560px; }
.poem em { color: var(--pink-deep); font-style: normal; }
.footer { margin-top: auto; padding: 1rem; color: var(--muted); font-size: 0.85rem; font-weight: 700; text-align: center; }

@media (max-width: 600px) {
  .nav { padding: 0.7rem 0.8rem; }
  .nav a.link { font-size: 0.82rem; padding: 0.4rem 0.7rem; }
  .brand { width: 100%; justify-content: center; margin-right: 0; margin-bottom: 0.3rem; }
  .page { padding: 0.6rem 0.8rem 1.4rem; }
  .arena { min-height: 360px; border-radius: 24px; }
  .card { padding: 1.1rem 1.2rem; border-radius: 22px; }
}
