.twitch-page {
    --twitch-purple: #9147ff;
    --twitch-purple-dark: #5f20b8;
    --twitch-purple-soft: #bf94ff;
    --twitch-panel: #15121d;
    --twitch-panel-soft: #1d1828;
    --twitch-border: rgba(255, 255, 255, .1);
    --twitch-muted: #b9b2c5;

    display: grid;
    gap: 18px;
    width: 100%;
    min-width: 0;
    padding: clamp(10px, 2vw, 20px);
    color: #fff;
    background:
        radial-gradient(
            circle at 10% 0,
            rgba(145, 71, 255, .18),
            transparent 28%
        ),
        linear-gradient(145deg, #09080d, #15111e 56%, #09080d);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
    overflow: hidden;
}

.twitch-page *,
.twitch-page *::before,
.twitch-page *::after {
    box-sizing: border-box;
}

.twitch-page a {
    color: inherit;
    text-decoration: none;
}

.twitch-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    min-height: 230px;
    padding: clamp(22px, 4vw, 42px);
    background:
        linear-gradient(
            120deg,
            rgba(145, 71, 255, .32),
            transparent 45%
        ),
        linear-gradient(145deg, #211633, #100c17);
    border: 1px solid rgba(191, 148, 255, .24);
    border-radius: 21px;
    overflow: hidden;
}

.twitch-hero::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -110px;
    bottom: -190px;
    background: var(--twitch-purple);
    border-radius: 50%;
    opacity: .14;
    filter: blur(12px);
    pointer-events: none;
}

.twitch-hero__brand {
    display: grid;
    place-items: center;
    width: clamp(82px, 12vw, 124px);
    aspect-ratio: 1;
    background:
        linear-gradient(145deg, var(--twitch-purple), #6c2bd9);
    border: 2px solid rgba(255, 255, 255, .4);
    border-radius: 28px;
    box-shadow:
        0 18px 36px rgba(0, 0, 0, .34),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    transform: rotate(-5deg);
}

.twitch-hero__icon {
    color: #fff;
    font-size: clamp(44px, 7vw, 70px);
    font-weight: 900;
    transform: rotate(5deg);
}

.twitch-hero__content {
    position: relative;
    z-index: 1;
}

.twitch-kicker,
.twitch-panel__eyebrow {
    color: var(--twitch-purple-soft);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.twitch-hero h1 {
    margin: 5px 0 8px;
    font-size: clamp(2rem, 6vw, 4.2rem);
    line-height: 1;
}

.twitch-hero p {
    max-width: 680px;
    margin: 0;
    color: #d8d3df;
    font-size: clamp(.95rem, 2vw, 1.08rem);
    line-height: 1.65;
}

.twitch-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.twitch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 17px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    color: #fff;
    font-weight: 900;
    text-align: center;
    transition:
        transform .18s ease,
        filter .18s ease,
        border-color .18s ease;
}

.twitch-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.twitch-button--primary {
    background:
        linear-gradient(
            135deg,
            var(--twitch-purple-dark),
            var(--twitch-purple)
        );
    border-color: rgba(191, 148, 255, .48);
    box-shadow: 0 12px 26px rgba(90, 32, 177, .3);
}

.twitch-button--soft {
    background: rgba(255, 255, 255, .07);
}

.twitch-hero__channel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
    min-width: 150px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    text-align: center;
}

.twitch-hero__channel span {
    color: var(--twitch-muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.twitch-hero__channel strong {
    font-size: 1.06rem;
}

.twitch-panel {
    padding: clamp(16px, 3vw, 28px);
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .02),
            transparent
        ),
        var(--twitch-panel);
    border: 1px solid var(--twitch-border);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

.twitch-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.twitch-panel__header h2,
.twitch-community h2,
.twitch-info-card h2 {
    margin: 5px 0 0;
    color: #fff;
}

.twitch-panel__header p {
    margin: 7px 0 0;
    color: var(--twitch-muted);
    line-height: 1.55;
}

.twitch-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 11px;
    color: #e6d4ff;
    background: rgba(145, 71, 255, .11);
    border: 1px solid rgba(191, 148, 255, .3);
    border-radius: 999px;
    font-size: .77rem;
    font-weight: 900;
    white-space: nowrap;
}

.twitch-live-badge span {
    width: 8px;
    height: 8px;
    background: #ff335f;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 51, 95, .7);
}

.twitch-embed {
    position: relative;
    width: 100%;
    min-height: 620px;
    background: #09080c;
    border: 1px solid rgba(191, 148, 255, .25);
    border-radius: 16px;
    overflow: hidden;
}

.twitch-embed iframe {
    display: block;
    width: 100% !important;
    height: 620px !important;
    border: 0;
}

.twitch-embed__loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    padding: 24px;
    color: #fff;
    text-align: center;
}

.twitch-embed__loading small {
    color: var(--twitch-muted);
}

.twitch-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255, 255, 255, .14);
    border-top-color: var(--twitch-purple);
    border-radius: 50%;
    animation: twitch-spin .85s linear infinite;
}

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

.twitch-embed-error {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    padding: 16px;
    color: #ffd8e2;
    background: rgba(150, 0, 38, .18);
    border: 1px solid rgba(255, 71, 116, .3);
    border-radius: 13px;
    text-align: center;
}

.twitch-embed-error[hidden] {
    display: none;
}

.twitch-embed-error a {
    justify-self: center;
    margin-top: 4px;
    color: #fff;
    font-weight: 900;
    text-decoration: underline;
}

.twitch-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.twitch-info-card {
    min-width: 0;
    padding: 20px;
    background: var(--twitch-panel-soft);
    border: 1px solid var(--twitch-border);
    border-radius: 17px;
}

.twitch-info-card__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: rgba(145, 71, 255, .12);
    border: 1px solid rgba(191, 148, 255, .24);
    border-radius: 12px;
    font-size: 21px;
}

.twitch-info-card h2 {
    font-size: 1.06rem;
}

.twitch-info-card p,
.twitch-community p {
    margin: 8px 0 0;
    color: var(--twitch-muted);
    line-height: 1.7;
}

.twitch-community {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: clamp(20px, 4vw, 34px);
    background:
        linear-gradient(
            120deg,
            rgba(145, 71, 255, .19),
            rgba(145, 71, 255, .04)
        ),
        #15111d;
    border: 1px solid rgba(191, 148, 255, .22);
    border-radius: 19px;
}

.twitch-ad {
    padding: 14px;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    text-align: center;
}

@media (max-width: 820px) {
    .twitch-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .twitch-hero__channel {
        grid-column: 1 / -1;
        width: 100%;
    }

    .twitch-info-grid {
        grid-template-columns: 1fr;
    }

    .twitch-community {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .twitch-page {
        gap: 12px;
        padding: 8px;
        border-radius: 16px;
    }

    .twitch-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 22px 16px;
        text-align: center;
    }

    .twitch-hero__content {
        display: grid;
        justify-items: center;
    }

    .twitch-hero__actions {
        width: 100%;
        flex-direction: column;
    }

    .twitch-button {
        width: 100%;
    }

    .twitch-panel {
        padding: 14px;
        border-radius: 15px;
    }

    .twitch-panel__header {
        align-items: stretch;
        flex-direction: column;
    }

    .twitch-live-badge {
        align-self: flex-start;
    }

    .twitch-embed,
    .twitch-embed iframe {
        min-height: 660px;
        height: 660px !important;
    }
}
