/* Fortune Cookie — vermilion lacquer, a baked cookie that cracks, a paper slip printed in red. */
:root {
  --lacquer: #c81f1b;
  --lacquer-deep: #9c1512;
  --lacquer-hi: #e0402f;
  --cream: #fff4e3;
  --cream-soft: rgba(255, 244, 227, 0.82);
  --cream-faint: rgba(255, 244, 227, 0.28);
  --gold: #f6c75e;
  --gold-deep: #b8811f;
  --gold-ink: #4f2a05;
  --paper: #fffdf8;
  --ink-red: #c81f1b;
  --ink: #3a1410;
  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  --pay-paper: #fffdf8;
  --pay-ink: #3a1410;
  --pay-muted: #7a4a40;
  --pay-line: rgba(58, 20, 16, 0.14);
  --pay-accent: #c81f1b;
  --pay-accent-ink: #fff4e3;
  --pay-font: var(--mono);
  --pay-display: var(--display);
  --pay-radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--lacquer-deep);
  background-image: radial-gradient(120% 100% at 50% 12%, var(--lacquer-hi) 0%, var(--lacquer) 45%, var(--lacquer-deep) 100%);
  background-repeat: no-repeat;
  background-size: 100% 1400px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.wrap {
  width: min(760px, 100% - 32px);
  margin-inline: auto;
}

/* ── top ── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1040px, 100% - 32px);
  margin: 0 auto;
  padding: 18px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
}
.brand > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
}
.brand-mark path {
  fill: var(--gold);
}
.brand-mark .seam {
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.4;
}
.top-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-tools select {
  appearance: none;
  min-height: 40px;
  padding: 6px 30px 6px 12px;
  border: 1.5px solid var(--cream-faint);
  border-radius: 999px;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff4e3' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--cream);
  font: 500 14px/1 var(--mono);
  cursor: pointer;
}
.top-tools select option {
  color: #111;
}
.sound {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--cream-faint);
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.sound svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound svg path:first-child {
  fill: currentColor;
}
.sound .mute {
  display: none;
}
.sound[aria-pressed='false'] .wave {
  display: none;
}
.sound[aria-pressed='false'] .mute {
  display: block;
}

/* ── hero & cookie ── */
.hero {
  text-align: center;
  padding-top: 10px;
}
h1 {
  margin: 0 auto 6px;
  max-width: 14em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 5.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.stage {
  position: relative;
  height: 330px;
  display: grid;
  place-items: center;
}
.glow {
  position: absolute;
  inset: 10% 15%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 120, 0.42), transparent);
  pointer-events: none;
}
.stage.is-gold .glow {
  background: radial-gradient(closest-side, rgba(255, 232, 140, 0.7), transparent);
}
.cookie-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 40%;
}
.cookie-btn[disabled] {
  cursor: default;
}
.cookie {
  display: block;
  width: min(360px, 80vw);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 22px 26px rgba(70, 6, 4, 0.45));
}
.cookie .body {
  fill: url(#g-plain);
  stroke: #a65d1b;
  stroke-width: 1.5;
}
.stage.is-gold .cookie .body {
  fill: url(#g-gold);
  stroke: #9a6a12;
}
.cookie .fold {
  fill: none;
  stroke: rgba(122, 58, 10, 0.42);
  stroke-width: 3;
  stroke-linecap: round;
}
.cookie .seam {
  fill: none;
  stroke: rgba(122, 58, 10, 0.55);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.cookie .pores circle {
  fill: rgba(122, 58, 10, 0.22);
}
.cookie .shine {
  fill: rgba(255, 255, 255, 0.35);
}
.cookie .half {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
.cookie-btn:not([disabled]):hover .cookie {
  animation: wobble 0.6s ease-in-out;
}
@keyframes wobble {
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}
.crumbs {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.crumbs i {
  position: absolute;
  width: 8px;
  height: 6px;
  border-radius: 40%;
  background: #e6a24a;
}
.stage.is-gold .crumbs i {
  background: #ffd76a;
}
.hint {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(60, 4, 2, 0.28);
  color: var(--cream);
  font-size: 14px;
}
.stage.is-gold + .hint {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
}

/* ── the paper slip ── */
.reading {
  margin-top: 26px;
}
.slip {
  position: relative;
  margin: 0 auto;
  max-width: 620px;
  padding: 24px 28px 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(70, 6, 4, 0.35);
  transform: rotate(-1.2deg);
}
.slip::before,
.slip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: radial-gradient(circle at 0 50%, transparent 4px, var(--paper) 4.5px) 0 0 / 10px 12px repeat-y;
}
.slip::before {
  left: -10px;
  transform: scaleX(-1);
}
.slip::after {
  right: -10px;
}
.slip-label {
  margin: 0 0 8px;
  color: var(--ink-red);
  font-size: 13px;
  font-weight: 600;
}
.slip-text {
  margin: 0;
  color: var(--ink-red);
  font-size: clamp(19px, 2.8vw, 23px);
  line-height: 1.45;
  font-weight: 500;
}
.slip-nums {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(200, 31, 27, 0.35);
  color: var(--ink);
  font-size: 14px;
}
.slip-nums b {
  color: var(--ink-red);
  letter-spacing: 0.08em;
}
.slip-gold {
  transform: rotate(0.8deg);
  border-top: 6px solid var(--gold);
}
.areas,
.extras {
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}
.areas > div,
.extras > div {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 12px;
}
.areas dt,
.extras dt {
  color: var(--ink-red);
  font-weight: 600;
  font-size: 14px;
}
.areas dd,
.extras dd {
  margin: 0;
  font-size: 15.5px;
}
.extras {
  padding-top: 14px;
  border-top: 1px dashed rgba(200, 31, 27, 0.35);
}
.extras dd {
  font-weight: 600;
  color: var(--ink-red);
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: -2px;
  box-shadow: 0 0 0 1.5px rgba(58, 20, 16, 0.3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  font: 600 15px/1.1 var(--mono);
  text-decoration: none;
  cursor: pointer;
}
.btn-cream {
  background: var(--cream);
  color: var(--lacquer-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--cream-faint);
}
.btn-ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--cream);
}
.free-next {
  margin: 16px 0 0;
  text-align: center;
  color: var(--cream-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.shared-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  max-width: 620px;
  margin: 0 auto 20px;
  padding: 14px 14px 14px 20px;
  border-radius: 16px;
  background: rgba(60, 4, 2, 0.3);
}
.shared-banner p {
  margin: 0;
}
.shared-invalid {
  text-align: center;
}

/* ── golden offer ── */
.gold-offer {
  margin-top: 44px;
}
.gold-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 26px 26px 24px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 220, 140, 0.16), rgba(60, 4, 2, 0.25));
  box-shadow: inset 0 0 0 1.5px rgba(246, 199, 94, 0.7);
}
.gold-card h2 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
}
.gold-card > p {
  margin: 0 0 18px;
  color: var(--cream);
}
.gold-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--cream-soft);
}
.gold-card input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1.5px solid var(--cream-faint);
  border-radius: 12px;
  background: rgba(60, 4, 2, 0.25);
  color: var(--cream);
  font: 500 17px/1.3 var(--mono);
}
.gold-card input::placeholder {
  color: rgba(255, 244, 227, 0.45);
}
.gold-card input:focus {
  outline: none;
  border-color: var(--gold);
}
.guard {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}
.guard p {
  margin: 0;
}
.guard a {
  color: var(--ink-red);
  font-weight: 600;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 14px;
  width: 100%;
  min-height: 62px;
  margin-top: 16px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 45%, #d99a2a);
  color: var(--gold-ink);
  font: 700 18px/1.2 var(--display);
  cursor: pointer;
  box-shadow: 0 6px 0 #8f5f0e, 0 14px 28px rgba(60, 4, 2, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #8f5f0e, 0 8px 18px rgba(60, 4, 2, 0.3);
}
.cta-price {
  font: 500 14px/1.2 var(--mono);
  opacity: 0.85;
}
.free-note {
  margin: 14px 0 0;
  text-align: center;
  color: var(--cream-soft);
  font-size: 14px;
}

/* ── footer ── */
.foot {
  margin-top: 64px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--cream-faint);
  color: var(--cream-soft);
  font-size: 13.5px;
  text-align: center;
}
.foot p {
  margin: 0 0 8px;
}
.more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
}
.more a {
  color: var(--cream);
  font-weight: 600;
}

@media (max-width: 600px) {
  .brand {
    font-size: 14px;
  }
  .stage {
    height: 260px;
  }
  .slip {
    padding: 20px 18px 18px;
  }
  .areas > div,
  .extras > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .gold-card {
    padding: 22px 18px 20px;
  }
  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-btn:not([disabled]):hover .cookie {
    animation: none;
  }
  .cta {
    transition: none;
  }
}
