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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0e1a;
    color: #e8ecf5;
    line-height: 1.5;
}

header {
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    padding: 30px 20px;
    text-align: center;
    border-bottom: 3px solid #f5b800;
}

header h1 { font-size: 2em; margin-bottom: 5px; }
header .subtitle { color: #8892a6; margin-bottom: 20px; font-size: 1.1em; }

.stats-bar {
    display: flex; gap: 30px; justify-content: center; flex-wrap: wrap;
    margin-top: 20px;
}
.stat { font-size: 0.95em; color: #8892a6; }
.stat strong { color: #f5b800; font-size: 1.3em; margin-right: 5px; }

.filters {
    padding: 20px;
    background: #131824;
    border-bottom: 1px solid #2a3042;
    display: flex; flex-wrap: wrap; gap: 20px;
}

.filter-group {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.filter-group label { color: #8892a6; font-size: 0.9em; font-weight: 500; }
.filter-group label.checkbox-label { cursor: pointer; display: flex; align-items: center; gap: 6px; }

.filter-btn {
    background: #1a2030;
    color: #e8ecf5;
    border: 1px solid #2a3042;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.15s;
}
.filter-btn:hover { background: #232a3d; border-color: #3a4260; }
.filter-btn.active { background: #f5b800; color: #000; border-color: #f5b800; font-weight: 600; }

.drive-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.drive-buttons .filter-btn { padding: 4px 10px; font-size: 0.8em; }

input[type="text"] {
    background: #1a2030;
    color: #e8ecf5;
    border: 1px solid #2a3042;
    padding: 8px 14px;
    border-radius: 6px;
    width: 250px;
    font-size: 0.9em;
}
input[type="text"]::placeholder { color: #5a6480; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}

.card {
    background: #131824;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.card.hornets { border-color: #111; }
.card.hornets:hover { border-color: #333; }
.card.luciernagas { border-color: #1a4d8f; }
.card.luciernagas:hover { border-color: #2563eb; }
.card.highlight { border-width: 3px; }
.card.td { border-color: #f5b800; }
.card.int { border-color: #ef4444; }

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #000;
    display: block;
}

.card-body { padding: 12px 14px; }

.card-title {
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.card-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: 0.78em;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}
.badge.team-hornets { background: #000; color: #fff; border: 1px solid #333; }
.badge.team-luciernagas { background: #1e3a8a; color: #fff; }
.badge.drive { background: #1a2030; color: #8892a6; border: 1px solid #2a3042; }
.badge.half { background: #2a3042; color: #e8ecf5; }
.badge.kind-td { background: #f5b800; color: #000; }
.badge.kind-int { background: #ef4444; color: #fff; }

.card-timestamp {
    font-size: 0.75em;
    color: #5a6480;
    margin-top: 8px;
    font-family: 'SF Mono', Monaco, monospace;
}

.footer {
    padding: 20px;
    text-align: center;
    color: #5a6480;
    font-size: 0.85em;
}

/* Modal para video — RESPONSIVE */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;              /* ← permite scroll si no cabe */
    justify-content: center;
    align-items: flex-start;       /* ← top-align, no center (evita recorte superior) */
}
.modal.open { display: flex; }

.modal-content {
    max-width: 1200px;
    width: 100%;
    margin: auto;                  /* ← centra vertical solo si cabe */
    position: relative;
}

.modal video, .modal iframe {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 8px;
    display: block;
}

/* Video box responsive: no más alto que lo que deja ver todo */
.modal-video-wrapper,
.modal-video-container > div:has(iframe) {
    width: 100%;
    max-height: calc(100vh - 450px);   /* deja 450px para botones + info + padding */
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    position: relative;
    margin: 0 auto 12px auto;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: #f5b800;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    z-index: 10;
}

.modal-info {
    margin-top: 15px;
    color: #e8ecf5;
    flex-shrink: 0;
}

.modal-info h3 { margin-bottom: 8px; color: #f5b800; }

.modal-info .desc {
    white-space: pre-wrap;
    font-size: 0.85em;
    color: #b0b9cc;
    background: #1a2030;
    padding: 12px;
    border-radius: 6px;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'SF Mono', Monaco, monospace;
}

/* En pantallas chicas, video aún más pequeño */
@media (max-height: 800px) {
    .modal-video-wrapper,
    .modal-video-container > div:has(iframe) {
        max-height: calc(100vh - 400px);
    }
}

/* En mobile, ya se ve bien pero por si acaso */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    .modal-video-wrapper,
    .modal-video-container > div:has(iframe) {
        max-height: calc(100vh - 350px);
    }
}

/* Zoom bar en el modal */
.modal-zoom-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    margin-bottom: 12px;
    background: #131824;
    border-radius: 8px;
    min-height: 40px;
}

.modal-video-wrapper {
    width: 100%;
}
