/* kinkster – mobile first, dark only */

:root {
    --bg: #120b1c;
    --surface: #1d1430;
    --surface-2: #2a1d41;
    --line: rgba(255, 255, 255, .1);
    --text: #f6f0ff;
    --muted: #b8abcc;
    --faint: #8c7fa3;

    --pink: #ff4d8d;
    --orange: #ff8a5c;
    --violet: #8b5cf6;
    --amber: #ffc24d;
    --green: #5eead4;
    --danger: #ff7a8a;

    --grad: linear-gradient(135deg, #ff4d8d 0%, #ff8a5c 100%);
    --grad-btn: linear-gradient(135deg, #e6317a 0%, #f4526b 100%);

    --radius: 1.25rem;
    --radius-sm: .875rem;
    --tap: 3.5rem;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.app-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(70% 45% at 10% -5%, rgba(255, 77, 141, .24), transparent 70%),
        radial-gradient(60% 40% at 100% 10%, rgba(139, 92, 246, .24), transparent 70%),
        radial-gradient(80% 50% at 50% 115%, rgba(255, 138, 92, .12), transparent 70%),
        var(--bg);
}

.app {
    flex: 1;
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: rise .45s var(--ease) both;
}

.boot { margin: auto; color: var(--muted); }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
[tabindex="-1"]:focus { outline: none; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: .5rem; }

.lead { color: var(--muted); font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- Marke ---------- */

.brand { display: flex; align-items: center; gap: .65rem; }
.brand img { width: 2.25rem; height: 2.25rem; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.04em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tagline { color: var(--muted); font-size: .8rem; letter-spacing: .06em; }

.brand-hero { flex-direction: column; text-align: center; gap: .5rem; padding-top: .75rem; }
.brand-hero img { width: 4.5rem; height: 4.5rem; filter: drop-shadow(0 8px 24px rgba(255, 77, 141, .45)); }
.brand-hero .brand-text { align-items: center; gap: .25rem; }
.brand-hero .wordmark { font-size: 3rem; }
.brand-hero .tagline { font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Karten, Hinweise ---------- */

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.note {
    border: 1px solid var(--line);
    border-left: 3px solid var(--amber);
    background: rgba(255, 194, 77, .07);
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    color: var(--muted);
    font-size: .925rem;
}
.note strong { color: var(--text); }

.error {
    color: var(--danger);
    background: rgba(255, 122, 138, .1);
    border: 1px solid rgba(255, 122, 138, .35);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .95rem;
}
.error[hidden] { display: none; }

/* ---------- Buttons ---------- */

.btn {
    appearance: none;
    font: inherit;
    font-weight: 700;
    font-size: 1.2rem; /* >= 19px fett zählt als "großer Text" → Kontrast ok */
    min-height: var(--tap);
    padding: .75rem 1.25rem;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: transform .15s var(--ease), opacity .15s, background-color .15s;
    color: #fff;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
    content: "";
    position: absolute;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--grad-btn); box-shadow: 0 10px 28px -10px rgba(244, 82, 107, .7); }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--line); font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 1rem; font-weight: 600; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 122, 138, .45); font-size: 1rem; }

.linkbtn {
    appearance: none;
    background: none;
    border: 0;
    padding: .6rem;
    font: inherit;
    font-size: .95rem;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    touch-action: manipulation;
    align-self: center;
}
.linkbtn[hidden] { display: none; }

.icon-btn {
    appearance: none;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    touch-action: manipulation;
}
.icon-btn:disabled { opacity: .35; cursor: default; }

.stack { display: flex; flex-direction: column; gap: .75rem; }

/* ---------- Formular ---------- */

.check { display: flex; gap: .75rem; align-items: flex-start; font-size: .95rem; color: var(--muted); cursor: pointer; }
.check input {
    appearance: none;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    border-radius: .4rem;
    border: 2px solid var(--faint);
    background: transparent;
    display: grid;
    place-content: center;
    cursor: pointer;
}
.check input::after { content: "✓"; color: #fff; font-weight: 800; font-size: 1rem; transform: scale(0); transition: transform .15s var(--ease); }
.check input:checked { background: var(--grad-btn); border-color: transparent; }
.check input:checked::after { transform: scale(1); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.choices { display: flex; flex-direction: column; gap: .6rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.choice {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s, background-color .15s;
}
.choice:focus-within { outline: 3px solid var(--amber); outline-offset: 3px; }
.choice:has(input:checked) { border-color: var(--pink); background: rgba(255, 77, 141, .12); }
.choice input {
    appearance: none;
    flex: none;
    width: 1.6rem;
    height: 1.6rem;
    margin: 0;
    border-radius: .45rem;
    border: 2px solid var(--faint);
    display: grid;
    place-content: center;
    cursor: pointer;
}
.choice input::after { content: "✓"; color: #fff; font-weight: 800; transform: scale(0); transition: transform .15s var(--ease); }
.choice input:checked { background: var(--grad-btn); border-color: transparent; }
.choice input:checked::after { transform: scale(1); }
.choice-text { display: flex; flex-direction: column; line-height: 1.3; }
.choice-text strong { font-size: 1.15rem; }
.choice-text span { color: var(--muted); font-size: .9rem; }

.emoji-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.emoji-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: 1.2rem .5rem 1rem;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s, background-color .15s, transform .12s var(--ease);
}
.emoji-tile:active { transform: scale(.97); }
.emoji-tile:focus-within { outline: 3px solid var(--amber); outline-offset: 3px; }
.emoji-tile:has(input:checked) { border-color: var(--pink); background: rgba(255, 77, 141, .14); }
.emoji-tile:has(input:checked)::after {
    content: "✓";
    position: absolute;
    top: .5rem;
    right: .55rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: grid;
    place-content: center;
    background: var(--grad-btn);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
}
.emoji-tile .emoji { font-size: 3.4rem; line-height: 1.1; }
.emoji-tile strong { font-size: 1.15rem; }
.emoji-tile small { color: var(--muted); font-size: .82rem; line-height: 1.3; }

.level { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem 1rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.level-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.level-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.slider { --p: 33%; -webkit-appearance: none; appearance: none; width: 100%; height: 2.25rem; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.slider::-webkit-slider-runnable-track { height: .6rem; border-radius: 999px; background: linear-gradient(90deg, var(--pink) 0 var(--p), var(--surface-2) var(--p) 100%); }
.slider::-moz-range-track { height: .6rem; border-radius: 999px; background: var(--surface-2); }
.slider::-moz-range-progress { height: .6rem; border-radius: 999px; background: var(--pink); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 2rem; height: 2rem; margin-top: -.7rem; border-radius: 50%; background: #fff; border: 4px solid var(--pink); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.slider::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; border: 4px solid var(--pink); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.slider:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.ticks { display: flex; justify-content: space-between; font-size: .8rem; color: var(--faint); padding-inline: .15rem; }
.ticks .is-active { color: var(--text); font-weight: 700; }

.divider { display: flex; align-items: center; gap: .75rem; color: var(--faint); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.join { display: flex; flex-direction: column; gap: .5rem; }
.join label { font-size: .9rem; color: var(--muted); }
.join-row { display: flex; gap: .6rem; }

.code-input {
    flex: 1;
    min-width: 0;
    height: var(--tap);
    padding: 0 .5rem 0 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .3);
    color: var(--text);
    font: 700 1.6rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .5em;
    text-transform: uppercase;
}
.code-input::placeholder { color: var(--faint); opacity: .6; }
.code-input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 77, 141, .3); }
.join-row .btn { font-size: 1.05rem; padding-inline: 1.1rem; }

/* ---------- Startseite ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; counter-reset: step; }
.steps li { display: flex; gap: .85rem; align-items: flex-start; color: var(--muted); counter-increment: step; }
.steps li::before {
    content: counter(step);
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    display: grid;
    place-content: center;
    font-weight: 800;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.steps strong { color: var(--text); }

.badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.badge {
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, .04);
}

/* ---------- Lobby ---------- */

.code-tiles { display: flex; justify-content: center; gap: .6rem; }
.tile {
    width: 3.8rem;
    height: 5rem;
    border-radius: var(--radius-sm);
    display: grid;
    place-content: center;
    font: 800 2.6rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: inset 0 -10px 24px -14px rgba(255, 77, 141, .6);
    animation: pop .5s var(--ease) both;
}
.tile:nth-child(2) { animation-delay: .06s; }
.tile:nth-child(3) { animation-delay: .12s; }
.tile:nth-child(4) { animation-delay: .18s; }

.pill {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    font-size: .95rem;
}
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--pink); animation: pulse 1.4s ease-in-out infinite; }
.dot.is-off { background: var(--amber); animation: none; }

.sr-copy { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ---------- Fragebogen ---------- */

body[data-view="quiz"] .site-footer { display: none; }
body[data-view="quiz"] .app { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }

.topbar { display: flex; align-items: center; gap: .85rem; }
.progress { flex: 1; height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .35s var(--ease); }
.progress-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; min-width: 4.2rem; text-align: right; }

.qcard {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    min-height: 15rem;
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}
.qcard.enter-next { animation: slide-next .32s var(--ease) both; }
.qcard.enter-prev { animation: slide-prev .32s var(--ease) both; }

.chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: rgba(255, 77, 141, .14);
    border: 1px solid rgba(255, 77, 141, .35);
    color: #ffc2d8;
    font-size: .85rem;
    font-weight: 600;
}
.chip-pos { color: var(--muted); font-weight: 500; margin-left: .25rem; }

.qtext { font-size: 1.6rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.qhint { color: var(--muted); font-size: .95rem; }

.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.ans {
    appearance: none;
    font: inherit;
    color: var(--text);
    min-height: 5.25rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    transition: transform .12s var(--ease), border-color .15s, background-color .15s;
}
.ans:active { transform: scale(.94); }
.ans-icon { font-size: 1.5rem; line-height: 1; font-weight: 800; }
.ans-label { font-size: 1rem; font-weight: 700; }
.ans-n .ans-icon { color: var(--faint); }
.ans-m .ans-icon { color: var(--amber); }
.ans-y .ans-icon { color: var(--pink); }
.ans[aria-pressed="true"].ans-n { border-color: var(--faint); background: var(--surface-2); }
.ans[aria-pressed="true"].ans-m { border-color: var(--amber); background: rgba(255, 194, 77, .14); }
.ans[aria-pressed="true"].ans-y { border-color: var(--pink); background: rgba(255, 77, 141, .18); }

.tone-y { color: var(--pink); }
.tone-m { color: var(--amber); }
.tone-n { color: var(--muted); }

.summary { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.stat { text-align: center; min-width: 5rem; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Warten & Ergebnis ---------- */

.hero-icon { font-size: 3.2rem; text-align: center; line-height: 1; }

.result-hero { text-align: center; display: flex; flex-direction: column; gap: .35rem; padding: .5rem 0 .25rem; }
.result-title { display: flex; flex-direction: column; align-items: center; gap: .25rem; font-size: 1.6rem; }
.big-number {
    font-size: 5rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.04em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 28px rgba(255, 77, 141, .45));
    animation: pop .6s var(--ease) both;
}

.match-section { display: flex; flex-direction: column; gap: 1rem; }
.match-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.match-head .count { color: var(--muted); font-size: .95rem; }
.match-group { display: flex; flex-direction: column; gap: .4rem; }
.match-group h3 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.match-list li {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    font-weight: 600;
    line-height: 1.3;
}
.match-list li::before { content: "♥"; flex: none; color: var(--pink); }
.match-list.is-maybe li::before { content: "◐"; color: var(--amber); }
.match-list .hint { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-top: .15rem; }

.footer-actions { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; }

/* ---------- Toast & Footer ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 10;
    padding: .7rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    color: #1a0f26;
    font-weight: 600;
    font-size: .95rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    animation: rise .25s var(--ease) both;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    color: var(--faint);
    font-size: .8rem;
}
.site-footer a { color: var(--muted); text-underline-offset: 3px; }

/* ---------- Rechtstexte ---------- */

.legal { max-width: 40rem; margin: 0 auto; padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.legal h2 { margin-top: 1rem; }
.legal p, .legal li { color: var(--muted); }
.legal ul { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .35rem; }
.legal a { color: var(--text); }
.legal a.plain { text-decoration: none; }
.legal code { font-size: .9em; background: var(--surface); padding: .1em .35em; border-radius: .3em; }
.legal .todo { background: rgba(255, 194, 77, .15); color: var(--amber); padding: 0 .3em; border-radius: .25em; }

/* ---------- Animation ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
@keyframes slide-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

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

/* ---------- Sehr schmale oder niedrige Displays ---------- */

@media (max-width: 22rem) {
    .tile { width: 3.2rem; height: 4.4rem; font-size: 2.2rem; }
    .qtext { font-size: 1.4rem; }
    .brand-hero .wordmark { font-size: 2.5rem; }
}

@media (max-height: 40rem) {
    .qcard { min-height: 11rem; padding-block: 1rem; }
}
