:root {
    --bg-gradient: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    --white: #ffffff;
    --primary: #8b5cf6;
    --primary-xlight: #ede9fe;
    --primary-light: #ddd6fe;
    --primary-medium: #a78bfa;
    --primary-dark: #6d28d9;
    --text-dark: #1e1b4b;
    --text-light: #64748b;
    --success: #10b981;
    --shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.1);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-content { flex: 1 0 auto; }
.footer { flex-shrink: 0; }

/* --- NAVBAR & DROPDOWNS --- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--primary-light);
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 20px; }

.logo { font-size: 1.8rem; font-weight: 900; letter-spacing: -1px; }
.logo span { color: var(--primary); }
.logo-link { text-decoration: none; color: inherit; }

/* Dropdown Basis */
.dropdown { position: relative; display: inline-block; }
.dropbtn {
    background: transparent;
    border: 1px solid var(--primary-light);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.dropbtn:hover { background: var(--primary-light); }
.lang-dropdown .dropbtn { background: var(--primary-xlight); border-color: var(--primary-light); }
.lang-dropdown .dropbtn:hover { background: var(--primary-light); }

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    box-shadow: var(--shadow);
    border-radius: 15px;
    padding: 8px;
    z-index: 10;
    margin-top: 5px;
    right: 0;
    left: auto;
}
.dropdown-content.open { display: block; animation: fadeIn 0.2s ease; }

.dropdown-content a {
    color: var(--text-dark);
    padding: 10px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
}
.dropdown-content a:hover { background: var(--primary-light); }

.arrow-icon { width: 16px; height: 16px; fill: currentColor; }
.lang-flag { height: 15px; width: auto; border-radius: 2px; vertical-align: middle; display: inline-block; }

/* Hamburger menu */
.menu-btn { padding: 8px 12px; }
.menu-icon { width: 18px; height: 18px; }
.menu-dropdown-content { min-width: 190px; }
.menu-dropdown-content a { white-space: nowrap; }

/* --- FILTER PILLS --- */
.filter-bar {
    padding: 22px 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
    transition: filter 0.3s, opacity 0.3s;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar.locked { filter: blur(4px); opacity: 0.45; pointer-events: none; user-select: none; }
.filter-container {
    display: flex; gap: 8px; flex-wrap: nowrap;
    justify-content: center;
    width: max-content; min-width: 100%;
    padding: 4px 12px 6px;
}
@media (max-width: 680px) {
    .filter-bar { overflow-x: visible; }
    .filter-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
        min-width: unset;
        padding: 0 8px;
        gap: 5px;
    }
    .league-pill {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 10px;
        padding: 5px 7px;
        border-radius: 8px;
        min-height: unset;
    }
}

.league-pill {
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--primary-light);
    border-radius: 35px;
    color: var(--primary);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.league-pill.active { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
@media (hover: hover) and (pointer: fine) {
    .league-pill:hover { background: var(--primary-medium); color: white; border-color: var(--primary-medium); }
    .league-pill.active:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
}

/* --- GAME GRID --- */
.game-container { display: flex; justify-content: center; padding: 20px; }
.grid-wrapper { background: white; padding: 25px; border-radius: 40px; box-shadow: var(--shadow); }

.grid {
    display: grid;
    grid-template-columns: 100px repeat(3, 140px);
    grid-template-rows: 100px repeat(3, 140px);
    gap: 15px;
}

/* ZENTRIERUNG DER LOGOS + TOOLTIP */
.club-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.club-header[data-club-name]::after {
    content: attr(data-club-name);
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 27, 75, 0.88);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 7px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 50;
}
@media (hover: hover) and (pointer: fine) {
    .club-header[data-club-name]:hover::after { opacity: 1; }
}
/* Auf Touch-Geräten: kein Sticky-Hover, stattdessen per JS kurz einblenden */
.club-header[data-club-name].touch-tooltip::after { opacity: 1; }
/* Tooltip-Abstand je nach Position */
.top-club-header[data-club-name]::after  { top: calc(100% + 11px); }
.side-club-header[data-club-name]::after { top: calc(100% + 2px); }
.club-header img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* REFRESH ICON BUTTON */
.grid-refresh-btn {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}
.refresh-icon { width: 40px; height: 40px; fill: var(--primary); transition: fill 0.3s; }
.grid-refresh-btn:hover { background: var(--primary-dark); }
.grid-refresh-btn:hover .refresh-icon { fill: white; }

/* QUIZ CELLS */
.quiz-cell {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    text-align: center;
    padding: 10px;
}
.quiz-cell:hover { background: #f1f5f9; border-color: var(--primary-light); }
.quiz-cell.filled {
    background: #f0ebff;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
    cursor: default;
}
.quiz-cell.filled-p2 {
    background: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

@keyframes cellWin {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.1); }
    65%  { transform: scale(0.97); }
    100% { transform: scale(1.04); }
}
.quiz-cell.winning-cell {
    animation: cellWin 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.35), 0 0 28px rgba(139, 92, 246, 0.22);
    border-color: var(--primary);
}
.quiz-cell.filled-p2.winning-cell {
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.38), 0 0 28px rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

/* --- GUESS THE HAIRCUT MODUS --- */
.mode-container { display: none; width: 100%; max-width: 1080px; margin: 0 auto; }
.mode-container.active { display: block; }

.haircut-game { text-align: center; padding: 40px 20px; }
.haircut-card {
    background: white;
    padding: 30px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    display: inline-block;
    width: 100%;
    max-width: 450px;
}

/* Hier passiert die Magie: Nur den oberen Teil des Bildes zeigen */
.haircut-image-wrapper {
    width: 100%;
    height: 220px; /* Begrenzte Höhe */
    overflow: hidden;
    border-radius: 20px;
    background: #eee;
    margin-bottom: 25px;
    position: relative;
}
#haircut-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top; /* Fokus auf den Kopf */
}
.gradient-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(transparent, white); /* Blendet den unteren Teil weich aus */
}

.guess-input-wrapper { position: relative; margin-top: 20px; }
#haircut-guess-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--primary-light);
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    box-sizing: border-box;
}

/* --- AUTOCOMPLETE --- */
.autocomplete-results {
    position: absolute;
    top: 100%; left: 0; width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 100;
    overflow: hidden;
}
.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}
.autocomplete-item:hover { background: var(--primary-light); }

.career-path-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.career-station {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
}
.career-station .arrow { color: var(--text-light); margin-right: 10px; }

/* --- MODALS --- */
.win-modal, .input-modal {
    display: none; position: fixed; inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000; justify-content: center; align-items: center;
    padding: 16px;
    box-sizing: border-box;
    /* Keyboard-sicheres Scrollen auf iOS */
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}
.win-modal { background: rgba(17, 10, 50, 0.75); }
.input-modal { background: rgba(17, 10, 50, 0.42); }
.win-modal.show { display: flex; }
.win-card { background: white; padding: 40px; border-radius: 30px; text-align: center; max-width: 400px; width: 90%; }

/* INPUT MODAL CARD */
.input-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 32px 64px -12px rgba(109, 40, 217, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.08);
    animation: cardSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-clubs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 14px;
}
.modal-clubs img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}
.modal-vs {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-light);
    line-height: 1;
    user-select: none;
}
.modal-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 18px;
    letter-spacing: 0.02em;
}

/* INPUT FIELD */
.input-wrapper {
    position: relative;
    margin-bottom: 6px;
}
.input-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
}
#player-input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border: 2px solid var(--primary-light);
    border-radius: 14px;
    font-size: 1rem; /* ≥16px verhindert iOS-Zoom beim Fokussieren */
    font-family: inherit;
    font-weight: 500;
    box-sizing: border-box;
    outline: none;
    background: #faf8ff;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#player-input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}
#player-input::placeholder { color: #94a3b8; }

/* AUTOCOMPLETE DROPDOWN */
.autocomplete-results:empty { display: none; }
.autocomplete-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 16px 40px -8px rgba(109, 40, 217, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.1);
    z-index: 200;
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}
.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f5f3ff;
    transition: background 0.12s;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-dark);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f5f3ff; }
.autocomplete-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light);
    flex-shrink: 0;
    border: 2px solid var(--primary-light);
}

/* ERROR + CANCEL */
.error-message {
    color: #ef4444;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 18px;
    text-align: center;
    margin-bottom: 10px;
}
.btn-cancel {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.02em;
}
.btn-cancel:hover { color: var(--primary); background: #f5f3ff; }

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

/* --- FOOTER --- */
.footer {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    margin-top: 60px;
    padding: 44px 40px 24px;
}
.footer-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: white;
    margin-bottom: 6px;
}
.footer-logo span { color: var(--primary-medium); }
.footer-tagline { color: rgba(255,255,255,0.4); font-size: 0.85rem; margin: 0; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-nav a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}
.footer-nav a:hover { color: white; }
.footer-bottom { max-width: 860px; margin: 0 auto; padding-top: 20px; text-align: center; }
.footer-bottom p { color: rgba(255,255,255,0.22); font-size: 0.75rem; margin: 0; line-height: 1.6; }

/* --- LOGO POP ANIMATION --- */
@keyframes logoPop {
    0%   { opacity: 0; transform: scale(0.3) rotate(-12deg); }
    60%  { opacity: 1; transform: scale(1.18) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.logo-pop { animation: logoPop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* --- PLAYER NAME IN CELL --- */
.player-name-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 100%;
}
.player-name-display span {
    display: block;
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1.2;
    letter-spacing: -0.4px;
    white-space: nowrap;
    text-align: center;
}
.quiz-cell.filled-p2 .player-name-display span {
    color: #92400e;
}

/* ============================================================
   RESPONSIVE – Mobile-First von 768px bis 320px
   Berechnungsgrundlage: grid total = Seite + 3×Zelle + 3×Gap
   Verfügbar  = Bildschirm – 2×game-container – 2×grid-wrapper
   ============================================================ */

/* --- 768px: Tablet --- */
@media (max-width: 768px) {
    .main-content, .legal-main, .footer, .cookie-banner {
        transition: filter 0.35s ease;
    }
    body.dropdown-open .main-content,
    body.dropdown-open .legal-main,
    body.dropdown-open .footer,
    body.dropdown-open .cookie-banner {
        filter: blur(4px);
    }

    .navbar { padding: 0.7rem 1.2rem; }
    .logo { font-size: 1.5rem; }
    .grid {
        grid-template-columns: 80px repeat(3, 108px);
        grid-template-rows: 80px repeat(3, 108px);
        gap: 10px;
    }
    .grid-wrapper { padding: 18px; border-radius: 28px; }
    .club-header img { max-width: 65px; max-height: 65px; }
    .grid-refresh-btn { width: 65px; height: 65px; border-radius: 16px; }
    .refresh-icon { width: 32px; height: 32px; }
}

/* --- 520px: Großes Smartphone ---
   Grid: 60+3×86+3×8 = 342 px; wrapper 24, container 16 → 382px
   Passt ab 382px. Lücke 381–430px wird durch nächsten Breakpoint gefüllt. */
@media (max-width: 520px) {
    .navbar { padding: 0.6rem 1rem; }
    .logo { font-size: 1.25rem; }
    .dropbtn { padding: 6px 12px; font-size: 0.85rem; min-height: 44px; }
    .game-container { padding: 8px; }
    .grid {
        grid-template-columns: 60px repeat(3, 86px);
        grid-template-rows: 60px repeat(3, 86px);
        gap: 8px;
    }
    .grid-wrapper { padding: 12px; border-radius: 20px; }
    .club-header img { max-width: 50px; max-height: 50px; }
    .grid-refresh-btn { width: 50px; height: 50px; border-radius: 13px; }
    .refresh-icon { width: 26px; height: 26px; }
    .quiz-cell { border-radius: 18px; }
    .filter-bar { padding: 16px 0 10px; }
    /* Modals */
    .win-card { padding: 28px 18px; border-radius: 22px; }
    .input-card { padding: 20px 16px 16px; border-radius: 22px; }
    .modal-clubs img { width: 52px; height: 52px; }
    .modal-clubs { gap: 14px; }
    /* Autocomplete-Items: Taphöhe ≥44px */
    .autocomplete-item { padding: 12px 16px; min-height: 44px; }
    /* Abbrechen-Button: Taphöhe ≥44px */
    .btn-cancel { padding: 13px; min-height: 44px; }
    /* Turn-Indicator kompakter */
    .turn-indicator { padding: 6px 10px; gap: 6px; font-size: 0.82rem; margin-bottom: 10px; }
    .turn-player { padding: 4px 10px; min-width: 80px; }
    /* Skip-Button: Taphöhe ≥44px */
    .skip-btn { width: 38px; height: 38px; }
    /* Mode-Toggle: Taphöhe ≥44px, weniger Abstand nach oben, mehr nach unten */
    .mode-toggle-btn { padding: 10px 18px; min-height: 44px; }
    .mode-switch-bar { padding: 2px 12px 40px; }
    /* Zurück-Button */
    .btn-back-setup { padding: 10px; min-height: 44px; }
    /* Setup-Panel */
    .setup-logo-in-grid { font-size: 2.8rem; margin-bottom: 8px; }
    .setup-panel { padding: 16px 20px 20px; }
    .setup-step { min-height: 300px; }
    .setup-explanation { font-size: 0.76rem; }
    .mode-options { gap: 10px; }
    .mode-option { padding: 16px 10px; }
    .mode-option-icon { font-size: 1.8rem; }
    /* Footer */
    .footer { padding: 28px 18px 18px; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
    .footer-nav { gap: 16px; flex-wrap: wrap; }
    .footer-nav a { min-height: 44px; display: inline-flex; align-items: center; }
    /* Win-Players-Row auf kleinen Screens */
    .win-player-item { max-width: 64px; font-size: 0.7rem; }
    .win-player-avatar { width: 40px; height: 40px; }
}

/* --- 430px: Schließt Lücke 381–430px ---
   Grid: 54+3×89+3×8 = 345px; wrapper 24, container 12 → 381px
   Passt exakt ab 381px. */
@media (max-width: 430px) {
    .game-container { padding: 6px; }
    .grid {
        grid-template-columns: 54px repeat(3, 89px);
        grid-template-rows: 54px repeat(3, 89px);
        gap: 8px;
    }
    .grid-wrapper { padding: 12px; border-radius: 18px; }
    .club-header img { max-width: 46px; max-height: 46px; }
    .grid-refresh-btn { width: 46px; height: 46px; border-radius: 12px; }
    .refresh-icon { width: 24px; height: 24px; }
    .quiz-cell { border-radius: 16px; }
    /* Setup */
    .setup-logo-in-grid { font-size: 2.4rem; }
    .setup-panel { padding: 14px 16px 18px; }
    .setup-step { min-height: 280px; }
    .mode-option small { font-size: 0.72rem; }
}

/* --- 380px: Kleines Smartphone (inkl. 320px) ---
   Grid: 48+3×76+3×5 = 291px; wrapper 16, container 8 → 315px
   Passt ab 315px → alle Screens ≥320px abgedeckt. */
@media (max-width: 380px) {
    .game-container { padding: 4px; }
    .grid {
        grid-template-columns: 48px repeat(3, 76px);
        grid-template-rows: 48px repeat(3, 76px);
        gap: 5px;
    }
    .grid-wrapper { padding: 8px; border-radius: 16px; }
    .club-header img { max-width: 40px; max-height: 40px; }
    .grid-refresh-btn { width: 40px; height: 40px; border-radius: 10px; }
    .refresh-icon { width: 20px; height: 20px; }
    .quiz-cell { border-radius: 14px; padding: 6px; }
    /* Turn-Indicator */
    .turn-indicator { gap: 4px; padding: 4px 8px; font-size: 0.78rem; }
    .turn-player { padding: 3px 8px; min-width: 70px; }
    .skip-btn { width: 34px; height: 34px; }
    /* Setup */
    .setup-logo-in-grid { font-size: 2rem; margin-bottom: 6px; }
    .setup-panel { padding: 10px 12px 16px; }
    .setup-step { min-height: 260px; }
    .setup-explanation { font-size: 0.74rem; line-height: 1.6; }
    .mode-options { gap: 8px; }
    .mode-option { padding: 12px 8px; gap: 5px; }
    .mode-option-icon { font-size: 1.5rem; }
    .mode-option strong { font-size: 0.82rem; }
    .mode-option small { font-size: 0.68rem; }
    /* Modal */
    .input-card { padding: 16px 12px 12px; }
    .modal-clubs img { width: 44px; height: 44px; }
    .win-card { padding: 22px 14px; }
    /* Navbar */
    .logo { font-size: 1.1rem; }
    .dropbtn { padding: 5px 10px; }
}

/* --- 340px: Sehr schmale Screens (320px Minimum) ---
   Grid: 44+3×70+3×4 = 266px; wrapper 12, container 6 → 284px < 320px ✓ */
@media (max-width: 340px) {
    .game-container { padding: 3px; }
    .grid {
        grid-template-columns: 44px repeat(3, 70px);
        grid-template-rows: 44px repeat(3, 70px);
        gap: 4px;
    }
    .grid-wrapper { padding: 6px; border-radius: 14px; }
    .club-header img { max-width: 36px; max-height: 36px; }
    .grid-refresh-btn { width: 36px; height: 36px; border-radius: 9px; }
    .refresh-icon { width: 18px; height: 18px; }
    .quiz-cell { border-radius: 12px; padding: 4px; }
    .navbar { padding: 0.5rem 0.75rem; }
    .logo { font-size: 1rem; }
    .setup-logo-in-grid { font-size: 1.8rem; }
    .turn-player { min-width: 60px; }
}

/* --- WIN MODAL INHALT --- */
.win-card {
    background: white;
    padding: 40px 36px 32px;
    border-radius: 30px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    animation: cardSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.win-trophy { font-size: 3.2rem; line-height: 1; margin-bottom: 6px; }
.win-line-label { color: var(--text-light); font-size: 0.88rem; margin: -6px 0 14px; }
.win-players-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 22px;
    flex-wrap: wrap;
}
.win-player-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; font-size: 0.76rem; font-weight: 600;
    color: var(--text-dark); max-width: 78px; text-align: center;
}
.win-player-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--primary-light);
}
.win-arrow { color: var(--primary-light); font-size: 1.2rem; font-weight: 900; }
.modal-new-game-btn {
    display: block; width: 100%; padding: 14px;
    background: var(--primary-dark); color: white;
    border: none; border-radius: 14px;
    font-family: inherit; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.modal-new-game-btn:hover {
    background: #4c1d95;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(109, 40, 217, 0.4);
}

/* --- TURN INDICATOR --- */
.turn-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow);
    width: fit-content;
    margin: 0 auto 16px;
    font-size: 0.88rem;
    font-weight: 700;
}
.turn-player {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 5px 14px; border-radius: 40px; min-width: 110px;
    opacity: 0.32; transition: all 0.3s ease; color: var(--text-dark);
    text-align: center;
}
.turn-player.turn-active { opacity: 1; background: #f0ebff; }
#turn-p2.turn-active { background: #f59e0b; color: white; }
#turn-p2.turn-active .turn-dot { background: white; }
.turn-dot { display: none; }
.turn-vs { color: var(--text-light); font-size: 0.72rem; font-weight: 600; }
.skip-btn {
    display: none; width: 30px; height: 30px; flex-shrink: 0;
    background: #f5f3ff; border: none; border-radius: 50%;
    cursor: pointer; align-items: center; justify-content: center;
    color: var(--text-light); transition: all 0.2s; padding: 0;
}
.skip-btn:hover { background: var(--primary-light); color: var(--primary); transform: scale(1.1); }
.skip-btn svg { width: 16px; height: 16px; }

/* --- SETUP PANEL (inside grid-wrapper) --- */
.setup-panel {
    padding: 20px 32px 32px;
    text-align: center;
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start; gap: 0;
    overflow: hidden;
    animation: cardSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.setup-logo-in-grid {
    font-size: 3.8rem; font-weight: 900; letter-spacing: -2px;
    color: var(--text-dark); margin-bottom: 10px; line-height: 1;
}
.setup-logo-in-grid span { color: var(--primary); }
.setup-step {
    width: 100%; max-width: 360px;
    min-height: 340px;
    display: none; flex-direction: column;
    align-items: center; justify-content: flex-start; gap: 0;
}
#setup-step-1 { display: flex; }
/* Step 1: explanation at top, title+buttons pushed down */
#setup-step-1 .setup-title-small { margin-top: 20px; }
/* Step 2 (leagues): content aligned top, actions pushed to bottom */
#setup-step-leagues { padding-top: 8px; }
#setup-step-leagues .league-step-actions { margin-top: auto; width: 100%; }
.setup-title-small { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin: 0 0 16px; }
.mode-options { display: flex; gap: 12px; justify-content: center; width: 100%; }
.mode-option {
    flex: 1; background: #faf8ff; border: 2px solid var(--primary-light);
    border-radius: 20px; padding: 20px 12px; cursor: pointer;
    transition: all 0.2s ease; display: flex; flex-direction: column;
    align-items: center; gap: 6px; font-family: inherit;
}
.mode-option:hover {
    border-color: var(--primary); background: #f0ebff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.2);
}
.mode-option-icon { font-size: 2rem; line-height: 1; }
.mode-option strong { font-size: 0.9rem; color: var(--text-dark); display: block; }
.mode-option small { font-size: 0.74rem; color: var(--text-light); line-height: 1.45; display: block; }
.duo-inputs { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 20px; text-align: left; }
.duo-input-row {
    display: flex; align-items: center; gap: 14px;
    background: #faf8ff; padding: 13px 18px; border-radius: 14px;
    border: 2px solid var(--primary-light); transition: border-color 0.2s;
}
.duo-input-row:focus-within { border-color: var(--primary); }
.duo-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.duo-input-row input {
    border: none; outline: none; font-family: inherit;
    font-size: 0.95rem; font-weight: 600; color: var(--text-dark);
    background: transparent; flex: 1; width: 100%;
}
.btn-start-game {
    display: block; width: 100%; padding: 14px;
    background: var(--primary-dark); color: white; border: none;
    border-radius: 14px; font-family: inherit; font-size: 1rem;
    font-weight: 700; cursor: pointer; transition: all 0.2s; margin-bottom: 10px;
}
.btn-start-game:hover {
    background: #4c1d95; transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(109, 40, 217, 0.4);
}
.btn-back-setup {
    background: none; border: none; color: var(--text-light);
    font-family: inherit; font-size: 0.85rem; cursor: pointer;
    padding: 6px; transition: color 0.2s;
}
.btn-back-setup:hover { color: var(--primary); }

@media (max-width: 480px) {
    .setup-panel { padding: 24px 16px; min-height: 420px; }
    .mode-options { gap: 10px; }
    .mode-option { padding: 18px 12px; }
    .mode-option-icon { font-size: 2rem; }
}

/* --- LEGAL PAGES (Impressum, Datenschutz, Kontakt) --- */
.legal-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}
.legal-header {
    margin-bottom: 32px;
}
.legal-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-dark);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.legal-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}
.legal-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.legal-section h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}
.legal-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 20px 0 6px;
}
.legal-section h3:first-of-type {
    margin-top: 0;
}
.legal-section p {
    color: var(--text-light);
    font-size: 0.88rem;
    line-height: 1.75;
    margin: 0 0 10px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}
.legal-section a:hover { text-decoration: underline; }
.legal-section .uppercase-warning {
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-dark);
}
.legal-source {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--primary-light);
    font-size: 0.8rem !important;
    color: var(--text-light) !important;
}

/* Kontakt-Card */
.contact-card {
    background: white;
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 28px;
}
.contact-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-dark);
    color: white;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 1px;
}
.contact-info { flex: 1; }
.contact-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 16px;
    letter-spacing: -0.3px;
}
.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.5;
}
.contact-row:last-child { margin-bottom: 0; }
.contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
}
.contact-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.contact-row a:hover { text-decoration: underline; }

@media (max-width: 520px) {
    .legal-main { padding: 28px 16px 60px; }
    .legal-section { padding: 22px 18px; }
    .legal-header h1 { font-size: 1.7rem; }
    .contact-card { flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px 18px; }
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--primary-light);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(139, 92, 246, 0.12);
}
.cookie-banner.hidden { display: none; }
.cookie-banner-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    flex: 1;
}
.cookie-banner-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.cookie-banner-text a:hover { text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn-accept {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-btn-accept:hover { background: var(--primary-dark); }
.cookie-btn-decline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--primary-light);
    padding: 8px 18px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-btn-decline:hover { background: var(--primary-xlight); }
@media (max-width: 520px) {
    .cookie-banner { flex-direction: column; align-items: flex-start; }
    .cookie-banner-actions { width: 100%; }
    .cookie-btn-accept, .cookie-btn-decline { flex: 1; text-align: center; }
}

/* --- MODUS WECHSELN --- */
.mode-switch-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 4px 20px 28px;
}
.mode-toggle {
    position: relative;
    display: inline-flex;
    background: white;
    border-radius: 20px;
    padding: 4px;
    box-shadow: var(--shadow);
}
.mode-toggle-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    border-radius: 16px;
    background: var(--primary-xlight);
    transition: left 0.28s cubic-bezier(0.34, 1.15, 0.64, 1),
                width 0.28s cubic-bezier(0.34, 1.15, 0.64, 1);
    pointer-events: none;
    z-index: 0;
}
.mode-toggle-btn {
    position: relative;
    z-index: 1;
    padding: 7px 22px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}
.mode-toggle-btn.active { color: var(--primary-dark); }
.mode-toggle-btn:not(.active):hover { color: var(--primary-dark); }
.duo-switch-form {
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 320px;
    flex-direction: column;
    gap: 10px;
    animation: cardSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* --- SETUP ERKLÄRTEXT & LIGA-AUSWAHL --- */
.setup-explanation {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.7;
    text-align: justify;
    margin: 0 0 20px;
    width: 100%;
}
.setup-leagues-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin: 0 0 18px;
    line-height: 1.5;
}
.setup-league-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    margin-bottom: 16px;
    margin-top: 4px;
}

/* --- SETUP STEP ANIMATIONEN --- */
@keyframes setupSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes setupSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes setupSlideOutBack {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}
@keyframes setupSlideInBack {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.setup-exiting     { animation: setupSlideOut     0.2s ease forwards; }
.setup-entering    { animation: setupSlideIn      0.2s ease forwards; }
.setup-exiting-back { animation: setupSlideOutBack 0.2s ease forwards; }
.setup-entering-back { animation: setupSlideInBack  0.2s ease forwards; }
.setup-league-pill {
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--primary-light);
    border-radius: 35px;
    color: var(--text-light);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.setup-league-pill:hover { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-light); }
.setup-league-pill.active { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.league-select-error {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    80%       { transform: translateX(-2px); }
}

/* --- LIGA-BESTÄTIGUNGS-MODAL --- */
.confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(17, 10, 50, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    box-sizing: border-box;
}
.confirm-modal.show { display: flex; }
.confirm-card {
    background: white;
    border-radius: 28px;
    padding: 36px 32px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 64px -12px rgba(109, 40, 217, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.08);
    animation: cardSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.confirm-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 14px; }
.confirm-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-dark);
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}
.confirm-text {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0 24px;
}
.confirm-actions { display: flex; gap: 10px; }
.confirm-btn-cancel {
    flex: 1;
    padding: 12px;
    background: none;
    border: 2px solid var(--primary-light);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}
.confirm-btn-cancel:hover { background: #f5f3ff; border-color: var(--primary-medium); color: var(--primary); }
.confirm-btn-ok {
    flex: 1;
    padding: 12px;
    background: var(--primary-dark);
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}
.confirm-btn-ok:hover { background: #4c1d95; transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(109, 40, 217, 0.4); }
@media (max-width: 520px) {
    .confirm-card { padding: 28px 20px 22px; }
    .confirm-btn-cancel, .confirm-btn-ok { min-height: 44px; }
}