/* custom.css – buchmatch.de
 * v1.0 2026-06-03 – Initiale Version
 * v1.1 2026-06-04 – Light/Dark Mode: CSS-Variablen-Override, color-scheme
 * v1.2 2026-06-05 – Tagesrätsel-Überschrift, erweiterter Ergebnisbereich (Trivia-Detail, Buchcover zentriert, Kauflink)
 *
 * Admin-Overrides (Bootstrap) + Game-Frontend-Styles
 */

/* ── CSS-Variablen (Dark Mode – Standard) ─────────────────── */
:root {
    --game-bg:         #1a1a2e;
    --game-bg-card:    #16213e;
    --game-accent:     #e94560;
    --game-accent-2:   #0f3460;
    --game-text:       #eaeaea;
    --game-text-muted: #8892a4;
    --game-correct:    #538d4e;
    --game-wrong:      #b71c1c;
    --game-border:     #2d3748;
    --game-input-bg:   #0d1117;
    --radius:          12px;
    --shadow:          0 4px 24px rgba(0,0,0,.4);
    color-scheme: dark;
}

/* ── Light Mode ──────────────────────────────────────────── */
.light-mode {
    --game-bg:         #f5f5f0;
    --game-bg-card:    #ffffff;
    --game-accent-2:   #e8eaf6;
    --game-text:       #1a1a2e;
    --game-text-muted: #6b7280;
    --game-correct:    #2e7d32;
    --game-wrong:      #c62828;
    --game-border:     #d1d5db;
    --game-input-bg:   #f0f2f5;
    --shadow:          0 4px 24px rgba(0,0,0,.1);
    color-scheme: light;
}

/* ── Admin-Overrides ──────────────────────────────────────── */
body.bg-light { background-color: #f4f6f9 !important; }

.card { border-radius: var(--radius); }
.card.shadow-sm { box-shadow: 0 2px 8px rgba(0,0,0,.08) !important; }

.navbar-brand { letter-spacing: .5px; }

/* ── Game-Frontend: Reset & Base ─────────────────────────── */
.game-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--game-bg);
    color: var(--game-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Game Header ────────────────────────────────────────── */
.game-header {
    border-bottom: 1px solid var(--game-border);
    padding: 0 1rem;
}
.game-header-inner {
    max-width: 600px;
    margin: 0 auto;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.game-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.5px;
}
/* Logo-Bilder: Dark-Logo standard, Light-Logo im Light Mode */
.game-logo-img, .pub-logo-img { height: 36px; width: auto; display: block; }
.logo-light            { display: none; }
.light-mode .logo-dark { display: none; }
.light-mode .logo-light{ display: block; }

.game-header-actions { display: flex; gap: .5rem; }
.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: .4rem;
    border-radius: 8px;
    transition: background .15s;
}
.btn-icon:hover { background: var(--game-border); }
.btn-icon.overflow-active { background: var(--game-border); }

/* ── Overflow Dropdown ───────────────────────────────────── */
.overflow-menu-wrap { position: relative; }
.overflow-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--game-bg);
    border: 1px solid var(--game-border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    padding: .35rem 0;
    list-style: none;
    margin: 0;
    z-index: 100;
}
.overflow-item {
    display: block;
    width: 100%;
    padding: .6rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: .95rem;
    cursor: pointer;
    color: var(--game-text);
    line-height: 1.4;
}
.overflow-item:hover { background: var(--game-border); }

/* ── Profile Dropdown ────────────────────────────────────── */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--game-bg);
    border: 1px solid var(--game-border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    z-index: 100;
    overflow: hidden;
}
.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem .7rem;
}
.profile-avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--game-accent, #e63946);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.btn-avatar-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--game-accent, #e63946);
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    pointer-events: none;
}
.profile-name {
    font-size: .92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}
.profile-divider { border-top: 1px solid var(--game-border); margin: 0; }

/* ── Auth Modal ──────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--game-border);
    margin-bottom: 1.2rem;
}
.auth-tab {
    flex: 1;
    padding: .6rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: .95rem;
    color: var(--game-text);
    opacity: .55;
    transition: opacity .15s, border-color .15s;
    margin-bottom: -1px;
}
.auth-tab.active {
    opacity: 1;
    border-bottom-color: var(--game-accent, #e63946);
    font-weight: 600;
}
.auth-field { margin-bottom: .9rem; }
.auth-field label {
    display: block;
    font-size: .83rem;
    opacity: .65;
    margin-bottom: .3rem;
}
.auth-field small { font-size: .8rem; opacity: .7; }
.auth-form .btn-submit { width: 100%; margin-top: .2rem; }
.auth-error {
    color: #e63946;
    font-size: .88rem;
    margin-bottom: .8rem;
    padding: .45rem .7rem;
    background: rgba(230,57,70,.1);
    border-radius: 6px;
}
.auth-success {
    color: #2a9d8f;
    font-size: .88rem;
    margin-bottom: .8rem;
    padding: .45rem .7rem;
    background: rgba(42,157,143,.1);
    border-radius: 6px;
}
.auth-link {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: .55rem;
    color: var(--game-text);
    opacity: .55;
    font-size: .88rem;
    margin-top: .4rem;
}
.auth-link:hover { opacity: 1; text-decoration: underline; }
.auth-info { font-size: .9rem; opacity: .75; margin-bottom: 1rem; line-height: 1.5; }

/* ── Game Modal ──────────────────────────────────────────── */
.game-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}
.game-modal {
    background: var(--game-bg);
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.game-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem .8rem;
    border-bottom: 1px solid var(--game-border);
    position: sticky;
    top: 0;
    background: var(--game-bg);
}
.game-modal-header h2 { margin: 0; font-size: 1.1rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: .35rem .45rem;
    border-radius: 6px;
    color: var(--game-text);
    opacity: .6;
    flex-shrink: 0;
}
.modal-close:hover { opacity: 1; background: var(--game-border); }
.game-modal-body {
    padding: 1rem 1.2rem 1.4rem;
    font-size: .95rem;
    line-height: 1.6;
}
.game-modal-body h3 { margin: 1.2rem 0 .3rem; font-size: 1rem; }
.game-modal-body p  { margin: .4rem 0; }

/* ── Game Main ──────────────────────────────────────────── */
.game-main {
    flex: 1;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

/* ── Lade-Spinner ────────────────────────────────────────── */
.game-loading { text-align: center; padding: 4rem 0; color: var(--game-text-muted); }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--game-border);
    border-top-color: var(--game-accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mode Badge ──────────────────────────────────────────── */
.game-mode-badge {
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--game-text-muted);
    margin-bottom: 1rem;
}

/* ── Zitate-Board ────────────────────────────────────────── */
.quotes-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.quote-item {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-style: italic;
    font-size: .95rem;
    line-height: 1.6;
    position: relative;
    animation: fadeIn .3s ease;
}
.quote-item::before {
    content: '"';
    font-size: 2.5rem;
    color: var(--game-accent);
    position: absolute;
    top: .25rem;
    left: .75rem;
    line-height: 1;
}
.quote-item-text { padding-left: 1.25rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── Input-Bereich ───────────────────────────────────────── */
.game-input-area {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}
.autocomplete-wrapper { flex: 1; position: relative; }
.game-input {
    width: 100%;
    background: var(--game-input-bg);
    border: 2px solid var(--game-border);
    border-radius: var(--radius);
    color: var(--game-text);
    padding: .75rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}
.game-input:focus { border-color: var(--game-accent); }
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    list-style: none;
    margin: 0; padding: 0;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}
.autocomplete-list li {
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .9rem;
    border-bottom: 1px solid var(--game-border);
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover { background: var(--game-accent-2); }
.autocomplete-list li .author { color: var(--game-text-muted); font-size: .8rem; }

.btn-submit {
    background: var(--game-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s, transform .1s;
}
.btn-submit:hover:not(:disabled) { opacity: .85; }
.btn-submit:active:not(:disabled) { transform: scale(.97); }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; }

/* ── Versuchs-Punkte ─────────────────────────────────────── */
.attempts-row {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: .5rem 0 1rem;
}
.attempt-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--game-border);
    background: transparent;
    transition: background .2s, border-color .2s;
}
.attempt-dot.correct  { background: var(--game-correct); border-color: var(--game-correct); }
.attempt-dot.wrong    { background: var(--game-wrong);   border-color: var(--game-wrong); }
.attempt-dot.current  { border-color: var(--game-text-muted); }

/* ── Seitentitel ─────────────────────────────────────────── */
.game-page-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--game-text-muted);
    margin: .75rem 0 0;
    padding: 0;
}

/* ── Ergebnis ────────────────────────────────────────────── */
.game-result { text-align: center; padding: 1rem 0; animation: fadeIn .4s ease; }
.result-emoji { font-size: 3rem; margin-bottom: .5rem; }
.game-result h2 { margin: 0 0 .5rem; }

/* Modus-spezifische Aufschlüsselung */
.result-details { margin: .25rem 0 .75rem; }

.result-attempt-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: .25rem 0;
}

.trivia-result-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: .25rem 0;
    text-align: left;
}
.trivia-result-row {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .35rem .6rem;
    border-radius: 8px;
    flex-wrap: wrap;
}
.trivia-result-row.res-correct { background: rgba(83, 141, 78, .18); }
.trivia-result-row.res-wrong   { background: rgba(183, 28, 28, .15); }
.trivia-result-icon {
    font-weight: 700;
    font-size: .95rem;
    min-width: 1.1rem;
    text-align: center;
    line-height: 1.5;
}
.trivia-result-row.res-correct .trivia-result-icon { color: var(--game-correct); }
.trivia-result-row.res-wrong   .trivia-result-icon { color: var(--game-wrong); }
.trivia-result-label { font-size: .9rem; color: var(--game-text-muted); line-height: 1.5; }
.trivia-result-hint {
    width: 100%;
    font-size: .78rem;
    color: var(--game-text-muted);
    padding-left: 1.6rem;
    margin-top: .1rem;
    font-style: italic;
}

/* Aufmunternder Spruch */
.result-message {
    color: var(--game-text-muted);
    font-size: .9rem;
    font-style: italic;
    margin: .25rem 0 1.25rem;
}

/* Buchpräsentation: Cover links – Infos rechts */
.result-book {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: left;
    margin-bottom: 1rem;
}
.result-cover {
    flex-shrink: 0;
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.result-book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;          /* verhindert Overflow bei langen Titeln */
}
.result-book-title  { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.result-book-link   { color: var(--game-accent); text-decoration: none; }
.result-book-link:hover { text-decoration: underline; }
.result-book-meta   { font-size: .75rem; color: var(--game-text-muted); }
.result-book-desc {
    font-size: .78rem;
    color: var(--game-text-muted);
    line-height: 1.55;
    margin: .1rem 0 0;
    overflow-wrap: break-word;
}

.result-score {
    background: var(--game-accent-2);
    border-radius: var(--radius);
    padding: .75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}
.btn-share {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    color: var(--game-text);
    border-radius: var(--radius);
    padding: .7rem 1.5rem;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
    max-width: 280px;
}
.btn-share:hover { background: var(--game-accent-2); }
.share-toast {
    margin-top: .5rem;
    font-size: .85rem;
    color: var(--game-correct);
    animation: fadeIn .2s ease;
}

/* ── Countdown ────────────────────────────────────────────── */
.game-countdown {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: var(--game-accent);
    margin: .5rem 0;
}
.game-countdown-label { font-size: .8rem; color: var(--game-text-muted); margin-top: 1.5rem; }

/* ── Toast-Nachrichten ────────────────────────────────────── */
.toast-area {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.toast-msg {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    color: var(--game-text);
    padding: .6rem 1.2rem;
    border-radius: var(--radius);
    font-size: .9rem;
    box-shadow: var(--shadow);
    animation: fadeIn .2s ease;
}

/* ── Modus C: Plot ───────────────────────────────────────── */
.plots-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.plot-num { font-weight: 700; color: var(--game-accent); margin-right: .4rem; font-size: .85rem; }
.plot-cover-hint {
    text-align: center;
    margin: 1rem 0;
    animation: fadeIn .4s ease;
}
.plot-hint-label { font-size: .75rem; color: var(--game-text-muted); margin-bottom: .5rem; }
.plot-hint-img {
    max-width: 100px;
    border-radius: 6px;
    filter: grayscale(1) brightness(.4);
    opacity: .7;
}

/* ── Modus D: Buchdeckel ─────────────────────────────────── */
.cover-board { text-align: center; margin-bottom: 1.5rem; }
.cover-image-wrap {
    display: inline-block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: .75rem;
}
.cover-image {
    display: block;
    width: 200px;
    height: 280px;
    object-fit: cover;
    transition: filter .5s ease;
}
/* Pixelierungs-Stufen via CSS (Fallback wenn serverseitige Stufen fehlen) */
.cover-level-1 { image-rendering: pixelated; filter: blur(8px)  brightness(.8); }
.cover-level-2 { image-rendering: pixelated; filter: blur(5px)  brightness(.9); }
.cover-level-3 { filter: blur(2px); }
.cover-level-4 { filter: blur(.5px); }
.cover-level-5 { filter: none; }
.cover-level-badge {
    font-size: .75rem;
    color: var(--game-text-muted);
    margin-top: .25rem;
}

/* ── Modus A: Trivia ─────────────────────────────────────── */
.trivia-board { padding-bottom: 1rem; }
.trivia-progress {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.trivia-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--game-text-muted);
    transition: background .2s, border-color .2s;
}
.trivia-dot.correct  { background: var(--game-correct); border-color: var(--game-correct); }
.trivia-dot.wrong    { background: var(--game-wrong);   border-color: var(--game-wrong); }
.trivia-dot.current  { border-color: var(--game-accent); }

.trivia-q-num {
    display: block;
    font-size: .7rem;
    color: var(--game-text-muted);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.trivia-question {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    animation: fadeIn .3s ease;
}
.trivia-options {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.trivia-option {
    background: var(--game-bg-card);
    border: 1.5px solid var(--game-border);
    color: var(--game-text);
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .95rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.trivia-option:not(:disabled):hover {
    border-color: var(--game-accent);
    background: var(--game-accent-2);
}
.trivia-option:disabled { cursor: default; }
.trivia-option.option-correct {
    border-color: var(--game-correct);
    background: rgba(83, 141, 78, .2);
}
.trivia-option.option-wrong {
    border-color: var(--game-wrong);
    background: rgba(183, 28, 28, .2);
}
.trivia-feedback {
    margin-top: .75rem;
    padding: .6rem 1rem;
    background: var(--game-accent-2);
    border-left: 3px solid var(--game-accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: .88rem;
    animation: fadeIn .3s ease;
}

/* ── Modus E: Zwei Lügen / eine Wahrheit ─────────────────── */
.lt-board { padding-bottom: 1rem; }
.lt-book-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}
.lt-cover {
    width: 56px; height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.lt-author { font-size: .9rem; color: var(--game-text-muted); }
.lt-instruction { font-size: .9rem; color: var(--game-text-muted); margin-bottom: .75rem; }
.lt-statements { display: flex; flex-direction: column; gap: .6rem; }
.lt-statement-btn {
    background: var(--game-bg-card);
    border: 1.5px solid var(--game-border);
    color: var(--game-text);
    padding: .85rem 1rem;
    border-radius: var(--radius);
    font-size: .95rem;
    text-align: left;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color .15s, background .15s;
}
.lt-statement-btn:not(:disabled):hover {
    border-color: var(--game-accent);
    background: var(--game-accent-2);
}
.lt-statement-btn:disabled    { cursor: default; opacity: .6; }
.lt-statement-btn.lt-selected { border-color: var(--game-text-muted); opacity: .8; }
.lt-statement-btn.lt-correct  { border-color: var(--game-correct); background: rgba(83,141,78,.2); opacity: 1 !important; }
.lt-statement-btn.lt-wrong    { border-color: var(--game-wrong);   background: rgba(183,28,28,.2); }

/* ════════════════════════════════════════════════════════════
   Einstellungsseite
   ════════════════════════════════════════════════════════════ */
.settings-wrap     { max-width: 640px; margin: 0 auto; }
.settings-loading  { text-align: center; padding: 4rem 0; color: var(--game-text-muted); }
.settings-noauth   { text-align: center; padding: 3rem 0; color: var(--game-text-muted); }

.settings-section {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.settings-section-danger { border-color: rgba(183,28,28,.4); }
.settings-section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--game-text-muted);
    margin: 0 0 1.25rem;
}
.settings-form { display: flex; flex-direction: column; gap: 1rem; }

.settings-field { display: flex; flex-direction: column; gap: .35rem; }
.settings-field label { font-size: .9rem; font-weight: 500; }
.settings-field input,
.settings-field select {
    background: var(--game-input-bg);
    border: 1.5px solid var(--game-border);
    color: var(--game-text);
    padding: .6rem .85rem;
    border-radius: 8px;
    font-size: .95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.settings-field input:focus,
.settings-field select:focus  { outline: none; border-color: var(--game-accent); }
.settings-field select option { background: var(--game-bg-card); }
.settings-hint    { font-size: .75rem; color: var(--game-text-muted); }
.settings-optional { font-size: .75rem; color: var(--game-text-muted); font-weight: 400; }

/* Buttons */
.settings-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.2rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, background .15s;
    text-decoration: none;
}
.settings-btn:disabled { opacity: .6; cursor: default; }
.settings-btn-primary   { background: var(--game-accent);   color: #fff; }
.settings-btn-secondary {
    background: var(--game-border);
    color: var(--game-text);
    border: 1.5px solid var(--game-border);
}
.settings-btn-danger    { background: var(--game-wrong);    color: #fff; }
.settings-btn:hover:not(:disabled) { opacity: .85; }

/* Toggle-Switch */
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem 0;
}
.settings-toggle-label { font-size: .9rem; font-weight: 500; }
.settings-toggle-hint  { font-size: .78rem; color: var(--game-text-muted); margin-top: .15rem; }
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 44px; height: 24px;
    flex-shrink: 0;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
    position: absolute; inset: 0;
    background: var(--game-border);
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}
.settings-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: var(--game-text);
    border-radius: 50%;
    transition: transform .2s;
}
.settings-toggle input:checked + .settings-toggle-slider { background: var(--game-correct); }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(20px); }

/* Flash-Nachrichten */
.settings-flash {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    animation: fadeIn .2s ease;
}
.settings-flash-success { background: rgba(83,141,78,.2); border: 1px solid var(--game-correct); color: var(--game-correct); }
.settings-flash-error   { background: rgba(183,28,28,.2); border: 1px solid var(--game-wrong);   color: #ef9a9a; }

/* DSGVO-Bereich */
.settings-dsgvo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem 0;
}
.settings-divider { border: none; border-top: 1px solid var(--game-border); margin: 1rem 0; }
.settings-danger-label { color: #ef9a9a; font-weight: 600; font-size: .9rem; }
.settings-delete-box {
    margin-top: 1rem;
    background: rgba(183,28,28,.08);
    border: 1px solid rgba(183,28,28,.3);
    border-radius: 8px;
    padding: 1rem;
}
.settings-delete-btns { display: flex; gap: .75rem; }

/* E-Mail-Sektion */
.settings-email-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
}
.settings-email-value {
    font-size: .95rem;
    color: var(--game-text);
    margin-top: .2rem;
    word-break: break-all;
}
.settings-verify-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.settings-verify-badge-ok   { background: rgba(83,141,78,.2);  color: var(--game-correct); border: 1px solid var(--game-correct); }
.settings-verify-badge-warn { background: rgba(201,148,5,.15); color: #e6b800;             border: 1px solid #e6b800; }

/* ════════════════════════════════════════════════════════════
   Öffentliche Seiten (Rangliste, Profil) – Dark Theme
   ════════════════════════════════════════════════════════════ */

/* ── Shared Public Layout ────────────────────────────────── */
.pub-body { min-height: 100vh; display: flex; flex-direction: column; }
.pub-header {
    border-bottom: 1px solid var(--game-border);
    padding: 0 1rem;
    flex-shrink: 0;
}
.pub-header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}
.pub-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--game-text);
    text-decoration: none;
    letter-spacing: -.5px;
}
.pub-logo:hover { color: var(--game-accent); }
.pub-nav { display: flex; gap: 1rem; }
.pub-nav-link {
    color: var(--game-text-muted);
    text-decoration: none;
    font-size: .9rem;
    padding: .3rem .5rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.pub-nav-link:hover, .pub-nav-link.active {
    color: var(--game-text);
    background: var(--game-bg-card);
}

.pub-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.pub-footer {
    border-top: 1px solid var(--game-border);
    padding: 1rem;
    margin-top: auto;
}
.pub-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: var(--game-text-muted);
}
.pub-footer-links { display: flex; gap: 1rem; }
.pub-footer-links a { color: var(--game-text-muted); text-decoration: none; }
.pub-footer-links a:hover { color: var(--game-text); }

.pub-page-title {
    margin-bottom: 2rem;
    text-align: center;
}
.pub-page-title h1 { margin: 0; font-size: 1.8rem; }
.pub-page-subtitle { color: var(--game-text-muted); margin: .3rem 0 0; font-size: .9rem; }

.pub-section { margin-bottom: 2.5rem; }
.pub-section-head {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--game-border);
    padding-bottom: .5rem;
}
.pub-section-head h2 { margin: 0; font-size: 1.1rem; }
.pub-section-subtitle { font-size: .8rem; color: var(--game-text-muted); }
.pub-empty { color: var(--game-text-muted); font-size: .9rem; text-align: center; padding: 2rem 0; }

/* ── Ranglisten-Tabelle ──────────────────────────────────── */
.lb-table-wrap { overflow-x: auto; }
.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.lb-table th {
    color: var(--game-text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .5rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--game-border);
}
.lb-table td {
    padding: .55rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: middle;
}
.lb-table tr:hover td { background: var(--game-bg-card); }
.lb-rank { width: 3rem; text-align: center; font-weight: 700; font-size: 1rem; }
.lb-pts  { width: 7rem; text-align: right; font-weight: 700; color: var(--game-accent); }
.lb-name { color: var(--game-text); text-decoration: none; font-weight: 500; }
.lb-name:hover { color: var(--game-accent); }
.lb-anon { color: var(--game-text-muted); font-style: italic; }
/* Podium-Farben */
.lb-top1 td { background: rgba(255,215,0,.06); }
.lb-top2 td { background: rgba(192,192,192,.05); }
.lb-top3 td { background: rgba(205,127,50,.05); }

/* ── Profil-Seite ─────────────────────────────────────────── */
.profile-wrap { max-width: 700px; margin: 0 auto; }

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.avatar-img {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--game-border);
}
.avatar-placeholder {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--game-bg-card);
    border: 2px solid var(--game-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.profile-name      { margin: 0 0 .2rem; font-size: 1.4rem; }
.profile-since     { margin: 0; color: var(--game-text-muted); font-size: .85rem; }
.profile-last-login { margin: .1rem 0 0; color: var(--game-text-muted); font-size: .8rem; }

.profile-private {
    text-align: center;
    padding: 3rem 0;
    color: var(--game-text-muted);
    font-size: 1.1rem;
}

.profile-section       { margin-bottom: 2rem; }
.profile-section-title { font-size: 1rem; margin: 0 0 1rem; color: var(--game-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; font-size: .8rem; }

/* Stats-Kacheln */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
}
.stat-card {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: .9rem .75rem;
    text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--game-accent); }
.stat-label { font-size: .75rem; color: var(--game-text-muted); margin-top: .2rem; }

/* Streak-Kalender */
.streak-cal-wrap  { overflow-x: auto; }
.streak-cal-inner { display: flex; align-items: flex-start; gap: 6px; padding: .5rem 0; }
.streak-grid {
    display: flex;
    gap: 3px;
}
.streak-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.streak-day {
    width: 13px; height: 13px;
    border-radius: 2px;
    background: var(--game-border);
    cursor: default;
    flex-shrink: 0;
}
.streak-solved { background: var(--game-correct); }
.streak-played { background: #2d5a2d; }
.streak-none   { background: var(--game-border); }
.streak-future { opacity: .15; }

.streak-day-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.streak-day-labels span {
    font-size: .55rem;
    color: var(--game-text-muted);
    height: 13px;
    line-height: 13px;
    text-align: right;
    white-space: nowrap;
}
.streak-legend {
    display: flex;
    gap: 1rem;
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--game-text-muted);
}
.streak-legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.streak-legend-item .streak-day {
    width: 10px; height: 10px;
    flex-shrink: 0;
}

/* Abzeichen-Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .75rem;
}
.achievement-card {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: .8rem .5rem;
    text-align: center;
    transition: border-color .2s;
}
.achievement-card.earned { border-color: var(--game-accent); }
.achievement-card.locked { opacity: .45; }
.achievement-icon  { font-size: 1.6rem; margin-bottom: .3rem; }
.achievement-name  { font-size: .75rem; font-weight: 600; line-height: 1.2; }
.achievement-date  { font-size: .65rem; color: var(--game-text-muted); margin-top: .2rem; }
.achievement-locked-label { font-size: .7rem; color: var(--game-text-muted); margin-top: .2rem; }

/* Modus-Grid */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}
.mode-card {
    background: var(--game-bg-card);
    border: 1px solid var(--game-border);
    border-radius: var(--radius);
    padding: .8rem 1rem;
}
.mode-label  { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.mode-played { font-size: .8rem; color: var(--game-text-muted); }
.mode-first  { font-size: .75rem; color: var(--game-correct); margin-top: .1rem; }

/* Responsive für kleine Screens */
@media (max-width: 480px) {
    .profile-header { flex-direction: column; text-align: center; }
    .pub-footer-inner { flex-direction: column; gap: .5rem; text-align: center; }
    .streak-day { width: 10px; height: 10px; }
    .streak-day-labels span { height: 10px; line-height: 10px; }
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
