/* ---------- tokens ---------- */
:root {
  --nebula-pink: #ff3cbd;
  --nebula-blue: #3d84fb;
  --nebula-purple: #7d00ff;
  --cosmos: #190033;
  --star-gold: #ffb800;

  /* Always-dark cosmic theme — the site lives in the same universe as the game */
  --bg: #0a001a;
  --fg: #f5f5f7;
  --fg-soft: #c7c7cc;
  --fg-mute: #8e8e93;
  --line: rgba(255,255,255,.1);
  --card: rgba(93,43,137,.18);
  --card-strong: rgba(93,43,137,.32);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,.55);
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.7);
  --grad-cta: linear-gradient(90deg, #ff00aa 0%, #005eff 100%);
  --grad-text: linear-gradient(90deg, var(--nebula-pink), var(--nebula-blue) 55%, #a45cff);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font-display: 'Exo 2', 'Inter', -apple-system, sans-serif;
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11','ss01','ss03';
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: 92px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1,h2,h3 { letter-spacing: -.02em; margin: 0; font-family: var(--font-display); }
p { margin: 0; }

/* ---------- stellar cosmic background (from the OG site, refined) ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 30%, rgba(125, 0, 255, 0.42) 0%, transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 170, 0.30) 0%, transparent 40%),
    radial-gradient(circle at 40% 70%, rgba(0, 50, 200, 0.26) 0%, transparent 40%),
    radial-gradient(circle at 70% 90%, rgba(100, 0, 255, 0.32) 0%, transparent 32%),
    linear-gradient(135deg, #0a001a 0%, #190033 50%, #2b0850 100%);
  background-size: 200% 200%;
  animation: gradientMovement 30s ease infinite;
}
@keyframes gradientMovement {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* ---------- star field ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 6s infinite;
}
@keyframes twinkle {
  0%,100% { opacity: 0; }
  50%     { opacity: .8; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.nav__logo { width: 32px; height: 32px; border-radius: 8px; box-shadow: var(--shadow-sm); }
.nav__name { font-size: 17px; letter-spacing: -.01em; }
.nav__links { display: flex; gap: 22px; font-size: 14px; color: var(--fg-soft); }
.nav__links a { transition: color .2s var(--ease); }
.nav__links a:hover { color: var(--fg); }
@media (max-width: 600px) {
  .nav { padding: 12px 18px; }
  .nav__links { gap: 14px; font-size: 13px; }
  .nav__links a:nth-child(2) { display: none; }
}

/* ---------- layout ---------- */
main { display: block; }
section { padding: 110px 28px; max-width: var(--max); margin: 0 auto; }
@media (max-width: 700px) { section { padding: 80px 20px; } }

.section__title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  text-shadow: 0 0 28px rgba(255, 60, 189, .28), 0 0 10px rgba(61, 132, 251, .2);
}
.section__lede {
  text-align: center;
  color: var(--fg-soft);
  font-size: clamp(17px, 2vw, 21px);
  max-width: 620px;
  margin: 14px auto 56px;
}

/* ---------- hero ---------- */
.hero { padding-top: 70px; padding-bottom: 60px; }
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__icon {
  width: clamp(120px, 18vw, 168px);
  height: auto;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  animation: floaty 6s ease-in-out infinite;
}
.hero__title {
  font-size: clamp(44px, 8.5vw, 92px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.04;
  margin: 32px 0 20px;
  text-shadow: 0 0 30px rgba(255, 60, 189, .35), 0 0 12px rgba(61, 132, 251, .25);
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 22px rgba(255, 60, 189, .4));
}
.hero__sub {
  max-width: 660px;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--fg-soft);
  margin-bottom: 20px;
}
.hero__pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
}
.hero__pills li {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--fg-mute);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  backdrop-filter: blur(8px);
}
.hero__appstore { margin: 0 0 36px; }

@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

/* ---------- phone mockup ---------- */
.hero__device {
  margin-top: 60px;
  display: flex;
  justify-content: center;
  perspective: 1500px;
}
.hero__screenshot {
  width: min(340px, 80vw);
  height: auto;
  display: block;
  border-radius: 32px;
  filter: drop-shadow(0 30px 80px rgba(125,0,255,.35));
  transform: rotateX(8deg) rotateY(-4deg);
  transition: transform .6s var(--ease);
}

/* ---------- screenshots gallery ---------- */
.shots { padding-top: 0; }
.shots__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: start;
}
.shots__grid img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease);
}
.shots__grid img:hover { transform: translateY(-6px) scale(1.02); }
@media (max-width: 920px) { .shots__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- cards grid ---------- */
.grid { display: grid; gap: 22px; }
.grid--features { grid-template-columns: repeat(3, 1fr); }
.grid--three   { grid-template-columns: repeat(3, 1fr); }
.grid--two     { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) {
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .grid--three { grid-template-columns: 1fr; }
  .grid--two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid--features { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: var(--card-strong); }
.card h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.card p  { color: var(--fg-soft); font-size: 15px; }
.card__glyph {
  width: 44px; height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--nebula-blue), var(--nebula-purple));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px -6px rgba(125,0,255,.45);
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
}
.card__glyph svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.card__glyph--modes  { background: linear-gradient(135deg, var(--nebula-pink), var(--nebula-purple)); }
.card__glyph--luck   { background: conic-gradient(from 200deg, var(--nebula-pink), var(--nebula-blue), var(--nebula-purple), var(--cosmos), var(--nebula-pink)); }
.card__glyph--cosmic { background: linear-gradient(135deg, var(--nebula-blue), #5e5ce6); }
.card__glyph--twist  { background: linear-gradient(135deg, #34c759, var(--nebula-blue)); }
.card__glyph--brain  { background: linear-gradient(135deg, var(--nebula-pink), #ff5e8a); }
.card__glyph--any    { background: linear-gradient(135deg, #5e5ce6, var(--cosmos)); }

/* ---------- game mode cards ---------- */
.mode-card {
  padding: 34px 30px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.mode-card h3 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.mode-card__grid {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 16px;
  display: block;
}
.mode-card > p { color: var(--fg-soft); font-size: 15.5px; margin-bottom: 12px; }
.mode-card__variants {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.variant { display: flex; flex-direction: column; gap: 2px; }
.variant__name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; }
.variant p { color: var(--fg-soft); font-size: 14px; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}
.badge--free    { background: #34c759; }
.badge--premium { background: var(--grad-cta); }

/* ---------- vignettes (difficulty & players) ---------- */
.vignette {
  padding: 26px 24px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.vignette__tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
  color: #fff;
}
.vignette__tag[data-color="pink"]   { background: var(--nebula-pink); }
.vignette__tag[data-color="blue"]   { background: var(--nebula-blue); }
.vignette__tag[data-color="purple"] { background: var(--nebula-purple); }
.vignette__tag[data-color="gold"]   { background: var(--star-gold); color: var(--cosmos); }
.vignette p { font-size: 17px; color: var(--fg); }

/* ---------- premium ---------- */
.premium__inner {
  padding: 60px 40px;
  border-radius: 36px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--nebula-pink) 14%, transparent), color-mix(in srgb, var(--nebula-purple) 16%, transparent));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
@media (max-width: 700px) { .premium__inner { padding: 44px 22px; } }
.premium__inner .section__lede { margin-bottom: 40px; }
.premium__cta { text-align: center; margin-top: 40px; }
.premium__note { color: var(--fg-soft); font-size: 15.5px; margin-bottom: 22px; }

/* ---------- app store badge ---------- */
.appstore-badge {
  display: inline-block;
  flex-shrink: 0;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.appstore-badge:hover { transform: translateY(-2px); opacity: .85; }
.appstore-badge img { display: block; }

/* ---------- launch bar ---------- */
.notify-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-top: 1px solid var(--line);
}
.notify-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.notify-bar__text { min-width: 0; }
.notify-bar__copy {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.notify-bar__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--fg-mute);
}
@media (max-width: 640px) {
  body { padding-bottom: 136px; }
  .notify-bar { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
  .notify-bar__inner { gap: 12px; }
  .notify-bar__copy { font-size: 14px; }
}

/* ---------- faq ---------- */
.faq__list {
  max-width: 760px;
  margin: 56px auto 0;
  display: grid;
  gap: 14px;
}
.faq__item {
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  padding: 0 24px;
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.faq__item:hover { background: var(--card-strong); }
.faq__item[open] { box-shadow: var(--shadow-md); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.faq__item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--fg-mute);
  transition: transform .3s var(--ease);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p {
  color: var(--fg-soft);
  font-size: 15.5px;
  line-height: 1.65;
  padding: 0 0 22px;
}
.faq__item p a { color: var(--nebula-blue); border-bottom: 1px solid color-mix(in srgb, var(--nebula-blue) 30%, transparent); }

/* ---------- studio cross-promo ---------- */
.studio-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.studio-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.studio-card__icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  object-fit: cover;
  background: var(--card-strong);
}
.studio-card__body h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.studio-card__body p  { font-size: 14.5px; color: var(--fg-soft); margin-bottom: 10px; }
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent, var(--nebula-blue));
  color: #fff;
  letter-spacing: .02em;
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 36px 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

/* Kahi peeking over the footer edge — click to poke */
.kahi-peek {
  position: absolute;
  bottom: 100%;
  right: clamp(24px, 10%, 140px);
  height: 84px;
  overflow: hidden;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.kahi-peek:focus-visible { outline: 2px solid var(--nebula-pink); outline-offset: 4px; border-radius: 8px; }
.kahi-peek img {
  display: block;
  width: 118px;
  height: auto;
  animation: kahiPeek 5s ease-in-out infinite;
}
@keyframes kahiPeek {
  0%, 100% { transform: translateY(10px); }
  50%      { transform: translateY(0); }
}

/* easter-egg quips & sparkles */
.kahi-bubble {
  position: absolute;
  z-index: 3;
  font-family: 'Caveat', cursive;
  font-size: 23px;
  font-weight: 600;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  rotate: -3deg;
  pointer-events: none;
  animation: kahiBubble 1.6s ease forwards;
}
@keyframes kahiBubble {
  0%   { opacity: 0; translate: 0 12px; }
  15%  { opacity: 1; translate: 0 0; }
  75%  { opacity: 1; }
  100% { opacity: 0; translate: 0 -16px; }
}
.kahi-spark {
  position: absolute;
  z-index: 3;
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  animation: kahiSpark .8s ease-out forwards;
}
@keyframes kahiSpark {
  from { transform: translate(0, 0) scale(.4) rotate(0deg); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(90deg); opacity: 0; }
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.footer__logo { width: 24px; height: 24px; border-radius: 6px; }
.footer__links { display: flex; gap: 22px; font-size: 14px; color: var(--fg-soft); flex-wrap: wrap; }
.footer__links a:hover { color: var(--fg); }
.footer__copy { font-size: 13px; color: var(--fg-mute); }

/* ---------- privacy page ---------- */
.policy {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.policy h1 {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 8px;
}
.policy__date { color: var(--fg-mute); font-size: 14px; margin-bottom: 32px; }
.policy__summary {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, color-mix(in srgb, var(--nebula-pink) 14%, transparent), color-mix(in srgb, var(--nebula-purple) 14%, transparent));
  border: 1px solid var(--line);
  margin: 0 0 36px;
  font-size: 16px;
  color: var(--fg);
}
.policy__summary strong { display: block; margin-bottom: 6px; font-weight: 600; }
.policy h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 10px;
  letter-spacing: -.01em;
}
.policy p, .policy ul {
  color: var(--fg-soft);
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.65;
}
.policy a { color: var(--nebula-blue); border-bottom: 1px solid color-mix(in srgb, var(--nebula-blue) 30%, transparent); }
.policy__back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--fg-soft);
}

/* ---------- playable demo ---------- */
.demo-wrap {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.demo-note {
  align-self: center;
  transform: translateX(-9%) rotate(-2.5deg);
  display: flex;
  align-items: flex-end;
  gap: 7px;
  font-family: 'Caveat', cursive;
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255,255,255,.82);
  margin-bottom: -4px;
}
.demo-note__arrow {
  width: 30px;
  height: 33px;
  margin-bottom: -22px;
  transform: rotate(6deg);
  opacity: .75;
}
@media (max-width: 600px) {
  .demo-note { font-size: 24px; transform: translateX(-6%) rotate(-2.5deg); }
}
.demo {
  position: relative;
  width: min(440px, 94vw);
  padding: 18px 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(93,43,137,.35), rgba(25,0,51,.55));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 80px -30px rgba(125,0,255,.55), 0 0 40px rgba(255,60,189,.12), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* HUD */
.demo__hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 14px;
}
.demo__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: #52ffa8;
  text-shadow: 0 0 14px rgba(82,255,168,.55);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.demo__score small {
  display: block;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--fg-mute);
  text-shadow: none;
  margin-bottom: 3px;
}
.demo__mode {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.demo__moves { display: flex; gap: 6px; align-items: center; }
.demo__moves span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--grad-cta);
  box-shadow: 0 0 8px rgba(255,60,189,.6);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.demo__moves span.used { background: rgba(255,255,255,.15); box-shadow: none; transform: scale(.8); }

/* board */
.demo__board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  container-type: inline-size;
}
.demo-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
  padding: 0;
  transition: background .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease);
}
button.demo-cell { cursor: pointer; }
button.demo-cell:hover { background: rgba(255,255,255,.16); }
.demo-cell.is-hint {
  animation: hintPulse 1.4s ease-in-out infinite;
  border-color: rgba(255,184,0,.7);
}
@keyframes hintPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,184,0,0); background: rgba(255,255,255,.1); }
  50%     { box-shadow: 0 0 16px 2px rgba(255,184,0,.45); background: rgba(255,184,0,.16); }
}
.demo-cell.is-scored { animation: scoreFlash .9s var(--ease); }
@keyframes scoreFlash {
  0%   { background: rgba(255,255,255,.08); }
  25%  { background: rgba(255,184,0,.85); box-shadow: 0 0 24px rgba(255,184,0,.8); }
  100% { background: rgba(255,255,255,.08); }
}

/* card tiles — white rounded cards with indigo border, like the app */
.demo-tile {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #f8f6ff;
  border: 2.5px solid #4f46ba;
  overflow: hidden;
}
.demo-tile__rank {
  position: absolute;
  left: 8%;
  bottom: 8%;
  font-family: 'Iowan Old Style', 'Palatino', Georgia, serif;
  font-weight: 800;
  font-size: 8cqw;
  line-height: 1;
}
.demo-tile__suit {
  position: absolute;
  top: 4%;
  right: 8%;
  font-size: 6.5cqw;
  line-height: 1;
}
.demo-tile[data-color="red"]   { color: #d92049; }
.demo-tile[data-color="black"] { color: #232047; }
.demo-tile.pop { animation: tilePop .38s var(--ease); }
@keyframes tilePop {
  0%   { transform: scale(1.35) translateY(-14px); opacity: 0; }
  60%  { transform: scale(.95) translateY(0); opacity: 1; }
  100% { transform: scale(1); }
}

/* offers row */
.demo__offers {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  min-height: 78px;
}
.demo-offer {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #f8f6ff;
  border: 2.5px solid #4f46ba;
  cursor: pointer;
  padding: 0;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .3s var(--ease);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.6);
}
.demo-offer:hover { transform: translateY(-4px); }
.demo-offer.is-selected {
  transform: translateY(-8px) scale(1.06);
  box-shadow: 0 0 0 3px var(--nebula-pink), 0 10px 26px -6px rgba(255,60,189,.55);
}
.demo-offer .demo-tile__rank { font-size: 20px; }
.demo-offer .demo-tile__suit { font-size: 16px; }
.demo-offer[data-color="red"]   { color: #d92049; }
.demo-offer[data-color="black"] { color: #232047; }
.demo-offer.shake { animation: offerShake .4s; }
@keyframes offerShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.demo__prompt {
  text-align: center;
  font-size: 13.5px;
  color: var(--fg-mute);
  margin-top: 14px;
  min-height: 20px;
  transition: color .3s;
}
.demo__prompt strong { color: var(--fg-soft); font-weight: 600; }

/* score bubble */
.demo__bubble {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  background: var(--grad-cta);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .01em;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 8px 24px -6px rgba(255,0,170,.6), 0 0 18px rgba(61,132,251,.4);
  pointer-events: none;
  animation: bubbleFloat 1.5s var(--ease) forwards;
}
@keyframes bubbleFloat {
  0%   { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  15%  { transform: translate(-50%, -60%) scale(1.12); opacity: 1; }
  30%  { transform: translate(-50%, -65%) scale(1); }
  80%  { transform: translate(-50%, -130%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -170%) scale(.95); opacity: 0; }
}

/* confetti canvas overlays the demo panel and beyond */
.demo__confetti {
  position: absolute;
  left: -80px;
  top: -100px;
  pointer-events: none;
  z-index: 6;
}

/* end overlay */
.demo__end {
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgba(16,2,36,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease);
}
.demo__end.is-visible { opacity: 1; pointer-events: auto; }
.demo__kahi {
  width: 88px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(255,60,189,.35));
  animation: floaty 4s ease-in-out infinite;
}
.demo__end h3 {
  font-size: 24px;
  font-weight: 800;
  text-shadow: 0 0 20px rgba(255,60,189,.45);
}
.demo__end .demo__final {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  color: #52ffa8;
  text-shadow: 0 0 18px rgba(82,255,168,.55);
  line-height: 1;
}
.demo__end p { color: var(--fg-soft); font-size: 14.5px; max-width: 300px; }
.demo__again {
  background: none;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--fg-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.demo__again:hover { background: rgba(255,255,255,.1); color: var(--fg); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .star { opacity: .4; }
}
