/* Local Font Hosting Setup */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  src: url('/fonts/inter-v19-latin-300.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/inter-v19-latin-regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/inter-v19-latin-500.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/inter-v19-latin-600.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/inter-v19-latin-700.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/jetbrains-mono-v23-latin-regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/jetbrains-mono-v23-latin-500.woff2') format('woff2');
  font-display: swap;
}

:root {
    --bg-primary: #fdfcf8;
    --bg-secondary: #f7f4ed;
    --bg-tertiary: #f1ede1;
    --bg-card: #ffffff;
    --text-primary: #2d2a26;
    --text-secondary: #5c5854;
    --text-tertiary: #8b8680;
    --accent-primary: #d4741a;
    --accent-secondary: #b8621c;
    --accent-light: #f4e6d3;
    --border-light: #e8e3d8;
    --border-medium: #d4cfc0;
    --success: #16a34a;
    --error: #dc2626;
    --warning: #d97706;
    --xp-gold: #f59e0b;
    --level-purple: #8b5cf6;
    --shadow-sm: 0 1px 2px 0 rgba(45, 42, 38, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(45, 42, 38, 0.1), 0 2px 4px -1px rgba(45, 42, 38, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(45, 42, 38, 0.1), 0 4px 6px -2px rgba(45, 42, 38, 0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Improved focus colors for better accessibility */
    --focus-ring: 0 0 0 3px rgba(212, 116, 26, 0.15);
    --focus-ring-contrast: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--accent-primary);
}

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

/* Improved focus styles for better accessibility */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Fix für Mobile Scroll Bug */
html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Complete reset for em elements */
em {
    all: unset;
    display: inline;
}

/* Your custom styles */
.page-header em {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Styles - Komplett überarbeitet */
.main-navigation {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    position: relative; /* Für absolute positioning des mobilen Menüs */
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    margin: -4px -8px;
}

.nav-brand:hover {
    color: var(--accent-primary);
    background: var(--bg-secondary);
}

.nav-brand:focus-visible {
    box-shadow: var(--focus-ring);
}

.nav-logo {
    height: 32px;
    width: auto;
    border-radius: var(--radius-sm);
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    gap: 4px;
}

.nav-toggle:hover {
    background: var(--bg-secondary);
}

.nav-toggle:focus-visible {
    box-shadow: var(--focus-ring);
}

.nav-toggle-line {
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Auf Desktop: Brand links, Menü rechts */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto; /* Schiebt das Menü nach rechts */
    margin-right: 16px; /* Platz zum Toggle Button (falls sichtbar) */
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-secondary);
}

.nav-link:focus-visible {
    box-shadow: var(--focus-ring);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-content {
        min-height: 56px;
    }
    
    .nav-logo {
        height: 28px;
    }
    
    .nav-title {
        font-size: 16px;
    }
    
    .nav-toggle {
        display: flex;
    }
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-top: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.2s ease;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    
    .nav-menu.nav-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-link {
        padding: 16px 24px;
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        font-size: 16px;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .nav-content {
        min-height: 52px;
    }
    
    .nav-logo {
        height: 26px;
    }
    
    .nav-title {
        font-size: 15px;
    }
    
    .nav-brand {
        gap: 8px;
    }
}

.main-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
    overflow-x: hidden;
}

.sidebar-ad {
    width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 20px;
    height: fit-content;
    margin: 20px 10px;
}

.sidebar-ad.left {
    order: 1;
}

.sidebar-ad.right {
    order: 3;
}

.main-content {
    flex: 1;
    order: 2;
    max-width: 1024px;
    margin: 0 auto;
    width: 100%;
}

.container {
    padding: 0 24px;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
}


.page-header {
    background: var(--bg-primary);
    padding: 24px 0 16px 0; 
    text-align: center; /* Nur der Header bleibt zentriert */
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.page-header .emoji {
    font-size: 40px;
    margin-right: 12px;
    vertical-align: middle;
}

.intro {
    font-size: 18px;
    font-weight: 400;
    max-width: 720px;
    margin: 0 auto 24px auto;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.6;
}

.main-content-area {
    flex: 1;
}

.game-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Game Header - Kompakter Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    gap: 20px;
    width: 100%;
}

.header-left {
    flex: 0 0 auto;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    flex: 0 0 auto;
}

/* Mode Selector mit Custom Dropdown */
.mode-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

/* Custom Dropdown Styling */
.dropdown-button {
    appearance: none;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    min-height: 44px; /* Touch-friendly size */
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    user-select: none;
}

.dropdown-button:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.dropdown-button:focus-visible {
    box-shadow: var(--focus-ring-contrast);
}

.dropdown-button.open {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 116, 26, 0.1);
}

.dropdown-button .dropdown-arrow {
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.dropdown-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
    width: 100%;
    min-width: 0; /* Verhindert Overflow auf mobilen Geräten */
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    min-height: 44px; /* Touch-friendly size */
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover:not(.disabled) {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.dropdown-option:focus-visible {
    background: var(--accent-light);
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.dropdown-option.disabled {
    color: var(--text-tertiary);
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

.dropdown-option.selected {
    background: var(--accent-light);
    color: var(--accent-secondary);
    font-weight: 600;
}

.dropdown-option .lock-icon {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-left: 8px;
}

/* Verstecke das Original-Select */
.theme-dropdown {
    display: none;
}

/* Kompakte Stats im Header */
.stats-compact {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat-compact {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
    cursor: help; /* Help-Icon als Cursor */
}

/* Enhanced Tooltips - native title unterdrücken */
.stat-compact[title] {
    title: ""; /* Unterdrücke native Tooltips */
}

.stat-compact::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.stat-compact::before {
    content: '';
    position: absolute;
    bottom: 112%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.stat-compact:hover::after,
.stat-compact:hover::before {
    opacity: 1;
    visibility: visible;
}

.stat-compact-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-compact-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Display as Button - überarbeitet */
.progress-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    min-width: 200px;
    width: 100%;
}

.progress-display:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.progress-display:focus-visible {
    box-shadow: var(--focus-ring-contrast);
}

.progress-display:active {
    transform: translateY(0);
}

/* Neue Struktur für Level-Anzeige */
.level-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 4px;
}

.xp-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-bar {
    position: relative;
    width: 100%;
    height: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-medium);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    /* iOS-Fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.5s ease;
    position: relative;
    /* iOS-Fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
}

.game-area {
    display: none;
}

.game-area.active {
    display: block;
}

.word-display {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    margin-bottom: 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 500;
    letter-spacing: 2px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.word .correct {
    color: var(--success);
    background: linear-gradient(120deg, rgba(22, 163, 74, 0.15) 0%, rgba(22, 163, 74, 0.05) 100%);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 1px;
}

.word .incorrect {
    color: var(--error);
    background: linear-gradient(120deg, rgba(220, 38, 38, 0.15) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 1px;
}

.word .current {
    color: var(--accent-primary);
    background: linear-gradient(120deg, rgba(212, 116, 26, 0.3) 0%, rgba(212, 116, 26, 0.15) 100%);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 1px;
    animation: pulse 1.5s ease-in-out infinite;
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
}

@keyframes pulse {
    0%, 100% {
        background: linear-gradient(120deg, rgba(212, 116, 26, 0.2) 0%, rgba(212, 116, 26, 0.1) 100%);
        transform: scale(1);
    }
    50% {
        background: linear-gradient(120deg, rgba(212, 116, 26, 0.3) 0%, rgba(212, 116, 26, 0.15) 100%);
        transform: scale(1.05);
    }
}

.input-area {
    margin-bottom: 24px;
}

.typing-input {
    width: 100%;
    padding: 20px 24px;
    font-size: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.typing-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(212, 116, 26, 0.1);
}

.typing-input:focus-visible {
    box-shadow: var(--focus-ring-contrast);
}

.typing-input:disabled {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.horizontal-ad-placeholder {
    width: 100%;
    height: 90px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px dashed var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 14px;
    text-align: center;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 24px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 0;
}

.control-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    width: 180px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.control-btn:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.control-btn:hover:not(:disabled)::before {
    left: 100%;
}

.control-btn:focus-visible {
    box-shadow: var(--focus-ring-contrast);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.control-btn:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.control-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.control-btn.secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Results Modal */
.round-complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    width: 100vw;
    height: 100vh;
}

.round-complete-overlay.show {
    display: flex;
}

.round-complete {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    margin: 0 auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.close-btn:focus-visible {
    box-shadow: var(--focus-ring);
}

.round-complete h2 {
    color: var(--success);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.xp-achievements-section {
    margin-bottom: 20px;
}

.achievements {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.achievement {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-light) 100%);
    color: var(--accent-secondary);
    border: 1px solid var(--accent-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: subtleSlideIn 0.4s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes subtleSlideIn {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.xp-gained {
    background: linear-gradient(135deg, var(--xp-gold) 0%, var(--accent-primary) 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

/* Schöne Stat Items für Results */
.round-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
}

.share-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.share-section p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
    color: #333;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.share-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

#share-twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

#share-facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

#share-linkedin:hover {
    background: #0a66c2;
    color: white;
    border-color: #0a66c2;
}

#share-copy:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.copy-success {
    background: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
}

.next-round-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.adsense-placeholder {
    width: 300px;
    height: 250px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px dashed var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 14px;
    text-align: center;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 0;
}

.next-round-btn-full {
    width: 300px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

.next-round-btn-full:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.next-round-btn-full:focus-visible {
    box-shadow: var(--focus-ring-contrast);
}

/* Stats Modal */
.stats-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    backdrop-filter: blur(5px);
    width: 100vw;
    height: 100vh;
}

.stats-modal-overlay.show {
    display: flex;
}

.stats-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    margin: 0 auto;
    animation: modalSlideIn 0.3s ease-out;
}

.stats-modal h2 {
    color: var(--accent-primary);
    font-size: 24px;
    font-weight: 700;
}

/* NEU: Header für das Statistik-Modal */
.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px; /* Die Margin von h2 hierher verschoben */
}

/* NEU: Überschrift innerhalb des neuen Headers anpassen */
.stats-modal-header h2 {
    text-align: left;
    flex-grow: 1; /* Sorgt dafür, dass die H2 den verfügbaren Platz einnimmt */
    padding-right: 16px; /* Etwas Abstand zum Button */
}

/* NEU: Absolute Positionierung des Buttons NUR hier aufheben */
.stats-modal-header .close-btn {
    position: static; /* Hebt 'position: absolute' auf */
    flex-shrink: 0; /* Verhindert, dass der Button schrumpft */
}

.stats-section {
    margin-bottom: 24px;
}

.stats-section h2 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 4px;
    text-align: left; /* Explizit links für Stats-Modal */
}

.best-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.best-stat-item {
    background-color: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.best-stat-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.best-stat-item span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.best-stat-item span:last-child {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 16px;
}

/* Progress Detail Section für Stats Modal */
.progress-detailed {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.current-level, .xp-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.level-label, .xp-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.level-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.xp-numbers {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-xp-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-medium);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.modal-xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.8s ease-out;
    border-radius: 11px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.modal-xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 2;
    white-space: nowrap;
    line-height: 1;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    background: var(--bg-secondary);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.tips-list li:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.achievement-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.achievement-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    text-align: center;
    font-size: 12px;
    opacity: 0.5;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.achievement-item:hover {
    transform: translateY(-1px);
}

.achievement-item.unlocked {
    background: var(--accent-light);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    opacity: 1;
    font-weight: 600;
}

/* Verbesserte Content-Section Styles */
.content-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

/* KORRIGIERTE ÜBERSCHRIFTEN-STYLES */

/* Haupt-Überschrift: zentriert (nur im page-header) */
.page-header h1,
.page-header h2 {
    text-align: center;
}

/* Alle Content-Überschriften: linksbündig */
.content-section h2 {
    color: var(--text-primary);
    margin: 0 0 24px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: left;
    line-height: 1.2;
}

/* Erste H2 in Content-Section bekommt keinen oberen Margin */
.content-section h2:first-of-type {
    margin-top: 0;
}

/* Weitere H2-Überschriften (Sections) */
.content-section h2:not(:first-of-type) {
    margin-top: 56px;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 3px solid var(--accent-light);
    padding-bottom: 8px;
}

/* H3-Überschriften (Subsections) */
.content-section h3 {
    color: var(--text-primary);
    margin: 32px 0 16px 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: left;
    line-height: 1.3;
}

.content-section p, .content-section ul {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-section ul {
    list-style-position: inside;
    padding-left: 8px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Content Images - Kleinere floating Bilder */
.content-image {
    max-width: 400px;
    margin: 16px 20px 16px 0;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    float: right; /* Standard rechts floaten */
    clear: both;
}

.content-image.float-left {
    float: left;
    margin: 16px 20px 16px 0;
}

.content-image.float-right {
    float: right;
    margin: 16px 0 16px 20px;
}

.content-image:hover {
    box-shadow: var(--shadow-md);
}

.content-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.content-image figcaption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.4;
    text-align: center;
}

/* Clearfix für Container mit floating Bildern */
.content-section::after {
    content: "";
    display: table;
    clear: both;
}

.trainer-info-section {
    background-color: var(--bg-secondary);
    padding: 32px 40px;
    margin: 48px 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.trainer-info-section h3 {
    margin: 24px 0 16px 0;
}

.trainer-info-section ul {
    list-style-position: inside;
    padding-left: 8px;
}

.privacy-note {
    background-color: var(--accent-light);
    border-left: 4px solid var(--warning);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.privacy-note strong {
     color: var(--accent-secondary);
}

.benefits-section {
    margin: 40px 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.benefit-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    padding: 24px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.benefit-card:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent-secondary);
}

.benefit-card h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.benefit-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Speed Benchmarks Table - verbessert */
.speed-benchmarks-table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.speed-benchmarks-table thead {
    background: var(--bg-secondary);
}

.speed-benchmarks-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
    border-bottom: 2px solid var(--border-medium);
}

.speed-benchmarks-table th:last-child {
    text-align: right;
}

.speed-benchmarks-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 15px;
    transition: background-color 0.2s ease;
}

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

.speed-benchmarks-table tr:hover {
    background: var(--bg-tertiary);
}

.speed-benchmarks-table .wpm-value {
    text-align: right;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 16px;
}

.faq-section {
    margin-top: 48px;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.faq-question {
    width: 100%;
    border: none;
    background: transparent;
    padding: 20px 24px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-size: 16px;
    position: relative;
    text-align: left;
    outline: none;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 300;
    color: var(--accent-primary);
    transition: transform 0.2s ease;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question:focus-visible {
    background: var(--bg-tertiary);
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

.faq-answer {
    padding: 0 24px 20px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.faq-answer.show {
    display: block;
}

.faq-item.open .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

/* Footer Styles - verbessert */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    margin-top: 60px;
    padding: 40px 0;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.footer-links a:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.footer-links a:focus-visible {
    box-shadow: var(--focus-ring);
}

.footer-separator {
    color: var(--text-tertiary);
    font-weight: 300;
}

.footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.5;
    max-width: 600px;
}

/* Fix: Progressbar im progress-display auf iOS/Safari */
.progress-display .xp-section {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.progress-display .xp-bar {
  width: 100%;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile Responsive Design */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar-ad {
        display: none;
    }

    .main-content {
        order: 1;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .game-container {
        padding: 32px 24px;
    }

    .word-display {
        font-size: 32px;
        padding: 36px 20px;
    }

    .game-header {
        flex-wrap: wrap;
        gap: 16px;
    }

    .stats-compact {
        gap: 20px;
    }

    .progress-display {
        min-width: 180px;
    }

    .speed-benchmarks-table th,
    .speed-benchmarks-table td {
        padding: 12px 16px;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .page-header h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .content-section {
        padding: 32px 24px;
    }

    .content-section h2:first-of-type {
        font-size: 28px;
    }

    .content-section h2:not(:first-of-type) {
        font-size: 24px;
        margin: 32px 0 16px 0;
    }

    .content-section h3 {
        font-size: 20px;
        margin: 24px 0 14px 0;
    }

    .content-image {
        float: none !important;
        max-width: 100%;
        margin: 20px auto;
        display: block;
    }
    
    .content-image.float-left,
    .content-image.float-right {
        float: none !important;
        margin: 20px auto;
    }
    
    .content-image figcaption {
        font-size: 11px;
        margin-top: 6px;
    }

    .game-container {
        padding: 24px 16px;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .header-left,
    .header-center,
    .header-right {
        width: 100%;
    }

    .header-center {
        justify-content: center;
    }

    .header-right {
        display: flex;
        justify-content: center;
    }

    /* Mobile Mode Selector */
    .mode-selector {
        width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .dropdown-button {
        width: 100%;
        min-width: auto;
        min-height: 48px; /* Größer auf mobilen Geräten */
        padding: 12px 16px;
    }

    .dropdown-menu {
        left: 0;
        right: 0;
        width: 100%;
    }

    /* Mobile Progress Display */
    .progress-display {
        width: 100%;
        min-width: auto;
        max-width: none;
    }

    /* Mobile Control Buttons */
    .game-controls {
        flex-direction: column;
        gap: 12px;
    }

    .control-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .stats-compact {
        justify-content: center;
        gap: 18px;
    }

    .word-display {
        font-size: 24px;
        padding: 28px 16px;
        min-height: 100px;
    }

    .typing-input {
        font-size: 18px;
        padding: 16px 20px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .best-stats-grid {
        grid-template-columns: 1fr;
    }

    .speed-benchmarks-table {
        font-size: 14px;
    }

    .speed-benchmarks-table th,
    .speed-benchmarks-table td {
        padding: 10px 12px;
    }
}

/* Mobile Landscape */
@media (max-width: 640px) {
    .page-header {
        padding: 20px 0 12px 0;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header .emoji {
        font-size: 28px;
        margin-right: 8px;
    }

    .intro {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .game-container {
        padding: 20px 12px;
        margin-bottom: 24px;
    }

    .game-header {
        padding: 12px;
        gap: 12px;
    }

    /* Mobile adjustments for all elements */
    .mode-selector {
        width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .dropdown-button {
        width: 100%;
        min-width: auto;
        padding: 8px 12px;
    }

    .dropdown-menu {
        width: 100%;
    }

    .progress-display {
        width: 100%;
        min-width: auto;
        gap: 8px;
        padding: 12px 16px;
    }

    .xp-bar {
        height: 14px;
        border-radius: 7px;
        min-height: 14px;
        /* Zusätzliche iOS-Fixes für kleine Screens */
        -webkit-appearance: none;
        appearance: none;
        will-change: auto;
    }

     .xp-progress-fill {
        min-width: 1px;
        /* Stelle sicher, dass der Progress auch bei 0% sichtbar ist */
        background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    }

    .level-text {
        font-size: 11px;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .control-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .stats-compact {
        gap: 14px;
        flex-wrap: wrap;
    }

    .stat-compact-value {
        font-size: 16px;
    }

    .stat-compact-unit {
        font-size: 10px;
    }

    .word-display {
        font-size: 20px;
        padding: 24px 12px;
        min-height: 80px;
        letter-spacing: 1px;
    }

    .typing-input {
        font-size: 16px;
        padding: 12px 16px;
    }

    .round-complete {
        padding: 20px 16px;
        max-width: 98%;
        margin: 0 1%;
    }

    .round-results {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .round-results .stat-item {
        padding: 12px 8px;
    }

    .round-results .stat-value {
        font-size: 20px;
    }

    .round-results .stat-label {
        font-size: 10px;
    }

    .adsense-placeholder,
    .next-round-btn-full {
        width: 100%;
        max-width: 280px;
    }

    .adsense-placeholder {
        height: 180px;
    }

    .next-round-btn-full {
        padding: 12px 20px;
        font-size: 14px;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    .stats-modal {
        padding: 20px 16px;
        max-width: 98%;
        margin: 0 1%;
    }

    .content-section {
        padding: 24px 20px;
    }

    .content-section h2:first-of-type {
        font-size: 24px;
    }

    .content-section h2:not(:first-of-type) {
        font-size: 22px;
        margin: 28px 0 14px 0;
    }

    .content-section h3 {
        font-size: 18px;
        margin: 20px 0 12px 0;
    }

    .footer {
        padding: 32px 0;
        margin-top: 40px;
    }
    
    .footer-content {
        gap: 16px;
    }
    
    .footer-links {
        gap: 12px;
    }
    
    .footer-links a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .footer-text {
        font-size: 12px;
        padding: 0 16px;
    }

    .speed-benchmarks-table th,
    .speed-benchmarks-table td {
        padding: 10px 12px;
    }

    .speed-benchmarks-table .wpm-value {
        font-size: 14px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .page-header h1 {
        font-size: 22px;
        line-height: 1.1;
    }

    .intro {
        font-size: 15px;
    }

    .game-container {
        padding: 16px 10px;
        border-radius: var(--radius-lg);
    }

    .game-header {
        padding: 10px;
        gap: 10px;
    }

    .mode-label {
        font-size: 13px;
    }

    /* Mobile Mode Selector */
    .mode-selector {
        width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .dropdown-button {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        min-width: auto;
        min-height: 46px;
    }

    .dropdown-menu {
        width: 100%;
    }

    /* Mobile Progress Display */
    .progress-display {
        width: 100%;
        min-width: auto;
        gap: 6px;
        padding: 8px 12px;
    }

   .xp-bar {
        height: 12px;
        border-radius: 6px;
        min-height: 12px;
    }

    .level-text {
        font-size: 10px;
    }

    /* Mobile Control Buttons */
    .game-controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .control-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 42px;
    }

    .stats-compact {
        gap: 10px;
        justify-content: space-between;
    }

    .stat-compact-value {
        font-size: 14px;
    }

    .stat-compact-unit {
        font-size: 9px;
    }

    .word-display {
        font-size: 18px;
        padding: 20px 8px;
        min-height: 70px;
        letter-spacing: 0.5px;
    }

    .typing-input {
        font-size: 15px;
        padding: 10px 12px;
        letter-spacing: 0.5px;
    }

    .round-complete {
        padding: 16px 12px;
        max-width: 96%;
        margin: 0 2%;
    }

    .round-complete h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .xp-gained {
        padding: 8px 14px;
        font-size: 12px;
    }

    .achievement {
        padding: 4px 8px;
        font-size: 10px;
    }

    .round-results .stat-item {
        padding: 10px 6px;
    }

    .round-results .stat-value {
        font-size: 18px;
    }

    .round-results .stat-label {
        font-size: 9px;
    }

    .adsense-placeholder,
    .next-round-btn-full {
        width: 100%;
        max-width: 250px;
    }

    .adsense-placeholder {
        height: 150px;
        font-size: 12px;
    }

    .next-round-btn-full {
        padding: 12px 20px;
        font-size: 14px;
    }

    .share-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 40px;
    }

    .share-btn svg {
        width: 16px;
        height: 16px;
    }

    .stats-modal {
        padding: 16px 12px;
        max-width: 96%;
        margin: 0 2%;
        max-height: 85vh;
    }

    .stats-modal h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .best-stat-item {
        padding: 10px 12px;
        font-size: 12px;
    }

    .tips-list li {
        padding: 10px 12px;
        font-size: 13px;
    }

    .content-section {
        padding: 20px 16px;
    }

    .content-section h2:first-of-type {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .content-section h2:not(:first-of-type) {
        font-size: 20px;
        margin: 24px 0 12px 0;
    }

    .content-section h3 {
        font-size: 17px;
        margin: 18px 0 10px 0;
    }

    .content-section p,
    .content-section ul {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .content-image {
        margin: 16px auto;
        padding: 10px;
    }
    
    .content-image figcaption {
        font-size: 10px;
        margin-top: 4px;
    }

    .benefit-card {
        padding: 20px 16px;
    }

    .benefit-card h3 {
        font-size: 16px;
        margin: 0 0 10px 0;
    }

    .benefit-card p {
        font-size: 14px;
    }

    .faq-question {
        padding: 16px 20px;
        font-size: 15px;
    }

    .faq-answer {
        padding: 0 20px 16px 20px;
        font-size: 14px;
    }

    .footer {
        padding: 24px 0;
        margin-top: 32px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-separator {
        display: none;
    }

    .speed-benchmarks-table {
        margin: 16px 0;
        border-radius: var(--radius-md);
    }

    .speed-benchmarks-table th,
    .speed-benchmarks-table td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .speed-benchmarks-table th:first-child,
    .speed-benchmarks-table td:first-child {
        width: 70%;
    }

    .speed-benchmarks-table .wpm-value {
        font-size: 13px;
    }
}

/* Sehr kleine Screens */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .game-container {
        padding: 12px 8px;
    }

    .game-header {
        padding: 8px;
    }

    /* Extra small mobile adjustments */
    .mode-selector {
        width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .dropdown-button {
        width: 100%;
        padding: 8px 10px;
        font-size: 12px;
        min-width: auto;
        min-height: 44px;
    }

    .progress-display {
        width: 100%;
        min-width: auto;
        gap: 4px;
        padding: 6px 10px;
    }

   .xp-bar {
        height: 10px;
        border-radius: 5px;
        min-height: 10px;
    }

    .level-text {
        font-size: 9px;
    }

    .game-controls {
        gap: 8px;
    }

    .control-btn {
        width: 100%;
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }

    .stats-compact {
        gap: 8px;
        flex-wrap: wrap;
    }

    .word-display {
        font-size: 16px;
        padding: 16px 6px;
        min-height: 60px;
    }

    .typing-input {
        font-size: 14px;
        padding: 8px 10px;
    }

    .adsense-placeholder,
    .next-round-btn-full {
        max-width: 220px;
    }

    .content-section {
        padding: 16px 12px;
    }

    .speed-benchmarks-table th,
    .speed-benchmarks-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* Mobile adjustments for progress modal */
@media (max-width: 480px) {
    .progress-detailed {
        padding: 16px;
    }
    
    .level-info {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .current-level, .xp-info {
        width: 100%;
    }
    
    .level-number {
        font-size: 20px;
    }
    
    .xp-numbers {
        font-size: 12px;
    }
    
    .modal-xp-bar {
        height: 20px;
    }
    
    .modal-xp-text {
        font-size: 10px;
    }
}