/* --bg, --surface, --neon and --text come from config.php */
:root {
    --soft: color-mix(in srgb, var(--text) 72%, var(--bg));
    --line: color-mix(in srgb, var(--text) 18%, var(--bg));
    --link: color-mix(in srgb, var(--neon) 65%, white);
    --display: 'Unbounded', 'Arial Black', sans-serif;
    --body: 'Figtree', system-ui, sans-serif;
    --r: 22px;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--body); color: var(--text); background: var(--bg); overflow-x: clip; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 .6em; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.small { font-size: .9rem; }
.soft { color: var(--soft); }
.lead { font-size: 1.2rem; color: var(--soft); max-width: 34em; margin: 0; }
.neon { color: var(--neon); text-shadow: 0 0 36px color-mix(in srgb, var(--neon) 60%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip-link:focus { left: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 24px; border: 2px solid transparent; border-radius: 999px; font: 700 1rem var(--body); text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow .2s, background .2s, border-color .2s; }
.btn-neon { background: var(--neon); color: #14071f; }
.btn-neon:hover { box-shadow: 0 0 34px color-mix(in srgb, var(--neon) 65%, transparent); }
.btn-line { background: transparent; color: var(--text); border-color: var(--line); }
.btn-line:hover { border-color: var(--neon); }
.btn-dark { background: #14071f; color: #fff; }
.btn-sm { min-height: 42px; padding: 6px 18px; font-size: .95rem; }
.btn-lg { min-height: 62px; padding: 14px 36px; font-size: 1.15rem; }
.btn-block { width: 100%; }
.btn[disabled] { cursor: default; color: var(--soft); border-color: var(--line); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 700 1.05rem var(--display); letter-spacing: -.03em; }
.brand-mark { width: 40px; flex: none; fill: none; stroke: var(--neon); stroke-width: 4; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a:not(.btn), .quiet { color: var(--soft); text-decoration: none; font-weight: 500; }
.main-nav a:not(.btn):hover, .quiet:hover { color: var(--text); }
.flash { padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.flash-error { border-color: var(--neon); }

/* Landing */
.hero { padding-top: 48px; overflow: hidden; }
.hero h1 { font-size: clamp(2.35rem, 7.4vw, 6rem); font-weight: 800; line-height: 1; max-width: 11.5em; margin-bottom: .5em; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.hero-row .btn { flex: none; }
.fan { display: flex; justify-content: center; margin: 72px 0 -40px; }
.fan-card { flex: none; width: clamp(150px, 21vw, 270px); aspect-ratio: 5 / 6; margin: 0 -14px; border-radius: 28px; overflow: hidden; border: 5px solid var(--bg); transform: translateY(calc(var(--d) * var(--d) * 14px)) rotate(calc(var(--i) * 6deg)); z-index: calc(3 - var(--d)); }
.avatar { display: block; width: 100%; height: 100%; object-fit: cover; }
.section { padding: 104px 0 0; }
.steps { list-style: none; counter-reset: s; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: block; font: 800 5.5rem/1 var(--display); color: transparent; -webkit-text-stroke: 2px var(--neon); margin-bottom: 20px; }
.steps p { color: var(--soft); margin: 0; }
.ask { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.ask > div { border-radius: 32px; padding: clamp(28px, 4vw, 52px); }
.ask-yes { background: var(--surface); }
.ask-no { border: 2px solid var(--line); }
.ask ul { list-style: none; margin: 0; padding: 0; font-size: 1.15rem; }
.ask li { padding: 14px 0; border-top: 1px solid var(--line); }
.ask-no li { color: var(--soft); text-decoration: line-through; text-decoration-color: var(--neon); text-decoration-thickness: 2px; }
.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 700; font-size: 1.15rem; }
.faq summary::marker { color: var(--neon); }
.faq p { color: var(--soft); max-width: 60ch; }
.cta { margin-top: 104px; background: var(--neon); color: #14071f; padding: 72px 0; }
.cta .container { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.cta h2 { font-size: clamp(1.8rem, 4.4vw, 3.4rem); margin: 0; max-width: 12em; }
.cta .btn { flex: none; }

/* Quiz */
.quiz { padding: 20px 0 96px; }
.segments { display: flex; gap: 6px; }
.segments span { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.segments .done { background: color-mix(in srgb, var(--neon) 55%, var(--bg)); }
.segments .now { background: var(--neon); box-shadow: 0 0 18px var(--neon); }
.quiz-form { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; padding-top: clamp(32px, 8vh, 88px); }
.quiz-ask h1 { margin-bottom: .4em; }
.options { display: grid; gap: 12px; }
.option { position: relative; display: block; }
.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.option span { display: flex; align-items: center; min-height: 76px; padding: 16px 26px; border-radius: var(--r); background: var(--surface); border: 2px solid transparent; font-weight: 600; font-size: 1.15rem; transition: border-color .15s, background .15s; }
.option input:hover + span { border-color: color-mix(in srgb, var(--neon) 60%, var(--surface)); }
.option input:checked + span { background: var(--neon); color: #14071f; }
.option input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 3px; }
.quiz-nav { display: flex; gap: 12px; margin-top: 28px; }
.quiz-nav .btn-neon { flex: 1; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; font-size: .95rem; color: var(--soft); }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--neon); }

/* Sign-in */
.auth { padding: 40px 0 96px; }
.auth-wrap { max-width: 540px; }
.auth-card { background: var(--surface); border-radius: 32px; padding: clamp(24px, 6vw, 48px); margin-bottom: 20px; }
.auth-card h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
.field { display: block; margin: 24px 0; }
.field > span { display: block; font-weight: 700; margin-bottom: 8px; }
.field input { width: 100%; min-height: 56px; padding: 12px 18px; border: 2px solid var(--line); border-radius: 16px; font: inherit; color: var(--text); background: var(--bg); }
.field input:focus { outline: none; border-color: var(--neon); }
.field input::placeholder { color: var(--soft); }
.field .code-input { font-size: 1.7rem; letter-spacing: .35em; text-align: center; }
.error { display: block; color: var(--link); margin-top: 6px; }
.auth-card .btn-block { margin-top: 12px; }
.auth-card form.center { margin-top: 20px; }
.demo-box, .note { border: 1px dashed color-mix(in srgb, var(--neon) 70%, var(--bg)); border-radius: 14px; padding: 12px 18px; }
.note { display: table; max-width: 100%; margin: 0 0 10px; font-size: .95rem; }
.code { font: 700 1.25rem ui-monospace, monospace; letter-spacing: .1em; }

/* Matches */
.matches { padding: 32px 0 96px; }
.matches h1 { max-width: 14em; margin-bottom: .4em; }
.match-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.match { display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; overflow: hidden; scroll-margin-top: 20px; }
.match-pic { position: relative; aspect-ratio: 1; flex: none; }
.match-pic .avatar { position: absolute; inset: 0; }
.sample { position: absolute; left: 14px; top: 14px; padding: 3px 12px; border-radius: 99px; background: #14071f; color: #fff; font-size: .85rem; font-weight: 600; }
.match-body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.match-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.match h2 { font-size: 1.25rem; margin: 0 0 6px; }
.score { font: 700 1.5rem var(--display); letter-spacing: -.03em; color: var(--link); margin: 0; }
.shared { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; }
.shared li { padding: 4px 12px; border: 1px solid var(--neon); border-radius: 99px; font-size: .88rem; }
.match form { margin-top: auto; }
.empty { margin-top: 36px; padding: 56px 24px; text-align: center; background: var(--surface); border-radius: 28px; }
.erase { margin: 40px 0 0; }
@media (min-width: 1000px) {
    .match:first-child { grid-column: 1 / -1; flex-direction: row; }
    .match:first-child .match-pic { width: 44%; aspect-ratio: auto; min-height: 440px; }
    .match:first-child .match-body { padding: 48px; justify-content: center; font-size: 1.1rem; }
    .match:first-child h2 { font-size: 2.2rem; }
    .match:first-child .score { font-size: 3rem; }
    .match:first-child form { margin-top: 12px; max-width: 300px; }
}

/* Legal */
.legal { padding-top: 40px; padding-bottom: 96px; }
.legal h2 { font-size: 1.25rem; margin-top: 2.2em; }
.legal li { margin-bottom: 8px; }
.legal ul { padding-left: 22px; }
.legal a { overflow-wrap: anywhere; }
.muted { color: var(--soft); }
.table { display: block; overflow-x: auto; border-collapse: collapse; margin-bottom: 1em; }
.table th, .table td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; }
.tip { background: var(--surface); border-radius: var(--r); padding: 24px; }
.tip h3 { font-size: 1.05rem; }
.tip p { color: var(--soft); margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer-top { display: flex; justify-content: space-between; gap: 32px; }
.footer-top nav, .footer-contact { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-top a, .footer-top .link-btn { color: var(--soft); text-decoration: none; }
.footer-top a:hover, .footer-top .link-btn:hover { color: var(--text); }
.wordmark { font: 800 clamp(1.8rem, 9.6vw, 7.6rem)/1.15 var(--display); letter-spacing: -.06em; color: var(--surface); margin: 40px 0 16px; white-space: nowrap; overflow: hidden; }

.cookie-banner { position: fixed; z-index: 50; right: 20px; bottom: 20px; width: min(420px, calc(100% - 40px)); padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0 0 14px; font-size: .95rem; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { flex: 1; }

@media (max-width: 999px) { .match-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) {
    .hero-row, .cta .container, .footer-top { flex-direction: column; align-items: flex-start; }
    .steps, .ask, .faq-grid, .quiz-form { grid-template-columns: 1fr; }
    .quiz-form { gap: 24px; }
    .steps li::before { font-size: 4rem; margin-bottom: 12px; }
    .section { padding-top: 80px; }
    .faq-grid { gap: 8px; }
}
@media (max-width: 600px) {
    .container { padding: 0 18px; }
    .nav-extra { display: none; }
    .main-nav { gap: 16px; }
    .brand { font-size: .88rem; gap: 8px; }
    .brand-mark { width: 30px; }
    .main-nav .btn { padding: 6px 14px; font-size: .88rem; }
    .hero { padding-top: 24px; }
    .hero-row .btn { width: 100%; }
    .fan { margin-top: 48px; }
    .option span { min-height: 64px; }
    .match-grid, .tips { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
