@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');
* { box-sizing: border-box; }

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.4) transparent;
}

/* Chrome, Edge, Safari, Opera */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.6); }

[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.4); }

:root {
    --bg-dark: #0a0a0c;
    --bg-gradient: radial-gradient(circle at top, #1e1e22 0%, #0a0a0c 100%);
    --card-bg: rgba(26, 26, 30, 0.85);
    --input-bg: #151518;
    --text-main: #ffffff;
    --text-dim: #8e8e93;
    --border-color: rgba(255, 255, 255, 0.1);
    --photo-bg-gradient: linear-gradient(135deg, #4a4a4f 0%, #25252a 100%);
    --photo-text-color: rgba(255,255,255,0.2);
    --path-box-bg: #222;
    --path-box-border: #444;
    --attr-box-bg: #111;
    --attr-box-border: #222;
    --divider-color: rgba(255, 255, 255, 0.1);
    --club-path-bg: #111;
    --club-path-border: #222;
    --accent: #f1c40f;
    --green-neon: #00ff66;
    --yellow-neon: #ffcc00;
    --red-neon: #ff3333;
}

[data-theme="light"] {
    --bg-dark: #f4f4f7;
    --bg-gradient: linear-gradient(to bottom, #eaeaef 0%, #f4f4f7 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --input-bg: #ffffff;
    --text-main: #1a1a1c;
    --text-dim: #6e6e73;
    --border-color: rgba(0, 0, 0, 0.1);
    --photo-bg-gradient: linear-gradient(135deg, #e0e0e5 0%, #cacaca 100%);
    --photo-text-color: rgba(0,0,0,0.2);
    --path-box-bg: #e0e0e0;
    --path-box-border: #b0b0b0;
    --attr-box-bg: #eeeeef;
    --attr-box-border: #dcdce0;
    --divider-color: rgba(0, 0, 0, 0.1);
    --club-path-bg: #f0f0f4;
    --club-path-border: #dcdce0;
}

html, body { overflow-x: hidden; max-width: 100vw; margin: 0; padding: 0; }
body { font-family: 'Montserrat', sans-serif; background-color: var(--bg-dark); background-image: var(--bg-gradient); color: var(--text-main); display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 20px; }

/* UTILITIES */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-around { display: flex; justify-content: space-around; align-items: center; }
.gap-4 { gap: 4px; }
.gap-5 { gap: 5px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.w-100 { width: 100%; }
.w-80 { width: 80%; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }
.max-w-400 { max-width: 400px; }
.max-w-320 { max-width: 320px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-0 { margin: 0; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mt-30 { margin-top: 30px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.mt-neg-10 { margin-top: -10px; }
.p-12 { padding: 12px; }
.p-15 { padding: 15px; }
.p-30 { padding: 30px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }
.text-center { text-align: center; }
.align-left { align-items: flex-start; }
.text-accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }
.text-red { color: var(--red-neon); }
.text-green { color: var(--green-neon); }
.text-blue { color: #3399ff; }
.text-white { color: #fff; }
.font-black { font-weight: 900; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 1px; }
.line-h-1-4 { line-height: 1.4; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.rounded-12 { border-radius: 12px; }
.position-relative { position: relative; }
.overflow-visible { overflow: visible; }
.overflow-y-auto { overflow-y: auto; }
.max-h-90vh { max-height: 90vh; }
.text-shadow { text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.text-shadow-lg { text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.border-red { border-color: var(--red-neon) !important; }
.border-blue { border-color: #3399ff !important; }

/* ANIMACJE */
@keyframes flipIn { 0% { transform: rotateX(-90deg); opacity: 0; } 100% { transform: rotateX(0); opacity: 1; } }
.flip-anim { animation: flipIn 0.4s ease forwards; opacity: 0; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
.shake-error { animation: shake 0.4s; }
.shake-error input { border-color: var(--red-neon) !important; background: rgba(255, 51, 51, 0.1); }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.loading-pulse { animation: pulse 1.5s infinite ease-in-out; color: var(--accent); }

/* --- TOASTS (POWIADOMIENIA) --- */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 99999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-msg { background: rgba(26, 26, 30, 0.95); color: #fff; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 700; text-transform: uppercase; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 2px solid var(--accent); animation: slideDownToast 0.3s ease forwards; backdrop-filter: blur(10px); }
.toast-msg.error { border-color: var(--red-neon); color: var(--red-neon); }
.toast-msg.success { border-color: var(--green-neon); color: var(--green-neon); }
@keyframes slideDownToast { 0% { transform: translateY(-50px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fadeOutToast { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }

/* KASKI */
.lives-container { display: flex; gap: 6px; justify-content: center; margin-top: 15px; flex-wrap: wrap; }
.helmet-icon { width: 28px; height: auto; transition: all 0.3s ease; filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.8)); -webkit-filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.8)); }
.helmet-lost { opacity: 0.25 !important; filter: grayscale(100%) !important; -webkit-filter: grayscale(100%) !important; transform: scale(0.85); }
@keyframes crackHelmetPNG { 
    0% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.8)); -webkit-filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.8)); } 
    25% { transform: scale(1.3) rotate(-15deg); opacity: 0.8; filter: none; -webkit-filter: none; } 
    50% { transform: scale(1.3) rotate(15deg); } 
    100% { transform: scale(0.85) rotate(0); opacity: 0.25; filter: grayscale(100%); -webkit-filter: grayscale(100%); } 
}
.life-lost-anim { animation: crackHelmetPNG 0.6s ease-out forwards; }

/* PRZYCISKI GŁÓWNE */
.top-right-buttons { position: relative; display: flex; justify-content: flex-end; width: 100%; gap: 10px; margin-bottom: 10px; z-index: 10; }
.icon-btn { background: transparent; border: 2px solid var(--border-color); border-radius: 12px; font-size: 20px; padding: 8px 12px; cursor: pointer; color: var(--text-main); transition: 0.3s; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.icon-btn-small { background: transparent; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; transition: 0.2s; padding: 5px; }
.icon-btn-small:hover { transform: scale(1.2); color: var(--text-main); }
.btn-close { background: transparent; color: #fff; padding: 16px 32px; border-radius: 12px; border: 2px solid #fff; cursor: pointer; text-transform: uppercase; font-weight: 900; }
.btn-reset { background: var(--accent); color: #000; padding: 16px 32px; border-radius: 12px; font-weight: 900; border: none; cursor: pointer; text-transform: uppercase; }
.btn-danger { background: var(--red-neon); color: #fff; box-shadow: 0 0 15px rgba(255,51,51,0.4); border-color: transparent;}
.btn-share { background: var(--green-neon); color: #000; padding: 16px 32px; border-radius: 12px; font-weight: 900; border: none; cursor: pointer; text-transform: uppercase; transition: transform 0.2s; }
.btn-share:hover { transform: scale(1.05); }

/* --- NOWOCZESNE PRZYCISKI 3D MENU --- */
.menu-btn { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 16px 25px; border: none; border-radius: 18px; cursor: pointer; font-weight: 900; text-transform: uppercase; font-size: 16px; width: 100%; transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.2s ease; position: relative; }
.menu-btn:hover { filter: brightness(0.85); outline: 2px solid rgba(255, 255, 255, 0.3); outline-offset: 2px; }
.btn-yellow { background: linear-gradient(180deg, #f1c40f 0%, #f39c12 100%); color: #1a1a1c; box-shadow: 0 6px 0 #d35400, 0 15px 20px rgba(0,0,0,0.4); }
.btn-yellow:active { transform: translateY(6px); box-shadow: 0 0 0 #d35400, 0 5px 10px rgba(0,0,0,0.4); }
.btn-clash { background: linear-gradient(135deg, #ff4757 0%, #3742fa 100%); color: white; box-shadow: 0 6px 0 #2f3542, 0 15px 20px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.2); }
.btn-clash:active { transform: translateY(6px); box-shadow: 0 0 0 #2f3542, 0 5px 10px rgba(0,0,0,0.4); }
.btn-gold { background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%); color: #111; box-shadow: 0 6px 0 #997a00, 0 15px 20px rgba(212, 175, 55, 0.4); border: 1px solid #ffee88; }
.btn-gold:active { transform: translateY(6px); box-shadow: 0 0 0 #997a00, 0 5px 10px rgba(212, 175, 55, 0.4); }
.btn-green { background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%); color: white; box-shadow: 0 6px 0 #1e8449, 0 15px 20px rgba(46, 204, 113, 0.3); }
.btn-green:active { transform: translateY(6px); box-shadow: 0 0 0 #1e8449, 0 5px 10px rgba(46, 204, 113, 0.3); }
.btn-flat { background: transparent; color: var(--text-dim); border: 2px dashed rgba(255,255,255,0.2); box-shadow: none; }
.menu-btn.disabled { opacity: 0.5; cursor: pointer; background: #666 !important; color: #fff !important; box-shadow: none !important; transform: none !important; outline: none; filter: none; }

/* KARTY MENU (MOBILE/DOMYŚLNE) */
.menu-container { position: relative; background: var(--card-bg); width: 800px; max-width: 90%; border-radius: 32px; padding: 30px 30px 50px 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.4); border: 1px solid var(--border-color); backdrop-filter: blur(10px); text-align: center; margin-top: 40px; display: flex; flex-direction: column; align-items: center; }
.game-title { font-weight: 900; font-size: 42px; text-transform: uppercase; letter-spacing: -1px; margin-top: 0; background: linear-gradient(to bottom, #fff 0%, #888 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .game-title { background: linear-gradient(to bottom, #000 0%, #666 100%); background-clip: text; -webkit-background-clip: text; }
.title-lg { font-size: 32px; }
.glow-title { font-size: 36px; text-shadow: 0 0 20px rgba(255, 255, 255, 0.2); }
.alpha-tag { font-size: 12px; color: var(--accent); font-weight: 700; margin-top: -15px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; }
.menu-subtitle { font-weight: 600; color: var(--text-dim); margin-top: -10px; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 2px; font-size: 16px; }
.clash-subtitle { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; }
.clash-divider { width: 100%; max-width: 400px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); margin-bottom: 20px; }

/* DAILY CARD */
.daily-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; padding: 20px; width: 100%; max-width: 400px; margin-bottom: 20px; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
[data-theme="light"] .daily-card { background: rgba(0,0,0,0.02); box-shadow: inset 0 0 20px rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
.daily-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.daily-header-title { font-size: 11px; color: var(--text-dim); font-weight: 700; letter-spacing: 1px; }
.daily-date-picker { background: rgba(0,0,0,0.3); border-radius: 16px; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
[data-theme="light"] .daily-date-picker { background: rgba(255,255,255,0.5); }
.daily-date-text { font-weight: 900; color: var(--text-main); font-size: 15px; }

/* TILES (KAFELKI) */
.daily-tiles-container { display: flex; justify-content: flex-start; gap: 8px; margin-top: 10px; }
.daily-tile { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); }
.daily-tile.win { background: linear-gradient(135deg, #00ff66 0%, #00cc52 100%); box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 0 10px rgba(0, 255, 102, 0.4); }
.daily-tile.loss { background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%); box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 0 10px rgba(255, 51, 51, 0.4); }
.daily-tile.draw { background: linear-gradient(135deg, #ffcc00 0%, #cca300 100%); box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 0 10px rgba(255, 204, 0, 0.4); }

/* CLASH MENU */
.clash-history-card { background: rgba(255,255,255,0.03); border-radius: 16px; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 400px; margin-bottom: 30px; border: 1px solid rgba(255,255,255,0.05); }
.clash-history-title { font-size: 11px; color: var(--text-dim); font-weight: 700; letter-spacing: 1px; }
.history-btn { background: rgba(255,255,255,0.1); border-radius: 8px; padding: 5px 10px; }
.rank-badge { background: rgba(0,0,0,0.2); padding: 4px 10px; border-radius: 8px; font-size: 11px; }
.lowercase-opacity { font-size: 10px; opacity: 0.8; text-transform: none; }

/* UTILITY BUTTONS (BRAK ZAWODNIKA / BŁĄD) */
.utility-btn { flex: 1; font-size: 11px; color: var(--text-dim); background: rgba(255,255,255,0.02); padding: 8px; border-radius: 12px; border: 1px solid var(--border-color); cursor: pointer; transition: 0.2s; font-weight: 700; text-transform: uppercase; }
.utility-btn.hint-hover:hover { color: var(--accent); border-color: var(--accent); }
.utility-btn.bug-hover:hover { color: var(--red-neon); border-color: var(--red-neon); }

/* AKTUALIZACJE / CHANGELOG */
.update-badge { display:none; position:absolute; top:-2px; right:-2px; background:var(--red-neon); width:12px; height:12px; border-radius:50%; box-shadow: 0 0 8px var(--red-neon); }
.update-block { background: rgba(0, 0, 0, 0.2); border-left: 4px solid var(--accent); padding: 15px; margin-bottom: 15px; border-radius: 0 12px 12px 0; }
.update-version { font-weight: 900; color: var(--accent); font-size: 16px; margin-bottom: 4px; }
.update-date { font-size: 10px; color: var(--text-dim); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.update-list { font-size: 13px; color: var(--text-main); padding-left: 20px; line-height: 1.6; margin: 0; }
.update-list li { margin-bottom: 6px; }
.update-list li::marker { color: var(--accent); }
.updates-modal { max-width: 500px; text-align: left; max-height: 85vh; display: flex; flex-direction: column; }
.updates-list-container { overflow-y: auto; flex: 1; padding-right: 10px; }

/* ============================================== */
/* ====== KALENDARZ ARCHIWUM DAILY ============= */
/* ============================================== */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 15px;
    font-weight: 900;
    color: var(--text-dim);
    text-transform: uppercase;
}
.calendar-grid-real {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
}
.cal-day:not(.empty):not(.disabled):hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.2);
}
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.disabled { opacity: 0.2; cursor: not-allowed; }
.cal-day.win { background: rgba(0, 255, 102, 0.15); border-color: var(--green-neon); color: var(--green-neon); }
.cal-day.loss { background: rgba(255, 51, 51, 0.15); border-color: var(--red-neon); color: var(--red-neon); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ============================================== */
/* ====== WYGLĄD RANG W "JAK GRAĆ" (CLASH) ====== */
/* ============================================== */
.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 14px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rank-item:hover { transform: translateY(-3px); }
.rank-item .rank-icon { height: 28px; margin-right: 10px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); vertical-align: middle; }
.rank-item span { display: flex; align-items: center; }

/* Kolory poszczególnych lig */
.rank-item.bronze { border-left: 4px solid #b87333; }
.rank-item.bronze:hover { box-shadow: 0 5px 15px rgba(184, 115, 51, 0.3); }
.rank-item.silver { border-left: 4px solid #d8d8d8; }
.rank-item.silver:hover { box-shadow: 0 5px 15px rgba(216, 216, 216, 0.3); }
.rank-item.gold { border-left: 4px solid #f1c40f; }
.rank-item.gold:hover { box-shadow: 0 5px 15px rgba(241, 196, 15, 0.3); }
.rank-item.emerald { border-left: 4px solid #2ecc71; }
.rank-item.emerald:hover { box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3); }
.rank-item.diamond { border-left: 4px solid #3498db; }
.rank-item.diamond:hover { box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3); }
.rank-item.legend { 
    background: linear-gradient(135deg, rgba(155,89,182,0.15), rgba(231,76,60,0.15)); 
    border: 1px solid #e74c3c; 
    border-left: 4px solid #e74c3c; 
    padding: 15px 20px;
}
.rank-item.legend:hover { box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4); }
.text-legend { 
    background: linear-gradient(90deg, #9b59b6, #e74c3c, #f1c40f); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* ============================================== */
/* ====== NOWE MENU DESKTOP (PC ONLY) =========== */
/* ============================================== */

/* Ukrywamy stare mobilne menu na desktopie (Tylko dla szerokich ekranów!) */
@media (min-width: 769px) {
    #mainMenuContainer {
        display: none !important; 
    }
}


/* Gładkie usunięcie standardowego tła z body, bo ładujemy zdjęcia z JS */
body {
    background-color: var(--bg-dark);
}

/* GŁÓWNY KONTENER MENU */
.desktop-menu-wrapper {
    display: grid;
    /* Tabela wyników bierze dla siebie twardo połowę ekranu (albo mniej jeśli to duży monitor) */
    grid-template-columns: 1fr max(450px, 40%); 
    gap: 40px; 
    
    width: 100vw;
    min-height: 100vh;
    padding: 40px 5vw; 
    box-sizing: border-box;
    align-content: center;
    justify-content: space-between;
    position: relative;
    z-index: 5;
    margin: 0 auto;
    max-width: 1400px; 
}

/* LEWA STRONA */
.desktop-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: auto; 
    padding-right: 40px; 
    position: relative;
}

.desktop-logo {
    font-size: clamp(60px, 6vw, 80px); /* Skaluje się ładnie na małych laptopach */
    line-height: 0.85;
    margin: 0 0 40px 0;
    color: #fff;
    text-shadow: 0 5px 15px rgba(0,0,0,0.8);
    letter-spacing: -2px;
}
.logo-sub {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    font-style: italic;
    letter-spacing: 2px;
    display: block;
    margin-top: 10px;
}

.desktop-nav {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Delikatnie zmniejszony gap */
}

.nav-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    width: max-content;
}

.nav-main {
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 900;
    color: rgba(255,255,255,0.5);
    transition: 0.2s;
    letter-spacing: 1px;
    padding-right: 15px;
}

.nav-main:hover, .nav-item.group:hover .nav-main {
    color: #fff;
    transform: translateX(10px);
    text-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.nav-main.text-clash:hover {
    color: #3399ff;
    text-shadow: 0 0 15px #ff3333;
}

/* ROZWIJANE SUBMENU JAKO AKORDEON (W DÓŁ) */
.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    /* Zmiana z calc(100% + 20px) na 100% i dodanie paddingu tworzy "niewidzialny most" dla kursora */
    left: 100%; 
    padding-left: 20px; 
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.nav-item.group:hover .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: all;
}

.nav-sub span {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 900;
    color: rgba(255,255,255,0.5);
    transition: 0.2s;
    cursor: pointer;
}

.nav-sub span:hover {
    color: var(--accent);
    transform: translateX(10px);
}

.nav-divider {
    height: 20px;
}

.desktop-footer-links {
    margin-top: 30px; /* Zmienione na zwykły margines, by nie zjadały ekranu z dołu */
    display: flex;
    gap: 20px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}
.desktop-footer-links span { cursor: pointer; transition: 0.2s; }
.desktop-footer-links span:hover { color: #fff; }

.update-badge-desktop {
    display: inline-block;
    width: 12px; height: 12px;
    background: var(--red-neon);
    border-radius: 50%;
    margin-left: 5px;
    box-shadow: 0 0 10px var(--red-neon);
}

/* PRAWA STRONA - LEADERBOARD */
.desktop-right {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 700px; 
}

/* KARTA TABELI */
.desktop-leaderboard-panel {
    background: rgba(40, 40, 45, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    height: 70vh; 
    min-height: 450px; 
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.desktop-leaderboard-panel h2 {
    font-size: 32px;
    color: var(--accent);
    margin: 0 0 20px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.desktop-table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}
.desktop-table-wrapper::-webkit-scrollbar { width: 4px; }
.desktop-table-wrapper::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.desktop-table {
    width: 100%;
    text-align: center; /* Wyśrodkowanie danych w tabeli */
    font-size: 15px;
}
.desktop-table th { color: rgba(255,255,255,0.5); font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.desktop-table td { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-weight: 600; }
.desktop-table tr:hover td { background: rgba(255,255,255,0.05); }

/* Wymuszamy, aby TYLKO kolumna z Nickiem (druga) trzymała się lewej strony */
.desktop-table th:nth-child(2), 
.desktop-table td:nth-child(2) { 
    text-align: left; 
}

.desktop-rank-tabs {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    font-weight: 900;
    font-size: 14px;
    color: rgba(255,255,255,0.3);
}
.d-tab { cursor: pointer; transition: 0.2s; }
.d-tab:hover, .d-tab.active { color: var(--accent); }

/* ============================================== */
/* ====== GAME HEADER & INPUT =================== */
/* ============================================== */
.game-header { text-align: center; margin-bottom: 25px; position: relative; width: 100%; max-width: 1150px; }
.game-title-small { font-weight: 900; font-size: 28px; text-transform: uppercase; margin: 0; background: linear-gradient(to bottom, #fff 0%, #888 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .game-title-small { background: linear-gradient(to bottom, #000 0%, #666 100%); background-clip: text; -webkit-background-clip: text; }
#gameModeDisplay { color: var(--accent); margin: 5px 0 0 0; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.game-daily-controls { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 10px; }

.input-section { margin-bottom: 20px; text-align: center; width: 100%; max-width: 600px; margin-left: auto; margin-right: auto;}
.search-box { display: flex; gap: 24px; justify-content: center; align-items: center; width: 100%; position: relative; }
.input-wrapper { position: relative; flex: 1; transition: 0.3s; width: 100%; max-width: 100%; box-sizing: border-box; z-index: 2;}
input { padding: 15px 25px; font-size: 16px; width: 100%; border-radius: 14px; border: 2px solid var(--border-color); background: var(--input-bg); color: var(--text-main); outline: none; transition: 0.3s; box-sizing: border-box;}
input::placeholder { color: var(--text-dim); }
button { padding: 15px 30px; background: var(--accent); color: #000; border: none; border-radius: 14px; cursor: pointer; font-weight: 900; text-transform: uppercase; z-index: 2;}

/* --- PRZYCISKI BOCZNE (POWER-UPY) --- */
.hint-btn, .giveup-btn {
    position: absolute;
    width: 52px; /* Idealny kwadrat */
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(20, 20, 25, 0.8); /* Ciemne, szklane tło */
    backdrop-filter: blur(5px);
    border-radius: 14px;
    font-size: 22px; /* Większa ikona */
    padding: 0;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Sprężysta animacja */
    cursor: pointer;
}

.hint-btn { 
    left: -70px; 
    border: 2px solid var(--accent); 
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.15);
}
.hint-btn:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(241, 196, 15, 0.15);
    box-shadow: 0 8px 25px rgba(241, 196, 15, 0.4);
}

.giveup-btn { 
    right: -70px; 
    border: 2px solid var(--red-neon); 
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.15);
}
.giveup-btn:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(255, 51, 51, 0.15);
    box-shadow: 0 8px 25px rgba(255, 51, 51, 0.4);
}

/* AUTOCOMPLETE */
.autocomplete-items { position: absolute; top: 100%; left: 0; right: 0; border: 1px solid var(--border-color); border-radius: 14px; background-color: var(--card-bg); z-index: 99; max-height: 200px; overflow-y: auto; margin-top: 5px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.autocomplete-items::-webkit-scrollbar { width: 8px; }
.autocomplete-items::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.4); border-radius: 4px; }
.autocomplete-items div { padding: 12px 20px; cursor: pointer; border-bottom: 1px solid var(--border-color); color: var(--text-main); text-align: left; font-size: 15px; transition: background 0.2s; }
.autocomplete-items div:last-child { border-bottom: none; }
.autocomplete-items div:hover { background-color: rgba(241, 196, 15, 0.2); color: var(--accent); font-weight: 600; }

/* MAIN CARD (INFO) - Default Mobile */
.main-card { background: var(--card-bg); width: 100%; max-width: 1150px; border-radius: 32px; padding: 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.4); border: 1px solid var(--border-color); backdrop-filter: blur(10px); box-sizing: border-box; }
.header-section { display: flex; align-items: center; gap: 30px; margin-bottom: 25px; width: 100%; box-sizing: border-box; }
.photo-container { width: 120px; height: 140px; flex-shrink: 0; border: 2px solid rgba(128,128,128,0.3); border-radius: 20px; display: flex; justify-content: center; align-items: center; background: var(--photo-bg-gradient); overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.2); font-size: 80px; font-weight: 900; color: var(--photo-text-color); transition: background 0.3s ease; }
.photo-container.revealed { background: #ffffff; border-color: #cacaca; }
.photo-container img { width: 100%; height: 100%; object-fit: contain; }
.info-container { flex: 1; min-width: 0; box-sizing: border-box; }
.info-container h2 { margin: 0 0 10px 0; font-size: 32px; font-weight: 900; transition: color 0.3s; }
.team-path { display: flex; align-items: center; gap: 15px; font-size: 13px; color: var(--text-dim); text-transform: uppercase; width: 100%; min-width: 0; }
.path-label { flex-shrink: 0; }
.path-boxes { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; flex: 1; min-width: 0; padding-bottom: 5px; }
.path-boxes::-webkit-scrollbar { height: 4px; }
.path-boxes::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.4); border-radius: 4px; }
.path-box { position: relative; width: 40px; height: 40px; background: var(--path-box-bg); border: 1px solid var(--path-box-border); border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 13px; font-weight: 900; transition: 0.3s; color: var(--text-main); flex-shrink: 0; }
.path-box.found { background-color: #25252a; border: 1px solid #f1c40f; color: #fff; }
[data-theme="light"] .path-box.found { background-color: #e0e0e5; border-color: #f1c40f; color: #000; }
.path-arrow { font-size: 16px; color: var(--path-box-border); flex-shrink: 0; }
.divider { border: none; border-top: 1px solid var(--divider-color); margin: 25px 0; }

/* TABELA I WYNIKI */
.table-wrapper { width: 100%; padding-bottom: 10px; }
.table-headers { display: flex; align-items: center; padding-bottom: 15px; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; text-align: center; }
.col-attr { width: 95px; padding: 0 5px; flex-shrink: 0; perspective: 1000px; cursor: help;} 
.col-name { width: 150px; text-align: left; flex-shrink: 0; padding-left: 10px;}
.col-clubs-header { flex: 1; text-align: center; padding-left: 20px; cursor: help;}
.guess-row { display: flex; align-items: center; width: 100%; background: rgba(128, 128, 128, 0.05); border: 1px solid var(--border-color); border-radius: 20px; padding: 12px 10px; margin-bottom: 12px; box-sizing: border-box;}
.attr-box { width: 65px; height: 65px; border-radius: 14px; background: var(--attr-box-bg); border: 2px solid var(--attr-box-border); display: flex; flex-direction: column; justify-content: center; align-items: center; font-weight: 900; color: white; margin: 0 auto; transition: background 0.2s, border-color 0.2s; text-align: center;}
.val-num { font-size: 20px; line-height: 1; }
.val-arrow { font-size: 14px; margin-top: 4px; line-height: 1; cursor: help; }
.status-icon { font-size: 26px; }
.tile-flag { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(128,128,128,0.2); object-fit: cover; }
.tile-flag-dual { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(128,128,128,0.2); display: flex; overflow: hidden; }
.flag-left { width: 50%; height: 100%; object-fit: cover; object-position: left center; border-right: 1px solid rgba(0,0,0,0.5); }
.flag-right { width: 50%; height: 100%; object-fit: cover; object-position: right center; }
.attr-box.green { background: rgba(0, 255, 102, 0.1); border-color: var(--green-neon); color: var(--green-neon); box-shadow: 0 0 15px rgba(0, 255, 102, 0.1); }
.attr-box.yellow { background: rgba(255, 204, 0, 0.1); border-color: #f1c40f; color: #f1c40f; box-shadow: 0 0 15px rgba(241, 196, 15, 0.1); }
.attr-box.red { background: rgba(255, 51, 51, 0.1); border-color: var(--red-neon); color: var(--red-neon); box-shadow: 0 0 15px rgba(255, 51, 51, 0.1); }
.attr-box.half { background: linear-gradient(135deg, rgba(0, 255, 102, 0.15) 0%, rgba(0, 255, 102, 0.1) 50%, rgba(255, 204, 0, 0.1) 50%, rgba(255, 204, 0, 0.15) 100%); border-top-color: var(--green-neon); border-left-color: var(--green-neon); border-bottom-color: var(--yellow-neon); border-right-color: var(--yellow-neon); }
.col-clubs { flex: 1; padding-left: 15px; display: flex; align-items: center; min-width: 0; perspective: 1000px;}
.clubs-path-container { height: 65px; width: 100%; border-radius: 14px; background: var(--club-path-bg); border: 2px solid var(--club-path-border); display: flex; align-items: center; padding: 0 10px; gap: 4px; overflow-x: auto; flex-wrap: nowrap; }
.clubs-path-container::-webkit-scrollbar { height: 4px; }
.clubs-path-container::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.4); border-radius: 4px; }
.club-logo-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: help;}
.club-divider { width: 2px; height: 25px; background: var(--divider-color); margin: 0 3px; flex-shrink: 0; border-radius: 2px; }
.club-abbr-box { width: 42px; height: 42px; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-weight: 900; font-size: 14px; transition: 0.3s; }
.club-match { background: rgba(0, 255, 102, 0.1); border: 1px solid var(--green-neon); box-shadow: 0 0 10px rgba(0, 255, 102, 0.2); color: var(--green-neon); }
.club-dim { background: rgba(128,128,128,0.1); border: 1px solid #444; color: var(--text-dim); opacity: 0.5; }
[data-theme="light"] .club-dim { background: rgba(0,0,0,0.05); border-color: #ccc; }
.club-special { border-style: dashed !important; font-size: 18px !important; background: rgba(128,128,128,0.05) !important; }
.club-match.club-special, .path-box.found.club-special { border-color: var(--green-neon) !important; background: rgba(0, 255, 102, 0.05) !important; box-shadow: none !important; }
[data-theme="light"] .club-special { background: rgba(0,0,0,0.02) !important; }
.loan-badge { position: absolute; top: -4px; right: -4px; background: #666; color: white; font-size: 9px; font-weight: 900; width: 16px; height: 16px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 1px solid #222; box-shadow: 0 2px 4px rgba(0,0,0,0.5); z-index: 5; }
/* OVERLAYS & MODALS */
.win-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); z-index: 9999; transition: opacity 0.2s ease; opacity: 0; }
.win-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: 100%; z-index: 10000; padding: 20px;}
.win-message h1 { font-size: clamp(50px, 10vw, 100px); font-weight: 900; margin: 0; }
.stats-modal { background: var(--card-bg); padding: 40px; border-radius: 20px; border: 1px solid var(--border-color); text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 20px 50px rgba(0,0,0,0.8); width: 90%; }
.stats-modal h2 { margin-top: 0; font-weight: 900; }
.modal-sm { max-width: 400px; }
.modal-md { max-width: 450px; }
.modal-lg { max-width: 550px; padding: 30px 15px; }
.app-modal { max-width: 430px; padding: 32px; }
.app-modal-message { color: var(--text-main); font-size: 15px; line-height: 1.5; font-weight: 600; margin: 12px 0 24px; white-space: normal; }

/* MODAL CONTENTS */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-box { background: var(--attr-box-bg); border: 1px solid var(--attr-box-border); padding: 15px; border-radius: 12px; display: flex; flex-direction: column; }
.stat-num { font-size: 32px; font-weight: 900; color: var(--text-main); }
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; font-weight: 600;}
.setting-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.setting-block label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.google-block { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 11px; color: var(--text-dim); font-weight: 700; text-transform: uppercase; }
.form-group input, .form-group textarea { padding: 12px; font-size: 14px; font-weight: 600; }
.form-group textarea { border-radius: 14px; border: 2px solid var(--border-color); background: var(--input-bg); color: var(--text-main); outline: none; resize: vertical; min-height: 70px; font-family: inherit; box-sizing: border-box; }

.theme-btn { padding: 8px 15px; font-size: 11px; border-radius: 8px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.theme-btn.light { background: #fff; color: #000; border: 1px solid #ccc; }
.theme-btn.dark { background: #222; color: #fff; border: 1px solid #444; }
.lang-flag { width: 32px; height: 24px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.3; transition: 0.3s; border: 2px solid transparent; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.lang-flag:hover { opacity: 0.7; transform: translateY(-2px); }
.lang-flag.active { opacity: 1; border-color: var(--accent); transform: scale(1.1); }
.btn-google { background: #4285F4; color: white; border: none; font-weight: 900; padding: 12px 20px; border-radius: 12px; cursor: pointer; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s; font-size: 13px; }
.btn-google:hover { background: #357ae8; transform: scale(1.02); }

/* ============================================== */
/* ====== OSIĄGNIĘCIA W PROFILU ================= */
/* ============================================== */
.achievements-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; overflow-y: auto; max-height: 180px; padding-right: 5px; }
.achievements-grid::-webkit-scrollbar { width: 4px; }
.achievements-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
.ach-badge { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 5px; background: rgba(0,0,0,0.3); border-radius: 12px; border: 1px solid var(--border-color); transition: 0.3s; }
.ach-badge.locked { opacity: 0.4; filter: grayscale(100%); background: rgba(0,0,0,0.1); }
.ach-badge:hover { transform: translateY(-2px); border-color: var(--accent); }
.ach-icon { font-size: 24px; margin-bottom: 5px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.ach-title { font-size: 10px; font-weight: 900; color: var(--accent); text-transform: uppercase; margin-bottom: 2px;}
.ach-desc { font-size: 8px; color: var(--text-dim); line-height: 1.2; }


/* ============================================== */
/* ====== UKŁAD GRY NA PC (WYŚRODKOWANY) ======== */
/* ============================================== */
@media (min-width: 1024px) {
    #gameContainer { 
        max-width: 1300px; /* Szerszy kontener, żeby tabela miała miejsce */
        width: 95%; 
        margin: 0 auto; 
    }

    /* Efekt szronionego szkła i pełna szerokość dla głównej karty */
    .glass-panel-centered { 
        background: rgba(26, 26, 30, 0.45) !important; 
        backdrop-filter: blur(15px); 
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255,255,255,0.1); 
        box-shadow: 0 25px 50px rgba(0,0,0,0.5); 
        padding: 40px; 
        width: 100%;
        max-width: 100% !important; 
        margin: 0 auto;
    }
    
    /* Ułożenie zdjęcia i danych obok siebie w poziomie */
    .header-section-centered {
        display: flex;
        flex-direction: row; 
        justify-content: center; 
        align-items: center; 
        gap: 40px; /* Duży, ładny odstęp między zdjęciem a danymi */
        margin-bottom: 40px;
    }

    /* Tekst i kluby wyrównane do lewej strony obok zdjęcia */
    .info-container-centered {
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .team-path-centered {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* Ścieżka klubów zaczyna się od lewej */
        gap: 10px;
    }

    .table-wrapper {
        width: 100%;
        overflow-x: auto; /* Włącz scrolla tylko gdy tabela nie mieści się na małym ekranie PC */
    }

    /* Ochrona przed zgnieceniem klubów */
    .guess-row { display: flex !important; flex-wrap: nowrap; }
    .col-name { flex-shrink: 0; }
    .col-attr { flex-shrink: 0; }
    .club-logo-wrapper { flex-shrink: 0; }

/* ============================================== */
    /* ===========  MODALE NA PC    ============= */
    /* ========================================== */

    /* 1. Szklany efekt dla wszystkich okienek (Profil, Ustawienia, Clash) */
    .stats-modal, #clashModeSelectContainer, #clashLobbyContainer, #clashLocalLobbyContainer {
        background: linear-gradient(135deg, rgba(30, 30, 35, 0.8) 0%, rgba(15, 15, 18, 0.95) 100%) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.1) !important;
    }

    /* 2. Przebudowa Profilu - Szeroki układ Dashboardu */
    #profileOverlay .stats-modal {
        max-width: 650px !important; /* Poszerzamy okno na PC */
        padding: 40px !important;
    }

    /* Statystyki w jednym rzędzie (4 kolumny zamiast 2) */
    #profileOverlay .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }

    /* Wygląd kart statystyk */
    .stat-box {
        background: rgba(0, 0, 0, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.05);
        transition: 0.3s;
    }
    .stat-box:hover {
        transform: translateY(-5px);
        border-color: var(--accent) !important;
        background: rgba(241, 196, 15, 0.1) !important;
        box-shadow: 0 10px 20px rgba(241, 196, 15, 0.2);
    }

    /* Wygląd kart osiągnięć i usunięcie scrolla */
    .achievements-grid {
        max-height: none !important; /* Pokazujemy wszystkie bez scrollowania */
        overflow: visible !important;
        gap: 15px !important;
    }
    
    .ach-badge {
        background: rgba(0, 0, 0, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 15px 10px !important;
    }
    .ach-badge:hover {
        transform: translateY(-5px) scale(1.05);
        border-color: var(--accent) !important;
        box-shadow: 0 10px 20px rgba(241, 196, 15, 0.2);
    }

    /* 3. Lepsze pola tekstowe (Zmiana nicku, zgłaszanie błędów) */
    .setting-block input, .form-group input, .form-group textarea {
        background: rgba(0, 0, 0, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    }
    .setting-block input:focus, .form-group input:focus, .form-group textarea:focus {
        border-color: var(--accent) !important;
        box-shadow: 0 0 10px rgba(241, 196, 15, 0.3) !important;
    }

    /* 4. Poprawka detali w Clash Menu */
    .clash-history-card {
        background: rgba(0, 0, 0, 0.5) !important;
        box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.05) !important;
    }

}

/* ========================================= */
/* --- RWD MOBILE (TELEFONY I TABLETY) --- */
/* ========================================= */

@media (max-width: 768px) {
    /* Ukryj menu desktopowe */
    #desktopMainMenu { display: none !important; }
    /* USUNIĘTO #mainMenuContainer { display: flex !important; } - dzięki temu gra sama ukryje to menu! */
    body { padding: 10px; overflow-x: hidden; }
    
    /* DODANE: Naprawa ułożenia menu trybu Clash (1 kolumna zamiast 2 na telefonie) */
    .desktop-menu-wrapper {
        grid-template-columns: 1fr !important;
        padding: 20px 10px !important;
        gap: 30px !important;
    }
    .desktop-left {
        padding-right: 0 !important;
        align-items: center;
        text-align: center;
    }
    .desktop-logo {
        font-size: 44px !important;
        margin-bottom: 20px !important;
    }
    .desktop-right {
        max-width: 100% !important;
    }
    .desktop-leaderboard-panel {
        height: auto !important;
        min-height: 350px !important;
        padding: 15px !important;
    }
    
    .menu-container { 
        padding: 25px 15px 35px 15px; 
        width: 100%; 
        max-width: 100%; 
        margin-top: 10px; 
        border-radius: 20px; 
        box-sizing: border-box; 
    }
    
    /* NAPRAWA IKONEK (Usunięcie nachodzenia na tytuł) */
    .top-right-buttons { 
        position: relative; 
        right: auto; 
        top: auto; 
        justify-content: center; 
        width: 100%; 
        margin-bottom: 20px; 
        z-index: 10; 
    }
    
    .game-header { 
        width: 100%; 
        max-width: 100%; 
        padding: 0 10px; 
        box-sizing: border-box; 
        padding-top: 10px; 
    }
    
    .game-title { font-size: 26px; margin-bottom: 10px; }
    .game-title-small { font-size: 20px; margin-top: 0; }
    .glow-title { font-size: 28px; }
    
    .search-box { flex-direction: column; width: 100%; gap: 10px; }
    .input-wrapper { width: 100%; flex: 1; }
    .search-box button { width: 100%; flex: none; }
    
    /* Zabezpieczenie przed absolutnymi przyciskami na mobile */
    .hint-btn, .giveup-btn {
        position: relative !important; 
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important; /* Reset wysokości z PC */
        padding: 12px !important;
        font-size: 16px !important; /* Reset rozmiaru ikonki */
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important; /* Wyłącza animację sprężystą na mobile */
    }
    
/* ======================================================== */
    /* PANCERNE KONTENERY - ZABEZPIECZENIE PRZED ROZPYCHANIEM */
    /* ======================================================== */
    
    /* Input - pole wyszukiwania */
    .input-section { 
        width: 100%; 
        max-width: 500px !important; /* Stała szerokość */
        margin: 0 auto 20px auto !important; /* Centrowanie na środku */
        padding: 0 10px; 
        box-sizing: border-box; 
    }

    /* Główna karta z pytajnikiem */
    .main-card { 
        padding: 15px; 
        border-radius: 20px; 
        width: 100%; 
        max-width: 500px !important; /* Stała szerokość */
        margin: 0 auto !important; /* Centrowanie na środku */
        box-sizing: border-box; 
        overflow: hidden; 
        min-width: 0; 
    }
    
    .header-section-centered { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-bottom: 20px; width: 100%; }
    .photo-container { width: 100px; height: 120px; margin: 0 auto; }
    .info-container-centered { width: 100%; max-width: 100%; box-sizing: border-box; text-align: center; }
    #mysteryName { font-size: 20px; text-align: center; margin: 0; line-height: 1.3; width: 100%; }
    .team-path-centered { width: 100%; display: block; text-align: center; margin: 0; }
    .path-label { display: block; margin-bottom: 8px; }

    /* SCROLL DLA GÓRNYCH KLUBÓW (POD ZNAKIEM ZAPYTANIA) */
    .path-boxes { 
        width: 100%; 
        overflow-x: auto; 
        display: flex; 
        flex-wrap: nowrap; 
        padding-bottom: 12px; 
        -webkit-overflow-scrolling: touch; 
        justify-content: flex-start; /* Ważne: psuło scrolla, teraz działa normalnie */
    }

    /* Usunięcie zepsutego centrowania z pseudo-elementów */
    .path-boxes::before, .path-boxes::after { display: none !important; }
    
    /* Blokada kurczenia = Wymuszenie poziomego scrolla! */
    .path-box, .path-arrow { flex-shrink: 0 !important; }
    .path-boxes::-webkit-scrollbar { height: 6px; }
    .path-boxes::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

    /* Modale i tabele */
    .post-game-actions { flex-direction: column; bottom: 10px; width: 95%; max-width: 95%; padding: 15px; }
    .post-game-actions button { width: 100%; margin-bottom: 8px; }
    .post-game-actions button:last-child { margin-bottom: 0; }
    .calendar-weekdays { font-size: 10px; }
    .cal-day { font-size: 12px; }
    .table-headers { display: none; } 
    .table-wrapper { width: 100%; max-width: 100%; }

    /* UKŁAD ODGADYWANIA - 3 WIERSZE (Grid) */
    .guess-row { 
        display: grid !important; 
        grid-template-columns: repeat(5, 1fr); 
        gap: 4px !important; /* Zmniejszony odstęp między kwadratami! */
        width: 100%; 
        max-width: 500px !important; /* Stała szerokość */
        margin: 0 auto 10px auto !important; /* Centrowanie wyniku */
        padding: 15px 10px; 
        box-sizing: border-box; 
        border-radius: 15px; 
        background: rgba(128, 128, 128, 0.05); 
        border: 1px solid var(--border-color); 
    }
    
    .col-name { grid-column: 1 / -1; width: 100%; text-align: center; padding: 0; font-size: 16px; font-weight: 900; margin-bottom: 5px; }
    .col-attr { width: 100%; padding: 0; display: flex; justify-content: center; }
    
    /* Zmniejszenie kwadratów atrybutów */
    .attr-box { 
        width: 100%; 
        max-width: 50px !important; 
        height: 50px !important; 
        border-radius: 10px; 
        padding: 2px; 
        margin: 0 auto;
    }
    
    .val-num { font-size: 14px; }
    .status-icon { font-size: 16px; }
    .tile-flag, .tile-flag-dual { width: 36px !important; height: 36px !important; }

    /* SCROLL DLA DOLNYCH KLUBÓW (HISTORIA ODP) */
    .col-clubs { grid-column: 1 / -1; width: 100%; max-width: 100%; min-width: 0; padding: 0; margin-top: 5px; overflow: hidden; display: block; }
    
    .clubs-path-container { 
        width: 100%; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        display: flex; 
        flex-wrap: nowrap; 
        padding: 10px; 
        box-sizing: border-box; 
        border: 2px solid var(--border-color); 
        border-radius: 12px;
        justify-content: flex-start; /* Ważne dla poprawnego scrolla */
    }

    /* Usunięcie zepsutego centrowania z pseudo-elementów */
    .clubs-path-container::before, .clubs-path-container::after { display: none !important; }

    /* Blokada kurczenia = Wymuszenie poziomego scrolla! */
    .club-logo-wrapper, .club-divider { flex-shrink: 0 !important; }

    .clubs-path-container::-webkit-scrollbar { height: 8px; background: rgba(0,0,0,0.2); border-radius: 4px; }
    .clubs-path-container::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
    /* Clash Mobile Responsive */
    .clash-grid { grid-template-columns: 50px 1fr 1fr 1fr; gap: 4px; max-width: 100%; }
    .clash-screen { width: 100%; min-height: calc(100vh - 20px); margin-top: 0; padding: 16px 10px; border-radius: 18px; }
    .clash-cell { min-height: 50px; font-size: 10px; padding: 3px; }
    .clash-header-cell { font-size: 8px; padding: 3px; }
    .clash-player-name { font-size: 9px; }
    .clash-header { padding: 10px; flex-direction: column; gap: 8px; }
    .clash-player { width: 100%; text-align: center; font-size: 14px; }
    
    .stats-modal { width: 95%; max-width: 95%; padding: 25px 20px; max-height: 90vh; overflow-y: auto; }
    .app-modal-actions { flex-direction: column-reverse; }
    .input-section { width: 100%; max-width: 100%; padding: 0 10px; box-sizing: border-box; }
    
    .icon-btn { padding: 6px 10px; font-size: 18px; }
    .icon-btn-small { font-size: 16px; padding: 4px; }

    /* Zabezpieczenie przed absolutnymi przyciskami na mobile */
    .hint-btn, .giveup-btn {
        position: relative !important; 
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important; /* Reset wysokości z PC */
        padding: 12px !important;
        font-size: 16px !important; /* Reset rozmiaru ikonki */
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important; /* Wyłącza animację sprężystą na mobile */
    }
}

/* Wymuszenie nadpisania dla ligi i podsumowań na mobile i desktopie */
#btnLeagueMode #leagueRankDisplay { color: #111 !important; text-shadow: none !important; background: rgba(0, 0, 0, 0.1) !important; border: 1px solid rgba(0, 0, 0, 0.15) !important; margin: 4px 0 0 0 !important; padding: 6px 12px !important; box-shadow: none !important; }
#summaryScore { white-space: nowrap !important; min-width: 100px !important; text-align: center !important; flex-shrink: 0 !important; }
#summaryP1Name, #summaryP2Name { word-break: break-word; }
