:root {
  color-scheme: light;
  --cream: #fffaf1;
  --canvas: #f3ebdf;
  --plum: #2d174d;
  --purple: #6332cf;
  --purple-dark: #5123ad;
  --lavender: #dfceff;
  --lavender-soft: #f0e7ff;
  --pink: #fa6196;
  --yellow: #ffd364;
  --coin-edge: #e9a72c;
  --muted: #786a8a;
  --line: #e5d9e8;
  --shadow: 9px 10px 0 var(--plum);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 8px;
  background: var(--canvas);
  color: var(--plum);
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 1.5;
}
button, a, input { font: inherit; }
a { color: inherit; }
.site-shell {
  width: min(100%, 1480px);
  min-height: calc(100vh - 16px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #e3d9d0;
  border-radius: 22px;
  background: var(--cream);
  box-shadow: 0 2px 12px rgba(49, 28, 67, .06);
}
.skip-link {
  position: absolute;
  z-index: 10;
  top: -5rem;
  left: 1rem;
  padding: .8rem 1rem;
  border-radius: .7rem;
  background: white;
  color: var(--plum);
}
.skip-link:focus { top: 1rem; }
.site-header {
  min-height: 78px;
  padding: 1.1rem clamp(1.25rem, 3.4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--plum);
  text-decoration: none;
  font-size: 1.7rem;
  font-weight: 1000;
  letter-spacing: -.085em;
  line-height: 1;
}
.brand span { color: var(--purple); }
.design-label {
  color: #9a8a9f;
  font-size: .78rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}
main { max-width: 1280px; margin: 0 auto; padding: 2.4rem clamp(1.25rem, 4.2vw, 3.5rem) 3.6rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 1rem 0 2rem;
}
.hero-copy { min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1.75rem;
  padding: .55rem .9rem;
  border: 1px solid #dcc5ff;
  border-radius: 999px;
  background: var(--lavender-soft);
  color: var(--purple-dark);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.eyebrow-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); }
.hero h1 {
  max-width: 570px;
  margin: 0 0 1.15rem;
  color: var(--plum);
  font-size: clamp(3.1rem, 6vw, 5.6rem);
  font-weight: 1000;
  letter-spacing: -.075em;
  line-height: .98;
}
.hero h1 span { color: var(--purple); }
.hero-intro { max-width: 490px; margin: 0; color: #68577a; font-size: 1.04rem; line-height: 1.8; }
.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.7rem 0 0;
  padding: 0;
  list-style: none;
}
.feature-chips li {
  padding: .52rem .72rem;
  border: 1px solid #eadfeb;
  border-radius: 999px;
  background: #fff;
  color: #584870;
  font-size: .75rem;
  font-weight: 700;
}
.flip-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 520px;
  padding: 2rem clamp(1.1rem, 3vw, 2.5rem) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  overflow: hidden;
  border: 3px solid var(--plum);
  border-radius: 34px;
  background: var(--lavender);
  box-shadow: var(--shadow);
  text-align: center;
}
.moment-label {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #78608e;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.panel-sparkle { position: absolute; z-index: -1; line-height: 1; pointer-events: none; }
.sparkle-left { top: 2.8rem; left: 9%; color: var(--pink); font-size: 2.3rem; transform: rotate(18deg); }
.sparkle-right { top: 3.5rem; right: 11%; color: var(--purple); font-size: 1.7rem; }
.coin-stage {
  --coin-size: 190px;
  width: 100%;
  min-height: 240px;
  padding: .7rem 0;
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
  perspective: 1000px;
}
.coin-stage[data-count="2"] { --coin-size: 118px; }
.coin-stage[data-count="3"] { --coin-size: 104px; }
.coin-stage[data-count="20"] { --coin-size: 48px; }
.coin-stage[data-count="100"] { --coin-size: 30px; min-height: 250px; gap: .28rem; }
.coin {
  width: var(--coin-size);
  height: var(--coin-size);
  flex: 0 0 var(--coin-size);
  display: grid;
  place-items: center;
  border: max(4px, calc(var(--coin-size) * .035)) solid var(--coin-edge);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #fff3bd 0 10%, #ffdc76 37%, #f6bd49 75%, #d98f1d 100%);
  box-shadow: inset 0 0 0 max(2px, calc(var(--coin-size) * .02)) rgba(255,255,255,.8), 6px 8px 0 rgba(93,51,123,.16);
  color: #633614;
  perspective: 700px;
}
.coin-inner {
  width: 78%;
  height: 78%;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(126, 84, 35, .45);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(var(--coin-size) * .55);
  font-weight: 900;
  line-height: 1;
  transform-style: preserve-3d;
}
.coin[data-side="tails"] { background: radial-gradient(circle at 32% 24%, #fff8d6 0 10%, #ffe28a 37%, #f3c25d 75%, #cf922d 100%); }
.coin.is-flipping .coin-inner { animation: coin-tumble 1.05s cubic-bezier(.2,.72,.25,1) both; animation-delay: var(--flip-delay,0ms); }
@keyframes coin-tumble {
  0% { transform: rotateY(0) rotateZ(0) scale(1); }
  25% { transform: rotateY(540deg) rotateZ(9deg) scale(1.08); }
  55% { transform: rotateY(1260deg) rotateZ(-8deg) scale(.94); }
  100% { transform: rotateY(1980deg) rotateZ(0) scale(1); }
}
.flip-button {
  position: relative;
  z-index: 1;
  width: min(78%, 360px);
  min-height: 60px;
  padding: .9rem 1.2rem;
  border: 2px solid var(--plum);
  border-radius: 19px;
  background: var(--purple);
  box-shadow: 7px 8px 0 var(--plum);
  color: white;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.flip-button:hover:not(:disabled) { transform: translate(2px,2px); box-shadow: 5px 6px 0 var(--plum); background: #5426bb; }
.flip-button:active:not(:disabled) { transform: translate(6px,7px); box-shadow: 1px 1px 0 var(--plum); }
.flip-button:disabled { opacity: .7; cursor: wait; }
.result-summary {
  max-width: 94%;
  min-height: 2.6rem;
  margin: .15rem 0 0;
  padding: .55rem 1rem;
  display: grid;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: #65517b;
  font-size: .9rem;
  font-weight: 900;
}
.round-stats { width: min(100%, 350px); display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding-top: .65rem; border-top: 1px solid rgba(76,45,113,.18); }
.round-stats div { display: flex; flex-direction: column; gap: .1rem; }
.round-stats strong { color: var(--purple-dark); font-size: 1.15rem; line-height: 1; }
.round-stats span { color: #715f85; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.stats-note { margin: 0; color: #756384; font-size: .7rem; }
.sequence-option {
  width: min(100%, 350px);
  padding: .5rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  border: 1px solid #ccb4ef;
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  color: #55309a;
  font-size: .78rem;
  font-weight: 700;
  text-align: left;
}
.sequence-option input { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--purple); }
.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; }
.mode-section { margin: 2.5rem 0 2.1rem; }
.mode-section h2, .content-section h2, .related-section h2 { margin: 0 0 .9rem; color: var(--plum); font-size: 1.3rem; font-weight: 1000; letter-spacing: -.035em; }
.mode-cards { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .75rem; }
.mode-card {
  min-height: 112px;
  padding: .9rem .6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  border: 2px solid #ded1e2;
  border-radius: 17px;
  background: white;
  color: var(--plum);
  text-align: center;
  text-decoration: none;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--purple); }
.mode-card.is-current { border-color: var(--purple); background: #eee4ff; }
.mode-icon { min-height: 1.8rem; color: #9560dc; font-size: 1.45rem; font-weight: 1000; letter-spacing: -.08em; line-height: 1.1; }
.mode-card:nth-child(5) .mode-icon { font-size: 1.55rem; letter-spacing: -.04em; }
.mode-card strong { font-size: .83rem; }
.mode-detail { color: #8a7995; font-size: .72rem; }
.content-section {
  margin-top: 2rem;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(220px, 300px);
  align-items: center;
  gap: 2.5rem;
  border: 1px solid #eee3e6;
  border-radius: 20px;
  background: white;
}
.content-section .eyebrow, .related-section .eyebrow { margin-bottom: .7rem; border: 0; background: transparent; padding: 0; color: var(--purple); }
.content-section p { max-width: 720px; margin: .65rem 0; color: #655773; }
.ad-space { min-height: 130px; padding: 1rem; display: grid; place-items: center; border: 1px dashed #d8c4e5; border-radius: 16px; background: #fcf9ff; color: #8c7c97; font-size: .78rem; text-align: center; }
.related-section { margin: 2.3rem 0 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.related-section h2 { margin: 0; }
.related-links { max-width: 650px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.related-link { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--purple-dark); font-size: .78rem; font-weight: 800; text-decoration: none; }
.related-link:hover { border-color: var(--purple); background: var(--lavender-soft); }
.site-footer { padding: 1.2rem clamp(1.25rem, 3.4vw, 3rem) 1.6rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--line); color: #7d6f82; font-size: .8rem; }
.site-footer a { color: var(--purple); font-weight: 900; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.flip-button:focus-visible, .mode-card:focus-visible, .related-link:focus-visible, .sequence-option input:focus-visible, .brand:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }

@media (max-width: 900px) {
  main { max-width: 720px; }
  .hero { grid-template-columns: 1fr; gap: 2.3rem; }
  .hero-copy { max-width: 610px; }
  .hero h1 { max-width: 690px; font-size: clamp(3.3rem, 10vw, 5.2rem); }
  .flip-card { width: 100%; min-height: 500px; }
}
@media (max-width: 600px) {
  body { padding: 0; }
  .site-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .site-header { min-height: 65px; padding: .9rem 1.1rem; }
  .brand { font-size: 1.5rem; }
  .design-label { font-size: .63rem; }
  main { padding: 1.6rem 1.1rem 2.5rem; }
  .hero { gap: 1.8rem; padding: .5rem 0 1rem; }
  .eyebrow { margin-bottom: 1.25rem; font-size: .68rem; }
  .hero h1 { font-size: clamp(3rem, 13vw, 4rem); }
  .hero-intro { font-size: .98rem; }
  .feature-chips { gap: .45rem; margin-top: 1.25rem; }
  .feature-chips li { padding: .45rem .6rem; font-size: .69rem; }
  .flip-card { min-height: 465px; padding: 1.4rem 1rem 1.1rem; border-radius: 26px; box-shadow: 7px 8px 0 var(--plum); }
  .moment-label { font-size: .72rem; }
  .sparkle-left { top: 2.8rem; font-size: 1.7rem; }
  .sparkle-right { top: 3.3rem; font-size: 1.3rem; }
  .coin-stage { --coin-size: 155px; min-height: 205px; gap: .35rem; }
  .coin-stage[data-count="2"] { --coin-size: 98px; }
  .coin-stage[data-count="3"] { --coin-size: 82px; }
  .coin-stage[data-count="20"] { --coin-size: 42px; min-height: 220px; }
  .coin-stage[data-count="100"] { --coin-size: 25px; min-height: 230px; gap: .22rem; }
  .flip-button { width: min(90%, 360px); min-height: 56px; font-size: .9rem; }
  .result-summary { min-height: 2.4rem; padding: .45rem .65rem; font-size: .78rem; }
  .stats-note { max-width: 95%; font-size: .64rem; }
  .mode-section { margin: 2rem 0 1.7rem; }
  .mode-cards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
  .mode-card { min-height: 100px; }
  .mode-card:last-child { grid-column: 1 / -1; }
  .content-section { grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.5rem; }
  .ad-space { min-height: 92px; }
  .related-section { align-items: flex-start; flex-direction: column; gap: .9rem; margin-top: 1.8rem; }
  .related-links { justify-content: flex-start; }
  .site-footer { flex-wrap: wrap; padding: 1rem 1.1rem 1.4rem; font-size: .72rem; }
}
@media (max-width: 370px) {
  .design-label { max-width: 108px; text-align: right; }
  .feature-chips li { font-size: .64rem; }
  .coin-stage[data-count="100"] { --coin-size: 22px; gap: .17rem; }
  .flip-card { padding-inline: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .coin.is-flipping .coin-inner { animation: none; }
}
