/* Quiz Show Platform - TV-Authentic Design */

/* Retro Arcade Font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'WWM Humanist';
    src: url('fonts/Humanist 777 Bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Copperplate';
    src: url('fonts/Copperplate.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* WWM TV Colors - heller und sichtbarer wie im Original */
    --wwm-bg-dark: #050510;
    --wwm-bg-mid: #0a1030;
    --wwm-box-dark: #102050;
    --wwm-box-mid: #1a3a7a;
    --wwm-box-light: #2850a0;
    --wwm-border-dark: #2050a0;
    --wwm-border-mid: #3070c0;
    --wwm-border-light: #5090e0;
    --wwm-border-highlight: #70b0ff;
    --accent-orange: #ff8c00;
    --accent-gold: #ffd700;
    --text-white: #ffffff;
    --correct-green: #00c853;
    --wrong-red: #ff2244;
}

html {
    background: #050515; /* Fallback für Safe Area */
}

body {
    font-family: 'WWM Humanist', 'Humanist 777', 'Frutiger', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    background: radial-gradient(ellipse at center bottom, #102050 0%, #050515 70%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport für Mobile Safari */
    color: var(--text-white);
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    /* Safe Area für Notch/Dynamic Island/Home Indicator */
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1; /* Über dem Starfield Canvas */
}

/* Screens */
.screen {
    display: none !important;
    animation: fadeIn 0.5s ease;
    padding-top: 3em;
}

.screen.active {
    display: block !important;
}

#start-screen.active {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Start Screen */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.logo {
    margin-bottom: 60px;
    text-align: center;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.logo h1 {
    font-family: 'Copperplate', serif;
    font-size: 2.5rem;
    font-weight: normal;
    letter-spacing: 0.4em;
    color: var(--text-white);
    text-shadow: 0 0 30px rgba(100, 150, 255, 0.5);
    margin-bottom: 10px;
}

.logo h2 {
    font-family: 'Copperplate', serif;
    font-size: 4rem;
    font-weight: normal;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Button Container - für Linie dahinter */
.main-btn-wrapper {
    position: relative;
    display: inline-block;
}

.main-btn-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -30px;
    right: -30px;
    height: 3px;
    transform: translateY(-50%);
    background: linear-gradient(to right,
        transparent 0%,
        #3050a0 3%,
        #5080d0 10%,
        #5080d0 90%,
        #3050a0 97%,
        transparent 100%);
    z-index: -1;
}

/* Main Button - Hexagon wie Answer Buttons */
.main-btn {
    position: relative;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: normal;
    padding: 12px 50px;
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 0 #000, 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.main-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        #70b8ff 0%,
        #4090e0 10%,
        #2868c0 30%,
        #1850a0 70%,
        #2060b0 90%,
        #3080d0 100%);
    clip-path: url(#answerHex);
    z-index: -2;
}

.main-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #0b0a3f 0%,
            #1f319b 50%,
            #061262 100%);
    clip-path: url(#answerHexInner);
    z-index: -1;
}

.main-btn:hover::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #1a1a5f 0%,
            #2f41ab 50%,
            #102272 100%);
}

.main-btn:hover {
    transform: scale(1.02);
}

/* Settings Bar */
.settings-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.settings-bar .sound-btn {
    display: none;  /* Temporarily hidden */
}

.settings-bar .sound-btn,
.settings-bar .tts-btn,
.settings-bar .highscore-btn {
    position: static;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--wwm-border-mid);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-bar .sound-btn:hover,
.settings-bar .tts-btn:hover,
.settings-bar .highscore-btn:hover {
    background: rgba(42, 90, 154, 0.5);
}

.settings-bar .tts-btn {
    opacity: 0.6;
}

.settings-bar .tts-btn.active {
    background: rgba(255, 140, 0, 0.5);
    border-color: var(--accent-orange);
    opacity: 1;
}

.sound-btn.muted {
    opacity: 0.5;
}

/* Volume Slider */
.volume-slider {
    width: 100px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--wwm-border-mid);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-orange);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-orange);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Joker Bar */
.joker-bar {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 15px;
    margin-bottom: 15px;
}

.joker-btn {
    position: relative;
    width: 100px;
    height: 60px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #0b0a3f 0%,
            #1f319b 50%,
            #061262 100%);
    border: 3px solid #4060c0;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.2),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.5);
    color: var(--text-white);
    font-size: 1.9rem;
    font-family: inherit;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.joker-btn:hover:not(:disabled) {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #1a1a5f 0%,
            #2f41ab 50%,
            #102272 100%);
    transform: scale(1.05);
}

.joker-btn:disabled {
    cursor: not-allowed;
}

/* SVG Icon für Publikumsjoker */
#joker-audience .joker-icon {
    position: absolute;
    width: 90%;
    height: 90%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    pointer-events: none;
}

/* SVG Icon für Telefonjoker */
#joker-phone .joker-icon {
    position: absolute;
    width: 110%;
    height: 110%;
    top: 50%;
    left: 42%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    pointer-events: none;
}

/* Wrapper für Schatten innerhalb des Ovals */
#joker-audience,
#joker-phone {
    position: relative;
}

#joker-audience::before,
#joker-phone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

/* Joker Wrapper für X-Overlay */
.joker-wrapper {
    position: relative;
}

/* Rotes Kreuz auf dem Wrapper wenn Button .used hat */
.joker-wrapper:has(.joker-btn.used)::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 149.93 84.99'%3E%3Cdefs%3E%3Cfilter id='shadow' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='4' dy='4' stdDeviation='3' flood-color='%23000' flood-opacity='0.7'/%3E%3C/filter%3E%3C/defs%3E%3Cpolygon filter='url(%23shadow)' fill='%23cc0000' points='149.93 0 126.78 0 74.96 34.73 23.15 0 0 0 63.39 42.49 0 84.99 23.15 84.99 74.96 50.25 126.78 84.99 149.93 84.99 86.54 42.49 149.93 0'/%3E%3C/svg%3E") center/contain no-repeat;
    z-index: 10;
    pointer-events: none;
}

.joker-btn.used::after {
    display: none;
}

/* Game Main Area */
.game-main {
    display: grid;
    grid-template-columns: 1fr 255px;
    gap: 25px;
    align-items: start;
}

/* ========== WWM TV-AUTHENTIC BOX DESIGN ========== */

/* Question Box Wrapper - für Strich-Positionierung */
.question-box-wrapper {
    position: relative;
    margin-bottom: 10px;
}

/* Strich hinter Question-Box - zentriert zur Wrapper-Höhe */
.question-box-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -30px;
    right: -30px;
    height: 4px;
    transform: translateY(-50%);
    background: linear-gradient(to right,
        transparent 0%,
        #3050a0 3%,
        #5080d0 10%,
        #5080d0 90%,
        #3050a0 97%,
        transparent 100%);
    z-index: -1;
    pointer-events: none;
}

/* Question Box - Hexagon with bezier curves */
.question-box {
    position: relative;
    padding: 12px 50px;
    text-align: center;
    background: linear-gradient(180deg,
        #e0e8ff 0%,
        #90b0e0 8%,
        #5080c0 20%,
        #3060a0 50%,
        #405080 80%,
        #304060 100%);
    /* SVG path mit Bezier-Kurven für sanfte Ecken */
    clip-path: url(#questionHex);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.question-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #0b0a3f 0%,
            #1f319b 50%,
            #061262 100%);
    clip-path: url(#questionHexInner);
    z-index: 0;
}

.question-box p {
    position: relative;
    z-index: 1;
}

#question-text {
    font-size: 1.4rem;
    line-height: 1.4;
    text-shadow: 1px 1px 0 #000, 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Question Area - hidden during intro */
.question-area.hidden-during-intro,
.joker-bar.hidden-during-intro,
.prize-ladder.hidden-during-intro,
.action-bar.hidden-during-intro {
    opacity: 0;
    visibility: hidden;
}

/* Striche hinter Hexagonen */
.question-area {
    position: relative;
}

/* Answer Grid */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 4px; /* row-gap column-gap - mehr Abstand zwischen Zeilen */
    position: relative;
}

/* Strich durch Answer-Buttons per Grid */
.answers-grid::before,
.answers-grid::after {
    content: '';
    position: absolute;
    left: -30px;
    right: -30px;
    height: 3px;
    background: linear-gradient(to right,
        transparent 0%,
        #3050a0 3%,
        #5080d0 10%,
        #5080d0 90%,
        #3050a0 97%,
        transparent 100%);
    z-index: 0;
    pointer-events: none;
}
/* Obere Reihe (A, B) */
.answers-grid::before {
    top: calc(25% - 2px);
    transform: translateY(-50%);
}
/* Untere Reihe (C, D) */
.answers-grid::after {
    top: calc(75% + 2px);
    transform: translateY(-50%);
}

/* Linien verstecken, bis erste Antwort eingeblendet wird */
.answers-grid:has(.answer-btn[data-index="0"].hidden-answer)::before,
.answers-grid:has(.answer-btn[data-index="0"].hidden-answer)::after {
    opacity: 0;
    visibility: hidden;
}

/* Answer Button - TV Authentic Hexagonal Style */
.answer-btn {
    position: relative;
    font-family: inherit;
    font-size: 1.15rem;
    min-height: 46px;
    padding: 10px 15px 10px 25px;
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 1px 1px 0 #000, 2px 2px 4px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

/* Answer Button Background - Hexagon with bezier curves */
.answer-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        #70b8ff 0%,
        #4090e0 10%,
        #2868c0 30%,
        #1850a0 70%,
        #2060b0 90%,
        #3080d0 100%);
    clip-path: url(#answerHex);
    z-index: -2;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.answer-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #0b0a3f 0%,
            #1f319b 50%,
            #061262 100%);
    clip-path: url(#answerHexInner);
    z-index: -1;
}

/* Orange Hover-Overlay (animiert via opacity) */
.answer-btn .hover-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #d26200 0%,
            #fdc215 50%,
            #f68d07 100%);
    clip-path: url(#answerHexInner);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Hover nur auf Geräten mit echtem Hover (Maus), nicht auf Touch */
@media (hover: hover) and (pointer: fine) {
    .answer-btn:hover:not(:disabled):not(.selected):not(.correct):not(.wrong) .hover-overlay {
        opacity: 1;
    }
}

.answer-letter {
    color: var(--accent-orange);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.answer-letter::before {
    content: '◆';
    font-size: 0.55em;
    color: #fff;
    transform: scaleY(0.6);
}

.answer-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Alter Hover entfernt - wird jetzt über .hover-overlay gemacht */

/* Selected Answer - Orange (nur Innenfläche, Rahmen bleibt blau) */
.answer-btn.selected::after {
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #d26200 0%,
            #fdc215 50%,
            #f68d07 100%);
}

.answer-btn.selected {
    animation: pulseGlow 0.8s infinite;
}

/* Correct Answer - Green (nur Innenfläche, Rahmen bleibt blau) */
.answer-btn.correct::after {
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #00804b 0%,
            #4ee194 50%,
            #029f67 100%);
}

.answer-btn.correct {
    animation: correctFlash 0.4s ease 3;
}

/* Wrong Answer - Red (nur Innenfläche, Rahmen bleibt blau) */
.answer-btn.wrong::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #e05050 0%,
            #c03030 50%,
            #801010 100%);
}

.answer-btn.wrong {
    animation: wrongFlash 0.4s ease 3;
}

.answer-btn.hidden-answer {
    pointer-events: none;
    opacity: 0 !important;
    visibility: hidden !important;
}

.answer-btn.hidden-answer .answer-text {
    visibility: hidden;
}

.answer-btn.revealing {
    visibility: visible !important;
    opacity: 1;
    animation: revealAnswer 0.25s ease-out forwards;
}

@keyframes revealAnswer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nur Antwort-TEXT verstecken (Slot mit A: B: C: D: bleibt sichtbar) */
.answer-btn .answer-text.text-hidden {
    opacity: 0;
    transform: translateY(8px);
}

.answer-btn .answer-text.text-revealing {
    animation: revealText 0.25s ease-out forwards;
}

@keyframes revealText {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-btn:disabled {
    cursor: not-allowed;
}

@keyframes pulseGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

@keyframes correctFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

@keyframes wrongFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Prize Ladder - TV Style */
.prize-ladder {
    background: transparent;
    border: none;
    padding: 10px 5px;
}

.prize-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 15px 0 58px;
    font-family: 'Copperplate', serif;
    font-size: 1.15rem;
    font-weight: normal;
    color: #ff9500;
    transition: all 0.3s ease;
}

.prize-item .level {
    position: absolute;
    left: 15px;
    width: 24px;
    text-align: center;
}

/* Raute zwischen Level und Amount - absolut positioniert */
.prize-item .amount::before {
    content: '◆';
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-60%) scaleY(0.6);
    color: transparent;
    font-size: 0.5em;
}

/* Raute weiß bei bereits beantworteten Fragen */
.prize-item.passed .amount::before {
    color: #ffffff;
}

.prize-item.milestone {
    color: #ffffff;
}

/* Current level - hexagon highlight like answer buttons */
.prize-item.current {
    color: #000000;
}

.prize-item.current::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5px;
    width: 180px;
    background: linear-gradient(180deg,
        #70b8ff 0%,
        #4090e0 10%,
        #2868c0 30%,
        #1850a0 70%,
        #2060b0 90%,
        #3080d0 100%);
    clip-path: url(#answerHex);
    z-index: -2;
}

.prize-item.current::after {
    content: '';
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 7px;
    width: 176px;
    background: radial-gradient(ellipse at center,
        #ffffff 0%,
        #ffee88 25%,
        #ffcc44 50%,
        #ff9900 75%,
        #ee7700 100%);
    clip-path: url(#answerHex);
    z-index: -1;
}

/* Passed levels - abgedimmt */
.prize-item.passed {
    opacity: 0.6;
}

.prize-item .amount {
    font-family: 'Copperplate', serif;
    font-weight: normal;
    text-align: left;
    flex: 1;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.action-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 25px;
    background: linear-gradient(180deg, #3a3a4a, #2a2a3a);
    border: 2px solid #555;
    border-radius: 6px;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--wwm-border-mid);
    background: linear-gradient(180deg, #4a4a5a, #3a3a4a);
}

/* Popup */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: linear-gradient(180deg, var(--wwm-box-mid), var(--wwm-box-dark));
    border: 2px solid var(--wwm-border-mid);
    border-radius: 15px;
    padding: 35px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.popup-content h3 {
    font-size: 1.6rem;
    font-weight: normal;
    margin-bottom: 25px;
    color: var(--accent-orange);
}

#joker-result {
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Audience Chart - TV Style */
.audience-chart {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0a1535 0%, #050515 100%);
    border: 2px solid #2050a0;
    border-radius: 8px;
    padding: 8px 10px;
    position: relative;
    margin: 10px auto;
    max-width: 180px;
}

/* Horizontale Rasterlinien */
.audience-chart::before {
    content: '';
    position: absolute;
    top: 35px;
    left: 15px;
    right: 15px;
    bottom: 35px;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 12px,
        rgba(100, 150, 255, 0.12) 12px,
        rgba(100, 150, 255, 0.12) 13px
    );
    pointer-events: none;
    z-index: 0;
}

/* Prozente oben */
.audience-percentages {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
    font-weight: normal;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.audience-percentages .percent-item {
    width: 30px;
    text-align: center;
    margin: 0 4px;
}

/* Balken-Container */
.audience-bars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

/* 3D Zylinder-Balken */
.audience-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audience-bar .bar {
    width: 30px;
    background: linear-gradient(90deg,
        #5522aa 0%,
        #8855dd 25%,
        #bb88ff 50%,
        #8855dd 75%,
        #5522aa 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    box-shadow:
        inset 3px 0 6px rgba(255,255,255,0.25),
        inset -3px 0 6px rgba(0,0,0,0.3);
}

/* Labels unten mit Rauten - gleiche Breite wie Balken */
.audience-labels {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: normal;
    font-size: 1.2rem;
    color: #ff9500;
    position: relative;
    z-index: 1;
    padding: 0 9px
}

.audience-labels .label-item {
    width: 30px;
    text-align: center;
}

.audience-labels .diamond {
    color: #fff;
    font-size: 0.4em;
    transform: scaleY(0.6);
    display: inline-block;
    margin: 0 4px;
    width: 8px;
    text-align: center;
}

/* Phone Friend Selection */
.phone-friend-content {
    max-width: 500px;
}

/* Confirm Popup */
.confirm-content {
    text-align: center;
}

.confirm-content h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #fff;
}

.confirm-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.confirm-btn {
    min-width: 140px;
    padding: 15px 30px;
    font-size: 1.1rem;
}

.phone-friends {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.phone-friend-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(180deg,
        #0b0a3f 0%,
        #1f319b 50%,
        #061262 100%);
    border: 2px solid var(--wwm-border-mid);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.phone-friend-card:hover {
    border-color: var(--accent-orange);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.3);
}

.friend-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1f319b, #061262);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid #4080d0;
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-name {
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--text-white);
}

.friend-specialty {
    font-size: 0.85rem;
    color: #a0c0ff;
}

/* Result Screen */
#result-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.result-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#result-title {
    font-size: 2.5rem;
    font-weight: normal;
    margin-bottom: 20px;
    color: var(--accent-orange);
}

#result-message {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
    white-space: pre-line;
}

#result-prize {
    font-family: 'Copperplate', serif;
    font-size: 3.5rem;
    font-weight: normal;
    color: var(--accent-gold);
    margin-bottom: 35px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.overlay.hidden,
.popup.hidden,
.hidden {
    display: none !important;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(100, 150, 255, 0.2);
    border-top-color: var(--wwm-border-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-overlay p {
    font-size: 1.1rem;
    font-weight: normal;
}

.error-content {
    text-align: center;
    padding: 30px;
}

.error-content h3 {
    color: var(--wrong-red);
    font-size: 1.8rem;
    font-weight: normal;
    margin-bottom: 15px;
}

#error-message {
    margin-bottom: 25px;
    font-size: 1rem;
    max-width: 350px;
}

/* Player Registration */
.player-registration {
    background: linear-gradient(180deg, rgba(20, 40, 80, 0.7), rgba(10, 20, 40, 0.8));
    border: 2px solid var(--wwm-border-mid);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 400px;
}

.player-select-group {
    margin-bottom: 20px;
}

.player-select-group label,
.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: normal;
    margin-bottom: 8px;
    color: var(--accent-orange);
}

#player-select,
#player-name,
#player-gender {
    width: 100%;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 1rem;
    background: rgba(10, 20, 40, 0.9);
    border: 2px solid var(--wwm-box-mid);
    border-radius: 8px;
    color: var(--text-white);
    transition: border-color 0.3s ease;
}

#player-select:focus,
#player-name:focus,
#player-gender:focus {
    outline: none;
    border-color: var(--wwm-border-light);
}

#player-select option,
#player-gender option {
    background: var(--wwm-box-dark);
    color: var(--text-white);
}

.new-player-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.new-player-form.hidden {
    display: none;
}

.input-group {
    display: flex;
    flex-direction: column;
}

/* Highscore Screen */
#highscore-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 50;
}

#highscore-screen.active {
    display: flex !important;
}

.highscore-content {
    background: linear-gradient(180deg, rgba(20, 40, 80, 0.9), rgba(10, 20, 40, 0.95));
    border: 2px solid var(--wwm-border-mid);
    border-radius: 15px;
    padding: 35px;
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.highscore-content h2 {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 25px;
    color: var(--accent-gold);
}

.highscore-list {
    margin-bottom: 25px;
}

.highscore-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(10, 20, 40, 0.5);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid var(--wwm-box-mid);
}

.highscore-entry.gold {
    border-left-color: gold;
    background: rgba(255, 215, 0, 0.1);
}

.highscore-entry.silver {
    border-left-color: silver;
    background: rgba(192, 192, 192, 0.1);
}

.highscore-entry.bronze {
    border-left-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
}

.highscore-rank {
    font-weight: normal;
    min-width: 30px;
    color: var(--accent-orange);
}

.highscore-name {
    flex: 1;
    text-align: left;
    padding: 0 15px;
    font-weight: 500;
}

.highscore-prize {
    font-family: 'Copperplate', serif;
    font-weight: normal;
    color: var(--accent-gold);
}

.highscore-empty {
    padding: 30px;
    opacity: 0.6;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.8rem;
        letter-spacing: 0.3em;
    }

    .logo h2 {
        font-size: 2.5rem;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    /* Hide 2-column grid lines on mobile (1-column layout) */
    .answers-grid::before,
    .answers-grid::after {
        display: none !important;
    }

    .answer-btn {
        font-size: 1.05rem;
        padding: 12px 15px 12px 45px;
    }

    .question-box {
        padding: 18px 50px;
    }

    #question-text {
        font-size: 1.15rem;
    }

    .joker-btn {
        width: 55px;
        height: 55px;
        font-size: 0.95rem;
    }

    .settings-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========== Mobile Prize Ladder Toggle ========== */
.prize-ladder-mobile-toggle {
    display: none;  /* Nur auf Mobile/Tablet sichtbar */
}

@media (max-width: 1024px) {
    .prize-ladder-mobile-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--wwm-box-dark);
        border: 2px solid var(--wwm-border-mid);
        border-radius: 8px;
        padding: 12px 16px;
        margin: 10px 0;
        cursor: pointer;
        font-family: 'Copperplate', serif;
        color: var(--accent-gold);
        transition: all 0.3s ease;
    }

    .prize-ladder-mobile-toggle:hover {
        border-color: var(--wwm-border-light);
    }

    .prize-ladder-mobile-toggle .toggle-icon {
        transition: transform 0.3s ease;
    }

    .prize-ladder-mobile-toggle.expanded .toggle-icon {
        transform: rotate(180deg);
    }

    .prize-ladder {
        display: none;  /* Standardmäßig versteckt */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(5, 5, 16, 0.98);
        z-index: 1000;
        padding: 60px 20px 20px;
        overflow-y: auto;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
    }

    .prize-ladder.expanded {
        display: flex !important;
    }

    .prize-ladder .prize-item {
        padding: 10px 15px 10px 55px;
        font-size: 1rem;
    }

    /* Close Button für Overlay */
    .prize-ladder::before {
        content: '✕ Schließen';
        position: fixed;
        top: 15px;
        right: 20px;
        color: #fff;
        padding: 10px 15px;
        font-size: 1rem;
        cursor: pointer;
        background: rgba(255,255,255,0.1);
        border-radius: 5px;
        z-index: 1001;
    }

    .prize-ladder::after {
        content: 'Gewinnleiter';
        position: fixed;
        top: 15px;
        left: 20px;
        color: var(--accent-gold);
        font-size: 1.2rem;
        font-family: 'Copperplate', serif;
        z-index: 1001;
    }
}

/* ========== NEULAND THEME ========== */
body.theme-neuland {
    --accent-orange: #ff5a55;
    --accent-gold: #ff7a75;
    /* Blau-Töne durch Rot-Töne ersetzen */
    --wwm-box-dark: #501020;
    --wwm-box-mid: #7a1a2a;
    --wwm-box-light: #a02840;
    --wwm-border-dark: #a02040;
    --wwm-border-mid: #c03050;
    --wwm-border-light: #e05070;
    --wwm-border-highlight: #ff7090;
}

/* Logo-Gradient für neuland */
body.theme-neuland .logo h2 {
    background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hintergrund-Gradient für neuland */
body.theme-neuland {
    background: radial-gradient(ellipse at center bottom, #501020 0%, #150510 70%);
}

/* Question Box für neuland */
body.theme-neuland .question-box {
    background: linear-gradient(180deg,
        #ffe0e8 0%,
        #e090a0 8%,
        #c05070 20%,
        #a03050 50%,
        #804050 80%,
        #603040 100%);
}

body.theme-neuland .question-box::before {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #3f0a1a 0%,
            #9b1f3a 50%,
            #620618 100%);
}

/* Linien hinter Boxen für neuland */
body.theme-neuland .question-box-wrapper::before,
body.theme-neuland .answers-grid::before,
body.theme-neuland .answers-grid::after,
body.theme-neuland .main-btn-wrapper::before {
    background: linear-gradient(to right,
        transparent 0%,
        #a03050 3%,
        #d05080 10%,
        #d05080 90%,
        #a03050 97%,
        transparent 100%);
}

/* Answer Buttons für neuland - Rahmen (::before) - rot */
body.theme-neuland .answer-btn::before {
    background: linear-gradient(180deg,
        #ffb8c0 0%,
        #e04060 10%,
        #c02848 30%,
        #a01838 70%,
        #b02048 90%,
        #d03060 100%);
}

/* Answer Buttons für neuland - Innenfläche (::after) - rot */
body.theme-neuland .answer-btn::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #3f0a1a 0%,
            #9b1f3a 50%,
            #620618 100%);
}

/* Selected/Correct/Wrong für neuland - BLAUE Farben wie im normalen Theme! */
body.theme-neuland .answer-btn.selected::before,
body.theme-neuland .answer-btn.correct::before,
body.theme-neuland .answer-btn.wrong::before {
    background: linear-gradient(180deg,
        #70b8ff 0%,
        #4090e0 10%,
        #2868c0 30%,
        #1850a0 70%,
        #2060b0 90%,
        #3080d0 100%);
}

body.theme-neuland .answer-btn.selected::after {
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #d26200 0%,
            #fdc215 50%,
            #f68d07 100%);
}

body.theme-neuland .answer-btn.correct::after {
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #00804b 0%,
            #4ee194 50%,
            #029f67 100%);
}

body.theme-neuland .answer-btn.wrong::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #e05050 0%,
            #c03030 50%,
            #801010 100%);
}

/* Main Button für neuland */
body.theme-neuland .main-btn::before {
    background: linear-gradient(180deg,
        #ffb8c0 0%,
        #e04060 10%,
        #c02848 30%,
        #a01838 70%,
        #b02048 90%,
        #d03060 100%);
}

body.theme-neuland .main-btn::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #3f0a1a 0%,
            #9b1f3a 50%,
            #620618 100%);
}

body.theme-neuland .main-btn:hover::after {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #5f1a2a 0%,
            #ab2f4a 50%,
            #721828 100%);
}

/* Joker Buttons für neuland */
body.theme-neuland .joker-btn {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #3f0a1a 0%,
            #9b1f3a 50%,
            #620618 100%);
    border-color: #c04060;
}

body.theme-neuland .joker-btn:hover:not(:disabled) {
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.1) 40%,
            transparent 70%),
        linear-gradient(180deg,
            #5f1a2a 0%,
            #ab2f4a 50%,
            #721828 100%);
}

/* Prize Ladder current level für neuland */
body.theme-neuland .prize-item.current::before {
    background: linear-gradient(180deg,
        #ffb8c0 0%,
        #e04060 10%,
        #c02848 30%,
        #a01838 70%,
        #b02048 90%,
        #d03060 100%);
}

/* Mobile Toggle für neuland Theme */
body.theme-neuland .prize-ladder-mobile-toggle {
    border-color: var(--wwm-border-mid);
}

body.theme-neuland .prize-ladder-mobile-toggle:hover {
    border-color: var(--wwm-border-light);
}

/* ========== INTRO OVERLAY ANIMATION ========== */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--wwm-bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-overlay.hidden {
    display: none !important;
}

/* Horst Video Overlay (during announcer intro) */
.horst-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--wwm-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.horst-video-overlay.hidden {
    display: none !important;
}

.horst-video-overlay.visible {
    opacity: 1;
}

.horst-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.horst-video-caption {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.horst-video-caption h2 {
    font-family: 'Copperplate', serif;
    font-size: 4rem;
    font-weight: normal;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.3);
    margin: 0;
    @media (max-width: 768px) {
      font-size: 2.5rem;
    }
}

.horst-video-caption p {
    font-size: 2rem;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    margin: 0.5rem 0 0 0;
    letter-spacing: 0.2em;
    @media (max-width: 768px) {
      font-size: 1.5rem;
    }
}

/* Spotlight Background Effect */
.intro-overlay::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 50% 30%,
        rgba(255, 215, 0, 0.15) 0%,
        transparent 50%
    );
    animation: none;
    pointer-events: none;
}

.intro-overlay:not(.hidden)::before {
    animation: spotlightPulse 3s ease-in-out infinite;
}

@keyframes spotlightPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Intro Phases */
.intro-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.intro-phase.hidden {
    display: none !important;
}

/* Logo Animation: Zoom + Glow */
@keyframes introZoomGlow {
    0% {
        opacity: 0;
        transform: scale(0.5);
        text-shadow: 0 0 0 var(--accent-gold);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        text-shadow: 0 0 40px var(--accent-gold);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 20px var(--accent-gold);
    }
}

.intro-title-line1 {
    font-family: 'Copperplate', serif;
    font-size: 3rem;
    font-weight: normal;
    letter-spacing: 0.4em;
    color: var(--text-white);
    margin: 0;
    opacity: 0;
    animation: introZoomGlow 1.5s ease-out forwards;
}

.intro-title-line2 {
    font-family: 'Copperplate', serif;
    font-size: 5rem;
    font-weight: normal;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    opacity: 0;
    animation: introZoomGlow 1.5s ease-out forwards;
    animation-delay: 0.3s;
}

.intro-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    opacity: 0;
    animation: introZoomGlow 1s ease-out forwards;
    animation-delay: 0.8s;
}

/* Player Welcome Animation */
@keyframes introFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-welcome-text {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    opacity: 0;
    animation: introFadeUp 0.8s ease-out forwards;
}

.intro-player-name {
    font-family: 'Copperplate', serif;
    font-size: 4rem;
    font-weight: normal;
    color: white;
    text-shadow: 0 0 30px var(--accent-gold);
    margin: 0;
    opacity: 0;
    animation: introFadeUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

/* Fade-Out Transition */
.intro-phase.fade-out {
    animation: introFadeOut 0.5s ease-out forwards;
}

@keyframes introFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* neuland Theme Intro Colors */
body.theme-neuland .intro-title-line2 {
    background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.theme-neuland .intro-overlay::before {
    background: radial-gradient(
        circle at 50% 30%,
        rgba(255, 90, 85, 0.15) 0%,
        transparent 50%
    );
}

/* Responsive Intro */
@media (max-width: 768px) {
    .intro-title-line1 {
        font-size: 1.8rem;
        letter-spacing: 0.3em;
    }

    .intro-title-line2 {
        font-size: 3rem;
    }

    .intro-subtitle {
        font-size: 1.1rem;
    }

    .intro-welcome-text {
        font-size: 1.5rem;
    }

    .intro-player-name {
        font-size: 2.5rem;
    }
}

/* ========== Mobile Layout Fixes ========== */
@media (max-width: 768px) {
    /* Safe area padding for notch + icons */
    .screen {
        padding-top: env(safe-area-inset-top, 70px);
    }

    /* Settings bar needs more space from edge on mobile */
    .settings-bar {
        top: max(env(safe-area-inset-top, 10px), 10px);
        right: 10px;
        gap: 8px;
    }

    .settings-bar .sound-btn,
    .settings-bar .tts-btn,
    .settings-bar .highscore-btn,
    .settings-bar .stats-btn,
    .settings-bar .achievements-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Result screen - title shouldn't overlap with icons */
    #result-screen {
        padding-top: 80px;
    }

    #result-title {
        font-size: 1.8rem;
        padding: 0 20px;
        margin-right: 0;
        max-width: 100%;
    }

    #result-message {
        font-size: 1rem;
        padding: 0 15px;
    }

    #result-prize {
        font-size: 2.5rem;
    }

    /* Start screen form elements */
    .input-group select {
        max-width: 100%;
        font-size: 14px;
    }

    /* Moderator dropdown text fits on mobile */
    #moderator-select {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    #result-title {
        font-size: 1.5rem;
    }

    #result-prize {
        font-size: 2rem;
    }

    .settings-bar .sound-btn,
    .settings-bar .tts-btn,
    .settings-bar .highscore-btn,
    .settings-bar .stats-btn,
    .settings-bar .achievements-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Cheat Console */
#cheat-console {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid #00ff00;
    z-index: 10000;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    transition: transform 0.3s ease-in-out;
}

#cheat-console.hidden {
    display: flex !important; /* Override global hidden */
    transform: translateY(-100%);
}

.console-header {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
}

.console-output {
    flex-grow: 1;
    overflow-y: auto;
    color: #ccc;
    font-size: 14px;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

#console-input {
    background: #111;
    border: 1px solid #333;
    color: #00ff00;
    padding: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

#console-input:focus {
    outline: none;
    border-color: #00ff00;
}

/* ========== STARFIELD CANVAS ========== */
#starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: none;
    /* GPU-Beschleunigung */
    will-change: contents;
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.theme-retro #starfield-canvas {
    display: block;
}


/* ========== RETRO ARCADE THEME ========== */
body.theme-retro {
    --wwm-bg-dark: #0a0014;
    --wwm-bg-mid: #140028;
    --wwm-box-dark: #1a0033;
    --wwm-box-mid: #2d004d;
    --wwm-box-light: #4a0080;
    --wwm-border-dark: #ff0080;
    --wwm-border-mid: #ff00ff;
    --wwm-border-light: #00ffff;
    --wwm-border-highlight: #ffff00;
    --accent-orange: #ff0080;
    --accent-gold: #00ffff;
    --correct-green: #00ff00;
    --wrong-red: #ff0040;
    font-family: 'Rajdhani', sans-serif;
    background: transparent; /* Canvas zeichnet den Hintergrund */
}

body.theme-retro .logo h1,
body.theme-retro .logo h2 {
    font-family: 'Rajdhani', sans-serif;
}

body.theme-retro .main-btn,
body.theme-retro .answer-btn,
body.theme-retro #question-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

body.theme-retro {
    background: linear-gradient(180deg, #0a0014 0%, #140028 50%, #0a0014 100%);
}

body.theme-retro .game-container {
    background: transparent;
}

body.theme-retro .logo h1 {
    color: #00ffff;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #0088ff;
    animation: retro-flicker 3s infinite;
}

body.theme-retro .logo h2 {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #ff00ff;
    background-clip: unset;
    color: #ff00ff;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px #ff0080, 0 0 40px #ff0080;
}

/* SVG Logo - standardmäßig versteckt */
.logo-svg,
.intro-logo-svg {
    display: none;
}

/* Im Retro-Theme: Text-Logo verstecken, SVG zeigen */
body.theme-retro .logo h1,
body.theme-retro .logo h2 {
    display: none;
}

body.theme-retro .logo-svg {
    display: block;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Intro SVG Logo */
body.theme-retro .intro-title-line1,
body.theme-retro .intro-title-line2,
body.theme-retro .intro-subtitle {
    display: none;
}

body.theme-retro .intro-logo-svg {
    display: block;
    max-width: 500px;
    width: 80%;
    margin: 0 auto;
    animation: intro-glow 2s ease-in-out;
}

@keyframes intro-glow {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Retro theme font overrides for intro elements */
body.theme-retro .intro-player-name {
    font-family: 'Rajdhani', sans-serif;
}

body.theme-retro .horst-video-caption h2 {
    font-family: 'Rajdhani', sans-serif;
}


body.theme-retro .main-btn {
    background: linear-gradient(180deg, #2d004d 0%, #1a0033 100%);
    border: 3px solid #ff00ff;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    box-shadow:
        0 0 15px rgba(255, 0, 255, 0.5),
        inset 0 0 20px rgba(255, 0, 255, 0.1);
    border-radius: 8px;
}

body.theme-retro .main-btn::before,
body.theme-retro .main-btn::after {
    display: none !important;
}

body.theme-retro .main-btn:hover {
    background: linear-gradient(180deg, #4a0080 0%, #2d004d 100%);
    border-color: #00ffff;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.7),
        inset 0 0 30px rgba(0, 255, 255, 0.2);
}

body.theme-retro .question-box {
    background: linear-gradient(180deg, rgba(45, 0, 77, 0.9) 0%, rgba(26, 0, 51, 0.95) 100%);
    border: 3px solid #ff00ff;
    box-shadow:
        0 0 20px rgba(255, 0, 255, 0.4),
        inset 0 0 30px rgba(255, 0, 255, 0.1);
    clip-path: none;
    border-radius: 8px;
}

body.theme-retro .question-box::before,
body.theme-retro .question-box::after {
    clip-path: none;
}

body.theme-retro .answer-btn {
    background: linear-gradient(180deg, #1a0033 0%, #0a0014 100%);
    border: 2px solid #ff0080;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    clip-path: none;
    border-radius: 8px;
    min-height: 64px;
    padding: 12px 15px 12px 25px;
}

body.theme-retro .answer-btn::before,
body.theme-retro .answer-btn::after {
    clip-path: none;
    display: none;
}

body.theme-retro .answer-btn:hover:not(.disabled):not(.correct):not(.wrong) {
    background: linear-gradient(180deg, #2d004d 0%, #1a0033 100%);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

body.theme-retro .answer-btn.correct {
    background: linear-gradient(180deg, #004400 0%, #002200 100%);
    border-color: #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    animation: retro-correct 0.5s ease;
}

body.theme-retro .answer-btn.wrong {
    background: linear-gradient(180deg, #440000 0%, #220000 100%);
    border-color: #ff0040;
    box-shadow: 0 0 30px rgba(255, 0, 64, 0.8);
}

@keyframes retro-correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

body.theme-retro .prize-ladder {
    background: linear-gradient(180deg, rgba(26, 0, 51, 0.9) 0%, rgba(10, 0, 20, 0.95) 100%);
    border: 2px solid #ff0080;
}

body.theme-retro .prize-item {
    border-color: #4a0080;
    color: #00ffff;
}

body.theme-retro .prize-item.current {
    background: rgba(255, 0, 128, 0.3);
    border-color: #ff00ff;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
    font-size: 16px;
}

body.theme-retro .prize-item.milestone {
    color: #ff00ff;
}

body.theme-retro .joker-btn {
    background: linear-gradient(180deg, #2d004d 0%, #1a0033 100%);
    border: 3px solid #ff0080;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
}

body.theme-retro .joker-btn:hover:not(.used) {
    border-color: #00ffff;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}

/* Space Mode: Hide classic WWM joker bar (Space uses inventory-based jokers) */
body.pack-space .joker-bar {
    display: none !important;
}

/* Retro: Alle Linien ausblenden */
body.theme-retro .question-box-wrapper::before,
body.theme-retro .answers-grid::before,
body.theme-retro .answers-grid::after,
body.theme-retro .main-btn-wrapper::before {
    display: none !important;
}

body.theme-retro .highscore-content {
    background: linear-gradient(180deg, rgba(45, 0, 77, 0.95) 0%, rgba(26, 0, 51, 0.98) 100%);
    border: 3px solid #ff00ff;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.4);
}

body.theme-retro .highscore-content h2 {
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff;
}

body.theme-retro .highscore-entry {
    background: rgba(26, 0, 51, 0.7);
    border-left: 4px solid #ff0080;
}

body.theme-retro .highscore-entry.gold {
    border-left-color: #ffff00;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
}

/* Retro: Alle Schriften überschreiben */
body.theme-retro,
body.theme-retro .prize-item,
body.theme-retro .prize-ladder-mobile-toggle,
body.theme-retro .joker-popup-content h3,
body.theme-retro .joker-title,
body.theme-retro .highscore-content h2,
body.theme-retro .result-content h2,
body.theme-retro .start-content h2,
body.theme-retro .phone-friend-name,
body.theme-retro .phone-friend-specialty,
body.theme-retro #player-name-input,
body.theme-retro #result-prize,
body.theme-retro .settings-label,
body.theme-retro button,
body.theme-retro input,
body.theme-retro select {
    font-family: 'Rajdhani', sans-serif !important;
}

/* Retro: Gewinnbaum anpassen */
body.theme-retro .prize-item,
body.theme-retro .prize-item .amount,
body.theme-retro .prize-item .level {
    font-family: 'Rajdhani', sans-serif !important;
}

body.theme-retro .prize-item {
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 10px 6px 70px;
    line-height: 1.2;
}

body.theme-retro .prize-item .level {
    left: 10px;
    width: 35px;
}

body.theme-retro .prize-item .amount::before {
    left: 50px;
}

body.theme-retro .prize-ladder {
    min-width: 250px;
}

body.theme-retro .joker-popup-content h3,
body.theme-retro .joker-title {
    font-size: 1.4rem;
    font-weight: 600;
}

body.theme-retro #player-name-input {
    font-size: 1.2rem;
}

body.theme-retro .prize-ladder-mobile-toggle {
    font-size: 1.1rem;
}

/* Retro: Alle clip-paths entfernen */
body.theme-retro .question-box,
body.theme-retro .question-box::before,
body.theme-retro .question-box::after,
body.theme-retro .answer-btn,
body.theme-retro .answer-btn::before,
body.theme-retro .answer-btn::after,
body.theme-retro .answer-btn .hover-overlay,
body.theme-retro .answer-btn.correct::before,
body.theme-retro .answer-btn.correct::after,
body.theme-retro .answer-btn.wrong::before,
body.theme-retro .answer-btn.wrong::after,
body.theme-retro .answer-btn.selected::before,
body.theme-retro .answer-btn.selected::after,
body.theme-retro .prize-item.current::before,
body.theme-retro .prize-item.current::after {
    clip-path: none !important;
}

/* Retro: Pseudo-Elemente komplett ausblenden */
body.theme-retro .question-box::before,
body.theme-retro .question-box::after,
body.theme-retro .answer-btn::before,
body.theme-retro .answer-btn::after,
body.theme-retro .answer-btn .hover-overlay,
body.theme-retro .answer-btn.selected::before,
body.theme-retro .answer-btn.selected::after,
body.theme-retro .answer-btn.correct::before,
body.theme-retro .answer-btn.correct::after,
body.theme-retro .answer-btn.wrong::before,
body.theme-retro .answer-btn.wrong::after,
body.theme-retro .prize-item.current::before,
body.theme-retro .prize-item.current::after {
    display: none !important;
}

/* Retro: Button States direkt auf dem Element stylen (ohne Pseudo-Elemente) */
body.theme-retro .answer-btn.selected {
    background: linear-gradient(180deg, #ff8800 0%, #ffaa00 50%, #ff6600 100%) !important;
    border-color: #ffff00 !important;
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.8);
}

body.theme-retro .answer-btn.correct {
    background: linear-gradient(180deg, #00aa00 0%, #00ff00 50%, #00cc00 100%) !important;
    border-color: #00ff00 !important;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

body.theme-retro .answer-btn.wrong {
    background: linear-gradient(180deg, #aa0000 0%, #ff0000 50%, #cc0000 100%) !important;
    border-color: #ff0040 !important;
    box-shadow: 0 0 30px rgba(255, 0, 64, 0.8);
}

/* Retro: Joker-Popup styling */
body.theme-retro .joker-popup-content {
    background: linear-gradient(180deg, rgba(45, 0, 77, 0.98) 0%, rgba(26, 0, 51, 0.99) 100%);
    border: 3px solid #ff00ff;
    border-radius: 8px;
}

body.theme-retro #joker-result {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
}

/* Retro: Alle WWM Gradients überschreiben */
body.theme-retro .action-btn {
    background: linear-gradient(180deg, #2d004d 0%, #1a0033 100%);
    border-color: #ff0080;
    color: #00ffff;
}

body.theme-retro .action-btn:hover {
    background: linear-gradient(180deg, #4a0080 0%, #2d004d 100%);
    border-color: #00ffff;
}

body.theme-retro .friend-avatar {
    background: linear-gradient(180deg, #4a0080 0%, #2d004d 100%);
    border-color: #ff00ff;
}

body.theme-retro .player-registration {
    background: linear-gradient(180deg, rgba(45, 0, 77, 0.7) 0%, rgba(26, 0, 51, 0.8) 100%);
    border-color: #ff00ff;
}

body.theme-retro .audience-chart {
    background: linear-gradient(180deg, #1a0033 0%, #0a0014 100%);
    border-color: #ff0080;
}

body.theme-retro .audience-bar .bar {
    background: linear-gradient(90deg, #ff0080 0%, #ff00ff 50%, #ff0080 100%);
}

body.theme-retro .result-content {
    background: transparent;
    border: none;
}

body.theme-retro .popup-content {
    background: linear-gradient(180deg, rgba(45, 0, 77, 0.98) 0%, rgba(26, 0, 51, 0.99) 100%);
    border-color: #ff00ff;
}

body.theme-retro .phone-friend-card {
    background: linear-gradient(180deg, #2d004d 0%, #1a0033 100%);
    border-color: #ff0080;
}

body.theme-retro .phone-friend-card:hover {
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

body.theme-retro .phone-friend-card.selected {
    border-color: #ffff00;
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.6);
}

/* ========== SPACE CONTACT CARDS (Subspace Link) ========== */
body.theme-retro .space-contact-card {
    background: linear-gradient(180deg, rgba(0, 30, 60, 0.9) 0%, rgba(0, 10, 30, 0.95) 100%);
    border: 2px solid var(--species-color, #00ffff);
    position: relative;
    overflow: hidden;
}

body.theme-retro .space-contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

body.theme-retro .space-contact-card:hover::before {
    left: 100%;
}

body.theme-retro .space-contact-card:hover {
    border-color: var(--species-color, #00ffff);
    box-shadow: 0 0 30px var(--species-color, rgba(0, 255, 255, 0.5)),
                inset 0 0 20px rgba(0, 255, 255, 0.1);
    transform: scale(1.03);
}

body.theme-retro .space-contact-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.theme-retro .space-contact-avatar .species-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 8px var(--species-color, #00ffff));
    z-index: 1;
}

body.theme-retro .space-contact-avatar img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    opacity: 0.8;
}

body.theme-retro .space-contact-card .friend-name {
    color: var(--species-color, #00ffff);
    text-shadow: 0 0 10px var(--species-color, rgba(0, 255, 255, 0.5));
    font-weight: bold;
    letter-spacing: 1px;
}

body.theme-retro .space-contact-card .friend-specialty {
    color: #aaa;
    font-size: 0.85rem;
}

/* Species-spezifische Glow-Animationen */
body.theme-retro .space-contact-card[data-species="robot"] {
    animation: robot-pulse 2s infinite;
}

body.theme-retro .space-contact-card[data-species="alien"] {
    animation: alien-pulse 3s infinite;
}

body.theme-retro .space-contact-card[data-species="ai"] {
    animation: ai-scan 4s infinite;
}

body.theme-retro .space-contact-card[data-species="telepathic"] {
    animation: telepathic-glow 2.5s infinite;
}

@keyframes robot-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.6); }
}

@keyframes alien-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 255, 0.5); }
}

@keyframes ai-scan {
    0% { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
    25% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), inset -50px 0 30px -30px rgba(0, 255, 255, 0.2); }
    50% { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
    75% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), inset 50px 0 30px -30px rgba(0, 255, 255, 0.2); }
    100% { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
}

@keyframes telepathic-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(170, 136, 255, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(170, 136, 255, 0.6), 0 0 60px rgba(170, 136, 255, 0.3);
        filter: brightness(1.1);
    }
}

body.theme-retro .start-content {
    background: transparent;
}

body.theme-retro .game-container {
    background: transparent;
}

body.theme-retro .settings-bar button {
    background: rgba(26, 0, 51, 0.8);
    border-color: #ff0080;
}

body.theme-retro .settings-bar button:hover {
    background: rgba(45, 0, 77, 0.9);
    border-color: #00ffff;
}

/* ========== STATISTICS SCREEN ========== */

#stats-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

#stats-screen.active {
    display: flex !important;
}

.stats-content-wrapper {
    max-width: 700px;
    width: 100%;
    padding: 30px;
    text-align: center;
}

.stats-content-wrapper h2 {
    font-family: 'Copperplate', serif;
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--accent-gold);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(16, 32, 80, 0.7);
    border: 2px solid var(--wwm-border-mid);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
}

.stat-card.highlight {
    border-color: var(--accent-gold);
    background: rgba(32, 48, 96, 0.8);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-white);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-section {
    background: rgba(16, 32, 80, 0.5);
    border: 1px solid var(--wwm-border-dark);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.stats-section h4 {
    font-size: 1.1rem;
    color: var(--accent-orange);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stats-bar-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-bar-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.stats-bar-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.stats-bar {
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.stats-bar-fill.win {
    background: linear-gradient(90deg, var(--correct-green), #00ff88);
}

.stats-bar-fill.quit {
    background: linear-gradient(90deg, var(--accent-orange), #ffaa00);
}

.stats-bar-fill.lose {
    background: linear-gradient(90deg, var(--wrong-red), #ff6666);
}

.stats-bar-value {
    font-size: 0.9rem;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.joker-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.joker-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.joker-stat-icon {
    font-size: 1.5rem;
}

.joker-stat-value {
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.stats-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-entry {
    display: grid;
    grid-template-columns: 60px 80px 1fr 40px;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
}

.history-entry.win {
    border-left: 3px solid var(--correct-green);
}

.history-entry.quit {
    border-left: 3px solid var(--accent-orange);
}

.history-entry.wrong {
    border-left: 3px solid var(--wrong-red);
}

.history-date {
    color: rgba(255, 255, 255, 0.6);
}

.history-level {
    color: rgba(255, 255, 255, 0.8);
}

.history-prize {
    color: var(--accent-gold);
    text-align: right;
}

.history-result {
    text-align: center;
    font-size: 1.1rem;
}

/* Settings Bar - Stats Button */
.settings-bar .stats-btn,
.settings-bar .achievements-btn {
    position: static;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--wwm-border-mid);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-bar .stats-btn:hover,
.settings-bar .achievements-btn:hover {
    background: rgba(42, 90, 154, 0.5);
}

/* ========== ACHIEVEMENTS SCREEN ========== */

#achievements-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

#achievements-screen.active {
    display: flex !important;
}

.achievements-content {
    margin-bottom: 20px;
}

.achievements-content-wrapper {
    max-width: 800px;
    width: 100%;
    padding: 30px;
    text-align: center;
}

.achievements-content-wrapper h2 {
    font-family: 'Copperplate', serif;
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--accent-gold);
}

.achievements-progress {
    margin-bottom: 25px;
}

.achievements-progress-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.achievements-progress-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
}

.achievements-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-gold));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(16, 32, 80, 0.7);
    border: 2px solid var(--wwm-border-mid);
    border-radius: 12px;
    text-align: left;
    transition: all 0.3s ease;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: var(--accent-gold);
    background: rgba(32, 48, 96, 0.8);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(0.7);
}

.achievement-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.achievement-info {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.achievement-name {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-white);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.achievement-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.achievement-date {
    font-size: 0.75rem;
    color: var(--accent-gold);
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10000;
    background: linear-gradient(135deg, rgba(32, 48, 96, 0.95), rgba(16, 32, 80, 0.95));
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    padding: 15px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.achievement-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.achievement-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-notification-icon {
    font-size: 2.5rem;
    animation: achievementBounce 0.5s ease 0.3s;
}

@keyframes achievementBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.achievement-notification-text {
    text-align: left;
}

.achievement-notification-title {
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.achievement-notification-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-white);
}

/* Mobile responsive for stats/achievements */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stats-bar-item {
        grid-template-columns: 80px 1fr 40px;
    }

    .history-entry {
        grid-template-columns: 50px 70px 1fr 30px;
        font-size: 0.8rem;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement-card {
        padding: 12px;
    }

    .achievement-icon {
        font-size: 2rem;
    }
}

/* ========== RETRO THEME: STATS & ACHIEVEMENTS ========== */

body.theme-retro .stats-content-wrapper h2,
body.theme-retro .achievements-content-wrapper h2 {
    font-family: 'Rajdhani', sans-serif;
    color: #00ffff;
    font-size: 1.1rem;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

body.theme-retro .stat-card {
    background: linear-gradient(135deg, rgba(60, 20, 100, 0.9), rgba(30, 10, 60, 0.9));
    border: 2px solid #ff0080;
}

body.theme-retro .stat-card.highlight {
    border-color: #00ffff;
}

body.theme-retro .stat-value {
    font-family: 'Rajdhani', sans-serif;
    color: #ffff00;
    font-size: 1.1rem;
}

body.theme-retro .stat-label {
    color: #ff80c0;
    font-size: 1rem;
    font-weight: 600;
}

body.theme-retro .stats-section {
    background: linear-gradient(135deg, rgba(60, 20, 100, 0.8), rgba(30, 10, 60, 0.8));
    border: 2px solid #ff0080;
}

body.theme-retro .stats-section h4 {
    font-family: 'Rajdhani', sans-serif;
    color: #00ffff;
    font-size: 1.1rem;
    font-weight: 600;
}

body.theme-retro .stats-bar {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff0080;
}

body.theme-retro .stats-bar-fill.win {
    background: linear-gradient(90deg, #00ff00, #00ff88);
}

body.theme-retro .stats-bar-fill.quit {
    background: linear-gradient(90deg, #ffff00, #ffaa00);
}

body.theme-retro .stats-bar-fill.lose {
    background: linear-gradient(90deg, #ff0080, #ff00ff);
}

body.theme-retro .stats-bar-label,
body.theme-retro .stats-bar-value {
    color: #ffffff;
}

body.theme-retro .joker-stat-value {
    color: #ffff00;
    font-size: 1.3rem;
}

body.theme-retro .joker-stat-icon {
    font-size: 1.8rem;
}

body.theme-retro .history-entry {
    background: rgba(60, 20, 100, 0.6);
    border: 2px solid #ff0080;
}

body.theme-retro .history-entry.win {
    border-left: 4px solid #00ff00;
}

body.theme-retro .history-entry.quit {
    border-left: 4px solid #ffff00;
}

body.theme-retro .history-entry.wrong {
    border-left: 4px solid #ff0080;
}

body.theme-retro .history-date,
body.theme-retro .history-level {
    color: #ffffff;
}

body.theme-retro .history-prize {
    color: #ffff00;
}

/* Retro Theme: Achievements Screen */
body.theme-retro .achievements-progress-bar {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff0080;
    height: 16px;
}

body.theme-retro .achievements-progress-fill {
    background: linear-gradient(90deg, #ff0080, #00ffff);
}

body.theme-retro .achievements-progress-text {
    color: #ffffff;
    font-size: 1rem;
}

body.theme-retro .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

body.theme-retro .achievement-card {
    background: linear-gradient(135deg, rgba(80, 30, 120, 0.9), rgba(40, 15, 70, 0.9));
    border: 2px solid #ff0080;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.3);
    padding: 12px;
    gap: 10px;
}

body.theme-retro .achievement-card.unlocked {
    border-color: #00ffff;
    background: linear-gradient(135deg, rgba(0, 80, 120, 0.9), rgba(0, 40, 80, 0.9));
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

body.theme-retro .achievement-card.locked {
    opacity: 0.6;
    filter: saturate(0.5);
}

body.theme-retro .achievement-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    width: 50px;
    text-align: center;
}

body.theme-retro .achievement-card.unlocked .achievement-icon {
    filter: none;
}

body.theme-retro .achievement-name {
    color: #ffff00;
    font-size: 0.95rem;
    font-weight: bold;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    margin-bottom: 3px;
}

body.theme-retro .achievement-desc {
    color: #ff80c0;
    font-size: 1rem;
    line-height: 1.3;
    display: block;
    -webkit-line-clamp: unset;
}

body.theme-retro .achievement-card.locked .achievement-name {
    color: #aa88cc;
    text-shadow: none;
}

body.theme-retro .achievement-card.locked .achievement-desc {
    color: #886699;
}

body.theme-retro .achievement-date {
    color: #00ffff;
    font-size: 1rem;
}

/* Retro Theme: Achievement Notification */
body.theme-retro .achievement-notification {
    background: linear-gradient(135deg, rgba(80, 30, 120, 0.95), rgba(0, 60, 100, 0.95));
    border: 3px solid #00ffff;
}

body.theme-retro .achievement-notification-title {
    color: #ff0080;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
}

body.theme-retro .achievement-notification-name {
    color: #ffff00;
    font-size: 1.1rem;
}
