/* Giraregalo: stile del sito */
/* Font ospitati sul sito (niente chiamate a Google) */
@font-face { font-family: "Bagel Fat One"; src: url("/assets/fonts/bagel-fat-one.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
:root {
  --cobalt: #2338c9;
  --cobalt-deep: #1a2a9e;
  --ink: #1a1446;
  --cream: #fff6e5;
  --paper: #ffffff;
  --sun: #ffd23f;
  --sun-deep: #f2b705;
  --cherry: #ff4d6d;
  --mandarin: #ff8a3d;
  --mint: #2ed198;
  --sky: #4cc9f0;
  --lilac: #b388ff;
  --muted: #5b5480;
  --radius-chip: 999px;
  --radius-card: 22px;
  --shadow-pop: 0 6px 0 var(--ink);
  --font-display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--cobalt);
  color: var(--cream);
  padding: 0 16px 56px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 28px;
  background: var(--cream);
  clip-path: polygon(0 100%, 0 40%, 4% 0, 8% 40%, 12% 0, 16% 40%, 20% 0, 24% 40%, 28% 0, 32% 40%, 36% 0, 40% 40%, 44% 0, 48% 40%, 52% 0, 56% 40%, 60% 0, 64% 40%, 68% 0, 72% 40%, 76% 0, 80% 40%, 84% 0, 88% 40%, 92% 0, 96% 40%, 100% 0, 100% 100%);
}
.topbar {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--font-display); font-size: 24px; letter-spacing: .2px; }
.topbar .season { font-weight: 700; font-size: 14px; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: var(--radius-chip); }

.hero-grid {
  max-width: 1120px; margin: 0 auto;
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
  align-items: center;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 9vw, 68px);
  line-height: .98;
  margin: 12px 0 14px;
  letter-spacing: -.5px;
  text-wrap: balance;
}
.hero-copy .lead { font-size: 19px; margin: 0 0 22px; max-width: 34ch; color: #e8e9ff; }

/* ---------- Filtri ---------- */
.filters { display: grid; gap: 16px; }
.filter-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.filter-group legend { font-weight: 800; font-size: 15px; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; font-size: 15px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-chip);
  border: 2px solid rgba(255,255,255,.55);
  background: transparent; color: var(--cream);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .15s, color .15s, border-color .15s, transform .1s;
}
.chip:hover { border-color: var(--cream); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.chip[aria-pressed="true"]::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.filter-hint { font-size: 14px; color: #c9ccff; margin: 0; }
.pool {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; margin-top: 4px;
}
.pool b { background: var(--sun); color: var(--ink); border-radius: 8px; padding: 0 8px; min-width: 2.2em; text-align: center; }
.pool.empty b { background: var(--cherry); color: #fff; }

/* ---------- Ruota ---------- */
.wheel-area { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.wheel {
  position: relative;
  width: min(86vw, 400px);
  aspect-ratio: 1;
}
.wheel-spin {
  width: 100%; height: 100%;
  transition: transform 4.6s cubic-bezier(.12, .67, .1, 1);
  will-change: transform;
  filter: drop-shadow(0 10px 0 rgba(10, 14, 80, .35));
}
.wheel-spin svg { width: 100%; height: 100%; display: block; }
.wheel .pointer {
  position: absolute; left: 50%; top: -14px;
  width: 54px; height: 68px;
  transform: translateX(-50%);
  transform-origin: 50% 12px;
  z-index: 2;
  filter: drop-shadow(0 4px 0 rgba(10, 14, 80, .35));
}
.wheel.spinning .pointer { animation: tick .14s ease-in-out infinite alternate; }
@keyframes tick { from { transform: translateX(-50%) rotate(-9deg); } to { transform: translateX(-50%) rotate(7deg); } }

.bulb { fill: #fff3c4; }
.wheel.spinning .bulb { animation: blink .5s steps(1) infinite; }
.wheel.spinning .bulb.alt { animation-delay: .25s; }
@keyframes blink { 0% { fill: #fff3c4; } 50% { fill: #6a5a2a; } }
.seg.win { filter: brightness(1.12) saturate(1.1); }

.hub { cursor: pointer; }

.btn-spin {
  font-family: var(--font-display); font-weight: 400;
  font-size: 26px; letter-spacing: .3px;
  width: min(86vw, 400px); min-height: 66px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--sun); color: var(--ink);
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background-color .15s;
  position: relative;
}
.btn-spin:hover { background: #ffdc66; }
.btn-spin:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn-spin[disabled] { cursor: default; opacity: .75; }
.btn-spin.ready { animation: nudge 2.6s ease-in-out 1.2s 2; }
@keyframes nudge { 0%, 100% { transform: none; } 8% { transform: translateY(-5px) rotate(-1.2deg); } 16% { transform: translateY(0) rotate(1deg); } 24% { transform: none; } }
.spin-note { font-size: 14px; color: #c9ccff; margin: -10px 0 0; text-align: center; }

/* ---------- Sezioni sotto ---------- */
main section { padding: 56px 16px; }
.wrap { max-width: 1120px; margin: 0 auto; }
.section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.05;
  margin: 0 0 22px;
}
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
.steps li {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  padding: 20px 20px 20px 74px;
  position: relative;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px;
  border: 2px solid var(--ink);
}
.steps li:nth-child(1)::before { background: var(--sun); }
.steps li:nth-child(2)::before { background: var(--mint); }
.steps li:nth-child(3)::before { background: var(--sky); }
.steps h3 { margin: 0 0 4px; font-size: 19px; }
.steps p { margin: 0; color: var(--muted); }

.wheels-nav { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.wheel-link {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 18px;
  border-radius: 18px; border: 2px solid var(--ink);
  background: var(--paper);
  text-decoration: none; font-weight: 800; font-size: 17px;
  transition: transform .12s, box-shadow .12s;
}
.wheel-link:hover { transform: translateY(-3px); box-shadow: 0 5px 0 var(--ink); }
.wheel-link .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.wheel-link[aria-current="page"] { background: var(--sun); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.faq details {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 16px;
  padding: 0 18px; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; font-weight: 800; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-display); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

.site-footer { background: var(--ink); color: #d9d6f5; padding: 36px 16px 48px; font-size: 14px; }
.site-footer .wrap { display: grid; gap: 12px; }
.site-footer a { color: #fff; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Risultato ---------- */
.result {
  border: 0; padding: 0;
  width: min(100%, 460px);
  max-height: 92dvh;
  border-radius: 26px;
  background: var(--paper); color: var(--ink);
  overflow: auto;
  scrollbar-width: none; /* niente barra: se lo schermo è molto basso si scorre lo stesso */
  box-shadow: 0 10px 0 var(--ink);
  outline: 3px solid var(--ink);
}
.result::-webkit-scrollbar { display: none; }
.result::backdrop { background: rgba(20, 16, 60, .62); backdrop-filter: blur(3px); }
.result[open] { animation: pop .38s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: translateY(40px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) {
  .result { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; box-shadow: none; }
  .result[open] { animation-name: sheet; }
  @keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
}
.result-head {
  position: relative;
  padding: 18px 64px 18px 22px;
  background: var(--result-color, var(--sun));
  border-bottom: 3px solid var(--ink);
}
.result-head .kicker { margin: 0 0 4px; font-weight: 800; font-size: 15px; }
.result-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 7vw, 36px); line-height: 1.02;
  text-wrap: balance;
}
.btn-close {
  position: absolute; right: 14px; top: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.result-body { padding: 16px 22px 20px; display: grid; gap: 12px; }
.result-media {
  display: grid; place-items: center;
  height: clamp(110px, 22vh, 220px);
  border-radius: 18px;
  background: #f6f2ff;
  border: 2px dashed #c9c1ef;
  overflow: hidden;
}
.result-media { position: relative; }
.result-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 12px; }
.result-media.has-img { border-style: solid; border-color: #e6e1f7; background: #fff; }
.result-media:not(.has-img) { height: 100px; }
.result-media svg { width: 64px; height: 64px; }
.result-line { font-size: 18px; margin: 0; line-height: 1.35; }
.result-product { margin: 0; font-size: 14px; color: var(--muted); }
.result-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.result-price strong { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; }
.result-price small { color: var(--muted); font-size: 12.5px; }

.btn-amazon {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 18px;
  background: var(--sun); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: var(--shadow-pop);
  font-weight: 900; font-size: 19px; text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn-amazon:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn-amazon svg { width: 20px; height: 20px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-ghost {
  font: inherit; font-weight: 800; font-size: 16px;
  min-height: 46px; border-radius: 16px;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost:hover { background: #f6f2ff; }
.btn-ghost svg { width: 18px; height: 18px; }
.disclosure { font-size: 12.5px; color: var(--muted); margin: 0; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-weight: 700; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ---------- Mobile: ruota e pulsante nella prima schermata ---------- */
@media (max-width: 899px) {
  .hero { padding-bottom: 44px; }
  .topbar { padding: 12px 0; }
  .hero-grid { gap: 18px; }
  .hero-copy h1 { font-size: clamp(32px, 9vw, 44px); margin: 4px 0 14px; }
  .hero-copy .lead, .filter-hint, .spin-note { display: none; }
  .filters { gap: 10px; }
  .filter-group legend { margin-bottom: 6px; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 4px;
    scroll-padding-inline: 16px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .wheel, .btn-spin { width: min(80vw, 380px); }
  .wheel-area { gap: 18px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .hero { padding-bottom: 80px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; }
  .hero-copy .lead { font-size: 21px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .wheel, .btn-spin { width: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-spin { transition-duration: .6s; }
  .wheel.spinning .pointer, .wheel.spinning .bulb, .btn-spin.ready { animation: none; }
  .result[open] { animation: none; }
}
