/* Intro steps */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  width: 100%;
  margin: 8px 0 32px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  opacity: 0;
  animation: step-in 0.5s ease-out both;
}

.step:nth-child(1) {
  animation-delay: 0.15s;
}
.step:nth-child(3) {
  animation-delay: 0.4s;
}
.step:nth-child(5) {
  animation-delay: 0.65s;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.step__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 1.1rem;
}

.step__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.step__line {
  width: 0;
  height: 0;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.45);
  margin: 22px 6px 0;
  flex-shrink: 0;
  animation: line-draw 0.4s ease-out both;
}

.step__line:nth-child(2) {
  animation-delay: 0.32s;
}
.step__line:nth-child(4) {
  animation-delay: 0.55s;
}

@keyframes line-draw {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 36px;
    opacity: 1;
  }
}

/* Play page */
.page--play {
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(16px + var(--safe-bottom));
  justify-content: flex-start;
}

.play-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.play-stats {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-pill {
  min-width: 100px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 0.95rem;
}

.stat-pill--earn {
  color: var(--pg-gold);
}

#game-root {
  width: 100%;
  max-width: 360px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.game-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.boost-banner {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 16, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 20px rgba(252, 128, 25, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: boost-banner-in 1.2s ease-out both;
  z-index: 2;
}

@keyframes boost-banner-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.98);
  }
}

.float-row {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 10px;
  animation: float-row-in 1.2s ease-out both;
  z-index: 2;
  white-space: nowrap;
}

@keyframes float-row-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.9);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-40px);
  }
}

.float-money {
  font-weight: 800;
  pointer-events: none;
}

.float-money--struck {
  font-size: 1.15rem;
  color: rgba(200, 200, 210, 0.85);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  font-weight: 700;
}

.float-money--boost {
  font-size: 2.15rem;
  color: #fc8019;
  text-shadow: 0 0 22px rgba(252, 128, 25, 0.85), 0 2px 10px rgba(0, 0, 0, 0.4);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.float-money--base {
  display: none;
}

.stat-pill--earn.earn-pulse {
  animation: earn-pulse 0.45s ease-out;
}

@keyframes earn-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(252, 128, 25, 0.5);
  }
  40% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(252, 128, 25, 0);
  }
  100% {
    transform: scale(1);
  }
}

.stat-pill--earn.earn-pulse--hard {
  animation: earn-pulse-hard 0.55s ease-out;
}

@keyframes earn-pulse-hard {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  20% {
    transform: translateX(-4px) scale(1.12);
  }
  40% {
    transform: translateX(4px) scale(1.1);
  }
  60% {
    transform: translateX(-3px) scale(1.08);
  }
  80% {
    transform: translateX(2px) scale(1.04);
  }
}

.moves-urgent {
  animation: moves-urgent 0.9s ease-in-out infinite;
  border-color: rgba(252, 128, 25, 0.7) !important;
  color: #ffe8b0;
}

@keyframes moves-urgent {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(252, 128, 25, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(252, 128, 25, 0);
  }
}

.combo-text {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 18px rgba(252, 128, 25, 0.85), 0 2px 8px rgba(0, 0, 0, 0.45);
  animation: combo-pop 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  z-index: 4;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes combo-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.6) translateY(10px);
  }
  25% {
    opacity: 1;
    transform: translateX(-50%) scale(1.12) translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(-6px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0.95) translateY(-28px);
  }
}

.coin-burst {
  position: absolute;
  left: 0;
  top: 0;
  color: #fc8019;
  font-size: 10px;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 0 8px rgba(252, 128, 25, 0.8);
  animation: coin-fly var(--d, 0.6s) ease-out var(--delay, 0s) both;
  --sx: 50%;
  --sy: 40%;
  --ex: 70%;
  --ey: 0%;
}

@keyframes coin-fly {
  0% {
    opacity: 1;
    transform: translate(var(--sx), var(--sy)) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(var(--ex), var(--ey)) scale(0.4);
  }
}

.skip-row {
  margin-top: 18px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.skip-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 44px;
  padding: 10px 16px;
}

/* Results */
.earn-amount {
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  font-weight: 800;
  color: var(--pg-gold);
  text-shadow: 0 0 28px rgba(252, 128, 25, 0.55);
  line-height: 1.05;
  margin: 6px 0 10px;
}

.breakdown-wrap {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.breakdown-wrap[hidden] {
  display: none !important;
}

.breakdown-wrap.is-in {
  animation: breakdown-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes breakdown-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.breakdown-label {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 18px 0 10px;
  opacity: 0;
}

.breakdown-card {
  width: 100%;
  max-width: 340px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin-bottom: 24px;
  text-align: left;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(8px);
}

.breakdown-row.is-in,
.breakdown-label.is-in {
  animation: row-in 0.45s ease-out both;
}

@keyframes row-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.breakdown-row--boost {
  color: var(--pg-gold);
  font-weight: 600;
}

.breakdown-row--total {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 6px;
  padding-top: 14px;
  font-weight: 800;
}

.breakdown-row--total .val {
  color: var(--pg-gold);
  font-size: 1.15rem;
}

.btn--cta-pulse {
  animation: btn-in 0.55s ease-out both, cta-pulse 2.2s ease-in-out 0.8s infinite;
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 28px rgba(252, 128, 25, 0.45);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 36px rgba(252, 128, 25, 0.75),
      0 0 0 8px rgba(252, 128, 25, 0.12);
  }
}

/* Playful page */
.page--playful {
  background: var(--playful-bg);
  background-image:
    linear-gradient(rgba(123, 63, 242, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 63, 242, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  padding: 0 0 calc(88px + var(--safe-bottom));
  align-items: stretch;
}

.playful-banner {
  width: 100%;
  background: var(--playful-yellow);
  color: #111;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
}

.playful-shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.playful-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(123, 63, 242, 0.4);
  object-fit: cover;
  background: linear-gradient(145deg, #6d28d9, #a78bfa);
}

.playful-headline {
  font-size: clamp(1.55rem, 6.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.playful-headline span {
  color: var(--playful-purple-light);
}

.playful-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 20px;
  max-width: 300px;
}

.btn-playful {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #7b3ff2, #a855f7);
  box-shadow: 0 8px 28px rgba(123, 63, 242, 0.5);
}

.btn-playful:active {
  transform: scale(0.98);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 22px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  width: 16px;
  height: 16px;
  background: #00b67a;
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  font-weight: 700;
}

.live-card {
  width: 100%;
  border: 1px solid var(--playful-border);
  border-radius: 14px;
  background: rgba(30, 10, 50, 0.7);
  padding: 12px 14px;
  margin-bottom: 24px;
  overflow: hidden;
  text-align: left;
}

.live-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.live-ticker {
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
}

.live-ticker .cash {
  color: var(--playful-green);
  font-weight: 700;
}

.live-ticker .cash.cash-glow {
  animation: cash-glow 0.7s ease-out;
}

@keyframes cash-glow {
  0% {
    text-shadow: 0 0 0 transparent;
  }
  40% {
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.95);
    color: #86efac;
  }
  100% {
    text-shadow: 0 0 0 transparent;
  }
}

.section-label {
  width: 100%;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.journey {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.journey-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--playful-border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(30, 10, 50, 0.55);
}

.journey-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: linear-gradient(145deg, #7b3ff2, #a855f7);
}

.journey-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.journey-item p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.tip-card {
  width: 100%;
  position: relative;
  border: 1px solid var(--playful-border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(30, 10, 50, 0.55);
  text-align: left;
  margin-bottom: 20px;
}

.tip-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--playful-purple);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.tip-card strong.title {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.tip-card p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

.tip-card .hl {
  color: #fff;
  font-weight: 700;
}

.playful-footer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, rgba(13, 6, 24, 0.95) 30%);
  display: flex;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sticky-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-cta .btn-playful {
  max-width: var(--max-w);
}

/* TikTok / in-app browser escape help */
.tt-escape {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  padding: calc(10px + var(--safe-top)) 14px 12px;
  background: rgba(8, 20, 16, 0.94);
  border-bottom: 1px solid rgba(252, 128, 25, 0.35);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.tt-escape__card {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: left;
  color: #fff;
}

.tt-escape__title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--pg-gold);
}

.tt-escape__msg {
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.tt-escape__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--pg-gold);
  color: var(--pg-btn-text);
  border: none;
  cursor: pointer;
}

.tt-escape__btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.tt-escape__hint {
  font-size: 0.85rem;
  color: var(--pg-mint-light);
  margin: 4px 0 10px;
  line-height: 1.35;
}

.tt-escape__steps {
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
}

.tt-escape__steps ol {
  margin: 6px 0 0 1.15rem;
  padding: 0;
}

.tt-escape__steps li {
  margin-bottom: 4px;
}

body:has(.tt-escape) .page {
  padding-top: calc(280px + var(--safe-top));
}

body:has(.tt-escape) .page--play {
  padding-top: calc(280px + var(--safe-top));
}

body:has(.tt-escape) .page--playful {
  padding-top: 0;
}

body:has(.tt-escape) .page--playful .playful-banner {
  margin-top: 260px;
}

@media (max-width: 380px) {
  body:has(.tt-escape) .page {
    padding-top: calc(300px + var(--safe-top));
  }
}
