:root {
    --bg: #f8fafc;          /* Lighter background */
    --text: #0f172a;        /* Darker text for better contrast */
    --card-bg: #ffffff;     /* Keep white cards */
    --card-border: #e2e8f0; /* Solid border color */
    --card-shadow: rgba(51, 65, 85, 0.1);
    --accent: #6366f1;      /* Brighter primary accent */
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;      /* Darker blue background */
        --text: #f1f5f9;    /* Light gray text */
        --card-bg: #1e293b; /* Lighter card background */
        --card-border: #334155; /* Visible card border */
        --card-shadow: rgba(0, 0, 0, 0.4);
    }
}

html {
    scroll-behavior: smooth;
}

body { 
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
    max-width: 1200px; 
    margin: 0 auto;
    padding: 2rem 1rem;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
.header {
    text-align: center;
    margin-bottom: 3rem;
}
.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #6366f1, #a855f7); /* Adjusted gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    animation: gradient 8s ease infinite;
    background-size: 200% auto;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.feeds { 
    list-style: none; 
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Changed from 160px */
    gap: 0.75rem; /* Changed from 1rem */
    padding: 0.75rem; /* Changed from 1rem */
    max-width: 100%;
}

@media (min-width: 640px) {
    .feeds {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Changed from 180px */
        gap: 1rem; /* Changed from 1.5rem */
    }
}

@media (min-width: 1024px) {
    .feeds {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Changed from 200px */
        gap: 1.25rem;
    }
}

.feeds li { 
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px -1px var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    aspect-ratio: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.feeds li:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px var(--card-shadow);
}

.feed-link { 
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    text-decoration: none;
    color: var(--text);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    transition: transform 0.2s ease;
}
.feed-icon {
    width: 100%;
    height: auto;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
    transform-origin: center;
}
.feed-link:hover .feed-icon {
    transform: scale(1.1);
}
.feed-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5em 0.75em 0.75em;
    margin: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #e0e0e0;
    text-shadow: 
        0px 0px 1px rgba(0,0,0,0.8),
        0px 0px 2px rgba(0,0,0,0.6);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-transform: capitalize;
}
@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px -1px var(--card-shadow);
    z-index: 1000;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 1.7s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}