/* ============================================================
   ASTROMATCHIX — dunkles Violett mit animierten Lichtpunkten
   ============================================================ */
:root {
    --bg: #0D0818;
    --bg2: #170F2B;
    --card: rgba(127, 119, 221, 0.10);
    --card-border: rgba(175, 169, 236, 0.28);
    --purple: #7F77DD;
    --purple-dark: #534AB7;
    --purple-light: #AFA9EC;
    --lavender: #CECBF6;
    --text: #EEEDFE;
    --muted: #A9A4D4;
    --teal: #5DCAA5;
    --danger: #E24B6A;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

body {
    background: radial-gradient(ellipse at 50% 0%, #241545 0%, var(--bg) 60%) fixed;
}

#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

h1, h2 { font-weight: 500; margin: 0 0 .6rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; color: var(--lavender); }
a { color: var(--purple-light); }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 1.4rem; }
.loading { text-align: center; color: var(--muted); }

.shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 56px 16px 140px;
}

.page { max-width: 880px; margin: 0 auto; }
.page.narrow { max-width: 560px; }

/* ---------- Logo ---------- */
.logo {
    font-size: clamp(1.7rem, 8.4vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: .14em;
    font-weight: 500;
    margin: .2rem 0 .3rem;
    padding-left: .14em;
    white-space: nowrap;
    /* leuchtendes Gold */
    background: linear-gradient(100deg, #FFD36B 0%, #FFF0B3 28%, #F7B731 52%, #FFE59A 76%, #F2AE2B 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 12px rgba(255, 196, 64, .55)) drop-shadow(0 0 30px rgba(255, 170, 40, .28));
    animation: gold-shimmer 7s ease-in-out infinite alternate;
}
.logo.small { font-size: clamp(1.5rem, 6.4vw, 2.4rem); margin: 0; padding-left: 0; letter-spacing: .14em; }
.tagline, .subtitle {
    /* gleiches lebendiges Gold wie das Logo, etwas dezenter */
    background: linear-gradient(100deg, #FFD36B 0%, #FFF0B3 28%, #F7B731 52%, #FFE59A 76%, #F2AE2B 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 196, 64, .4));
    animation: gold-shimmer 7s ease-in-out infinite alternate;
}
.tagline { font-size: clamp(1.6rem, 6.6vw, 2.6rem); letter-spacing: .1em; line-height: 1.2; }
.subtitle { font-size: clamp(.68rem, 3.4vw, 1.25rem); letter-spacing: .18em; text-transform: uppercase; margin: .4rem 0 1.8rem; }
.lead { color: var(--lavender); font-size: 1.05rem; margin: 0 auto 1.6rem; }
.hero { padding-top: 0; }

/* ---------- Karten ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px 22px;
    margin: 0 0 16px;
    backdrop-filter: blur(6px);
    text-align: left;
}
.card.highlight { border-color: var(--purple); box-shadow: 0 0 40px rgba(127, 119, 221, .18); }
.card.login, .card.center { text-align: center; }
.card.login .field { margin-bottom: 12px; }
.card.login form { margin: 0; }
.card.login + .card.login { margin-top: 4px; }
.hp-wrap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Knöpfe ---------- */
.btn, .btn-ghost, .btn-danger {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s, border-color .15s;
}
.btn { background: var(--purple); color: #fff; }
.btn:hover:not(:disabled) { background: var(--purple-dark); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--lavender); border-color: var(--card-border); }
.btn-ghost:hover { border-color: var(--purple-light); }
.btn-danger { background: transparent; color: #F4A3B5; border-color: rgba(226, 75, 106, .5); }
.btn-danger:hover:not(:disabled) { background: rgba(226, 75, 106, .15); }
.btn.small, .btn-ghost.small { padding: 8px 18px; font-size: .9rem; }
.btn.big { padding: 15px 38px; font-size: 1.1rem; }
button:disabled { opacity: .5; cursor: default; }

/* ---------- Eingaben ---------- */
.field {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(13, 8, 24, .6);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    color-scheme: dark;
}
.field:focus { outline: 2px solid var(--purple); outline-offset: 1px; }
.field:disabled { opacity: .45; }
.lbl-field { display: block; margin: 14px 0 6px; font-size: .9rem; color: var(--muted); }
.lbl-field:first-child { margin-top: 0; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; cursor: pointer; color: var(--lavender); font-size: .95rem; }
.check input { margin-top: 4px; accent-color: var(--purple); width: 18px; height: 18px; flex: none; }
.check.consent { margin-top: 0; font-size: .88rem; line-height: 1.5; }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.error { color: #F4A3B5; font-size: .9rem; margin: 0 0 10px; }
.error-box { background: rgba(226, 75, 106, .12); border: 1px solid rgba(226, 75, 106, .45); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; color: #F4B8C5; }
.picked { margin-top: 10px; color: var(--teal); }
.results { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.results li + li { border-top: 1px solid var(--card-border); }
.results button { width: 100%; text-align: left; padding: 10px 14px; background: transparent; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.results button:hover { background: rgba(127, 119, 221, .2); }

/* ---------- Umschalter ---------- */
.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--lavender);
    font: inherit;
    cursor: pointer;
    transition: all .15s;
}
.toggle:hover { border-color: var(--purple-light); }
.toggle.on { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 0 18px rgba(127, 119, 221, .45); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.center-chips { justify-content: center; }
.chip { font-size: .78rem; padding: 3px 11px; border-radius: 999px; background: rgba(127, 119, 221, .22); color: var(--lavender); }
.intensity-stark { background: rgba(240, 153, 123, .25); color: #F5C4B3; }
.intensity-transformativ { background: rgba(226, 75, 106, .25); color: #F4B8C5; }
.intensity-merklich { background: rgba(93, 202, 165, .2); color: #9FE1CB; }

/* ---------- Zähler ---------- */
.counters { display: flex; justify-content: center; gap: 36px; margin-top: 28px; }
.counters.inline { margin-top: 0; gap: 24px; }
.counter .num { font-size: 1.8rem; font-weight: 500; color: var(--teal); line-height: 1.1; }
.counter .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* ---------- Startseite angemeldet ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.match-card { border: 1px solid var(--card-border); border-radius: 14px; padding: 14px 16px; background: rgba(13, 8, 24, .45); }
.match-card.mutual { border-color: var(--teal); box-shadow: 0 0 22px rgba(93, 202, 165, .18); }
.match-top { display: flex; justify-content: space-between; align-items: baseline; }
.match-name { font-size: 1.1rem; }
.match-score { font-size: 1.6rem; color: var(--teal); font-weight: 500; }
.match-score span { font-size: .9rem; margin-left: 2px; }
.match-action { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status { font-size: .85rem; color: var(--muted); }
.status.hot { color: var(--teal); }

.data-rows { margin: 0; }
.data-rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid rgba(175, 169, 236, .12); }
.data-rows dt { color: var(--muted); }
.data-rows dd { margin: 0; text-align: right; }

.bottom-zone { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 34px 0 10px; }

/* ---------- Fenster ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(5, 2, 12, .72);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fade .2s ease;
}
.modal {
    position: relative;
    width: 100%; max-width: 420px;
    background: var(--bg2);
    border: 1px solid var(--purple);
    border-radius: 22px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 0 60px rgba(127, 119, 221, .35);
    animation: rise .25s ease;
}
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.amounts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px 0; }
.amount { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--purple); color: var(--text); text-decoration: none; }
.amount:hover { background: var(--purple); }
.amount.free { border-color: var(--teal); }
.amount.free:hover { background: var(--teal); color: #05130e; }

.match-popup .pop-glow { position: absolute; inset: -1px; border-radius: 22px; pointer-events: none; box-shadow: inset 0 0 40px rgba(93, 202, 165, .12); }
.pop-kicker { text-transform: uppercase; letter-spacing: .25em; font-size: .75rem; color: var(--teal); margin-bottom: 6px; }
.match-popup h2 { font-size: 1.6rem; color: var(--text); margin-bottom: 4px; }
.pop-score { font-size: 3rem; font-weight: 500; color: var(--teal); line-height: 1.1; }
.pop-score-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-bottom: 6px; }
.pop-note { margin-top: 10px; color: var(--lavender); font-size: .92rem; }
.pop-note.ok { color: var(--teal); }
.pop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.match-popup .chips { justify-content: center; }

/* ---------- Analyse ---------- */
.trio { display: flex; justify-content: space-around; text-align: center; gap: 10px; }
.trio-lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.trio-val { font-size: 1.3rem; color: var(--teal); }
.long-text { white-space: pre-line; color: var(--text); }
.part { margin-top: 14px; }
.part:first-of-type { margin-top: 6px; }
.part-lbl { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.growth { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--teal); background: rgba(93, 202, 165, .08); border-radius: 0 10px 10px 0; font-size: .95rem; white-space: pre-line; }
.analysis-card h2, .transit-card h2 { color: var(--purple-light); }
.transit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.transit-meta { display: flex; gap: 6px; }

/* ---------- Match-Seite ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--card-border); background: transparent; color: var(--lavender); font: inherit; cursor: pointer; }
.tab.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.big-score { font-size: 3.6rem; font-weight: 500; color: var(--teal); line-height: 1.1; }
.big-score span { font-size: 1.4rem; margin-left: 3px; }

/* ---------- Chat ---------- */
.chat-log { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 10px; }
.bubble { max-width: 80%; padding: 8px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: var(--purple-dark); border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: rgba(175, 169, 236, .18); border-bottom-left-radius: 4px; }
.bubble-time { font-size: .68rem; color: var(--muted); text-align: right; margin-top: 2px; }
.chat-input { display: flex; gap: 10px; margin-top: 8px; }
.chat-retention { font-size: .8rem; margin-top: 10px; }
.chat-input input { flex: 1; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--card-border); background: rgba(13, 8, 24, .6); color: var(--text); font: inherit; }
.chat-input input:focus { outline: 2px solid var(--purple); outline-offset: 1px; }

/* ---------- Rechtliches ---------- */
.legal h2 { margin-top: 1.4rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }

/* ---------- Sprache oben links ---------- */
.lang-switch { position: absolute; top: 12px; left: 12px; z-index: 40; display: flex; border: 1px solid var(--card-border); border-radius: 999px; overflow: hidden; background: rgba(13, 8, 24, .6); }
.lang-switch button { padding: 5px 13px; background: transparent; border: 0; color: var(--muted); font: inherit; font-size: .8rem; letter-spacing: .08em; cursor: pointer; }
.lang-switch button.on { background: var(--purple); color: #fff; }

/* ---------- Zurück-Pfeil, rechts neben dem Sprachwechsel ---------- */
.back-btn {
    position: absolute; top: 12px; left: 108px; z-index: 40;
    width: 34px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--card-border); border-radius: 999px; background: rgba(13, 8, 24, .6);
    color: var(--text, #fff); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer;
    transition: background .15s, transform .15s;
}
.back-btn:hover, .back-btn:focus-visible { background: var(--purple); color: #fff; transform: translateX(-2px); outline: none; }

.top-nav {
    position: absolute; top: 12px; right: 12px; z-index: 40;
    padding: 7px 18px; border: 0; border-radius: 999px;
    /* goldenes, wabernd schimmerndes Gelb wie beim Geschenk-Knopf */
    background: linear-gradient(100deg, #FFD36B 0%, #FFF0B3 28%, #F7B731 52%, #FFE59A 76%, #F2AE2B 100%);
    background-size: 220% 100%;
    color: #3A2400; text-decoration: none; font-size: .88rem; font-weight: 600; letter-spacing: .02em; white-space: pre;
    box-shadow: 0 4px 22px rgba(255, 196, 64, .55);
    animation: gold-shimmer 5s ease-in-out infinite alternate, gold-glow 3.2s ease-in-out infinite;
    transition: transform .15s;
}
.top-nav:hover { transform: translateY(-2px); }

/* ---------- Bücher ---------- */
.books-page { text-align: center; }
.books-page .logo.small { font-size: clamp(1.4rem, 6.4vw, 1.9rem); margin-bottom: 6px; }
.books-intro { max-width: 560px; margin: 14px auto 8px; }
.shelf { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 34px 38px; margin: 34px auto 10px; padding: 0 4px; }
.book {
    padding: 0; border: 0; background: none; cursor: pointer;
    height: 330px; border-radius: 6px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .55), 0 0 26px rgba(127, 119, 221, .25);
    transition: transform .25s ease, box-shadow .25s ease;
}
.book img { display: block; height: 100%; width: auto; border-radius: 6px; }
.book:hover, .book:focus-visible { transform: translateY(-8px) scale(1.03); box-shadow: 0 16px 44px rgba(0, 0, 0, .6), 0 0 40px rgba(255, 196, 64, .4); outline: none; }
.shell:has(.modal-backdrop) { z-index: 60; }
h1:focus, h1:focus-visible { outline: none; }
.book img { outline: 1px solid rgba(175, 169, 236, .22); outline-offset: -1px; }
.book-modal { max-width: 440px; max-height: 90vh; overflow-y: auto; }
.book-cover { display: block; height: 240px; width: auto; margin: 0 auto 14px; border-radius: 6px; box-shadow: 0 8px 26px rgba(0, 0, 0, .55); }
.book-modal h2 { margin: 0 0 4px; }
.book-sub { color: var(--purple-light); font-size: .9rem; margin-bottom: 14px; }
.book-desc { text-align: left; line-height: 1.6; margin: 0 0 20px; }
.book-links { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.book-links .btn { min-width: 200px; text-align: center; text-decoration: none; }
.book-links-label { color: var(--muted); font-size: .85rem; letter-spacing: .04em; }
.book-soon { display: inline-block; padding: 10px 22px; border: 1px solid var(--card-border); border-radius: 999px; color: var(--muted); }

/* ---------- Fußzeile ---------- */
.site-foot {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 8px 16px 10px;
    text-align: center;
    background: linear-gradient(to top, rgba(13, 8, 24, .95) 60%, rgba(13, 8, 24, 0));
    pointer-events: none;
}
.site-foot > * { pointer-events: auto; }
.foot-links { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: .8rem; margin-bottom: 4px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--lavender); }
.foot-links .btn-ghost { padding: 5px 16px; font-size: .8rem; color: var(--lavender); }
.copyright { font-size: .75rem; color: var(--muted); }

.donate-fab {
    position: fixed; right: 16px; bottom: 16px; z-index: 45;
    display: flex; align-items: center; gap: 7px;
    padding: 11px 22px;
    border: 0; border-radius: 999px;
    /* goldenes, wabernd schimmerndes Gelb */
    background: linear-gradient(100deg, #FFD36B 0%, #FFF0B3 28%, #F7B731 52%, #FFE59A 76%, #F2AE2B 100%);
    background-size: 220% 100%;
    color: #3A2400; font: inherit; font-weight: 600; letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 4px 22px rgba(255, 196, 64, .55);
    animation: gold-shimmer 5s ease-in-out infinite alternate, gold-glow 3.2s ease-in-out infinite;
    transition: transform .15s;
}
.donate-fab:hover { transform: translateY(-2px); }
.donate-fab .heart { animation: beat 1.8s infinite; }

/* ---------- Fehlerleiste ---------- */
#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: #3a1230; color: #F4B8C5; padding: 10px 20px;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 10px; }
#blazor-error-ui .reload { color: #fff; margin-left: 10px; }

/* ---------- Bewegung ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes gold-shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes gold-glow { 0%, 100% { box-shadow: 0 4px 18px rgba(255, 196, 64, .40); } 50% { box-shadow: 0 4px 34px rgba(255, 210, 90, .85); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 560px) {
    .shell { padding-top: 60px; }
    .top-nav { padding: 6px 13px; font-size: .8rem; }
    .counters { gap: 22px; }
    .foot-links { flex-wrap: wrap; gap: 10px; }
    .donate-fab { padding: 9px 15px; bottom: 56px; }
    .book { height: 270px; }
    .shelf { gap: 28px 24px; }
    .row { flex-direction: column; }
}

/* Blockieren */
.link-quiet { background: none; border: 0; color: var(--muted, #9d95c4); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 6px 4px; }
.link-quiet:hover { color: #fff; }
.blocked-box { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.blocked-box h3 { font-size: 1rem; margin: 0 0 4px; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
