/*
  games.css — games section systems
  Contains Twitch schedule/status/countdown and highlights/clip player styling.
*/

/* === SCHEDULE PAGE === */
.section-heading {
    margin-bottom: 1.75rem;
}

.section-heading p {
    max-width: 720px;
}

.stream-status-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
    margin-top: 2rem;
}

.status-card,
.countdown-card,
.schedule-card,
.schedule-note-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
}

.status-card,
.countdown-card {
    padding: 1.35rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.status-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #777;
}

.is-live .status-dot {
    background: #35ff7a;
    box-shadow: 0 0 18px rgba(53, 255, 122, 0.75);
}

.is-offline .status-dot {
    background: #f2c96d;
    box-shadow: 0 0 16px rgba(242, 201, 109, 0.35);
}

.status-card h2,
.countdown-card h2 {
    margin: 0.9rem 0 0.4rem;
}

.status-copy,
.countdown-subcopy {
    margin-bottom: 1rem;
    opacity: 0.82;
}

.countdown-time {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-top: 1rem;
}

.countdown-unit {
    padding: 0.8rem 0.5rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    text-align: center;
}

.countdown-number {
    display: block;
    font-size: clamp(1.45rem, 4vw, 2.2rem);
    line-height: 1;
    font-weight: 800;
}

.countdown-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    opacity: 0.68;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.weekly-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
}

.schedule-card {
    position: relative;
    min-height: 160px;
    padding: 1rem;
    overflow: hidden;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.schedule-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(242, 201, 109, 0.55);
    opacity: 0.25;
}

.schedule-card.is-stream-day::before {
    opacity: 1;
}

.schedule-card.is-next {
    outline: 1px solid rgba(242, 201, 109, 0.65);
    box-shadow: 0 0 30px rgba(242, 201, 109, 0.12);
}

.schedule-card.is-today {
    z-index: 2;
    transform: scale(1.045);
    border-color: rgba(229, 204, 128, 0.75);
    background: rgba(242, 201, 109, 0.08);
    box-shadow:
        0 0 0 1px rgba(229, 204, 128, 0.35),
        0 0 34px rgba(229, 204, 128, 0.16);
}

.schedule-card.is-live-card {
    border-color: rgba(53, 255, 122, 0.85);
    box-shadow:
        0 0 0 1px rgba(53, 255, 122, 0.35),
        0 0 34px rgba(53, 255, 122, 0.18);
}

.live-badge {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.65rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(53, 255, 122, 0.14);
    color: #35ff7a;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.schedule-day {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
}

.schedule-time {
    margin: 0 0 0.35rem;
    font-weight: 700;
}

.schedule-theme {
    margin: 0;
    opacity: 0.8;
    font-size: 0.95rem;
}

.schedule-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.8rem;
}

.mini-tag {
    display: inline-flex;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    opacity: 0.86;
}

.schedule-note-card {
    margin-top: 1rem;
    padding: 1.1rem 1.25rem;
}

.schedule-note-card p {
    margin: 0;
    opacity: 0.82;
}

.twitch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.plain-link {
    opacity: 0.8;
}

@media (max-width: 980px) {
    .stream-status-panel {
        grid-template-columns: 1fr;
    }

    .schedule-card {
        min-height: auto;
    }
}

@media (max-width: 520px) {
    .countdown-time {
        grid-template-columns: repeat(2, 1fr);
    }

    .schedule-card.is-today {
        transform: none;
    }
}

.stream-live-meta {
    margin-bottom: 18px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(229, 204, 128, 0.22);
    border-radius: 14px;
    background: rgba(229, 204, 128, 0.07);
}

.stream-live-meta p {
    margin: 0.25rem 0 0;
    color: #ddd;
}

.stream-live-meta p + p {
    color: #aaa;
    font-size: 13px;
}

.clip-player {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(360px, 0.68fr);
    gap: 2.5rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 1.35rem;
}

.clip-player-frame {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(0,0,0,0.35);
}

.clip-player-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.clip-player-meta {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.15rem;
    min-height: 100%;
}

.clip-player-meta .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.clip-player-meta .tag {
    margin-bottom: auto;
}

.clip-player-meta h2 {
    max-width: 12ch;
    font-size: clamp(1.25rem, 1.9vw, 1.95rem);
    line-height: 1.02;
    margin: 0 0 0.75rem;
    letter-spacing: -0.04em;
}

.clip-player-meta p {
    margin-bottom: 0.35rem;
}

.clip-player-meta .button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 1rem;
    min-height: 40px;
    font-size: 13px;
    white-space: nowrap;
}

.clip-player-empty {
    grid-column: 1 / -1;
    padding: 3rem 2rem;
}

@media (max-width: 860px) {
    .clip-player {
        grid-template-columns: 1fr;
    }

    .clip-player-meta {
        padding: 0.25rem;
    }
}

.highlights-grid {
    --clip-card-width: 218px;

    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 0.35rem;
    padding-bottom: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.highlights-grid .clip-card {
    flex: 0 0 var(--clip-card-width);
    width: var(--clip-card-width);
}

.clip-card {
    cursor: pointer;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    min-height: 280px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.clip-card:hover,
.clip-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(222, 190, 95, 0.55);
}

.clip-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(222, 190, 95, 0.55);

    background:
        linear-gradient(
            135deg,
            rgba(222, 190, 95, 0.12),
            rgba(255,255,255,0.02)
        );

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 0 0 1px rgba(222,190,95,0.18),
        0 10px 30px rgba(0,0,0,0.35);
}

.clip-card::before {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clip-card.is-active::before {
    opacity: 1;
}
.clip-thumb {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.clip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.clip-card-body {
    margin-top: auto;
    padding: 0.9rem;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.clip-card-body .tag {
    margin-bottom: 0.6rem;
}


.clip-card-body h3 {
    margin-top: 0;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 0.35rem;
    overflow-wrap: anywhere;
}

.clip-card-body p {
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .highlights-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

@media (max-width: 900px) {
    .clip-player {
        grid-template-columns: 1fr;
    }
}

.clip-player-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    min-height: 100%;
    padding: 1rem;
}

.clip-player-empty h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    line-height: 1.05;
    margin: 0;
}

.clip-player-empty p {
    max-width: 42ch;
    opacity: 0.82;
}

.clip-card-fallback {
    pointer-events: none;
}

.clip-thumb-fallback {
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.04),
            rgba(255,255,255,0.015)
        );
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.clip-thumb-overlay {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 1rem;
}
