/* style.css - Epoch Design System (Glassmorphic Dark Mode) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #0a0813;
    --card-bg: rgba(45, 40, 65, 0.85); /* Changed from rgba(20,18,38,0.6) to dark gray so black censors stand out */
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f0ff;
    --text-muted: #9d99b5;
    
    /* Neon Colors */
    --neon-purple: #a855f7;
    --neon-cyan: #06b6d4;
    --neon-pink: #ec4899;
    --neon-gold: #eab308;
    --neon-green: #22c55e;
    --neon-red: #ef4444;
    --neon-orange: #f97316;
    
    --grad-primary: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-pink) 100%);
    --grad-cyan: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.15) 0%, transparent 45%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 24px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 8px var(--neon-purple));
    animation: pulse 2s infinite alternate;
}

.brand h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

/* Menu Screen */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

.menu-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-card:hover::before {
    opacity: 1;
}

.menu-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.15);
}

.menu-card-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.menu-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.menu-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Buttons */
.btn-primary {
    background: var(--grad-primary);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-cyan);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Input Fields */
.text-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.text-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

/* Matchmaking Panel */
.matchmaking-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-code-display {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
    text-align: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.player-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-ready-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-ready {
    background: rgba(34, 197, 94, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-waiting {
    background: rgba(234, 179, 8, 0.15);
    color: var(--neon-gold);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Game Interface */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
}

.timer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px 16px;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: var(--neon-pink);
    border-radius: 12px;
    min-width: 80px;
    box-sizing: border-box;
}

.timer-box span {
    font-variant-numeric: tabular-nums;
}

.timer-critical {
    animation: shake 0.5s infinite;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* Artifact Viewer */
.artifact-container {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px 24px 24px 24px;
    overflow: hidden;
    position: relative;
}

.artifact-text {
    font-size: 1.15rem;
    line-height: 1.7;
    text-align: justify;
    max-width: 650px;
}

.redacted {
    display: inline-block;
    background: #000;
    color: #000;
    padding: 0 6px;
    border-radius: 3px;
    border: 1px solid #000;
    font-family: monospace;
    font-size: 0.95rem;
    user-select: none;
}

.artifact-image-wrapper {
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
}

.artifact-img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.artifact-img:hover {
    transform: scale(1.02);
}

.artifact-image-caption {
    width: 100%;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Canvas Timeline Layout & Styles */
.timeline-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 769px) {
    #screen-game.active {
        display: grid;
        grid-template-columns: 1fr 340px;
        grid-template-rows: auto 1fr;
        gap: 24px;
        align-items: stretch;
    }
    #screen-game .game-header {
        grid-column: 1 / span 2;
    }
    #screen-game #artifact-container {
        grid-column: 1;
        grid-row: 2;
        min-height: 520px;
        margin-bottom: 0;
    }
    #screen-game .timeline-panel {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        min-height: 520px;
        margin-bottom: 0;
    }
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    min-height: 380px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

@media (max-width: 768px) {
    .canvas-wrapper {
        min-height: 280px;
    }
}

#timeline-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

#timeline-canvas:active {
    cursor: grabbing;
}

.zoom-controls {
    position: absolute;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.zoom-controls button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.zoom-controls button:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.timeline-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.micro-adjuster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-adjust {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-adjust:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.current-guess-display {
    flex-grow: 1;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--neon-gold);
    text-shadow: 0 0 12px rgba(234, 179, 8, 0.3);
}

/* Reveal Screen */
.reveal-header {
    text-align: center;
}

.reveal-year-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
    margin-bottom: 4px;
}

.reveal-timeline-track {
    position: relative;
    height: 60px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 20px 0;
    overflow: visible;
}

.reveal-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: left 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.marker-actual .marker-pin {
    background: var(--neon-gold);
    box-shadow: 0 0 15px var(--neon-gold);
    width: 26px;
    height: 26px;
}

.marker-player1 .marker-pin {
    background: var(--neon-pink);
    box-shadow: 0 0 12px var(--neon-pink);
}

.marker-player2 .marker-pin {
    background: var(--neon-cyan);
    box-shadow: 0 0 12px var(--neon-cyan);
}

.marker-label {
    background: rgba(0,0,0,0.7);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scoring-summary {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    margin: 16px 0;
}

.score-gain-box {
    padding: 16px 24px;
    text-align: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex: 1;
}

.score-gain-box h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.score-gain-points {
    font-size: 2rem;
    font-weight: 800;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

@media (max-width: 768px) {
    .scoring-summary {
        flex-direction: column;
        gap: 12px;
    }
    
    .score-gain-box {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        text-align: left;
    }

    .score-gain-box:has(.performance-bar-container),
    .score-gain-box.has-performance-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .score-gain-box h4 {
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .score-gain-box.has-performance-bar h4 {
        margin-bottom: 8px;
    }
    
    .score-gain-points {
        font-size: 1.4rem;
    }

    .score-countup {
        font-size: 2rem;
    }
    
    /* Reduce padding/gap on reveal and results screens to prevent overflow */
    #screen-reveal .glass-panel,
    #screen-results .glass-panel {
        padding: 20px !important;
        gap: 16px !important;
    }
}

.info-box {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid var(--neon-gold);
    border-radius: 0 12px 12px 0;
    line-height: 1.6;
}

/* Particle Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
    from { transform: scale(1); opacity: 0.9; }
    to { transform: scale(1.05); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ELO Change styling */
.elo-plus {
    color: var(--neon-green);
    font-weight: 700;
}
.elo-minus {
    color: #ef4444;
    font-weight: 700;
}
.elo-neutral {
    color: var(--text-muted);
    font-weight: 700;
}

/* ================================================== */
/* 8. Thematic Puzzle Cards & Themes */
/* ================================================== */

/* Theme Card Container */
.theme-card {
    width: 100%;
    min-height: 300px;
    display: flex;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.theme-card-image {
    justify-content: center;
    align-items: center;
}

.theme-card-text {
    justify-content: flex-start;
    align-items: stretch;
}

/* 1. Gallery Theme - Der visuelle Code */
.theme-gallery {
    background: #1c1926; /* Changed from #030206 to dark gray so black censors stand out */
    border: 2px solid var(--neon-purple);
}
.gallery-viewfinder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.gallery-img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    transition: transform 0.3s ease, filter 0.3s ease;
}
.gallery-viewfinder:hover .gallery-img {
    transform: scale(1.02);
    filter: saturate(1.2) contrast(1.1);
}
.viewfinder-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--neon-cyan);
    pointer-events: none;
}
.viewfinder-corner.top-left { top: 15px; left: 15px; border-right: none; border-bottom: none; }
.viewfinder-corner.top-right { top: 15px; right: 15px; border-left: none; border-bottom: none; }
.viewfinder-corner.bottom-left { bottom: 15px; left: 15px; border-right: none; border-top: none; }
.viewfinder-corner.bottom-right { bottom: 15px; right: 15px; border-left: none; border-top: none; }

.gallery-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(6, 182, 212, 0.15);
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: scanline-move 4s linear infinite;
    pointer-events: none;
}
@keyframes scanline-move {
    0% { top: 0%; }
    100% { top: 100%; }
}
.gallery-title-tag {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 5px var(--neon-cyan);
    border-top: 1px solid rgba(6, 182, 212, 0.3);
    padding-top: 6px;
    width: 100%;
    text-align: center;
}

/* 2. Patent Theme - Das historische Patent */
.theme-patent {
    background: #0b1d33;
    border: 2px solid #1e3a8a;
    font-family: 'Courier New', Courier, monospace;
}
.patent-blueprint {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.blueprint-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 20px 20px;
    background-image: 
        linear-gradient(to right, rgba(6, 182, 212, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
    pointer-events: none;
}
.blueprint-frame {
    position: relative;
    z-index: 2;
    border: 1px dashed rgba(6, 182, 212, 0.4);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(11, 29, 51, 0.8);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.patent-img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
}
.patent-title-stamp {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-top: 1px solid rgba(6, 182, 212, 0.3);
    padding-top: 6px;
    width: 100%;
    text-align: center;
}
.patent-stamp {
    position: absolute;
    z-index: 1;
    bottom: 20px;
    right: 20px;
    border: 3px double rgba(239, 68, 68, 0.65);
    color: rgba(239, 68, 68, 0.65);
    font-weight: 900;
    font-size: 1.1rem;
    padding: 6px 14px;
    border-radius: 6px;
    transform: rotate(-15deg);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none;
    background: rgba(11, 29, 51, 0.9);
}

/* 3. Newspaper Theme - Der zensierte Zeitungszeuge */
.theme-newspaper {
    background: #f4edd8;
    color: #222;
    border: 3px solid #7c5d3f;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.newspaper-clipping {
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    font-family: 'Playfair Display', 'Georgia', serif;
}
.newspaper-header {
    text-align: center;
    border-bottom: 3px double #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
}
.newspaper-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #111;
    text-transform: uppercase;
}
.newspaper-meta {
    font-size: 0.75rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: bold;
}
.newspaper-body {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #2b2b2b;
    text-align: justify;
}
.newspaper-body p {
    margin: 0;
}
.newspaper-censor {
    background: #111;
    color: #111;
    padding: 0 4px;
    margin: 0 2px;
    border-radius: 2px;
    user-select: none;
    font-weight: bold;
    box-shadow: 0 0 1px #111;
    border: 1px solid #111;
}
.newspaper-sub-headline {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    color: #111;
    margin-bottom: 12px;
    border-bottom: 2px solid #333;
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 4. Dispatch Theme - Die diplomatische Depesche */
.theme-dispatch {
    background: #fdfaf2;
    color: #3b2c1a;
    border: 2px solid #c9b195;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    font-family: 'EB Garamond', 'Georgia', serif;
}
.dispatch-letter {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 30px;
    border: 1px solid rgba(0,0,0,0.06);
    margin: 4px;
    border-radius: 12px;
}
.dispatch-body {
    font-size: 1.15rem;
    line-height: 1.7;
    font-style: italic;
    text-align: left;
    color: #4a3721;
}
.dispatch-body p {
    margin: 0;
}
.wax-seal {
    position: absolute;
    bottom: 15px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, #b91c1c 60%, #7f1d1d 100%);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    color: rgba(255,255,255,0.8);
    transform: rotate(10deg);
    border: 2px solid #991b1b;
}
.dispatch-subject {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-size: 1.1rem;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(74, 55, 33, 0.2);
    padding-bottom: 4px;
    color: #4a3721;
}

/* 5. Interrogation Theme - Der Verhörraum */
.theme-interrogation {
    background: #d4ccb6;
    color: #2b2b2b;
    border: 2px solid #8c8269;
    font-family: 'Special Elite', 'Courier New', Courier, monospace;
}
.interrogation-dossier {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.dossier-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    border: 4px solid rgba(220, 38, 38, 0.18);
    color: rgba(220, 38, 38, 0.18);
    font-size: 3.5rem;
    font-weight: 900;
    padding: 10px 30px;
    letter-spacing: 5px;
    pointer-events: none;
    border-radius: 12px;
    text-transform: uppercase;
}
.dossier-header {
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    border-bottom: 2px solid #2b2b2b;
    padding-bottom: 4px;
    margin-bottom: 2px;
}
.dossier-subheader {
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-bottom: 16px;
    color: #555;
}
.dossier-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.transcript-line {
    display: flex;
    font-size: 0.95rem;
    line-height: 1.4;
}
.line-num {
    color: #8c8269;
    width: 30px;
    border-right: 1px solid #8c8269;
    margin-right: 12px;
    font-weight: bold;
    user-select: none;
}
.line-text {
    flex: 1;
}

/* 6. Propaganda Theme - Die Propagandamaschine */
.theme-propaganda {
    background: #1c1922; /* Changed from #0f0d11 to dark gray so black censors stand out */
    border: 3px solid #dc2626;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.15);
}
.propaganda-pamphlet {
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #26212e 0%, #17141e 100%); /* Changed from #18151b & #0a080c to dark gray */
    position: relative;
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.propaganda-header {
    font-family: 'Bebas Neue', sans-serif;
    background: #dc2626;
    color: #fff;
    font-size: 1.6rem; /* slightly increased because Bebas Neue is compact */
    font-weight: 900;
    text-align: center;
    padding: 6px;
    margin-bottom: 16px;
    letter-spacing: 3px;
    text-transform: uppercase;
    clip-path: polygon(0% 0%, 100% 0%, 95% 100%, 5% 100%);
}
.propaganda-body {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f3f0ff;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}
.propaganda-body p {
    margin: 0;
}
.propaganda-poster {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.propaganda-frame {
    border: 4px solid #fff;
    outline: 2px solid #dc2626;
    box-shadow: 0 12px 28px rgba(0,0,0,0.8);
    background: #fff;
    padding: 4px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}
.propaganda-img {
    max-width: 100%;
    max-height: 190px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: grayscale(20%) contrast(1.1) brightness(0.95);
}
.propaganda-banner {
    font-family: 'Bebas Neue', sans-serif;
    position: absolute;
    top: 15px; /* Changed from bottom: 25px to top: 15px to avoid overlapping the title at the bottom */
    background: #dc2626;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem; /* slightly increased because Bebas Neue is compact */
    padding: 6px 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transform: rotate(5deg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 10; /* Ensures the banner stays on top of the frame */
}
.propaganda-poster-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: #dc2626;
    background: #fff;
    margin-top: 6px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-top: 2px solid #dc2626;
    padding-top: 4px;
    width: 100%;
}
.propaganda-pamphlet-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: #dc2626;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    padding-bottom: 4px;
}

/* Default / Fallback Theme */
.theme-default {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}
.default-text-card {
    padding: 24px;
    font-size: 1.1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}
.default-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--neon-gold);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Image Lightbox / Zoom-Effekt --- */

/* Clickable zoom-in cursor for game images */
.gallery-img,
.patent-img,
.propaganda-img {
    cursor: zoom-in;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Lightbox Dialog Styling */
dialog#image-lightbox {
    border: none;
    background: transparent;
    padding: 0;
    margin: auto;
    max-width: 90vw;
    max-height: 90vh;
    outline: none;
    overflow: visible;
}

/* Glassmorphism Backdrop Styling and Transition */
dialog#image-lightbox::backdrop {
    background-color: rgba(10, 8, 19, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition:
        display 0.3s allow-discrete,
        overlay 0.3s allow-discrete,
        background-color 0.3s ease-out,
        backdrop-filter 0.3s ease-out,
        -webkit-backdrop-filter 0.3s ease-out;
}

dialog[open]#image-lightbox::backdrop {
    background-color: rgba(10, 8, 19, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    @starting-style {
        background-color: rgba(10, 8, 19, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

/* Entry and Exit Transition for the Dialog itself */
dialog#image-lightbox {
    opacity: 0;
    transform: scale(0.9);
    transition-property: opacity, transform, display, overlay;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-behavior: allow-discrete;
}

dialog[open]#image-lightbox {
    opacity: 1;
    transform: scale(1);

    @starting-style {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Lightbox Content Layout and Zoom-out cursor */
.lightbox-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: zoom-out;
}

#lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.25);
}

/* Pulsing Close Hint */
.lightbox-close-hint {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.6;
        text-shadow: 0 0 4px rgba(255,255,255,0.1);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(255,255,255,0.4);
    }
}

/* Reduced Motion Compatibility */
@media (prefers-reduced-motion: reduce) {
    dialog#image-lightbox {
        transform: none;
        transition-duration: 0.1s;
    }
    dialog[open]#image-lightbox {
        @starting-style {
            transform: none;
        }
    }
}

/* Results detailed styles */
.results-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.results-table th, .results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.results-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr.me-row {
    background: rgba(6, 182, 212, 0.08);
}

.results-table tr.me-row td {
    font-weight: 700;
    color: var(--neon-cyan);
}

.results-table td.rank-cell {
    font-weight: 800;
    width: 80px;
    text-align: left;
}

.results-table td.points-cell {
    font-weight: 700;
    color: var(--neon-gold);
}

/* --- Difficulty Badges --- */
.difficulty-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid currentColor;
    display: inline-block;
}
.difficulty-badge.diff-hard { color: var(--neon-red); background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.25); }
.difficulty-badge.diff-medium { color: var(--neon-orange); background: rgba(249, 115, 22, 0.15); border-color: rgba(249, 115, 22, 0.25); }
.difficulty-badge.diff-easy { color: var(--neon-green); background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.25); }
.difficulty-badge.diff-very-easy { color: var(--neon-cyan); background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.25); }

/* ================================================== */
/* 10. Dopamine Features */
/* ================================================== */

/* --- 1. Tiered Reveal Feedback --- */
.reveal-tier-banner {
    text-align: center;
    padding: 16px 20px;
    border-radius: 16px;
    animation: reveal-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(0);
}

.reveal-tier-banner .tier-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 4px;
}

.reveal-tier-banner .tier-title {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
}

.reveal-tier-banner .tier-subtitle {
    font-size: 0.85rem;
    margin-top: 4px;
    opacity: 0.7;
    display: block;
}

/* Tier: Perfect */
.reveal-perfect {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(168, 85, 247, 0.2) 100%);
    border: 2px solid rgba(234, 179, 8, 0.6);
    box-shadow: 0 0 40px rgba(234, 179, 8, 0.3), inset 0 0 30px rgba(234, 179, 8, 0.1);
    animation: reveal-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, 
               perfect-glow 2s ease-in-out infinite alternate;
}
.reveal-perfect .tier-title { color: var(--neon-gold); }

/* Tier: Excellent */
.reveal-excellent {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 2px solid rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.2);
    animation: reveal-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               excellent-pulse 1.5s ease-in-out infinite alternate;
}
.reveal-excellent .tier-title { color: var(--neon-pink); }

/* Tier: Impressive */
.reveal-impressive {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    border: 2px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}
.reveal-impressive .tier-title { color: var(--neon-cyan); }

/* Tier: Good */
.reveal-good {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.reveal-good .tier-title { color: var(--neon-green); }

/* Tier: Okay */
.reveal-okay {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.reveal-okay .tier-title { color: var(--text-muted); }

/* Tier: Miss */
.reveal-miss {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.reveal-miss .tier-title { color: #f87171; }

/* Tier: Far */
.reveal-far {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.reveal-far .tier-title { color: var(--text-muted); opacity: 0.6; }

@keyframes reveal-scale-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes perfect-glow {
    from { box-shadow: 0 0 30px rgba(234, 179, 8, 0.2), inset 0 0 20px rgba(234, 179, 8, 0.05); }
    to { box-shadow: 0 0 50px rgba(234, 179, 8, 0.4), inset 0 0 40px rgba(234, 179, 8, 0.1); }
}

@keyframes excellent-pulse {
    from { box-shadow: 0 0 20px rgba(236, 72, 153, 0.15); }
    to { box-shadow: 0 0 35px rgba(236, 72, 153, 0.3); }
}

/* --- 2. Streak System --- */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    animation: streak-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-badge-small {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(234, 179, 8, 0.15) 100%);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: var(--neon-gold);
}

.streak-badge-medium {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(234, 179, 8, 0.2) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fb923c;
    animation: streak-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), flame-pulse 1s ease-in-out infinite alternate;
}

.streak-badge-large {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(234, 179, 8, 0.3) 100%);
    border: 2px solid rgba(239, 68, 68, 0.6);
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    animation: streak-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), flame-pulse 0.7s ease-in-out infinite alternate;
}

.streak-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(234, 179, 8, 0.15));
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: var(--neon-gold);
    animation: flame-pulse 1.2s ease-in-out infinite alternate;
    margin-left: 8px;
}

.streak-lost-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0;
    animation: fadeInOut 2s ease forwards;
}

@keyframes streak-pop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes flame-pulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- 3. Animated Score Counter --- */
.score-countup {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    padding: 8px 0;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.score-countup.score-low { color: var(--text-muted); }
.score-countup.score-mid { color: var(--neon-green); }
.score-countup.score-high { color: var(--neon-cyan); text-shadow: 0 0 15px rgba(6, 182, 212, 0.4); }
.score-countup.score-max { color: var(--neon-gold); text-shadow: 0 0 20px rgba(234, 179, 8, 0.5); }

.score-countup-bounce {
    animation: score-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes score-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* --- 4. Highscore & New Record --- */
.new-record-banner {
    text-align: center;
    padding: 16px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 2px solid rgba(234, 179, 8, 0.5);
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.2);
    animation: reveal-scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               perfect-glow 2s ease-in-out infinite alternate;
    transform: scale(0);
}

.new-record-banner .record-emoji {
    font-size: 2.5rem;
    display: block;
}

.new-record-banner .record-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
}

.new-record-banner .record-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.highscore-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(234, 179, 8, 0.06);
    border: 1px solid rgba(234, 179, 8, 0.15);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-gold);
}

.highscore-display .hs-icon {
    font-size: 1.1rem;
}

/* --- 5. Performance Bar --- */
.performance-bar-container {
    width: 100%;
    margin: 8px 0 4px 0;
}

.performance-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.performance-bar {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.performance-bar-fill {
    height: 100%;
    border-radius: 6px;
    width: 0%;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.perf-fill-low { background: linear-gradient(90deg, #ef4444, #f97316); }
.perf-fill-mid { background: linear-gradient(90deg, #f97316, #eab308); }
.perf-fill-good { background: linear-gradient(90deg, #eab308, #22c55e); }
.perf-fill-great { background: linear-gradient(90deg, #22c55e, #06b6d4); }
.perf-fill-perfect { background: linear-gradient(90deg, #06b6d4, #eab308); box-shadow: 0 0 12px rgba(234, 179, 8, 0.4); }

/* --- 6. Micro-Interactions --- */
.timer-urgent .artifact-container {
    animation: urgency-pulse 1.5s ease-in-out infinite;
}

.artifact-container.urgency-active {
    animation: urgency-pulse 1.5s ease-in-out infinite;
}

@keyframes urgency-pulse {
    0%, 100% { box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.2), inset 0 0 20px rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
}

.guess-flash {
    animation: guess-flash-anim 0.2s ease;
}

@keyframes guess-flash-anim {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); color: var(--neon-cyan); }
    100% { transform: scale(1); }
}

.btn-adjust:active {
    transform: scale(0.9);
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

#btn-submit-guess {
    transition: all 0.2s ease, box-shadow 0.3s ease;
}

#btn-submit-guess:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.3);
}

/* --- 7. Achievement Badges --- */
.badges-section {
    width: 100%;
    margin-top: 8px;
}

.badges-section h3 {
    color: var(--neon-cyan);
    text-align: left;
    margin-bottom: 12px;
}

.badge-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 12px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    -webkit-overflow-scrolling: touch;
}

.badge-card {
    min-width: 130px;
    max-width: 160px;
    padding: 16px 12px;
    border-radius: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transform: scale(0);
    animation: badge-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.badge-card.earned {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.3);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.1);
}

.badge-card.locked {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    opacity: 0.25 !important;
    filter: grayscale(1) brightness(0.5) !important;
}

.badge-card .badge-emoji {
    font-size: 2rem;
}

.badge-card .badge-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--neon-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-card.locked .badge-title {
    color: var(--text-muted);
}

.badge-card .badge-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

@keyframes badge-pop-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Badge staggered delays */
.badge-card:nth-child(1) { animation-delay: 0.1s; }
.badge-card:nth-child(2) { animation-delay: 0.2s; }
.badge-card:nth-child(3) { animation-delay: 0.3s; }
.badge-card:nth-child(4) { animation-delay: 0.4s; }
.badge-card:nth-child(5) { animation-delay: 0.5s; }

@media (max-width: 768px) {
    .reveal-tier-banner .tier-emoji { font-size: 2rem; }
    .reveal-tier-banner .tier-title { font-size: 1.2rem; }
    .score-countup { font-size: 2.2rem; }
    .new-record-banner .record-title { font-size: 1.2rem; }
    .badge-card { min-width: 110px; padding: 12px 10px; }
    .badge-card .badge-emoji { font-size: 1.6rem; }
}

/* ================================================== */
/* 11. Haptics Toggle Switch                          */
/* ================================================== */

.haptics-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: 14px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: fadeIn 0.3s ease;
}

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

.haptics-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.haptics-icon {
    font-size: 1.2rem;
}

/* iOS-style Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 26px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(6, 182, 212, 0.25);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* Reduced motion: instant transitions */
@media (prefers-reduced-motion: reduce) {
    .toggle-slider,
    .toggle-slider::before {
        transition-duration: 0.05s;
    }
    .haptics-settings-row {
        animation: none;
    }
}

/* ==========================================================================
   Historischer Twist Feature Styles
   ========================================================================== */
.twist-box {
    margin-top: 10px;
    background: rgba(26, 21, 44, 0.45);
    border: 1.5px solid rgba(139, 92, 246, 0.2); /* purple/violet tint */
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(139, 92, 246, 0.05);
}

.twist-box.unlocked {
    border-color: var(--neon-cyan);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.twist-box.bonus-unlocked {
    border-color: var(--neon-gold);
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.twist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.twist-box.unlocked .twist-header {
    background: rgba(6, 182, 212, 0.1);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}

.twist-box.bonus-unlocked .twist-header {
    background: rgba(245, 158, 11, 0.1);
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.twist-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.twist-icon {
    font-size: 1.25rem;
}

.twist-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: #c084fc; /* purple tint */
}

.twist-box.unlocked .twist-title {
    color: var(--neon-cyan);
}

.twist-box.bonus-unlocked .twist-title {
    color: var(--neon-gold);
}

.twist-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.twist-badge.locked {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.twist-badge.unlocked-label {
    background: rgba(6, 182, 212, 0.15);
    color: var(--neon-cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.twist-badge.bonus-label {
    background: rgba(245, 158, 11, 0.15);
    color: var(--neon-gold);
    border: 1px solid rgba(245, 158, 11, 0.25);
    animation: pulseGlow 2s infinite alternate;
}

.twist-content-wrapper {
    position: relative;
    padding: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reveal-twist-text {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-main);
    text-align: left;
    width: 100%;
    transition: filter 0.5s ease, opacity 0.5s ease;
}

/* Blurred state when locked */
.twist-box.is-locked-state .reveal-twist-text {
    filter: blur(8px);
    opacity: 0.3;
    user-select: none;
    pointer-events: none;
}

.twist-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 11, 28, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    text-align: center;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.twist-lock-overlay .lock-icon {
    font-size: 1.8rem;
    animation: wobbleLock 3s infinite ease-in-out;
}

.twist-lock-overlay .lock-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 80%;
    margin: 0;
}

.btn-reveal-twist {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
}

.btn-reveal-twist:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.btn-reveal-twist:active {
    transform: translateY(0);
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    to { box-shadow: 0 0 15px rgba(245, 158, 11, 0.5); }
}

@keyframes wobbleLock {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-8deg); }
    30% { transform: rotate(6deg); }
    45% { transform: rotate(-4deg); }
    60% { transform: rotate(2deg); }
    75% { transform: rotate(0deg); }
}
