:root {
  --bg: #0e0709;
  --bg2: #1c0d13;
  --surface: rgba(255, 236, 232, .045);
  --surface2: rgba(255, 236, 232, .085);
  --line: rgba(255, 228, 222, .12);
  --ink: #f7ece8;
  --ink2: #c4a6ab;
  --accent: #ff6f9c;
  --accent-ink: #2a0712;
  --gold: #e9c27e;
  --display: 'Frank Ruhl Libre', 'David', serif;
  --latin: 'Cormorant Garamond', 'Frank Ruhl Libre', serif;
  --ui: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}
[data-theme="noir"] { --accent: #d9b27c; --accent-ink: #1a1006; }
[data-theme="rouge"] { --accent: #e3263f; --accent-ink: #fff5f6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #060203; color: var(--ink); font-family: var(--ui); overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin: 0; }

#app {
  position: relative; max-width: 480px; margin: 0 auto; min-height: 100dvh; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, #2a1119 0%, var(--bg) 55%, #070304 100%);
  box-shadow: 0 0 80px rgba(0, 0, 0, .6);
}

.screen {
  min-height: 100dvh; display: flex; flex-direction: column; gap: 18px;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
  animation: rise .45s cubic-bezier(.2, .8, .2, 1);
}
.screen.full { padding: 0; gap: 0; }
.screen.dark { background: #050203; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.top { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 13px; }
.top .bn { font-family: var(--latin); letter-spacing: .24em; font-size: 15px; color: var(--ink); margin-inline-end: auto; font-weight: 600; }
.top span:last-child:not(.bn) { margin-inline-start: auto; }

.brandmark { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 7vh; text-align: center; }
.brandmark .logo { filter: drop-shadow(0 8px 30px rgba(255, 120, 150, .25)); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04) rotate(2deg); } }
.wordmark { font-family: var(--latin); font-weight: 600; font-size: 40px; letter-spacing: .34em; margin-inline-start: .34em; direction: ltr; }
.tagline { font-family: var(--display); font-size: 19px; color: var(--ink2); }

.copy { display: flex; flex-direction: column; gap: 8px; }
.copy.center, .center { text-align: center; }
.copy h2 { font-family: var(--display); font-weight: 500; font-size: 27px; line-height: 1.2; text-wrap: balance; }
.copy h2.big { font-size: 34px; }
.copy p { color: var(--ink2); font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.eyebrow { color: var(--accent) !important; font-size: 13px !important; letter-spacing: .04em; }
.fine { color: var(--ink2); font-size: 12.5px; opacity: .8; }
.muted { color: var(--ink2); font-size: 13px; }
.gate .copy { margin-top: auto; text-align: center; }
.gate .fine { text-align: center; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 14px 10px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: radial-gradient(120% 80% at 50% 20%, rgba(255, 210, 200, .09), rgba(255, 210, 200, .02) 70%), var(--surface);
  transition: transform .15s, border-color .2s, background .2s;
}
.card:active { transform: scale(.97); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card:focus-visible, .btn:focus-visible, .link:focus-visible, .coupon:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.art { width: 100%; display: block; }
.art svg, .hero-art svg { width: 100%; height: auto; display: block; }
.pn { font-family: var(--display); font-size: 19px; }
.pp { color: var(--ink2); font-size: 14px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: rgba(0, 0, 0, .25); }
.chip i { font-style: normal; font-size: 11px; }
.badge { position: absolute; top: 10px; inset-inline-start: 10px; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.brand-card { padding: 26px 12px; gap: 10px; min-height: 190px; justify-content: center; }
.brand-card .bw { font-family: var(--latin); font-weight: 600; font-size: 24px; letter-spacing: .18em; direction: ltr; }
.brand-card .bt { color: var(--ink2); font-size: 14px; }
.demo { font-size: 10.5px; color: var(--ink2); opacity: .7; }

.pair.grow { flex: 1; align-content: center; }
.product-card { padding: 18px 10px 16px; gap: 7px; }
.product-card .art { width: 116%; margin: 4px -8% 4px; }
.price { font-size: 16px; }
.price s, .pp s { color: var(--ink2); opacity: .7; }
.price span { color: var(--accent); font-weight: 600; }
.hero-art { width: 78%; margin: 4px auto 0; padding: 4% 0; background: radial-gradient(closest-side, rgba(255, 196, 204, .16), transparent); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); animation: float 6s ease-in-out infinite; }
.hero-art.small { width: 58%; }
@keyframes float { 50% { transform: translateY(-6px); } }

.cta-row { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cta-row.single { grid-template-columns: 1fr; }
.btn { min-height: 56px; border-radius: 999px; font-size: 16.5px; font-weight: 500; padding: 0 16px; transition: transform .12s, filter .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
  60% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent), 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
}
.link { color: var(--ink2); font-size: 14px; text-decoration: none; padding: 8px; align-self: center; }
.link:hover { color: var(--ink); }

/* ---------- play ---------- */
.play, .stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.play { overflow: hidden; background: #060203; }
.scene-svg { width: 100%; height: 100%; display: block; }
.stage { transition: filter .6s; }
.failed .stage { filter: saturate(.55) brightness(.6); }
.grain { position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); opacity: .1; mix-blend-mode: overlay; }
.hud { position: absolute; inset: 0 0 auto 0; padding-top: env(safe-area-inset-top); pointer-events: none; background: linear-gradient(rgba(5, 2, 3, .55), transparent); }
.timebar { height: 3px; background: rgba(255, 255, 255, .1); }
.timebar i { display: block; height: 100%; background: var(--accent); transform-origin: right; }
.hud-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px 18px; }
.hud-tag { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hud-tag b { font-family: var(--display); font-weight: 500; font-size: 17px; }
.hud-tag span { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-family: var(--display); font-size: 36px; font-variant-numeric: tabular-nums; direction: ltr; text-shadow: 0 2px 20px rgba(0, 0, 0, .6); transition: color .2s, transform .2s; }
.clock.hot { color: var(--accent); transform: scale(1.08); }
.clock.won { color: var(--gold); transform: scale(1.15); }
.icon-btn { pointer-events: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--ink); }
.hint { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; padding: 0 18px calc(26px + env(safe-area-inset-bottom)); pointer-events: none; transition: opacity .4s, transform .4s; }
.hint span { background: rgba(10, 4, 6, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); padding: 11px 18px; border-radius: 999px; font-size: 15px; text-align: center; }
.hint.gone { opacity: 0; transform: translateY(10px); }
.toast { position: absolute; top: 21%; left: 50%; transform: translate(-50%, -8px); max-width: 86%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .25s, transform .25s;
  background: rgba(10, 4, 6, .75); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); padding: 10px 16px; border-radius: 16px; font-size: 15px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(60% 40% at 50% 54%, rgba(255, 210, 170, .55), rgba(255, 120, 140, .12) 60%, transparent 80%); }
.opened .flash { animation: flash 1.2s ease-out forwards; }
@keyframes flash { 15% { opacity: 1; } 100% { opacity: .35; } }
.ghost { pointer-events: none; }
.glint { animation: glint 1.4s ease-in-out infinite; }
@keyframes glint { 0%, 100% { stroke-opacity: 0; } 50% { stroke-opacity: .55; } }
.flicker { animation: flicker 2.2s infinite steps(1); }
@keyframes flicker { 0% { opacity: .9; } 20% { opacity: .75; } 35% { opacity: 1; } 60% { opacity: .82; } 80% { opacity: .95; } }

/* ---------- sheets ---------- */
.sheet { position: absolute; inset: 0; display: flex; align-items: flex-end; z-index: 10; background: linear-gradient(transparent 30%, rgba(4, 1, 2, .78)); animation: fade .3s; }
.sheet-card {
  width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: center;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background: linear-gradient(rgba(36, 16, 22, .92), rgba(20, 8, 12, .97)); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: up .45s cubic-bezier(.2, .9, .2, 1);
}
.sheet-card h2 { font-family: var(--display); font-weight: 500; font-size: 25px; line-height: 1.25; text-wrap: balance; }
.sheet-card p { color: var(--ink2); font-size: 15px; line-height: 1.5; }
.sheet-card .cta-row { margin-top: 8px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.gift-line { color: var(--gold) !important; }
.stars { display: flex; justify-content: center; gap: 6px; font-size: 30px; }
.stars i { font-style: normal; color: rgba(255, 255, 255, .15); }
.stars i.on { color: var(--gold); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) backwards; text-shadow: 0 0 18px rgba(233, 194, 126, .6); }
.stars i.on:nth-child(2) { animation-delay: .12s; }
.stars i.on:nth-child(3) { animation-delay: .24s; }
@keyframes pop { from { transform: scale(0); } }
.time { font-family: var(--display); font-size: 62px; line-height: 1; direction: ltr; font-variant-numeric: tabular-nums; }
.time small { font-size: 16px; color: var(--ink2); margin-inline-start: 8px; direction: rtl; }
.rank { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; }
.rank.wide { width: 100%; }
.bar { display: block; width: 70%; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 6px; }
.rank-line { color: var(--ink) !important; }

/* ---------- reward / home ---------- */
.coupon { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-radius: 18px; border: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); position: relative; overflow: hidden; }
.coupon .code { font-size: 26px; font-weight: 600; letter-spacing: .2em; direction: ltr; }
.coupon .cp { font-size: 13px; color: var(--ink2); }
.coupon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .25) 50%, transparent 65%); transform: translateX(-120%); animation: shine 2.4s .4s ease-in-out; }
@keyframes shine { to { transform: translateX(120%); } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.stats b { font-family: var(--display); font-weight: 500; font-size: 22px; }
.stats span { font-size: 12px; color: var(--ink2); }
.home .cta-row { margin-top: 0; }
.foot { display: flex; justify-content: space-between; }

/* ---------- teaser ---------- */
.teaser { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; position: relative; }
.teaser p { font-family: var(--display); font-size: 34px; opacity: 0; animation: tease 3.6s forwards; }
.teaser .t2 { animation-delay: .9s; color: var(--ink2); }
.teaser .t3 { animation-delay: 1.8s; color: var(--accent); }
@keyframes tease { 0% { opacity: 0; transform: translateY(10px); filter: blur(6px); } 20% { opacity: 1; transform: none; filter: none; } 85% { opacity: 1; } 100% { opacity: .2; } }
.skip { position: absolute; top: 0; inset-inline-end: 0; color: var(--ink2); font-size: 14px; padding: 8px 12px; }

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