:root {
  --page: #eef2f0;
  --surface: #ffffff;
  --ink: #15201c;
  --muted: #64716c;
  --line: #dbe3df;
  --brand: #0f7b5c;
  --brand-strong: #07563f;
  --mint: #dff6ec;
  --amber: #f4c542;
  --amber-strong: #f0a900;
  --coal: #10120f;
  --coal-2: #181b14;
  --steel: #7b847f;
  --danger: #b04434;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: var(--page);
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(15, 123, 92, 0.12), transparent 38%),
    var(--page);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 123, 92, 0.45);
  outline-offset: 3px;
}

.phone-shell {
  width: min(100vw, 430px);
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(20, 36, 31, 0.18);
}

.portal-shell {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 28px 18px;
}

.portal-hero {
  padding: 34px 22px 10px;
}

.brand-mark,
.app-icon,
.coin-mark {
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-mark {
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #1a9f74 55%, #93dbc1);
  font-size: 2rem;
}

.official-pill,
.soft-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.official-pill {
  color: var(--brand-strong);
  background: var(--mint);
}

.soft-badge {
  color: #3b4844;
  background: #edf2ef;
}

.portal-hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(2.4rem, 16vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.portal-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.portal-links {
  display: grid;
  gap: 12px;
}

.portal-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  transition: transform 160ms ease, border-color 160ms ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 123, 92, 0.35);
}

.portal-card-dark {
  color: #fff8dc;
  border-color: #2d3026;
  background: var(--coal);
}

.portal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  color: var(--brand-strong);
  background: var(--mint);
  font-weight: 900;
}

.portal-card-dark .portal-icon {
  color: var(--coal);
  background: var(--amber);
}

.portal-card strong,
.portal-card small {
  display: block;
}

.portal-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.portal-card-dark small {
  color: #c6c0a4;
}

.browser-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: #edf2ef;
  font-size: 1.45rem;
  cursor: pointer;
}

.icon-button.dark {
  color: #fff8dc;
  background: rgba(255, 255, 255, 0.1);
}

.address-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: #52605b;
  background: #eef3f0;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-field span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.store-shell {
  padding-bottom: 30px;
}

.store-identity,
.install-panel,
.section-block {
  padding: 20px 18px;
}

.store-badge-row,
.section-title-row,
.tag-row,
.install-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.app-heading {
  display: grid;
  grid-template-columns: minmax(72px, 86px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 20px;
}

.app-heading > div:last-child {
  min-width: 0;
}

.app-icon {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  color: #ffffff;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(135deg, #064f3b, #16a376);
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.18), 0 16px 28px rgba(7, 86, 63, 0.25);
  font-size: 2.5rem;
}

.app-heading h1,
.challenge-hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.developer,
.verified {
  margin: 7px 0 0;
}

.developer {
  color: var(--brand);
  font-weight: 800;
}

.verified {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.app-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.app-stats div {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 14px 8px;
  background: #fbfdfb;
}

.app-stats strong {
  font-size: 1.05rem;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.app-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.install-panel {
  display: grid;
  gap: 12px;
}

.install-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(15, 123, 92, 0.24);
}

.install-button:hover {
  background: var(--brand-strong);
}

.install-button:disabled {
  cursor: wait;
  background: #85958f;
  box-shadow: none;
}

.install-button.compact {
  min-height: 44px;
}

.install-actions {
  justify-content: center;
}

.text-action,
.record-button,
.rule-button {
  border: 1px solid transparent;
  cursor: pointer;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--mint);
  font-weight: 800;
}

.install-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.section-block {
  border-top: 1px solid var(--line);
}

.section-title-row {
  justify-content: space-between;
}

.section-title-row h2,
.section-block h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
}

.section-title-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.section-block p {
  margin: 0;
  color: #43504b;
  line-height: 1.58;
}

.screenshots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 12px;
  margin: 14px -18px 0;
  padding: 0 18px 8px;
  overflow-x: auto;
  max-width: calc(100% + 36px);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.screenshots::-webkit-scrollbar {
  display: none;
}

.shot-card {
  position: relative;
  min-height: 252px;
  padding: 18px;
  border-radius: 8px;
  color: #ffffff;
  overflow: hidden;
  scroll-snap-align: start;
}

.shot-card span,
.shot-card strong {
  position: relative;
  z-index: 1;
  display: block;
}

.shot-card span {
  font-size: 0.78rem;
  opacity: 0.78;
}

.shot-card strong {
  max-width: 160px;
  margin-top: 6px;
  font-size: 1.35rem;
  line-height: 1.08;
}

.shot-market {
  background: linear-gradient(150deg, #0b5c44, #1aa97b);
}

.shot-trade {
  background: linear-gradient(150deg, #26322e, #0f7b5c);
}

.shot-learn {
  background: linear-gradient(150deg, #35362c, #a47822);
}

.mini-chart {
  position: absolute;
  right: 18px;
  bottom: 22px;
  left: 18px;
  height: 94px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.82) 49% 52%, transparent 53%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
}

.price-list,
.lesson-stack {
  position: absolute;
  right: 18px;
  bottom: 22px;
  left: 18px;
  display: grid;
  gap: 10px;
}

.price-list i,
.lesson-stack i {
  display: block;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
}

.lesson-stack i:nth-child(2),
.price-list i:nth-child(2) {
  width: 84%;
}

.lesson-stack i:nth-child(3),
.price-list i:nth-child(3) {
  width: 68%;
}

.tag-row {
  margin-top: 14px;
}

.tag-row span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #51605b;
  background: #edf2ef;
  font-size: 0.82rem;
  font-weight: 750;
}

.safety-card {
  display: grid;
  gap: 16px;
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 24px;
  color: #384642;
  line-height: 1.35;
}

.check-list li::before {
  position: absolute;
  left: 0;
  top: 0.08em;
  content: "✓";
  color: var(--brand);
  font-weight: 900;
}

.review-grid {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.review-grid strong {
  font-size: 2.6rem;
  line-height: 1;
}

.bar-list {
  display: grid;
  gap: 7px;
}

.bar-list span {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--brand) var(--value), #e6ede9 var(--value));
}

.challenge-page {
  color: #fff8dc;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 197, 66, 0.22), transparent 36%),
    var(--coal);
}

.challenge-shell {
  position: relative;
  min-height: 100vh;
  padding-bottom: 26px;
  color: #fff8dc;
  background:
    linear-gradient(180deg, #191c14 0%, #10120f 58%, #16130a 100%);
  overflow: hidden;
}

.challenge-shell::before {
  position: absolute;
  inset: 74px -80px auto;
  height: 220px;
  background:
    repeating-linear-gradient(90deg, rgba(244, 197, 66, 0.12) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 18px);
  transform: rotate(-10deg);
  content: "";
  pointer-events: none;
}

.challenge-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 8px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(244, 197, 66, 0.28);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.icon-pill:hover {
  background: rgba(244, 197, 66, 0.16);
  transform: translateY(-1px);
}

.challenge-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 900;
}

.challenge-brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(244, 197, 66, 0.5));
  animation: coinSpin 6s ease-in-out infinite;
}

.coin-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rule-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(244, 197, 66, 0.28);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(244, 197, 66, 0.12);
  font-weight: 850;
  white-space: nowrap;
}

.rule-button span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 1;
}

.challenge-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px 18px 12px;
}

.hero-badge {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 16px rgba(244, 197, 66, 0.45));
  animation: badgeFloat 4.5s ease-in-out infinite;
}

.hero-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-copy {
  min-width: 0;
}

.dark-pill {
  color: #211b08;
  background: var(--amber);
}

.challenge-hero h1 {
  margin-top: 10px;
  font-size: clamp(1.65rem, 7.6vw, 2.05rem);
  line-height: 1.04;
  background: linear-gradient(180deg, #ffe9a6, #f0a900);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(244, 197, 66, 0.25);
}

.countdown-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 18px 14px;
  padding: 13px 14px;
  border: 1px solid rgba(244, 197, 66, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.countdown-label {
  color: #cfc6a0;
  font-size: 0.88rem;
  white-space: nowrap;
}

.countdown-clock {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
}

.countdown-clock .seg {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 5px 7px;
  border: 1px solid rgba(244, 197, 66, 0.28);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
}

.countdown-clock .seg b {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 12px rgba(244, 197, 66, 0.5);
}

.countdown-clock .seg i {
  color: #b8ad84;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 800;
}

.countdown-clock .seg[data-flip] b {
  animation: segFlip 420ms ease;
}

.ticker {
  position: relative;
  z-index: 1;
  margin: 0 18px 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 26px;
  padding: 9px 16px;
  color: #e6dcb4;
  font-size: 0.84rem;
  white-space: nowrap;
  animation: tickerMove 24s linear infinite;
}

.ticker-track span b {
  color: var(--amber);
  font-weight: 900;
}

.reward-board {
  position: relative;
  z-index: 1;
  padding: 4px 18px 16px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  aspect-ratio: 1;
}

.reward-cell,
.challenge-button {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.reward-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border: 1px solid rgba(244, 197, 66, 0.24);
  color: #efe4bd;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #1c2018;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

/* soft shimmer sweeping across the idle grid */
.reward-cell::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 240, 190, 0.16) 50%, transparent 65%);
  transform: translateX(-130%);
  content: "";
  pointer-events: none;
}

.reward-board.is-idle .reward-cell::after {
  animation: cellShimmer 4.6s ease-in-out infinite;
}

.reward-cell:nth-child(2)::after { animation-delay: 0.5s; }
.reward-cell:nth-child(3)::after { animation-delay: 1s; }
.reward-cell:nth-child(4)::after { animation-delay: 1.5s; }
.reward-cell:nth-child(6)::after { animation-delay: 2s; }
.reward-cell:nth-child(7)::after { animation-delay: 2.5s; }
.reward-cell:nth-child(8)::after { animation-delay: 3s; }
.reward-cell:nth-child(9)::after { animation-delay: 3.5s; }

.reward-ico {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 7px rgba(244, 197, 66, 0.3));
  transition: transform 200ms ease, filter 200ms ease;
}

.reward-cell:hover .reward-ico {
  transform: translateY(-2px) scale(1.06);
  filter: drop-shadow(0 0 10px rgba(244, 197, 66, 0.6));
}

.reward-cell.is-active {
  color: #fff3cf;
  border-color: var(--amber);
  background:
    radial-gradient(circle at 50% 35%, rgba(244, 197, 66, 0.32), transparent 70%),
    #241f10;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.5), 0 16px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(244, 197, 66, 0.5);
}

.reward-cell.is-active .reward-ico {
  filter: drop-shadow(0 0 12px rgba(244, 197, 66, 0.85)) brightness(1.12);
  transform: scale(1.14);
}

/* the freshly-won prize keeps a celebratory pulse */
.reward-cell.is-won {
  animation: wonPulse 1.1s ease-out 3;
}

.challenge-button {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 8px;
  border: 3px solid rgba(255, 245, 200, 0.65);
  border-radius: 50%;
  color: #2a1c00;
  background:
    radial-gradient(circle at 50% 32%, #fff0b0, #ffd23d 46%, var(--amber-strong));
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.02;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 -8px 18px rgba(133, 86, 0, 0.35), 0 0 0 6px rgba(244, 197, 66, 0.12), 0 12px 34px rgba(244, 197, 66, 0.4);
  animation: buttonGlow 2.4s ease-in-out infinite;
}

.challenge-button-label {
  position: relative;
  z-index: 1;
}

/* diagonal light sweep across the CTA */
.challenge-button-glint {
  position: absolute;
  top: -60%;
  left: -40%;
  width: 45%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: rotate(18deg) translateX(0);
  pointer-events: none;
  animation: buttonGlint 2.8s ease-in-out infinite;
}

.challenge-button:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  animation: none;
}

.challenge-button:disabled .challenge-button-glint {
  animation-duration: 0.6s;
}

.challenge-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 0 18px;
}

.record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 8px;
  color: #fff8dc;
  border-color: rgba(244, 197, 66, 0.28);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 850;
}

.record-sep {
  color: rgba(244, 197, 66, 0.5);
}

.record-link {
  color: var(--amber);
}

.scroll-cue {
  justify-self: center;
  margin-top: 2px;
  color: var(--amber);
  font-size: 1.2rem;
  text-shadow: 0 0 12px rgba(244, 197, 66, 0.6);
  animation: scrollBounce 1.6s ease-in-out infinite;
}

.challenge-actions p {
  margin: 0;
  color: #c6bf9e;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(100%, 394px);
  padding: 24px 20px 20px;
  border: 1px solid rgba(244, 197, 66, 0.25);
  border-radius: 8px;
  color: #fff8dc;
  background: #191b14;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff8dc;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-kicker {
  margin: 0 0 7px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.modal-card p:not(.modal-kicker) {
  margin: 0 0 16px;
  color: #d8d0ad;
  line-height: 1.5;
}

@keyframes tickerMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ===== Ambient atmosphere ===== */
.challenge-aurora {
  position: absolute;
  inset: -10% -20% auto;
  z-index: 0;
  height: 60%;
  background:
    radial-gradient(40% 60% at 20% 10%, rgba(244, 197, 66, 0.22), transparent 70%),
    radial-gradient(45% 55% at 85% 0%, rgba(26, 159, 116, 0.18), transparent 72%);
  filter: blur(8px);
  pointer-events: none;
  animation: auroraDrift 14s ease-in-out infinite alternate;
}

.challenge-sparks {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.challenge-sparks i {
  position: absolute;
  bottom: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(244, 197, 66, 0.9);
  box-shadow: 0 0 8px rgba(244, 197, 66, 0.8);
  opacity: 0;
  animation: sparkRise 9s linear infinite;
}

.challenge-sparks i:nth-child(1)  { left: 8%;  animation-delay: 0s;    animation-duration: 8s; }
.challenge-sparks i:nth-child(2)  { left: 18%; animation-delay: 1.4s;  animation-duration: 10s; }
.challenge-sparks i:nth-child(3)  { left: 27%; animation-delay: 3.1s;  animation-duration: 9s; }
.challenge-sparks i:nth-child(4)  { left: 36%; animation-delay: 4.7s;  animation-duration: 11s; }
.challenge-sparks i:nth-child(5)  { left: 45%; animation-delay: 0.7s;  animation-duration: 9.5s; }
.challenge-sparks i:nth-child(6)  { left: 54%; animation-delay: 2.6s;  animation-duration: 8.5s; }
.challenge-sparks i:nth-child(7)  { left: 63%; animation-delay: 5.2s;  animation-duration: 10.5s; }
.challenge-sparks i:nth-child(8)  { left: 72%; animation-delay: 1.9s;  animation-duration: 9s; }
.challenge-sparks i:nth-child(9)  { left: 80%; animation-delay: 3.8s;  animation-duration: 11.5s; }
.challenge-sparks i:nth-child(10) { left: 88%; animation-delay: 6s;    animation-duration: 8s; }
.challenge-sparks i:nth-child(11) { left: 94%; animation-delay: 2.2s;  animation-duration: 10s; }
.challenge-sparks i:nth-child(12) { left: 13%; animation-delay: 5.7s;  animation-duration: 9s; }

.confetti-canvas {
  position: absolute;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== Entrance reveal ===== */
.challenge-hero,
.countdown-card,
.ticker,
.reward-board,
.challenge-actions {
  animation: riseIn 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.challenge-hero    { animation-delay: 80ms; }
.countdown-card    { animation-delay: 180ms; }
.ticker            { animation-delay: 260ms; }
.reward-board      { animation-delay: 340ms; }
.challenge-actions { animation-delay: 440ms; }

/* ===== Keyframes ===== */
@keyframes coinSpin {
  0%, 100% { transform: rotateY(0deg); }
  50%      { transform: rotateY(360deg); }
}

@keyframes countdownPulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 14px rgba(244, 197, 66, 0.45); }
  50%      { opacity: 0.82; text-shadow: 0 0 22px rgba(244, 197, 66, 0.75); }
}

@keyframes buttonGlow {
  0%, 100% { box-shadow: inset 0 -8px 18px rgba(133, 86, 0, 0.35), 0 0 0 6px rgba(244, 197, 66, 0.12), 0 12px 30px rgba(244, 197, 66, 0.32); }
  50%      { box-shadow: inset 0 -8px 18px rgba(133, 86, 0, 0.35), 0 0 0 10px rgba(244, 197, 66, 0.2), 0 14px 42px rgba(244, 197, 66, 0.6); }
}

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

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(5px); opacity: 1; }
}

@keyframes segFlip {
  0%   { transform: translateY(-40%); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes buttonGlint {
  0%        { transform: rotate(18deg) translateX(0); }
  60%, 100% { transform: rotate(18deg) translateX(720%); }
}

@keyframes cellShimmer {
  0%        { transform: translateX(-130%); }
  55%, 100% { transform: translateX(130%); }
}

@keyframes wonPulse {
  0%   { box-shadow: 0 0 0 0 rgba(244, 197, 66, 0.55), 0 16px 30px rgba(0, 0, 0, 0.28); }
  100% { box-shadow: 0 0 0 16px rgba(244, 197, 66, 0), 0 16px 30px rgba(0, 0, 0, 0.28); }
}

@keyframes auroraDrift {
  from { transform: translate3d(-4%, 0, 0) scale(1); opacity: 0.85; }
  to   { transform: translate3d(5%, 2%, 0) scale(1.1); opacity: 1; }
}

@keyframes sparkRise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  12%  { opacity: 0.9; }
  80%  { opacity: 0.7; }
  100% { transform: translateY(-94vh) scale(0.4); opacity: 0; }
}

@keyframes riseIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: start center;
    padding: 28px 0;
  }

  .phone-shell {
    min-height: 860px;
    border-radius: 28px;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .app-heading {
    grid-template-columns: 72px 1fr;
    gap: 12px;
  }

  .app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    font-size: 2rem;
  }

  .app-heading h1 {
    font-size: 1.68rem;
  }

  .challenge-hero h1 {
    font-size: 2.1rem;
  }

  .reward-cell,
  .challenge-button {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .browser-bar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 10px 10px 8px;
  }

  .store-identity,
  .install-panel,
  .section-block {
    padding-right: 16px;
    padding-left: 16px;
  }

  .app-stats {
    margin-right: 16px;
    margin-left: 16px;
  }

  .screenshots {
    grid-auto-columns: minmax(252px, 78%);
    max-width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .challenge-topbar {
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .challenge-hero,
  .challenge-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .countdown-card,
  .ticker {
    margin-right: 16px;
    margin-left: 16px;
  }

  .reward-board {
    padding-right: 14px;
    padding-left: 14px;
  }

  .reward-grid {
    gap: 8px;
  }
}

@media (max-width: 390px) {
  .rule-button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .reward-cell,
  .challenge-button {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .ticker-track {
    transform: none !important;
  }
}
