/* Pro8e / Lucky8 — site styles. Dark luxe: ink + gold + violet. */
:root {
    --bg: #0d0a14; --bg2: #16101f; --card: #1c1428;
    --fg: #f0e8ff; --dim: #9a8fb8;
    --gold: #ffd166; --violet: #a55eea; --pink: #ff6b9d;
    --border: rgba(255, 209, 102, 0.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(165, 94, 234, 0.14), transparent 60%),
        radial-gradient(900px 500px at 90% 110%, rgba(255, 209, 102, 0.10), transparent 60%),
        var(--bg);
    color: var(--fg); min-height: 100vh; display: flex; flex-direction: column;
}
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .03;
    background: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px); }
a { color: var(--gold); }
.main-content { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1rem 4rem; }

/* Nav */
.navbar { display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
    background: rgba(13, 10, 20, .85); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 40; }
.nav-logo { font-weight: 800; letter-spacing: 3px; text-decoration: none;
    color: var(--fg); font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.logo-8 { display: inline-flex; align-items: center; justify-content: center;
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--violet));
    color: #0d0a14; font-weight: 900; }
.nav-links { display: flex; gap: 1.2rem; }
.nav-link { color: var(--dim); text-decoration: none; font-size: .95rem; letter-spacing: .5px; }
.nav-link:hover, .nav-link.active { color: var(--gold); }

/* Hero */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero-8 { font-size: 5rem; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, var(--gold), var(--violet));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 24px rgba(255, 209, 102, .35)); }
.hero-title { font-size: 2.2rem; letter-spacing: 4px; margin: .6rem 0 .3rem; }
.hero-tag { color: var(--gold); font-size: 1.05rem; }
.hero-intro { color: var(--dim); margin-top: .6rem; }

/* Experience cards */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; padding: 1rem 0; }
.exp-card { display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 1.6rem 1.4rem; text-decoration: none; color: var(--fg);
    transition: transform .15s, border-color .15s; }
.exp-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.exp-card-8 { font-size: 2rem; font-weight: 900; color: var(--gold); margin-bottom: .6rem; }
.exp-card h3 { margin-bottom: .3rem; }
.exp-card p { color: var(--dim); font-size: .9rem; }
.exp-go { display: inline-block; margin-top: .9rem; color: var(--gold); font-weight: 600; }

/* Quiz */
.quiz-wrap { max-width: 620px; margin: 0 auto; padding: 2rem 0; }
.quiz-title { text-align: center; letter-spacing: 4px; margin-bottom: 1.5rem; }
.quiz-loading { text-align: center; color: var(--dim); padding: 3rem; }
.q-progress { height: 6px; background: var(--bg2); border-radius: 3px; margin-bottom: 1.6rem; overflow: hidden; }
.q-progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--violet)); transition: width .3s; }
.q-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 1.8rem; }
.q-text { font-size: 1.3rem; margin-bottom: 1.4rem; line-height: 1.4; }
.q-opt { display: block; width: 100%; text-align: left; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 12px; color: var(--fg);
    padding: 1rem 1.2rem; margin-bottom: .7rem; font-size: 1rem; cursor: pointer;
    transition: border-color .12s, background .12s; }
.q-opt:hover { border-color: var(--gold); background: #241a35; }
.q-meta { display: grid; gap: .8rem; }
.q-meta input { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
    padding: 1rem 1.2rem; color: var(--fg); font-size: 1rem; width: 100%; }
.q-meta label { color: var(--dim); font-size: .85rem; margin-bottom: -.4rem; }
/* Culture-formatted DOB — dob_fmt tokens render as inputs, unit text as
   spans (ja 年/月/日, ko 년/월/일). Field order comes from the pack. */
.q-dob { display: flex; align-items: center; gap: .45rem; }
.q-dob .q-dob-in { width: auto; min-width: 0; flex: 0 0 auto; text-align: center;
    padding: 1rem .6rem; }
.q-dob .q-dob-in[data-part="y"] { width: 5.2rem; }
.q-dob .q-dob-in[data-part="m"], .q-dob .q-dob-in[data-part="d"] { width: 3.4rem; }
.q-dob-unit { color: var(--dim); white-space: pre; }

/* Buttons */
.btn-share, .btn-buy { display: inline-block; border: none; cursor: pointer;
    padding: 1rem 2rem; border-radius: 14px; font-size: 1.05rem; font-weight: 800;
    letter-spacing: .5px; color: #0d0a14; text-decoration: none;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    box-shadow: 0 0 22px rgba(255, 209, 102, .35); transition: transform .12s, box-shadow .12s; }
.btn-share:hover, .btn-buy:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 34px rgba(255, 107, 157, .45); }
.btn-ghost { padding: 1rem 1.4rem; border-radius: 14px; border: 1px solid var(--border);
    background: transparent; color: var(--dim); cursor: pointer; font-size: .95rem; }
.btn-ghost:hover { color: var(--fg); border-color: var(--gold); }

/* Result */
.result-wrap { max-width: 640px; margin: 0 auto; padding: 1.5rem 0; }
.result-card { background: linear-gradient(180deg, var(--card), var(--bg2));
    border: 1px solid var(--border); border-radius: 22px; padding: 2.4rem 1.8rem;
    text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.result-8 { font-size: 3rem; font-weight: 900; color: var(--gold); opacity: .9; }
.result-tier { color: var(--violet); letter-spacing: 4px; text-transform: uppercase;
    font-size: .8rem; margin: .8rem 0 .2rem; }
.result-arch { font-size: 2.4rem; letter-spacing: 2px; margin: .2rem 0 1rem;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-score { line-height: 1; }
.score-num { font-size: 4rem; font-weight: 900; color: var(--gold); }
.score-denom { color: var(--dim); font-size: 1.3rem; }
.score-label { color: var(--dim); font-size: .8rem; letter-spacing: 3px; text-transform: uppercase; margin-top: .3rem; }
.result-blurb { color: var(--fg); font-size: 1.05rem; line-height: 1.6; margin: 1.4rem auto 0; max-width: 440px; }
.charm-stage { height: 300px; margin: 1.4rem 0 0; border-radius: 14px;
    background: radial-gradient(circle at 50% 60%, rgba(165, 94, 234, .12), transparent 70%); }
.charm-stage canvas { width: 100% !important; height: 100% !important; display: block; }
.share-row { display: flex; gap: .8rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap; }

/* Tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-top: 1.6rem; }
.tier-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
    padding: 1.3rem 1.1rem; text-align: center; display: flex; flex-direction: column; gap: .6rem; }
.tier-card h3 { font-size: 1rem; }
.tier-card p { color: var(--dim); font-size: .82rem; flex: 1; line-height: 1.5; }
.tier-card .btn-buy { width: 100%; padding: .8rem 1rem; font-size: .95rem; }
.tier-card.owned { border-color: var(--gold); opacity: .75; }
.tier-card.owned .btn-buy { background: var(--bg2); color: var(--dim); box-shadow: none; cursor: default; }

.paid-block { background: var(--card); border: 1px solid var(--gold); border-radius: 16px;
    padding: 1.6rem; margin-top: 1.6rem; }
.paid-block h3 { color: var(--gold); margin-bottom: .8rem; }
.reading-text { line-height: 1.75; color: var(--fg); }
.charm-card-img { display: block; max-width: 100%; border-radius: 16px; margin: 1.4rem auto 0; }
.paid-actions { display: flex; gap: .7rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
.paid-media { text-align: center; }
.paid-media .btn-ghost { display: inline-block; margin: .8rem auto 0; padding: .6rem 1.2rem; font-size: .85rem; }
.gift-link { word-break: break-all; text-align: center; margin: .4rem 0 0; }
.gift-link a { color: var(--gold); }

.gift-banner { background: linear-gradient(135deg, rgba(255, 209, 102, .15), rgba(255, 107, 157, .12));
    border: 1px solid var(--gold); border-radius: 12px; padding: .9rem 1.2rem;
    text-align: center; margin-bottom: 1rem; }
.gift-status { margin-top: 1.4rem; text-align: center; color: var(--dim); font-size: .9rem; }
.fineprint { text-align: center; color: var(--dim); font-size: .75rem; margin-top: 1.8rem; opacity: .7; }

/* Gift */
.gift-wrap { max-width: 520px; margin: 0 auto; padding: 2rem 0; }
.gift-card { background: var(--card); border: 1px solid var(--border); border-radius: 22px;
    padding: 2.6rem 1.8rem; text-align: center; }
.gift-from { font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.gift-sent { color: var(--dim); margin: .4rem 0 1.6rem; letter-spacing: 1px; }
.egg-stage { height: 320px; position: relative; cursor: pointer; }
.egg-stage canvas { width: 100% !important; height: 100% !important; display: block; }
.egg-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
    color: var(--dim); font-size: .85rem; animation: pulse 1.6s ease-in-out infinite; }
#gift-quiz-cta { margin-top: 1.4rem; }
@keyframes pulse { 0%, 100% { opacity: .4 } 50% { opacity: 1 } }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.g-tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.g-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.g-cap { padding: .8rem 1rem; font-weight: 600; }
.g-cap span { display: block; color: var(--dim); font-size: .8rem; font-weight: 400; margin-top: .2rem; }

/* Prose pages */
.page-prose { max-width: 640px; margin: 0 auto; padding: 2rem 0; line-height: 1.7; }
.page-prose h1 { margin-bottom: 1rem; }
.page-prose h2 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; color: var(--gold, #ffd166); }
.page-prose .legal-updated { color: var(--dim); font-size: .8rem; margin-bottom: 1.2rem; }
.page-prose form { display: grid; gap: .8rem; margin-top: 1rem; }
.page-prose input, .page-prose textarea { background: var(--bg2); border: 1px solid var(--border);
    border-radius: 10px; padding: .9rem 1rem; color: var(--fg); font-size: 1rem; }
.page-prose textarea { min-height: 140px; }
.page-prose ul { padding-left: 1.4rem; }
.page-prose li { margin-bottom: .4rem; }
.empty-state { color: var(--dim); text-align: center; padding: 3rem 1rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 1.4rem 1.5rem; margin-top: auto; }
.footer-content { max-width: 960px; margin: 0 auto; display: flex; flex-wrap: wrap;
    gap: .8rem; justify-content: space-between; align-items: center; }
.footer p { color: var(--dim); font-size: .8rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--dim); font-size: .8rem; text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

/* --- Post-purchase veil: thank-you → photo step → reveal --- */
.paid-veil { position: fixed; inset: 0; z-index: 60; display: flex;
    align-items: center; justify-content: center; padding: 1.2rem;
    background: radial-gradient(ellipse at 50% 30%, rgba(165,94,234,.22), transparent 60%), var(--bg); }
.paid-veil[hidden] { display: none; }
.veil-card { max-width: 460px; width: 100%; text-align: center;
    background: linear-gradient(180deg, var(--card), var(--bg2));
    border: 1px solid var(--border); border-radius: 20px; padding: 2.2rem 1.8rem;
    box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.veil-8 { font-size: 3rem; color: var(--gold); margin-bottom: .6rem;
    animation: veil-pulse 2.4s ease-in-out infinite; }
@keyframes veil-pulse { 0%,100% { opacity: .55; transform: scale(.96); }
    50% { opacity: 1; transform: scale(1.05); } }
.veil-card h2 { color: var(--gold); font-size: 1.35rem; margin-bottom: .7rem; }
.veil-card p { color: var(--dim); line-height: 1.55; }
.veil-progress { height: 4px; border-radius: 2px; background: var(--bg2);
    margin-top: 1.4rem; overflow: hidden; }
.veil-progress span { display: block; height: 100%; width: 40%;
    border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--pink));
    animation: veil-slide 1.6s ease-in-out infinite; }
@keyframes veil-slide { 0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); } }
#veil-photo { margin-top: 1.4rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }
#veil-photo h3 { color: var(--fg); font-size: 1.05rem; margin-bottom: .5rem; }
#veil-preview { display: block; width: 110px; height: 110px; object-fit: cover;
    border-radius: 50%; border: 3px solid var(--gold); margin: .9rem auto 0; }
.veil-actions { display: flex; flex-direction: column; gap: .7rem;
    align-items: center; margin-top: 1.1rem; }
.veil-actions .btn-share { width: auto; padding: .9rem 2rem; }
.veil-skip { background: none; border: none; color: var(--dim); font-size: .85rem;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.veil-skip:hover { color: var(--fg); }
#veil-photo-err { color: var(--pink); font-size: .85rem; margin-top: .8rem; }
.anim-pending { display: inline-block; margin: .8rem auto 0; color: var(--dim);
    font-size: .8rem; animation: veil-pulse 2s ease-in-out infinite; }
.anim-block { border-top: 1px solid var(--border); margin-top: 1.2rem; padding-top: 1rem; }
.anim-block h3 { color: var(--gold); font-size: .95rem; margin-bottom: .7rem; }

/* --- Tier previews + gift-it — a peek at the product under each button --- */
.tier-preview { display: block; width: 100%; max-width: 120px; height: auto;
    margin: .7rem auto .4rem; border-radius: 10px; border: 1px solid var(--border);
    opacity: .9; }
.btn-gift { display: block; width: 100%; margin-top: .3rem; padding: .45rem .6rem;
    background: none; border: none; color: var(--dim); font-size: .8rem;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-gift:hover { color: var(--gold); }
/* Artifact language — create/gift the trinket in any pack's language. */
.art-locale-row { display: flex; align-items: center; justify-content: center;
    gap: .5rem; margin-top: .6rem; font-size: .75rem; color: var(--dim); }
.art-locale { background: var(--bg2, rgba(255,255,255,.04)); color: var(--fg);
    border: 1px solid var(--border); border-radius: 8px; padding: .25rem .4rem;
    font-size: .75rem; font-family: inherit; }

/* --- Photo widget: focus reticle --- */
.pw-stage { position: relative; display: inline-block; margin: .9rem auto 0;
    max-width: 240px; touch-action: none; }
.pw-img { display: block; width: 100%; border-radius: 12px;
    border: 1px solid var(--border); }
.pw-reticle { position: absolute; border: 2px solid var(--gold); border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.35); cursor: grab; pointer-events: none; }
.pw-hint { color: var(--dim); font-size: .78rem; margin: .5rem 0 0; }
.pw-actions { display: flex; flex-direction: column; gap: .6rem;
    align-items: center; margin-top: 1rem; }
.pw-actions .btn-share { width: auto; padding: .8rem 1.8rem; }
.pw-skip { background: none; border: none; color: var(--dim); font-size: .82rem;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pw-skip:hover { color: var(--fg); }
.pw-err { color: var(--pink); font-size: .85rem; margin-top: .7rem; }
.pw-rights { color: var(--dim); font-size: .72rem; margin: .7rem 0 0;
    max-width: 32ch; margin-left: auto; margin-right: auto; line-height: 1.4; }
.photo-drop { text-align: center; }
.face-panel { border-top: 1px solid var(--border); margin-top: 1rem;
    padding-top: 1rem; }
.face-panel p { color: var(--dim); font-size: .85rem; }

/* --- Gift block: name, send sheet, journey --- */
.paid-gift { text-align: center; }
.gift-name-row { margin: .6rem 0 .4rem; }
.gift-name-row input { width: 100%; max-width: 280px; padding: .7rem .9rem;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
    color: var(--fg); font-size: .95rem; text-align: center; }
.gift-name-row input:focus { border-color: var(--gold); outline: none; }
.gift-send-panel { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
    margin-top: .8rem; }
.gift-photo-choice { border-top: 1px dashed var(--border); margin-top: 1rem;
    padding-top: .9rem; }
.gift-photo-choice p { color: var(--dim); font-size: .85rem; }
.gift-status { margin-top: .9rem; color: var(--gold); font-size: .85rem; }
.gift-for { color: var(--gold); font-size: 1rem; margin: .3rem 0 .8rem; }

/* --- Delivery ack --- */
.received-ack { text-align: center; margin: 1.2rem auto 0; color: var(--dim);
    font-size: .85rem; }
.received-ack.done { color: var(--gold); }
.received-ack input { accent-color: var(--gold); }

/* --- Find purchase --- */
.find-wrap { max-width: 560px; margin: 2rem auto; padding: 0 1rem; }
.find-card { background: var(--card); border: 1px solid var(--border);
    border-radius: 18px; padding: 2rem; text-align: center; }
.find-card .result-8 { font-size: 2.4rem; color: var(--gold); }
.find-card h1 { color: var(--fg); font-size: 1.4rem; margin: .6rem 0; }
.find-intro { color: var(--dim); font-size: .9rem; line-height: 1.5; }
.find-row { display: flex; gap: .6rem; margin-top: 1.2rem; }
.find-row input { flex: 1; padding: .8rem 1rem; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 10px; color: var(--fg);
    font-size: .95rem; }
.find-row input:focus { border-color: var(--gold); outline: none; }
.find-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.find-list li { margin: .5rem 0; }
.find-list a { color: var(--gold); text-decoration: none; font-size: .95rem; }
.find-list a:hover { text-decoration: underline; }
#find-out p { color: var(--dim); font-size: .9rem; margin-top: 1rem; }

/* --- Recent luck recall (landing) --- */
.recent-luck { max-width: 560px; margin: 1.5rem auto; text-align: center; }
.recent-luck-title { color: var(--dim); font-size: .85rem; margin-bottom: .6rem; }
.recent-luck-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

@media (max-width: 560px) {
    .hero-title { font-size: 1.7rem; }
    .result-arch { font-size: 1.9rem; }
    .tiers { grid-template-columns: 1fr; }
    .charm-stage { height: 240px; }
}
