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

:root {
    --bg: #0f172a;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #3b82f6;
}

html,
body {
    overscroll-behavior-y: contain;
}

body {
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1f2937;
}

nav {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    max-width: 900px;
    margin: auto;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

nav::-webkit-scrollbar {
    display: none;
}

nav a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    color: var(--muted);
    flex-shrink: 0;
}

nav a:hover {
    background: var(--card);
    color: var(--text);
}

nav a.active {
    background: var(--accent);
    color: white;
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}

.content {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.featured {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    display: block;
    filter: brightness(70%);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.featured:hover {
    transform: scale(1.03) translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    filter: brightness(85%);
}

h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 700px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

.yt-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
}

.video-card {
    background: var(--card);
    padding: 10px;
    border-radius: 10px;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: scale(1.02);
}

.video-card .yt-wrapper,
.video-grid .yt-wrapper {
    aspect-ratio: 16 / 9;
    max-width: 100%;
}

.shorts-item {
    max-width: 420px;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    background: var(--bg);
}

.yt-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 10px 15px;
}

.video-title,
.shorts-title {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    padding: 0 10px;
}

.shorts-feed {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.shorts-item {
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    contain: layout size style;
}

.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.video-modal.hidden {
    display: none;
}

.video-modal-content {
    width: min(90vw, 600px);
    aspect-ratio: 9 / 16;
    background: #000;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.video-modal-content iframe {
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
}

@media (min-width: 1024px) {
    .shorts-feed {
        height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
        gap: 20px;
        padding: 20px 0;
        overflow: visible;
        scroll-snap-type: none;
        justify-content: center;
    }

    .shorts-item {
        height: auto;
        display: block;
        background: transparent;
    }

    .shorts-feed .yt-wrapper {
        max-width: 280px;
        aspect-ratio: 9 / 16;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .shorts-feed .yt-wrapper {
        max-width: 100%;
        border-radius: 0;
    }
}

