/* ============================================================
   PadelCompass Schläger-Finder – Premium Quiz UI
   Genutzt von: quiz.html, quiz-basic.html, quiz-advanced.html
   ============================================================ */

/* --- Basis (vorher inline in den Quiz-Seiten) --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 48;
}
.glassmorphism {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Ambiente: sanfte Glows hinter dem Quiz --- */
.quiz-stage {
    position: relative;
}
.quiz-stage::before,
.quiz-stage::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}
.quiz-stage::before {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -140px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.09), transparent 70%);
}
.quiz-stage::after {
    width: 380px;
    height: 380px;
    bottom: -100px;
    right: -120px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.07), transparent 70%);
}
.quiz-stage > * {
    position: relative;
    z-index: 1;
}

/* --- Fortschritt --- */
.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.quiz-progress-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #67E8F9;
}
.quiz-progress-label::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00FFFF;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    animation: quizPulseDot 2.2s ease-in-out infinite;
}
@keyframes quizPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.8); }
}
.quiz-progress-pct {
    font-size: 12px;
    font-weight: 800;
    color: #9CA3AF;
    font-variant-numeric: tabular-nums;
}
.quiz-progress-track {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.quiz-progress-fill {
    position: relative;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0891B2, #00FFFF 60%, #5EEAD4);
    box-shadow: 0 0 14px rgba(0, 255, 255, 0.45);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.quiz-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    background-size: 200% 100%;
    animation: quizShine 2.4s linear infinite;
}
@keyframes quizShine {
    0% { background-position: 180% 0; }
    100% { background-position: -80% 0; }
}

/* --- Fragen-Übergang --- */
.quiz-step {
    animation: quizStepIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes quizStepIn {
    from { opacity: 0; transform: translateY(14px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.quiz-step.quiz-step-out {
    animation: quizStepOut 0.2s ease-in both;
}
@keyframes quizStepOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

/* --- Antwort-Karten --- */
.quiz-answer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015) 55%),
        rgba(10, 12, 14, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 10px 30px rgba(0, 0, 0, 0.35);
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
/* Gradient-Schimmer am oberen Rand */
.quiz-answer::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.quiz-answer:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 255, 0.45);
    background:
        linear-gradient(160deg, rgba(0, 255, 255, 0.09), rgba(0, 255, 255, 0.02) 60%),
        rgba(10, 12, 14, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(0, 255, 255, 0.14);
}
.quiz-answer:hover::before {
    opacity: 1;
}
.quiz-answer:active {
    transform: translateY(-1px) scale(0.985);
}
.quiz-answer:focus-visible {
    outline: none;
    border-color: rgba(0, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.22);
}
/* Check-Badge (erscheint bei Auswahl) */
.quiz-answer .quiz-answer-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #00FFFF;
    color: #04151a;
    display: grid;
    place-items: center;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quiz-answer .quiz-answer-check::before {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: translateY(-1px) rotate(-45deg);
}
.quiz-answer.answer-selected {
    border-color: rgba(0, 255, 255, 0.75);
    background:
        linear-gradient(160deg, rgba(0, 255, 255, 0.14), rgba(0, 255, 255, 0.04) 60%),
        rgba(10, 12, 14, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 255, 255, 0.35),
        0 0 30px rgba(0, 255, 255, 0.2);
}
.quiz-answer.answer-selected .quiz-answer-check {
    opacity: 1;
    transform: scale(1);
}
/* Gestaffeltes Erscheinen der Antworten */
.quiz-step .quiz-answer {
    animation: quizStepIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.quiz-step .quiz-answer:nth-child(1) { animation-delay: 0.05s; }
.quiz-step .quiz-answer:nth-child(2) { animation-delay: 0.1s; }
.quiz-step .quiz-answer:nth-child(3) { animation-delay: 0.15s; }
.quiz-step .quiz-answer:nth-child(4) { animation-delay: 0.2s; }

/* --- Info-Panel --- */
.quiz-info {
    border-radius: 14px;
    border: 1px solid rgba(0, 255, 255, 0.18);
    background:
        linear-gradient(135deg, rgba(0, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 60%),
        rgba(10, 12, 14, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.quiz-info-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(0, 255, 255, 0.12);
    border: 1px solid rgba(0, 255, 255, 0.25);
}
.quiz-info-icon .material-symbols-outlined {
    font-size: 18px;
    color: #67E8F9;
}

/* --- Zurück-Button --- */
.quiz-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #D1D5DB;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.quiz-back:hover {
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.07);
    color: #FFFFFF;
    transform: translateX(-2px);
}

/* --- Lade-Animation (Berechnung) --- */
.quiz-loader {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto 28px;
}
.quiz-loader span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #00FFFF;
    animation: quizSpin 1.1s linear infinite;
}
.quiz-loader span:nth-child(2) {
    inset: 12px;
    border-top-color: rgba(0, 255, 255, 0.6);
    animation-duration: 1.5s;
    animation-direction: reverse;
}
.quiz-loader span:nth-child(3) {
    inset: 24px;
    border-top-color: rgba(94, 234, 212, 0.8);
    animation-duration: 1.9s;
}
.quiz-loader::after {
    content: '';
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.16);
    animation: quizPulseDot 1.6s ease-in-out infinite;
}
@keyframes quizSpin {
    to { transform: rotate(360deg); }
}

/* --- Ergebnis-Seite --- */
.quiz-reveal {
    animation: quizStepIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.quiz-reveal-1 { animation-delay: 0.05s; }
.quiz-reveal-2 { animation-delay: 0.18s; }
.quiz-reveal-3 { animation-delay: 0.32s; }
.quiz-reveal-4 { animation-delay: 0.46s; }

.quiz-topmatch {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, 0.4);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(0, 255, 255, 0.12), transparent 55%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        rgba(10, 12, 14, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 24px 60px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(0, 255, 255, 0.12);
}
.quiz-topmatch::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.8), transparent);
}
.quiz-trophy {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 255, 255, 0.12);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.18);
}
.quiz-match-pct {
    font-variant-numeric: tabular-nums;
    background: linear-gradient(120deg, #00FFFF, #5EEAD4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.35));
}
/* Rating-Balken (Power/Kontrolle) */
.quiz-bar {
    flex: 1;
    max-width: 130px;
    height: 6px;
    margin: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.quiz-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0891B2, #00FFFF);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}
.quiz-bar.quiz-bar-on span {
    width: var(--v, 0%);
}

/* Top-10-Scroller */
.quiz-top10-scroller {
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.3) transparent;
}
.quiz-top10-card {
    scroll-snap-align: start;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
        rgba(10, 12, 14, 0.6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.quiz-top10-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 22px rgba(0, 255, 255, 0.1);
}
.quiz-top10-card.quiz-top10-first {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 26px rgba(0, 255, 255, 0.14);
}
.quiz-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 255, 0.25);
    background: rgba(0, 255, 255, 0.08);
    color: #67E8F9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* CTA-Buttons (Ergebnis) */
.quiz-cta-primary {
    position: relative;
    display: inline-block;
    border-radius: 14px;
    background: linear-gradient(120deg, #00FFFF, #5EEAD4);
    color: #04151a;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(0, 255, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quiz-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 255, 255, 0.3);
}
.quiz-cta-secondary {
    display: inline-block;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    font-weight: 700;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.quiz-cta-secondary:hover {
    border-color: rgba(0, 255, 255, 0.35);
    background: rgba(0, 255, 255, 0.07);
    transform: translateY(-2px);
}

/* --- Reduzierte Bewegung --- */
@media (prefers-reduced-motion: reduce) {
    .quiz-step,
    .quiz-step .quiz-answer,
    .quiz-reveal,
    .quiz-progress-fill::after,
    .quiz-progress-label::before {
        animation: none !important;
    }
    .quiz-answer,
    .quiz-top10-card,
    .quiz-progress-fill,
    .quiz-bar span {
        transition: none !important;
    }
    .quiz-bar.quiz-bar-on span {
        width: var(--v, 0%);
    }
}
