:root {
  --bg: #14123a;
  --bg-2: #1f1b5c;
  --text: #f4f2ff;
  --muted: #b9b4e6;
  --violet: #7c3aed;
  --pink: #ec4899;
  --orange: #f97316;
  --grad: linear-gradient(90deg, var(--violet), var(--pink), var(--orange));
  --card: #ffffff;
  --card-text: #1c1a33;
  --gold: #a8730a;
  --gold-tint: #fff6dc;
  --age-tint: #e4efff;   --age-ink: #1e4fa0;
  --pers-tint: #efe7ff;  --pers-ink: #5b2fb3;
  --roast-tint: #ffe6e1; --roast-ink: #b3402d;
  --comp-tint: #e1f6e8;  --comp-ink: #1d7a44;
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-2), var(--bg) 60%) var(--bg);
  overflow-x: hidden; line-height: 1.5;
}
.app { max-width: 480px; margin: 0 auto; padding: 16px 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }
.brand { padding: 4px 0 12px; }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 1.05rem; }
h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); line-height: 1.1; margin: 12px 0; font-weight: 800; overflow-wrap: anywhere; }
h2 { font-size: 1.5rem; margin: 8px 0 12px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: 1.05rem; margin: 0 0 20px; }
.screen { flex: 1; animation: fadein .35s ease both; }
.screen[hidden], [hidden] { display: none !important; }
.center { text-align: center; padding-top: 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.actions { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 20px;
  border-radius: 14px; border: 2px solid transparent; font: inherit; font-weight: 700; font-size: 1.05rem;
  color: #fff; text-decoration: none; cursor: pointer; text-align: center; user-select: none;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); box-shadow: 0 6px 20px rgba(236, 72, 153, .35); }
.btn-secondary { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .35); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; }
:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }

.age-check { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 600; }
.age-check input { width: 26px; height: 26px; accent-color: var(--pink); flex: none; }
.msg { background: #ffe3e3; color: #8a1c1c; border-radius: 12px; padding: 10px 14px; margin: 8px 0; font-weight: 600; }
.privacy { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .95rem; margin: 16px 0; }
.icon { width: 20px; height: 20px; flex: none; margin-top: 2px; color: #ffd166; }

.preview-frame { background: rgba(255, 255, 255, .06); border-radius: var(--radius); padding: 8px; }
.preview-frame img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; }

.spinner { width: 72px; height: 72px; margin: 24px auto; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .15); border-top-color: var(--pink); border-right-color: var(--orange); animation: spin 1s linear infinite; }
.step { font-size: 1.2rem; font-weight: 700; min-height: 2em; }
.bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; margin: 12px auto; max-width: 320px; }
.bar span { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 8px; animation: slide 1.4s ease-in-out infinite; }

.demo-badge { display: inline-block; background: #ffd166; color: #3a2a00; font-weight: 800; font-size: .75rem; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px; }
.cards { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); color: var(--card-text); border-radius: var(--radius); padding: 18px; border-top: 6px solid; animation: pop .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.card h3 { margin: 0 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.card p { margin: 0; font-size: 1.05rem; }
.card .big { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.card-celeb { background: var(--gold-tint); border-color: #e0a526; }
.card-celeb h3 { color: var(--gold); }
.card-age { background: var(--age-tint); border-color: #4a86e8; } .card-age h3 { color: var(--age-ink); }
.card-pers { background: var(--pers-tint); border-color: #8b5cf6; } .card-pers h3 { color: var(--pers-ink); }
.card-roast { background: var(--roast-tint); border-color: #f2705a; } .card-roast h3 { color: var(--roast-ink); }
.card-comp { background: var(--comp-tint); border-color: #3fb872; } .card-comp h3 { color: var(--comp-ink); }
.pair { display: flex; gap: 10px; margin: 8px 0 12px; }
.pair figure { margin: 0; flex: 1; min-width: 0; text-align: center; }
.pair img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #ddd; display: block; }
.pair figcaption { font-size: .8rem; color: #5a5775; margin-top: 4px; }
.celeb-name { font-size: 1.7rem; font-weight: 800; color: var(--gold); line-height: 1.15; overflow-wrap: anywhere; margin: 0; }
.chip { display: inline-block; background: #fff; border: 1px solid #e0a526; color: var(--gold); border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 700; margin: 6px 6px 0 0; }
.credit { font-size: .75rem; color: #5a5775; margin-top: 10px !important; }

.share-panel { background: rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 14px; margin: 8px 0; }
.share-panel p { margin: 0 0 10px; font-weight: 700; }
.share-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fineprint { color: var(--muted); font-size: .8rem; text-align: center; }

/* Reserved ad slots: fixed height prevents layout shift. Hidden until body.ads-on. */
.ad-slot { display: block; box-sizing: border-box; width: 100%; max-width: 100%; height: 280px; min-height: 280px; margin: 40px 0 24px; padding: 6px 8px; overflow: hidden; background: rgba(255, 255, 255, .05); border-radius: var(--radius); text-align: center; }
.ad-slot .ad-label { display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot ins { max-width: 100%; }
body:not(.ads-on) .ad-slot { display: none; }
@media (min-width: 768px) { .ad-slot { height: 250px; min-height: 250px; } }

.foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot a { color: var(--muted); display: inline-block; padding: 12px 0; min-height: 44px; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #1c1a33; padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); z-index: 10; max-width: calc(100vw - 32px); }

@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .spinner { border-top-color: var(--pink); }
  .bar span { width: 100%; }
}
@media (min-width: 600px) { .app { padding-top: 32px; } }
