:root {
    --lime: #d7f500;
    --red: #e31c20;
    --white: #f6f7f3;
    --muted: #aeb4aa;
    --panel: rgba(5, 8, 5, .88);
    --line: rgba(215, 245, 0, .28);
}

* {
    box-sizing: border-box;
}

/* Links gerais da Glenn Garage */
a {
    color: var(--lime);
    text-decoration: none;
    transition: color .18s ease, opacity .18s ease;
}

a:visited {
    color: #a8bd32;
}

a:hover {
    color: var(--white);
    text-decoration: underline;
}

a:active {
    color: var(--red);
}

html {
    background: #030503;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--white);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .70)),
        #030503 url("assets/site-bg.webp") center top / cover fixed no-repeat;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 18%, transparent 0 24%, rgba(0, 0, 0, .46) 73%),
        linear-gradient(90deg, rgba(0, 0, 0, .30), transparent 40%, rgba(0, 0, 0, .38));
}

.hero {
    width: 100%;
    background: #000;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 55px #000;
}

.hero img {
    display: block;
    width: 100%;
    height: auto;
}

main {
    width: 100%;
    max-width: none;
    padding: clamp(14px, 2vw, 32px);
}

.status-panel,
.card {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(5, 8, 5, .93), rgba(12, 16, 12, .84));
    box-shadow: 0 20px 65px rgba(0, 0, 0, .50);
    backdrop-filter: blur(10px);
}

.status-panel {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 64px;
    padding: 14px 20px;
    border-color: var(--line);
}

.lamp {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #888;
    box-shadow: 0 0 16px currentColor;
    flex: none;
}

.lamp.online {
    color: #35f15a;
    background: #35f15a;
}

.lamp.offline {
    color: var(--red);
    background: var(--red);
}

.lamp.waiting {
    color: var(--lime);
    background: var(--lime);
    animation: pulse 1.2s infinite;
}

.status-panel strong {
    color: var(--lime);
    letter-spacing: .10em;
    font-size: clamp(.82rem, 1.2vw, 1.1rem);
}

#liveMeta {
    margin-left: auto;
    color: var(--muted);
    font-size: .9rem;
    text-align: right;
}

.card {
    margin-top: clamp(20px, 2.8vw, 38px);
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: clamp(20px, 2.4vw, 34px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.section-head small,
.project small {
    color: var(--lime);
    font-weight: 900;
    letter-spacing: .22em;
}

.section-head h1,
.section-head h2,
.project h2 {
    margin: .35rem 0 0;
    line-height: 1.04;
}

.section-head h1 {
    font-size: clamp(1.7rem, 3.1vw, 3.1rem);
}

.section-head h2,
.project h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
}

.section-head a,
.photos,
.offline-panel a {
    color: #080a08;
    background: var(--lime);
    padding: 11px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.live-zone {
    background: rgba(0, 0, 0, .72);
}

.player-shell {
    position: relative;
    width: min(100%, 1800px);
    margin: clamp(14px, 2vw, 28px) auto 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 18px;
    background: #020302;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow:
        0 22px 70px #000,
        inset 0 0 0 1px rgba(215, 245, 0, .08);
    isolation: isolate;
}

/* Fundo exclusivo da área do player: muito escuro, forte blur e movimento.
   Quando o canal estiver offline, o iframe da Twitch é escondido,
   pois não é possível aplicar blur dentro do iframe da Twitch. */
.player-ambient {
    position: absolute;
    inset: -9%;
    z-index: 0;
    background: url("assets/player-bg.webp") center / cover no-repeat;
    filter: blur(20px) brightness(.66) saturate(.72);
    transform: scale(1.16);
    animation: ambientDrift 16s ease-in-out infinite alternate;
}

.player-ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .22) 48%, rgba(0, 0, 0, .74)),
        radial-gradient(circle at 50% 50%, transparent 0 28%, rgba(0, 0, 0, .55) 80%);
}

.twitch-player {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}

.twitch-player iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.player-shell.is-online .twitch-player {
    opacity: 1;
    visibility: visible;
}

.offline-panel {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(24px, 5vw, 70px);
    text-align: center;
    background: rgba(0, 0, 0, .24);
    transition: opacity .3s ease, visibility .3s ease;
}

.player-shell.is-online .offline-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.offline-logo {
    width: clamp(62px, 8vw, 110px);
    height: clamp(62px, 8vw, 110px);
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 0 22px rgba(215, 245, 0, .22));
}

.offline-kicker {
    color: var(--lime);
    font-size: .84rem;
    font-weight: 900;
    letter-spacing: .28em;
}

.offline-panel h2 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(1.6rem, 3.2vw, 3rem);
}

.offline-panel p {
    margin: 0 0 10px;
    max-width: 720px;
    color: #d5d9d3;
    line-height: 1.6;
}

.player-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, .74);
    color: var(--muted);
    transition: opacity .3s ease, visibility .3s ease;
}

.player-shell:not(.is-loading) .player-loading {
    opacity: 0;
    visibility: hidden;
}

.player-loading span {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .2);
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.note {
    margin: 0;
    padding: 13px 24px 22px;
    text-align: center;
    color: var(--muted);
}

.vod-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.8vw, 24px);
    padding: clamp(20px, 2.5vw, 34px);
}

.vod-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 17px;
    background: rgba(0, 0, 0, .72);
    transition: transform .2s ease, border-color .2s ease;
}

.vod-card:hover {
    transform: translateY(-3px);
    border-color: var(--line);
}

.vod-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #0a0a0a center / cover no-repeat;
    text-decoration: none;
}

.vod-thumb::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: white;
    background: rgba(0, 0, 0, .18);
    opacity: .78;
}

.vod-info {
    padding: 15px 17px 18px;
}

.vod-info b {
    display: block;
    color: var(--white);
    line-height: 1.25;
}

.vod-info span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: .86rem;
}

.loading {
    grid-column: 1 / -1;
    padding: 42px;
    text-align: center;
    color: var(--muted);
}

.project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: clamp(24px, 3vw, 44px);
}

.project p {
    max-width: 850px;
    color: #d6d9d3;
    line-height: 1.7;
}

.photos.disabled {
    opacity: .45;
    pointer-events: none;
}

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 35px 20px 48px;
    color: var(--muted);
}

footer b {
    font-size: 1.8rem;
    color: var(--lime);
}

footer small {
    margin-left: 12px;
}

@keyframes pulse {
    50% {
        opacity: .42;
        transform: scale(.78);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ambientDrift {
    from {
        transform: scale(1.16) translate3d(-1.6%, 0, 0);
    }
    to {
        transform: scale(1.23) translate3d(1.8%, -1.2%, 0);
    }
}

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

    .project {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-head a,
    .photos {
        white-space: normal;
        text-align: center;
        width: 100%;
    }

    #liveMeta {
        display: none;
    }

    .hero img {
        min-height: 150px;
        object-fit: cover;
        object-position: center;
    }

    .status-panel {
        align-items: flex-start;
    }

    .status-panel strong {
        line-height: 1.35;
    }

    footer {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        scroll-behavior: auto !important;
    }
}


/* Reprodução das transmissões gravadas dentro da própria Glenn Garage */
.vod-thumb {
    width: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.vod-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: clamp(14px, 3vw, 34px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.vod-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.vod-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(12px);
}

.vod-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1500px, 100%);
    max-height: calc(100vh - 28px);
    overflow: auto;
    border: 1px solid rgba(215, 245, 0, .30);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(5, 8, 5, .98), rgba(10, 14, 10, .97));
    box-shadow: 0 30px 110px #000;
}

.vod-modal-head {
    padding: 20px 60px 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.vod-modal-head small {
    color: var(--lime);
    font-weight: 900;
    letter-spacing: .20em;
}

.vod-modal-head h2 {
    margin: .35rem 0 0;
    font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.vod-modal-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    color: white;
    background: rgba(0, 0, 0, .65);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
}

.vod-modal-player {
    aspect-ratio: 16 / 9;
    min-height: 300px;
    background: #000;
}

.vod-modal-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 300px;
    border: 0;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .vod-modal {
        padding: 8px;
    }

    .vod-modal-dialog {
        border-radius: 15px;
    }

    .vod-modal-head {
        padding: 16px 52px 14px 16px;
    }

    .vod-modal-player {
        min-height: 225px;
    }
}


/* Links que funcionam como botões — não herdam cores de links comuns */
.section-head a,
.photos,
.offline-panel a {
    color: #080a08;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.section-head a:visited,
.photos:visited,
.offline-panel a:visited {
    color: #080a08;
}

.section-head a:hover,
.photos:hover,
.offline-panel a:hover {
    color: #080a08;
    background: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
}

.section-head a:active,
.photos:active,
.offline-panel a:active {
    color: #080a08;
    background: var(--lime);
    transform: translateY(0);
}

/* =========================================================
   RODAPÉ
   ========================================================= */

footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    padding: 28px 24px;
    color: var(--muted);
}

.footer-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-center b {
    font-size: 1.8rem;
    color: var(--lime);
}

.footer-center small {
    margin-left: 12px;
}


/* CONTADOR — independente, extremo esquerdo */

.online-visitors {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);

    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    white-space: nowrap;
}

.online-dot {
    color: #35f15a;
    margin-right: 5px;
}


/* =========================================================
   BOTÃO FLUTUANTE — VOLTAR AO TOPO
   ========================================================= */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border: 1px solid rgba(215, 245, 0, .35);
    border-radius: 50%;

    background: rgba(5, 8, 6, .88);
    color: var(--lime);

    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;

    box-shadow: 0 6px 22px rgba(0, 0, 0, .35);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);

    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        background .2s ease,
        border-color .2s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    color: #000;
    background: var(--lime);
    border-color: var(--lime);
    text-decoration: none;
    transform: translateY(-3px);
}


/* Mobile */

@media (max-width: 850px) {
    footer {
        flex-direction: column;
        gap: 16px;
    }

    .online-visitors {
        position: static;
        transform: none;
        align-self: flex-start;
    }

    .footer-center {
        width: 100%;
    }

    .back-to-top {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        font-size: 27px;
    }
}

/* =========================================================
   GLENN GARAGE — YOUTUBE
   ========================================================= */

.youtube-garage {
    width: 50%;
    max-width: 900px;
    margin: 35px auto 25px;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

.youtube-garage-link {
    display: block;
    width: 100%;
    max-width: 100%;
    text-decoration: none;
}

.youtube-garage-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 0;
    object-fit: contain;

    transition:
        transform 0.20s ease,
        filter 0.20s ease;
}

.youtube-garage-link:hover .youtube-garage-img {
    transform: scale(1.015);
    filter: brightness(1.08);
}


/* MOBILE */
@media (max-width: 768px) {

    .youtube-garage {
        width: 100%;
        max-width: none;
        margin: 20px auto 15px;
        padding: 10px;
    }

    .youtube-garage-link {
        width: 100%;
        max-width: 100%;
    }

    .youtube-garage-img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}