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

:root {
    --bg: #f8f9fa;
    --card-bg: #fff;
    --text: #1a1a1a;
    --text-muted: #666;
    --accent: #2563eb;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    background: var(--bg);
    color: var(--text);
}

header { margin-bottom: 1rem; }
header h1 { font-size: 1.75rem; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* Navigation tabs */
nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover { color: var(--text); }

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Sections */
.section { display: none; }
.section.active { display: block; }
.section h2 { margin-bottom: 0.25rem; }
.section-desc { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }

/* Live stream */
#player {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
    aspect-ratio: 16/9;
}

.status { font-weight: 600; margin-top: 0.5rem; }
.status.live { color: #16a34a; }
.status.offline { color: #dc2626; }

/* Gallery grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.grid-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.grid-item video,
.grid-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.item-label {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Overlay / Modal */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay.hidden { display: none; }

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}

.overlay-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.overlay-content video,
.overlay-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius);
    display: block;
}

.overlay-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.overlay-info {
    color: #ccc;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

#recent-clips { margin-top: 1.5rem; }
#recent-clips h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

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

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

.hidden { display: none; }

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    header h1 { font-size: 1.4rem; }
}
