:root {
    --bg: #0f0f13;
    --nav: rgba(20, 20, 25, 0.60);
    --card: #18181c;
    --text: #ffffff;
    --text-muted: #a0a0b0;
    --border: rgba(255,255,255,0.05);
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.4);
    --accent-contrast: #000000; 
    --skeleton: #202025;
    --shadow: rgba(0,0,0,0.3);
}
body.light-mode {
    --bg: #f0f2f5;
    --nav: rgba(255, 255, 255, 0.60);
    --card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666;
    --border: rgba(0,0,0,0.05);
    --skeleton: #e0e0e0;
    --shadow: rgba(0,0,0,0.1);
}
body.amoled-mode {
    --bg: #000000;
    --nav: rgba(0, 0, 0, 0.70);
    --card: #000000;
    --text: #ffffff;
    --text-muted: #777777;
    --border: rgba(255, 255, 255, 0.1);
    --skeleton: #0a0a0a;
    --shadow: none;
}

html { font-size: 16px; transition: font-size 0.3s ease; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); margin: 0; padding-top: 60px; padding-bottom: 50px; overscroll-behavior-y: none; }
body.no-images .img-wrap { display: none !important; }
body.no-images .card { min-height: auto !important; }

.ptr-indicator {
    position: fixed; top: 55px; left: 0; width: 100%; text-align: center;
    color: var(--accent); font-weight: bold; font-size: 0.9rem; z-index: 50;
    transform: translateY(-50px); opacity: 0; transition: transform 0.2s, opacity 0.2s;
}
.ptr-indicator.visible { transform: translateY(10px); opacity: 1; }

.new-news-toast {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-100px);
    background: var(--accent); color: var(--accent-contrast); padding: 10px 20px; border-radius: 30px;
    font-weight: 600; font-size: 0.9rem; cursor: pointer; box-shadow: 0 4px 15px var(--accent-glow);
    z-index: 1001; opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    pointer-events: none;
}
.new-news-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

/* NAWIGACJA GŁÓWNA */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 48px; 
    background: var(--nav); backdrop-filter: blur(15px); border-bottom: 1px solid var(--border); 
    z-index: 1000; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; box-sizing: border-box;
}

.nav-left { display: flex; align-items: center; flex-shrink: 0; }
.nav-right { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 20px; width: auto; display: block; }

/* GŁÓWNY OBSZAR SCROLLA: Marginesy wpisane na sztywno zgodnie z życzeniem */
.nav-scroll {
    display: flex; overflow-x: auto; flex-grow: 1; height: 100%; min-width: 0;
    margin-left: 10px;  /* SZTYWNE ZLECENIE 5px */
    margin-right: 5px; 
    scrollbar-width: none; scroll-behavior: smooth;
}
.nav-scroll::-webkit-scrollbar { display: none; }

/* WEWNĘTRZNY POJEMNIK: Padding wpisany na sztywno zgodnie z życzeniem */
.nav-inner {
    display: flex; height: 100%; align-items: center;
    margin: 0 auto;
    padding-left: 0px; 
    padding-right: 66px; /* SZTYWNE ZLECENIE 90px */
}

.nav-item {
    font-family: 'Libre Baskerville', serif; padding: 6px 14px; margin: 0 4px; 
    cursor: pointer; color: var(--text-muted); font-weight: 700; font-size: 0.85rem; 
    border-radius: 20px; flex-shrink: 0; border: 1px solid transparent; transition: all 0.3s ease; user-select: none;
    position: relative; top: 1px;
}
@media (hover: hover) { .nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); } }

.nav-item.active {
    color: var(--accent); background: linear-gradient(0deg, var(--accent) -500%, transparent 100%);
    border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); 
}

.menu-btn { background: none; border: none; color: var(--text); font-size: 1.4rem; padding: 0 5px; margin: 0; cursor: pointer; display: block; }

/* PASEK Z ŚWIECĄCĄ POŚWIATĄ JAK W PASTYLCE (bez tła pod spodem) */
.progress-container { position: fixed; top: 48px; left: 0; width: 100%; height: 3px; z-index: 1001; background: transparent; pointer-events: none; }
.progress-bar { 
    height: 100%; background: var(--accent); width: 0%; 
    box-shadow: 0 0 15px var(--accent-glow); 
    transition: width 0.15s ease-out; border-radius: 0 3px 3px 0;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr; gap: 20px; min-height: 60vh; }
@media (min-width: 768px) { .container { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .container { grid-template-columns: repeat(3, 1fr); } }

.card { text-decoration: none; color: inherit; background: var(--card); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: 0 4px 15px var(--shadow); transition: box-shadow 0.3s ease, border-color 0.3s ease; }
@media (hover: hover) { .card:hover { box-shadow: 0 8px 30px -5px var(--accent-glow); border-color: var(--accent); } }

.img-wrap { width: 100%; height: 180px; position: relative; background: var(--skeleton); overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
@media (hover: hover) { .card:hover .card-img { transform: scale(1.08); } }

.placeholder-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--card); background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 20px 20px; }
.placeholder-icon { width: 80px; height: 80px; border-radius: 16px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }

.card.read { opacity: 0.5; filter: grayscale(0.8); }
.card-body { padding: 18px; flex-grow: 1; display: flex; flex-direction: column; }

.meta { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.7rem; color: var(--text-muted); }
.meta-source { 
    color: var(--accent); background: linear-gradient(0deg, var(--accent) -500%, transparent 100%); 
    border-color: var(--accent); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); 
    display: inline-flex; align-items: center; gap: 6px; 
    max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta-source span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.favicon { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.meta span:last-child { flex-shrink: 0; } 

.title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.desc { font-size: 0.85rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.highlight { color: var(--accent); background: rgba(255, 255, 255, 0.05); padding: 0 2px; border-radius: 4px; font-style: italic; }

.skeleton { background: var(--skeleton); animation: pulse 1.5s infinite; border-radius: 4px; }
.sk-img { width: 100%; height: 180px; border-radius: 0; }
.sk-title-line { height: 22px; margin-bottom: 10px; }
.sk-desc-line { height: 16px; margin-bottom: 8px; }
.w-80 { width: 80%; } .w-60 { width: 60%; } .w-40 { width: 40%; } .w-20 { width: 20%; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

/* MODAL USTAWIEŃ */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 2000;
    display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
    background: var(--card); border: 1px solid var(--border); padding: 20px; border-radius: 20px;
    width: 90%; max-width: 400px; max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: translateY(20px); transition: transform 0.3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-top:0; margin-bottom: 15px; font-size: 1.2rem; }
.setting-group { margin-bottom: 15px; }
.setting-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
.opt-btn-group { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.opt-btn {
    flex: 1; padding: 10px 5px; border: 1px solid var(--border); background: rgba(255,255,255,0.03);
    color: var(--text); border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: 0.2s; text-align: center; min-width: 60px;
    display: flex; align-items: center; justify-content: center;
}
.opt-btn:hover { background: rgba(255,255,255,0.1); }

.opt-btn.active { 
    background: var(--accent); 
    color: var(--accent-contrast); 
    border-color: var(--accent); 
    box-shadow: 0 0 10px var(--accent-glow); 
}

.color-dot { 
    width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-right: 6px; 
    border: 1px solid var(--text-muted); 
    vertical-align: middle; flex-shrink: 0;
}

.color-picker-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.03); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); margin-top: 10px;
}
.color-picker-wrapper input[type="color"] {
    border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; background: transparent; padding: 0; outline: none;
}
.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-wrapper input[type="color"]::-webkit-color-swatch { border: 2px solid var(--border); border-radius: 50%; }

.close-modal { width: 100%; padding: 12px; background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 10px; margin-top: 15px; cursor: pointer; font-weight: bold; }

/* LAYOUTY */
.layout-list { grid-template-columns: 1fr !important; }
.layout-list .card { flex-direction: row; height: auto; min-height: 140px; }
.layout-list .img-wrap { width: 35%; height: auto; min-height: 100%; }
.layout-list .card-body { width: 65%; padding: 15px; }
.layout-list .desc { -webkit-line-clamp: 2; }
@media (max-width: 480px) {
    .layout-list .img-wrap { width: 30%; } .layout-list .card-body { width: 70%; padding: 10px; } .layout-list .title { font-size: 1rem; }
}

.layout-compact { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.layout-compact .card { flex-direction: row; align-items: center; height: auto; padding: 10px; }
.layout-compact .img-wrap { width: 60px; height: 60px; border-radius: 8px; flex-shrink: 0; margin-right: 15px; }
.layout-compact .card-img { border-radius: 8px; }
.layout-compact .card-body { padding: 0; }
.layout-compact .meta, .layout-compact .desc { display: none; }
.layout-compact .title { margin: 0; font-size: 0.95rem; }

.layout-tinder {
    position: fixed !important; top: 48px; bottom: 0; left: 0; right: 0; width: 100%; height: auto !important;
    display: flex !important; flex-direction: column; justify-content: flex-start; align-items: center; 
    background: var(--bg); z-index: 50; overflow: hidden; padding: 0 !important; padding-bottom: 70px !important; box-sizing: border-box !important;
}
.layout-tinder .card { 
    display: none; width: 100%; max-width: 800px; height: 100%; max-height: 100%; 
    flex-direction: column; z-index: 1; margin: 0 auto; padding: 0; background: transparent; 
    box-shadow: none; border: none; border-radius: 0; box-sizing: border-box; align-self: center;
}
.layout-tinder .card.active-card { display: flex; z-index: 2; animation: fadeIn 0.3s ease; }
.layout-tinder .img-wrap { height: 250px; flex-shrink: 0; border-radius: 0; background: transparent; }
.layout-tinder .card-img { border-radius: 0; }
.layout-tinder .card-body { overflow-y: auto; padding: 20px; font-size: 1.15rem; line-height: 1.6; flex-grow: 1; }
.layout-tinder .desc { -webkit-line-clamp: unset; display: block; overflow: visible; font-size: 1rem; line-height: 1.5; }

.tinder-controls { display: none; position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%); width: 95%; max-width: 600px; z-index: 100; gap: 15px; }
.tinder-btn { flex: 1; height: 45px; border: 2px solid; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: bold; border-radius: 50px; background: rgba(255,255,255,0.05); backdrop-filter: blur(2px); transition: transform 0.2s; }
.tinder-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.15); }
.btn-prev { border-color: #ff4757; color: #ff4757; } 
.btn-next { border-color: #2ed573; color: #2ed573; } 
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }