/* ============================================================
   Pinwheel Names — carnival prize-wheel theme
   Palette: deep canvas teal, ticket cream, cherry, marigold, cobalt
   Signature: chasing marquee bulbs + torn ticket-stub result
   ============================================================ */

:root {
  --canvas:      #0C4548;
  --canvas-deep: #072F31;
  --paper:       #F7EFDA;
  --paper-dim:   #EDE2C6;
  --ink:         #17262A;
  --ink-soft:    #4A5C5E;
  --cherry:      #E2402A;
  --cherry-deep: #B92F1D;
  --marigold:    #F5A623;
  --cobalt:      #2C5D8F;
  --cream-text:  #FBF6E9;

  --edge: 2px solid var(--ink);
  --edge-cream: 2px solid var(--cream-text);
  --shadow-pop: 5px 6px 0 var(--ink);
  --shadow-pop-sm: 3px 4px 0 var(--ink);

  --font-display: "Bungee", "Arial Black", system-ui, sans-serif;
  --font-body: "Fraunces", Georgia, "Times New Roman", serif;
  --font-util: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.7rem); }
h2 { font-size: clamp(1.7rem, 1.25rem + 2vw, 2.6rem); }
h3 { font-family: var(--font-body); font-weight: 700; font-size: clamp(1.15rem, 1.02rem + 0.6vw, 1.4rem); }

p { margin: 0 0 1.1em; max-width: 66ch; }

a { color: var(--cobalt); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--cherry); }

.eyebrow {
  font-family: var(--font-util);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--marigold);
  display: inline-block;
  padding-bottom: 0.9rem;
}
.eyebrow::before { content: "☆ "; }
.eyebrow::after { content: " ☆"; }

.lede { font-size: 1.16em; color: var(--ink-soft); font-style: italic; }

/* ---------- layout ---------- */

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--dark { background: var(--canvas); color: var(--cream-text); }
.section--dark .lede { color: #BFDAD9; }
.section--dark h2 { color: var(--cream-text); }

.skip {
  position: absolute; left: -9999px;
  background: var(--marigold); color: var(--ink);
  padding: 0.75rem 1.25rem; font-family: var(--font-util); z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

/* candy-stripe awning edge, used top of masthead and bottom of footer */
.awning {
  height: 14px;
  background: repeating-linear-gradient(115deg, var(--cherry) 0 22px, var(--paper) 22px 44px);
  border-bottom: var(--edge);
}
.awning--foot { border-top: var(--edge); border-bottom: 0; }

/* ---------- header ---------- */

.masthead { background: var(--canvas); color: var(--cream-text); position: relative; z-index: 10; }
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.9rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-size: 1.05rem;
  letter-spacing: 0.01em; text-decoration: none; color: var(--cream-text);
}
.brand__mark {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--cream-text);
  background: conic-gradient(var(--cherry) 0 25%, var(--marigold) 0 50%, var(--cherry) 0 75%, var(--marigold) 0);
  box-shadow: inset 0 0 0 2px var(--canvas);
}
.navlinks { display: flex; gap: 1.4rem; font-family: var(--font-util); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.navlinks a { color: var(--cream-text); text-decoration: none; }
.navlinks a:hover { color: var(--marigold); text-decoration: underline; text-decoration-thickness: 2px; }
@media (max-width: 620px) { .navlinks a:nth-child(n+3) { display: none; } }

/* ---------- hero ---------- */

.hero { padding-block: clamp(2.5rem, 6vw, 4rem) 0; text-align: center; }
.hero h1 { color: var(--cream-text); margin-bottom: 0.4em; }
.hero h1 .ink-gold { color: var(--marigold); }
.hero .lede { margin-inline: auto; max-width: 44ch; }

/* ---------- controls ---------- */

.controls {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.6rem; margin: 2rem auto 0.75rem; max-width: 800px;
}

.segmented { display: inline-flex; border: var(--edge-cream); border-radius: 999px; overflow: hidden; background: var(--canvas-deep); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label {
  font-family: var(--font-util); font-size: 0.76rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.62rem 1.1rem; cursor: pointer;
  color: var(--cream-text); user-select: none; transition: background 0.15s ease, color 0.15s ease;
}
.segmented input:checked + label { background: var(--marigold); color: var(--ink); }
.segmented input:focus-visible + label { outline: 3px solid var(--cobalt); outline-offset: -3px; }

.field { display: inline-flex; align-items: center; }
.field select {
  font-family: var(--font-util); font-size: 0.76rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--cream-text);
  padding: 0.6rem 2.1rem 0.6rem 0.95rem;
  border: var(--edge-cream); border-radius: 999px; background-color: var(--canvas-deep);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23FBF6E9' stroke-width='2'/></svg>");
  background-repeat: no-repeat; background-position: right 0.85rem center;
}
.field select option { background: var(--canvas); color: var(--cream-text); }

.pool-count {
  font-family: var(--font-util); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #9FC4C2; text-align: center;
  margin: 0.35rem 0 0;
}

/* ---------- the wheel cabinet (signature element) ---------- */

.stage {
  display: grid; grid-template-columns: minmax(0, 1fr);
  justify-items: center; gap: 2rem;
  padding-block: 2rem clamp(2.5rem, 6vw, 4rem);
}
@media (min-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); align-items: center; gap: 3rem; }
  .stage__wheel { justify-self: end; }
  .stage__result { justify-self: start; width: 100%; }
}

.wheel-frame { position: relative; width: min(90vw, 480px); }

.cabinet-ring {
  position: absolute; inset: -22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #2b6b6e 0%, var(--canvas-deep) 60%);
  border: 6px solid var(--canvas-deep);
  box-shadow: 0 14px 0 rgba(7, 47, 49, 0.55), inset 0 0 0 3px rgba(251, 246, 233, 0.15);
}

.bulb {
  fill: var(--marigold);
  stroke: var(--canvas-deep);
  stroke-width: 1.5;
  opacity: 0.28;
  transition: opacity 0.15s ease;
}
.wheel-frame.is-lit .bulb {
  animation: chase 0.9s linear infinite;
  animation-delay: calc(var(--i) * 0.045s);
}
@keyframes chase {
  0%, 100% { opacity: 0.28; }
  15% { opacity: 1; filter: drop-shadow(0 0 4px var(--marigold)); }
  35% { opacity: 0.28; }
}
.wheel-frame.is-won .bulb {
  animation: none; opacity: 1; filter: drop-shadow(0 0 5px var(--marigold));
}

.wheel-pointer {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 46px; z-index: 3;
  filter: drop-shadow(2px 3px 0 rgba(7, 47, 49, 0.6));
}

.wheel { display: block; width: 100%; height: auto; overflow: visible; position: relative; z-index: 1; }
.wheel-rotor { transform-origin: 320px 320px; transform-box: view-box; filter: drop-shadow(0 6px 0 rgba(7,47,49,0.5)); }
.wheel-rotor.is-spinning { transition: transform 5s cubic-bezier(0.14, 0.72, 0.12, 1); }

.wedge { stroke: var(--marigold); stroke-width: 3; transition: opacity 0.4s ease; }
.wedge-label {
  font-family: var(--font-display); font-weight: 400;
  font-size: 20px; letter-spacing: 0.01em;
  transition: opacity 0.4s ease;
}

.wheel.is-settled .wedge { opacity: 0.5; }
.wheel.is-settled .wedge-label { opacity: 0.5; }
.wheel.is-settled .wedge.is-win,
.wheel.is-settled .wedge-label.is-win { opacity: 1; }
.wedge.is-win { stroke: var(--cream-text); stroke-width: 5; }

.hub { fill: var(--canvas-deep); stroke: var(--marigold); stroke-width: 4; }
.hub-text { font-family: var(--font-display); font-size: 15px; fill: var(--cream-text); }

.spin {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1rem, 0.92rem + 0.5vw, 1.2rem); letter-spacing: 0.02em;
  color: var(--cream-text); background: var(--cherry-deep);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.9rem 2.9rem; cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.spin:hover { background: var(--cherry); }
.spin:active { transform: translate(5px, 6px); box-shadow: 0 0 0 var(--ink); }
.spin[disabled] { opacity: 0.5; cursor: wait; }

.reshuffle {
  background: none; border: 0; cursor: pointer; color: #9FC4C2;
  font-family: var(--font-util); font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: underline;
  text-decoration-color: var(--marigold); text-decoration-thickness: 2px;
  text-underline-offset: 4px; padding: 0.4rem;
}
.reshuffle:hover { color: var(--marigold); }

/* ---------- ticket-stub result card ---------- */

.result {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-pop);
  width: min(100%, 460px);
  padding: 0;
  isolation: isolate;
}
.result::before, .result::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  background: var(--canvas); border: 3px solid var(--ink); border-radius: 50%;
  top: 50%; transform: translateY(-50%); z-index: 2;
}
.result::before { left: -14px; }
.result::after { right: -14px; }

.result__perf {
  border-bottom: 3px dashed var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-util); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.result__ticket-no::before { content: "No. "; }

.result__body { padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2rem) clamp(1.6rem, 3vw, 2.2rem); }
.result.is-empty .result__body { display: none; }
.result.is-empty .result__perf { display: none; }
.result__hint {
  font-family: var(--font-util); font-size: 0.82rem; color: var(--ink-soft);
  margin: 0; line-height: 1.8; padding: clamp(1.4rem, 3vw, 2rem);
}
.result:not(.is-empty) .result__hint { display: none; }

.result__name {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.3rem, 1.6rem + 3vw, 3.5rem); line-height: 1;
  letter-spacing: 0.005em; margin: 0 0 0.4rem; word-break: break-word; color: var(--cherry);
}
.result__meaning { font-size: 1.15rem; font-style: italic; margin: 0 0 1.1rem; color: var(--ink); }
.result__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.4rem; padding: 0; list-style: none; }
.tag {
  font-family: var(--font-util); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; border: 2px solid var(--ink);
  padding: 0.26rem 0.6rem; background: var(--paper); transform: rotate(-1.2deg);
}
.tag:nth-child(even) { transform: rotate(1deg); }
.tag--origin { background: var(--cobalt); color: var(--cream-text); border-color: var(--ink); }

.result__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn {
  font-family: var(--font-util); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); padding: 0.62rem 1.05rem; cursor: pointer;
  box-shadow: var(--shadow-pop-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.btn:hover { background: var(--marigold); }
.btn:active { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn.is-on { background: var(--cherry); color: var(--cream-text); }

@keyframes stamp {
  0%   { opacity: 0; transform: scale(1.2) rotate(-3deg); }
  60%  { opacity: 1; transform: scale(0.98) rotate(0.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.result__body.is-stamped { animation: stamp 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

/* ---------- shortlist ---------- */

.shortlist { background: var(--paper-dim); border-block: var(--edge); }
.shortlist__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; }
.shortlist__head h2 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 3px solid var(--ink); background: var(--paper); padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  font-family: var(--font-display); font-size: 0.95rem;
  box-shadow: var(--shadow-pop-sm); border-radius: 999px;
}
.chip button {
  border: 0; border-radius: 50%; background: var(--cherry); color: var(--cream-text); cursor: pointer;
  width: 22px; height: 22px; line-height: 1; font-size: 0.85rem; padding: 0;
}
.chip button:hover { background: var(--ink); }
.shortlist__empty { font-family: var(--font-util); font-size: 0.82rem; color: var(--ink-soft); margin: 1.25rem 0 0; }

/* ---------- ticket perforation section divider ---------- */

.perf-divider {
  border: 0; height: 0; border-top: 3px dashed var(--ink); opacity: 0.35; margin: 0;
}

/* ---------- content blocks ---------- */

.steps { display: grid; gap: 1.5rem; padding: 0; margin: 2rem 0 0; list-style: none; counter-reset: step; }
@media (min-width: 780px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { border: 3px solid var(--ink); background: var(--paper); box-shadow: var(--shadow-pop); padding: 1.5rem; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display); font-size: 1.4rem; color: var(--cherry);
  display: block; margin-bottom: 0.6rem;
}
.steps h3 { margin-bottom: 0.4rem; }
.steps p { margin: 0; font-size: 0.98rem; }

.prose h3 { margin-top: 2.25rem; display: flex; align-items: center; gap: 0.6rem; }
.prose h3::before {
  content: "★"; color: var(--marigold); font-size: 1.1rem;
}

.rank-board {
  margin-top: 2rem; background: var(--canvas); color: var(--cream-text);
  border: 3px solid var(--ink); box-shadow: var(--shadow-pop);
}
.rank-board__head {
  padding: 1rem 1.5rem; border-bottom: 3px dashed rgba(251,246,233,0.4);
  font-family: var(--font-util); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--marigold);
}
.rank-grid { display: grid; gap: 0; padding: 1.5rem; }
@media (min-width: 720px) { .rank-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
caption {
  font-family: var(--font-display); font-size: 1.05rem; text-align: left; padding-bottom: 0.75rem; color: var(--cream-text);
}
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(251,246,233,0.2); }
thead th { border-bottom: 2px solid rgba(251,246,233,0.5); font-family: var(--font-util); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9FC4C2; }
tbody td:first-child { font-family: var(--font-util); color: var(--marigold); width: 3ch; }
tbody td:nth-child(2) { font-family: var(--font-display); font-size: 0.95rem; }
.source-note { font-size: 0.88rem; color: var(--ink-soft); margin-top: 1.5rem; }

.faq { margin-top: 2rem; }
.faq details { border-bottom: 3px dashed var(--ink); padding: 1.2rem 0; }
.faq details:first-of-type { border-top: 3px dashed var(--ink); }
.faq summary {
  font-family: var(--font-body); font-weight: 700; font-size: 1.12rem;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--cream-text); background: var(--cherry);
  border-radius: 50%; width: 28px; height: 28px; flex: none;
  display: grid; place-content: center; font-size: 1.1rem; font-family: var(--font-util);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.9rem 0 0; }

/* ---------- ad slots ---------- */

.ad-slot { display: block; margin-block: clamp(2rem, 5vw, 3rem); text-align: center; }
.ad-slot__label {
  display: block; font-family: var(--font-util); font-size: 0.63rem;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.5rem;
}
.ad-slot__unit { min-height: 280px; display: block; }
@media (min-width: 780px) { .ad-slot__unit { min-height: 250px; } }
.ad-placeholder {
  min-height: 250px; display: grid; place-content: center;
  border: 3px dashed var(--ink-soft); opacity: 0.6;
  font-family: var(--font-util); font-size: 0.75rem; color: var(--ink-soft);
  padding: 1rem; line-height: 1.8;
}

/* ---------- footer ---------- */

.foot { background: var(--canvas); color: var(--cream-text); }
.foot a { color: var(--cream-text); }
.foot a:hover { color: var(--marigold); }
.foot__inner { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
@media (min-width: 760px) { .foot__inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h3 { font-family: var(--font-body); font-size: 1rem; margin-bottom: 0.9rem; }
.foot ul { list-style: none; padding: 0; margin: 0; font-size: 0.95rem; line-height: 2; }
.foot p { font-size: 0.95rem; color: #9FC4C2; }
.foot__legal {
  border-top: 1px solid rgba(251, 246, 233, 0.2); padding-block: 1.25rem;
  font-family: var(--font-util); font-size: 0.7rem; letter-spacing: 0.05em;
  color: #9FC4C2; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
}

/* ---------- consent bar ---------- */

.consent {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  background: var(--canvas); color: var(--cream-text); border-top: var(--edge-cream);
  padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.75rem 1.25rem; box-shadow: 0 -6px 0 rgba(7,47,49,0.35);
}
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 0.9rem; max-width: 58ch; }
.consent .btn { background: var(--paper); }

/* ---------- utility ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wheel-rotor.is-spinning { transition-duration: 0.6s; }
  .result__body.is-stamped { animation: none; }
  .wheel-frame.is-lit .bulb { animation: none; opacity: 0.7; }
  * { transition-duration: 0.01ms !important; }
}
