:root {
  --bg: #07060d;
  --text: #f4f2ff;
  --muted: #9b93b0;
  --orange: #ff7a2f;
  --orange-glow: rgba(255, 122, 47, 0.55);
  --blue: #2d6bff;
  --blue-glow: rgba(45, 107, 255, 0.5);
  --accent: #8ec5ff;
  --highlight: #ffc94a;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 20px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Ambient scene */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(45, 107, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 80%, rgba(255, 122, 47, 0.12), transparent 50%),
    linear-gradient(180deg, #0c0a18 0%, #07060d 60%, #050408 100%);
}

.scene__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-drift 12s ease-in-out infinite alternate;
}

.scene__orb--1 {
  width: 280px;
  height: 280px;
  top: 5%;
  left: -10%;
  background: rgba(45, 107, 255, 0.25);
}

.scene__orb--2 {
  width: 220px;
  height: 220px;
  bottom: 20%;
  right: -8%;
  background: rgba(255, 122, 47, 0.18);
  animation-delay: -6s;
}

@keyframes orb-drift {
  to { transform: translate(30px, 20px) scale(1.08); }
}

/* Notice stack */
.notice-stack {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(360px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(10, 9, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(45, 107, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: notice-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both,
             notice-out 0.4s ease 3.4s both;
}

.notice__avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(145deg, #3d7aff, #1e4fd4);
  box-shadow: 0 6px 16px rgba(45, 107, 255, 0.4);
}

.notice__body {
  flex: 1;
  min-width: 0;
}

.notice__text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.notice__nick {
  font-weight: 800;
  color: #fff;
  margin-right: 5px;
}

.notice__action {
  font-weight: 500;
  color: rgba(155, 147, 176, 0.95);
}

.notice__glow {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
  animation: pulse-dot 1.8s ease infinite;
}

@keyframes notice-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notice-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 16px calc(28px + var(--safe-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Online pulse */
.audience__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Hero — soft glass, not a solid blue card */
.hero {
  position: relative;
  margin-bottom: 16px;
  padding: 22px 18px 20px;
  border-radius: 28px;
  overflow: hidden;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(255, 122, 47, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.28);
  animation: fade-up 0.65s ease 0.05s both;
}

.hero__wash {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(45, 107, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 40% 50% at 85% 40%, rgba(142, 197, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.hero__online {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}

.hero__online-label {
  font-weight: 600;
  color: #86efac;
  text-transform: lowercase;
}

.hero__eyebrow {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
}

.hero__title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  line-height: 1;
  margin-bottom: 10px;
}

.hero__num {
  font-size: clamp(2.7rem, 12vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 8px 28px rgba(45, 107, 255, 0.45);
}

.hero__plus {
  font-size: clamp(2rem, 9vw, 2.7rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-right: 4px;
}

.hero__word {
  font-size: clamp(1.45rem, 6.5vw, 1.9rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.02em;
}

.hero__sub {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.68);
}

/* CTA row */
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-bottom: 22px;
  animation: fade-up 0.65s ease 0.12s both;
}

.cta {
  position: relative;
  border: none;
  border-radius: 50px;
  padding: 14px 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.cta:active:not(.is-loading) {
  transform: scale(0.96);
}

.cta.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.cta--main {
  background: linear-gradient(135deg, #ff8c42, var(--orange));
  color: #fff;
  box-shadow: 0 6px 24px var(--orange-glow);
}

.cta--alt {
  background: linear-gradient(135deg, #3d7aff, var(--blue));
  color: #fff;
  box-shadow: 0 6px 28px var(--blue-glow);
  animation: cta-alt-pulse 2.8s ease-in-out infinite;
}

.cta--alt > span:not(.cta__shine) {
  position: relative;
  z-index: 1;
}

@keyframes cta-alt-pulse {
  0%, 100% {
    box-shadow: 0 6px 24px rgba(45, 107, 255, 0.45);
  }
  50% {
    box-shadow:
      0 10px 34px rgba(45, 107, 255, 0.72),
      0 0 0 2px rgba(255, 255, 255, 0.14),
      0 0 18px rgba(45, 107, 255, 0.22);
  }
}

.cta__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: btn-shine 3s ease infinite;
}

@keyframes btn-shine {
  0%, 70% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Feed */
.feed {
  margin-bottom: 22px;
  animation: fade-up 0.65s ease 0.2s both;
}

.feed__head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.feed__title {
  font-size: 1rem;
  font-weight: 700;
}

.feed__track-wrap {
  overflow: hidden;
  margin: 0 -16px;
  padding: 4px 16px 2px;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.feed__track {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

/* Poster tiles */
.tile {
  flex-shrink: 0;
  width: 118px;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}

.tile:hover {
  transform: translateY(-3px);
}

.tile.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.tile__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.tile__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 28px 8px 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 5, 12, 0.88) 55%);
}

.tile__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  line-height: 1;
}

.tile__rating-num {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.tile__stars {
  display: inline-flex;
  gap: 0;
  line-height: 1;
}

.tile__star {
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1;
}

.tile__star--on {
  color: var(--highlight);
}

.tile__audience {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #86efac;
  line-height: 1;
  white-space: nowrap;
}

.tile__person {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  color: rgba(134, 239, 172, 0.7);
}

/* Scratch cards */
.scratch {
  margin-bottom: 22px;
  animation: fade-up 0.65s ease 0.24s both;
}

.scratch__head {
  margin-bottom: 12px;
}

.scratch__title {
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  margin-bottom: 4px;
}

.scratch__sub {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  text-align: left;
  max-width: 280px;
}

.scratch__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scratch-card {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.25s ease, opacity 0.3s ease, filter 0.3s ease;
}

.scratch-card.is-locked {
  opacity: 0.42;
  filter: grayscale(0.35);
  pointer-events: none;
}

.scratch-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(142, 197, 255, 0.35);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(45, 107, 255, 0.25);
}

.scratch-card.is-revealed {
  border-color: rgba(255, 201, 74, 0.45);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(255, 201, 74, 0.18);
  cursor: pointer;
}

.scratch-card__media {
  position: absolute;
  inset: 0;
}

.scratch-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scratch-card__badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #1a1408;
  background: linear-gradient(135deg, #ffe08a, #ffc94a);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.scratch-card.is-revealed .scratch-card__badge {
  opacity: 1;
  transform: translateY(0);
}

.scratch-card__foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  touch-action: none;
  cursor: grab;
}

.scratch-card.is-revealed .scratch-card__foil {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.scratch-card__flakes {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.scratch-flake {
  position: absolute;
  width: 7px;
  height: 5px;
  margin-left: -3px;
  margin-top: -2px;
  border-radius: 1px;
  background: linear-gradient(135deg, #fff7d6, #c9a24a 45%, #8ec5ff);
  box-shadow: 0 0 6px rgba(255, 220, 140, 0.55);
  opacity: 0.95;
  animation: flake-fall 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.scratch-flake--silver {
  background: linear-gradient(135deg, #ffffff, #b8c2d4 50%, #7a8799);
  box-shadow: 0 0 5px rgba(200, 220, 255, 0.45);
}

.scratch-flake--blue {
  background: linear-gradient(135deg, #dcebff, #5b8fff 55%, #2d6bff);
  box-shadow: 0 0 6px rgba(45, 107, 255, 0.45);
}

.scratch-flake--warm {
  background: linear-gradient(135deg, #ffe8c8, #ff9a4a 50%, #ff7a2f);
  box-shadow: 0 0 6px rgba(255, 122, 47, 0.4);
}

@keyframes flake-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  70% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--fx), var(--fy), 0) rotate(var(--fr)) scale(0.55);
  }
}

/* Bottom strip */
.bottom-strip {
  margin-top: auto;
  padding: 16px 14px 14px;
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: fade-up 0.65s ease 0.28s both;
}

.bottom-strip__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.bottom-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(45, 107, 255, 0.14);
  border: 1px solid rgba(142, 197, 255, 0.2);
}

.bottom-strip__hint {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 300px;
  margin: 0 auto;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

