@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
    --primary: #4a86c8;
    --primary-dark: #326199;
    --heading-blue: #4a90d9;
    --accent-red: #c62828;
    --accent-green: #2e7d32;
    --accent-gold: #d4a017;
    --bg: #f2f4f6;
    --border: #dde1e6;
    --text: #232629;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3 {
    font-family: 'Quicksand', 'Open Sans', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.hint { font-size: 0.85rem; color: #666; margin: 8px 0; }
.hint-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; color: var(--primary); font-weight: 600; text-decoration: none; }
.hint-link:hover { text-decoration: underline; }
.member-count { font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); margin: 8px 0; }

.alert { padding: 14px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.95rem; }
.alert-success { background: #e6f4ea; color: var(--accent-green); }
.alert-error { background: #fdecea; color: var(--accent-red); }

button, .btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-danger { background: #c53030; }
.btn-danger:hover { background: #9b2c2c; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }

.checkbox-label { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; font-weight: normal; cursor: pointer; }
.checkbox-label input { margin-top: 3px; }

.consent-locked { background: #eceff2; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: default; color: #4b5563; }
.consent-locked input[type="checkbox"] { cursor: default; accent-color: #6b7280; }

.marketing-consent { background: #f4f6f9; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.marketing-consent p { margin: 0 0 8px; font-size: 0.9rem; }
.radio-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: normal; cursor: pointer; margin-right: 20px; }

/* ==================== Öffentlicher Spielbereich ==================== */

.quiz-container { max-width: 640px; }

.quiz-header { text-align: center; margin-bottom: 24px; }
.quiz-logo { height: 70px; width: auto; margin-bottom: 8px; }
.quiz-header h1 { color: var(--heading-blue); margin: 4px 0; }

.quiz-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.info-card h2 { color: var(--heading-blue); margin: 0 0 10px; font-size: 1.1rem; }
.info-list { margin: 0; padding-left: 20px; font-size: 0.9rem; line-height: 1.6; }
.info-list li { margin-bottom: 4px; }

.quiz-start-form { display: flex; flex-direction: column; gap: 14px; }
.quiz-start-form label { font-weight: 600; font-size: 0.9rem; }
.quiz-start-form input[type="text"], .quiz-start-form input[type="email"] {
    padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.btn-start { align-self: flex-start; margin-top: 6px; font-size: 1.05rem; padding: 14px 28px; }
.honeypot { position: absolute; left: -9999px; top: -9999px; }

.leaderboard-card h2 { color: var(--heading-blue); margin-top: 0; }
.leaderboard-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.leaderboard-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.leaderboard-list li:last-child { border-bottom: none; }
.leaderboard-list li:nth-child(1) .rank { color: var(--accent-gold); }
.leaderboard-list .rank { font-weight: 700; color: var(--primary); min-width: 34px; }
.leaderboard-list .name { flex: 1; font-weight: 600; }
.leaderboard-list .score { color: var(--primary-dark); font-weight: 700; }
.leaderboard-widget { padding: 18px; }

/* Frage-Ablauf */
.quiz-progress { margin-bottom: 18px; }
.quiz-progress-bar { background: #e2e6ea; border-radius: 999px; height: 10px; overflow: hidden; }
.quiz-progress-fill { background: linear-gradient(90deg, var(--primary), var(--accent-gold)); height: 100%; transition: width .3s; }

.quiz-timer { position: relative; width: 56px; height: 56px; margin: 0 auto 14px; }
.timer-ring { display: block; width: 56px; height: 56px; transform: rotate(-90deg); }
.timer-ring-bg { fill: none; stroke: #e2e6ea; stroke-width: 10; }
.timer-ring-fg {
    fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke .3s;
}
.timer-number {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: 'Quicksand', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--text);
}
.quiz-timer.timer-warning .timer-ring-fg { stroke: var(--accent-red); }
.quiz-timer.timer-warning .timer-number { color: var(--accent-red); animation: timer-pulse 1s infinite; }
.quiz-timer.timer-expired .timer-ring-fg { stroke: var(--accent-red); }
.quiz-timer.timer-expired .timer-number { color: var(--accent-red); }
@keyframes timer-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}
.timer-expired-banner {
    background: #fdecea; color: var(--accent-red); border: 1px solid #f3b8b5;
    border-radius: 8px; padding: 12px 16px; font-weight: 700; font-size: 0.95rem;
    text-align: center; margin: 0 0 18px;
}

.question-card { position: relative; text-align: center; }
.question-text { color: var(--heading-blue); font-size: 1.3rem; margin: 0 0 18px; }

.question-image { margin: 0 0 20px; }
.question-image img { max-width: 100%; max-height: 280px; border-radius: 10px; border: 1px solid var(--border); }
.question-image figcaption { font-size: 0.75rem; color: #888; margin-top: 6px; }

.joker-form { margin: 0 0 18px; }
.btn-joker { background: var(--accent-gold); color: var(--text); font-size: 0.9rem; padding: 10px 18px; }
.btn-joker:hover { background: #b8860b; color: #fff; }

.answer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.answer-btn {
    display: flex; align-items: center; gap: 10px;
    background: #f4f6f9; color: var(--text); border: 2px solid var(--border);
    border-radius: 10px; padding: 14px 16px; text-align: left; font-size: 0.95rem; font-weight: 600;
}
.answer-btn:hover { background: #fff3b0; border-color: var(--accent-gold); color: var(--text); }
.answer-letter {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; border-radius: 50%;
    width: 30px; height: 30px; flex-shrink: 0; font-weight: 700;
}
@media (max-width: 560px) {
    .answer-form { grid-template-columns: 1fr; }
}

/* Ergebnis */
.result-card { text-align: center; }
.result-name { font-size: 1.1rem; font-weight: 600; }
.result-score { font-size: 2.6rem; font-weight: 700; color: var(--accent-gold); margin: 8px 0; }
.result-rank { font-size: 1rem; }
.result-compare { font-size: 1rem; font-weight: 600; color: var(--primary-dark); }

.share-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.btn-share { font-size: 0.9rem; padding: 10px 18px; }
.btn-share-whatsapp { background: #25d366; }
.btn-share-whatsapp:hover { background: #1da851; }
.btn-share-facebook { background: #1877f2; }
.btn-share-facebook:hover { background: #145dc4; }
.btn-share-copy { background: #6b7280; }
.btn-share-copy:hover { background: #4b5563; }
.btn-share-native { background: var(--primary-dark); }
.btn-share-image { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.btn-share-image:hover { filter: brightness(1.08); }

.review-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.review-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.review-list li:last-child { border-bottom: none; }
.review-correct .review-icon { color: var(--accent-green); }
.review-wrong .review-icon { color: var(--accent-red); }
.review-text { flex: 1; }
.review-points { color: var(--accent-green); font-weight: 700; white-space: nowrap; }

/* ==================== Admin-Bereich ==================== */

.admin-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom: 20px;}
.admin-header .brand { display: flex; align-items: center; gap: 14px; }
.admin-header h1 { margin: 0; font-size: 26px; color: var(--heading-blue); }
.admin-header .action-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.admin-nav { margin-bottom: 24px; }
.admin-nav-links { display: flex; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.admin-nav-links a { color: var(--primary); text-decoration: none; font-weight: 600; padding: 8px 10px; border-radius: 6px; }
.admin-nav-links a:hover { background: #fff3b0; color: #6b5900; }
.admin-nav-links a.active { background: var(--primary); color: #fff; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { text-align: center; padding: 20px; margin-bottom: 0; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--primary-dark); }
.stat-label { font-size: 0.85rem; color: #666; margin-top: 4px; }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px;}
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; vertical-align: middle; }
table.admin-table th { background: #f1f3f5; }
.table-scroll { overflow-x: auto; margin-bottom: 16px; }
.table-scroll table.admin-table { margin-bottom: 0; }

.status-badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pending { background: #fdecea; color: var(--accent-red); }
.status-approved { background: #e6f4ea; color: #1e6f39; }

.action-buttons { display: flex; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.action-buttons form { display: inline; margin: 0; }
.action-buttons button, .action-buttons a.btn { padding: 8px 14px; font-size: 0.85rem; border-radius: 6px; white-space: nowrap; }
.rename-form { display: inline-flex !important; gap: 4px; }
.rename-form input[type="text"] { width: 130px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar input[type="text"] { flex: 1 1 260px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }
.filter-bar select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; }

.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form label { font-weight: 600; font-size: 0.9rem; }
.admin-form input, .admin-form textarea, .admin-form select {
    font-size: 1rem; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-weight: normal; font-family: inherit; width: 100%;
}
.admin-form code { background: #f1f3f5; padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }
