/* Override some base styles to allow scrolling and layout */
html {
    overflow: auto;
}

body {
    margin: 0;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

header.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

header.page-header h1 {
    font-size: 28px;
    margin: 0;
    color: rgb(235, 235, 235);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgb(225, 225, 225);
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.15);
    transition: background 120ms, border-color 120ms, color 120ms;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chip.active {
    border-color: rgb(255, 184, 119);
    background: rgba(255, 184, 119, 0.18);
    color: rgb(255, 214, 170);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.thumb {
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.25);
    display: block;
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
}

.title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: rgb(235, 235, 235);
    text-decoration: none;
    transition: color 120ms, text-decoration-color 120ms;
}

.card .title {
    cursor: pointer;
}

.card .title:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    color: rgb(255, 214, 170);
}

.meta {
    font-size: 12px;
    color: rgb(200, 200, 200);
    opacity: 0.9;
}

/* Actions (e.g., YouTube button) placed before tags */
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.yt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgb(230, 230, 230);
    text-decoration: none;
    transition: background 120ms, border-color 120ms, color 120ms;
}

.yt-btn:hover {
    background: rgba(255, 184, 119, 0.18);
    border-color: rgb(255, 184, 119);
    color: rgb(255, 214, 170);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgb(230, 230, 230);
    white-space: nowrap;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-row .label {
    opacity: 0.9;
}

.empty {
    opacity: 0.8;
    padding: 20px 0;
}

.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.backlink {
    font-size: 14px;
}

/* Event grouping styles */
.event-group {
    margin-top: 24px;
}

.event-title {
    margin: 24px 0 8px;
    font-size: 22px;
    color: rgb(240, 240, 240);
}

.event-theme {
    font-size: 14px;
    opacity: 0.9;
    margin-left: 8px;
    color: rgb(210, 210, 210);
}

.event-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    /* When there are too many games for one line, wrap to multiple lines */
}

.event-row .card {
    /* Make cards responsive so they can wrap to new lines */
    flex: 1 1 300px;
    max-width: 360px;
}

.participants-list {
    margin: 0;
    padding: 5px;
}

.participants-list li:before {
    content: "";
}

/* Simple video overlay */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none; /* shown via .open */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.video-overlay.open {
    display: flex;
}

.video-wrapper {
    position: relative;
    width: min(960px, 100%);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.video-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}