:root {
    --bg: #09111f;
    --bg-strong: #050910;
    --panel: rgba(11, 19, 35, 0.88);
    --panel-border: rgba(124, 149, 184, 0.18);
    --text: #eef4ff;
    --muted: #94a7c4;
    --accent: #f7f4ea;
    --twitch: #9146ff;
    --youtube: #ff0000;
    --kick: #53fc18;
    --tiktok: #25f4ee;
    --ok: #73f0a8;
    --warn: #ffd166;
    --danger: #ff7b7b;
    --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background:
        radial-gradient(circle at top left, rgba(145, 70, 255, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(83, 252, 24, 0.12), transparent 26%),
        linear-gradient(160deg, #09111f 0%, #050910 65%, #020408 100%);
    color: var(--text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    overflow: hidden;
}

body {
    padding: 28px;
}

.app-shell {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hero {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: linear-gradient(140deg, rgba(14, 23, 41, 0.96), rgba(9, 15, 28, 0.88));
    box-shadow: var(--shadow);
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 1.85rem;
    line-height: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 9px;
}

.lite-tag {
    font-size: 0.6em;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    align-self: flex-end;
}

.header-logo {
    height: 1.6em;
    width: auto;
}

h2 {
    font-size: 1.15rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

/* The side column scrolls on its own so the app always fits the viewport,
   no matter how short the window is. */
.side-column {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 149, 184, 0.35) transparent;
    padding-right: 4px;
}

.side-column::-webkit-scrollbar {
    width: 6px;
}

.side-column::-webkit-scrollbar-thumb {
    background: rgba(124, 149, 184, 0.35);
    border-radius: 3px;
}

.side-column > .panel {
    flex-shrink: 0;
}

.panel {
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

/* All side-column section headers share the micro-label look. */
.side-column h2 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px 0;
}

.feed-panel > .panel-header {
    padding: 10px 14px 4px;
    gap: 10px;
}

.channels-panel .panel-header,
.controls-panel .panel-header {
    padding: 10px 16px 0;
}

.channels-form {
    display: grid;
    gap: 8px;
    padding: 10px 16px 14px;
}

.channel-field {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 8px;
}

.channel-clear {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: rgba(255, 59, 48, 0.18);
    color: #ff7b7b;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, transform 160ms ease;
}

.channel-clear:hover {
    background: rgba(255, 59, 48, 0.4);
    transform: scale(1.12);
}

.channel-clear.hidden {
    display: none;
}

.channel-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.channel-field[data-platform="twitch"] .channel-label {
    color: var(--twitch);
}

.channel-field[data-platform="youtube"] .channel-label {
    color: var(--youtube);
}

.channel-field[data-platform="kick"] .channel-label {
    color: var(--kick);
}

.channel-field[data-platform="tiktok"] .channel-label {
    color: var(--tiktok);
}

.channel-input {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.channel-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Same quiet style as the Clear chat button, in the "connected" green. */
.connect-button {
    margin-top: 4px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid rgba(115, 240, 168, 0.3);
    background: transparent;
    color: var(--ok);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease;
}

.connect-button:hover {
    background: rgba(115, 240, 168, 0.12);
}

.input-field {
    width: 100%;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 8, 15, 0.72);
    color: var(--text);
    padding: 10px 16px;
    font: inherit;
}

.controls-panel .filter-row {
    padding: 10px 16px 14px;
    gap: 8px;
}

.filter-row {
    padding: 20px 22px 22px;
}

.status-grid {
    display: grid;
    gap: 8px;
    padding: 10px 16px 16px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-detail {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--muted);
}

.status-dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--warn);
    box-shadow: 0 0 10px currentColor;
}

.status-dot.ok {
    background: var(--ok);
    color: var(--ok);
}

.status-dot.warn {
    background: var(--warn);
    color: var(--warn);
}

.status-dot.error {
    background: var(--danger);
    color: var(--danger);
}

.status-dot.idle {
    background: rgba(255, 255, 255, 0.25);
    color: transparent;
    box-shadow: none;
}

.about-panel {
    padding: 12px 16px;
    display: grid;
    gap: 10px;
}

.about-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--muted);
    text-decoration: none;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.about-link svg {
    height: 13px;
    width: auto;
}

.about-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.about-link.donate {
    border-color: rgba(255, 209, 102, 0.3);
    color: #ffd166;
}

.about-link.donate:hover {
    background: rgba(255, 209, 102, 0.1);
    color: #ffe199;
}

.about-credit {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.about-credit .heart {
    color: #ff3b3b;
}

.about-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.about-credit a:hover {
    color: var(--text);
}

.about-credit .heart {
    color: #ff5c8a;
}


.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ghost-button {
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    font: inherit;
    transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ghost-button:hover {
    transform: translateY(-1px);
}

.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font: inherit;
    font-size: 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.filter-button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.filter-button.active {
    color: var(--text);
}

.chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    transition: background 160ms ease, box-shadow 160ms ease;
}

.filter-button.active[data-platform="twitch"] {
    border-color: rgba(145, 70, 255, 0.45);
}

.filter-button.active[data-platform="twitch"] .chip-dot {
    background: var(--twitch);
    box-shadow: 0 0 8px var(--twitch);
}

.filter-button.active[data-platform="youtube"] {
    border-color: rgba(255, 0, 0, 0.5);
}

.filter-button.active[data-platform="youtube"] .chip-dot {
    background: var(--youtube);
    box-shadow: 0 0 8px var(--youtube);
}

.filter-button.active[data-platform="kick"] {
    border-color: rgba(83, 252, 24, 0.4);
}

.filter-button.active[data-platform="kick"] .chip-dot {
    background: var(--kick);
    box-shadow: 0 0 8px var(--kick);
}

.filter-button.active[data-platform="tiktok"] {
    border-color: rgba(37, 244, 238, 0.4);
}

.filter-button.active[data-platform="tiktok"] .chip-dot {
    background: var(--tiktok);
    box-shadow: 0 0 8px var(--tiktok);
}

.settings-rows {
    display: grid;
    gap: 10px;
    padding: 10px 16px 16px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.settings-label {
    font-size: 0.88rem;
    color: var(--text);
}

.font-size-value {
    color: var(--muted);
    font-size: 0.76rem;
    margin-left: 4px;
}

.font-slider {
    width: 92px;
    accent-color: var(--ok);
    cursor: pointer;
}

.switch {
    position: relative;
    width: 36px;
    height: 20px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #94a7c4;
    transition: transform 180ms ease, background 180ms ease;
}

.switch.active {
    background: rgba(115, 240, 168, 0.22);
    border-color: rgba(115, 240, 168, 0.5);
}

.switch.active::after {
    transform: translateX(16px);
    background: var(--ok);
}

.settings-action {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 123, 123, 0.22);
    background: transparent;
    color: var(--danger);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease;
}

.settings-action:hover {
    background: rgba(255, 59, 48, 0.12);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    text-decoration: none;
}

.small-button {
    padding: 6px 10px;
    font-size: 0.88rem;
}

.feed-panel {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.feed-panel > .panel-header {
    flex-shrink: 0;
}

.hype-train-bar {
    flex-shrink: 0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(145, 70, 255, 0.08);
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
    transition: opacity 500ms ease, max-height 500ms ease, padding 500ms ease;
}

.hype-train-bar.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 14px;
    border-bottom: none;
    pointer-events: none;
}

.hype-train-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 5px;
}

.hype-train-label {
    font-weight: 700;
    color: var(--text);
}

#ht-progress-text {
    color: var(--muted);
}

.hype-train-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.hype-train-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #9146ff, #ffd700);
    transition: width 400ms ease;
}

.feed-wrapper {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 4px 4px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.scroll-bottom {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    min-width: 36px;
    padding: 0 10px;
    height: 36px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid var(--panel-border);
    background: rgba(30, 40, 60, 0.9);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, opacity 220ms ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
    opacity: 1;
}

.scroll-bottom:hover {
    transform: translateX(-50%) scale(1.1);
    background: rgba(40, 55, 80, 0.95);
}

.scroll-bottom.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.message-card {
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: var(--chat-font, 1rem);
}

.message-card.mention {
    background: rgba(255, 92, 138, 0.1);
    border-color: rgba(255, 92, 138, 0.35);
}

.message-card:last-child {
    animation: fade-in 220ms ease;
}

.message-card.deleted {
    opacity: 0.72;
}

.message-card.deleted .message-text {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.message-card.deleted .emote {
    filter: grayscale(1);
    opacity: 0.5;
}

@property --twitch-rainbow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.message-card.system-notice {
    border: 2px solid transparent;
    background:
        linear-gradient(rgba(145, 70, 255, 0.08), rgba(145, 70, 255, 0.08)) padding-box,
        linear-gradient(#0d1626, #0d1626) padding-box,
        conic-gradient(
            from var(--twitch-rainbow-angle),
            rgba(255, 59, 59, 0.8), rgba(255, 177, 59, 0.8), rgba(245, 238, 58, 0.8), rgba(76, 217, 100, 0.8),
            rgba(52, 192, 255, 0.8), rgba(106, 92, 255, 0.8), rgba(255, 92, 209, 0.8), rgba(255, 59, 59, 0.8)
        ) border-box;
    animation: twitch-rainbow-spin 6s linear infinite;
}

@keyframes twitch-rainbow-spin {
    to { --twitch-rainbow-angle: 360deg; }
}

.system-notice-text {
    color: #fff;
}

.message-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.message-link:hover {
    text-decoration-thickness: 2px;
}

.message-topline {
    display: inline;
    line-height: 1;
    margin-bottom: 2px;
}

.platform-pill {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #fff;
    margin-right: 3px;
}

.platform-pill svg,
.platform-pill img {
    height: 16px;
    vertical-align: middle;
}

.platform-pill.twitch {
    background: rgba(145, 70, 255, 0.18);
}

.platform-pill.youtube {
    background: rgba(255, 0, 0, 0.16);
}

.platform-pill.kick {
    background: rgba(83, 252, 24, 0.18);
    color: #d7ffd0;
}

.platform-pill.tiktok {
    background: rgba(37, 244, 238, 0.14);
    color: #d6fdfb;
}

.message-time {
    color: var(--muted);
    font-size: 0.82rem;
    margin-right: 4px;
}

.badge {
    height: 16px;
    width: 16px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.source-streamer-avatar {
    height: 22px;
    width: 22px;
    border-radius: 999px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.author-name {
    font-weight: 700;
    white-space: nowrap;
}

.message-text {
    word-break: break-word;
    font-size: calc(var(--chat-font, 1rem) * 0.93);
}

.emote {
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}

.cheer-amount {
    font-weight: 700;
    font-size: 0.85em;
    vertical-align: middle;
    margin: 0 3px 0 1px;
}

.empty-state {
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1120px) {
    html, body {
        height: auto;
        overflow: auto;
    }

    .app-shell {
        height: auto;
    }

    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .hero,
    .side-column,
    .feed-panel {
        grid-column: 1;
        grid-row: auto;
    }

    /* Panels become grid items so the feed can sit between Settings and Status. */
    .side-column {
        display: contents;
    }

    .channels-panel { order: 1; }
    .controls-panel { order: 2; }
    .feed-panel { order: 3; }
    .status-panel { order: 4; }
    .about-panel { order: 5; }

    .feed-panel {
        height: calc(100vh - 80px);
        min-height: 400px;
        overflow: visible;
    }

    .feed {
        max-height: none;
    }
}

@media (max-width: 720px) {
    body {
        padding: 10px;
    }

    .hero {
        padding: 12px 16px;
        border-radius: 12px;
    }

    .panel {
        border-radius: 12px;
    }
}

/* --- Stream player (popout) --- */

.player-pane {
    flex-shrink: 0;
    background: #000;
    border-bottom: 1px solid var(--panel-border);
}

.player-pane.hidden {
    display: none;
}

.player-frame iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 55vh;
    border: none;
}

.player-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.player-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.55;
    transition: opacity 160ms ease;
}

.player-controls:hover {
    opacity: 1;
}

.player-sources {
    display: flex;
    gap: 6px;
}

.player-sources.hidden {
    display: none;
}

.player-toggle,
.player-source {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: rgba(30, 40, 60, 0.45);
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.player-toggle:hover,
.player-source:hover {
    transform: scale(1.1);
    background: rgba(40, 55, 80, 0.95);
}

.player-source svg,
.player-source img {
    height: 16px;
    width: auto;
    pointer-events: none;
}

.player-source {
    opacity: 0.55;
}

.player-source.active {
    opacity: 1;
}

.player-source.active[data-platform="twitch"] {
    border-color: rgba(145, 70, 255, 0.65);
}

.player-source.active[data-platform="kick"] {
    border-color: rgba(83, 252, 24, 0.55);
}

/* --- Alert sounds --- */

.alerts-edit {
    min-width: 30px;
    height: 24px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 160ms ease;
}

.alerts-edit:hover {
    background: rgba(255, 255, 255, 0.12);
}

.alerts-editor {
    display: grid;
    gap: 8px;
    padding: 2px 0 4px;
}

.alerts-editor.hidden {
    display: none;
}

.alerts-rows {
    display: grid;
    gap: 6px;
}

.alerts-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alerts-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
}

.alerts-input.invalid {
    border-color: rgba(255, 123, 123, 0.75);
}

.alerts-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.alerts-add-row {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease;
}

.alerts-add-row:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.alerts-apply {
    padding: 5px 14px;
    border-radius: 8px;
    border: 1px solid rgba(115, 240, 168, 0.3);
    background: transparent;
    color: var(--ok);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 160ms ease;
}

.alerts-apply:hover {
    background: rgba(115, 240, 168, 0.12);
}

.alerts-hint {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

/* In normal flow, so it pushes the feed down instead of covering it. */
.alerts-unlock {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: none;
    border-bottom: 1px solid rgba(255, 209, 102, 0.25);
    background: rgba(255, 209, 102, 0.1);
    color: var(--warn);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease;
}

.alerts-unlock:hover {
    background: rgba(255, 209, 102, 0.18);
}

.alerts-unlock.hidden {
    display: none;
}

.alert-frames {
    position: absolute;
    top: 0;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert-frames iframe {
    width: 1px;
    height: 1px;
    border: 0;
}

/* --- "More info" overlay ------------------------------------------------ */

.info-button {
    white-space: nowrap;
    font-size: 0.85rem;
}

.info-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(2, 6, 12, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.info-overlay.hidden {
    display: none;
}

.info-dialog {
    width: 100%;
    max-width: 560px;
    max-height: min(80vh, 640px);
    display: flex;
    flex-direction: column;
    animation: fade-in 180ms ease;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 0;
}

.info-close {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, color 160ms ease;
}

.info-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.info-body {
    padding: 10px 20px 20px;
    overflow-y: auto;
    display: grid;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 149, 184, 0.35) transparent;
}

.info-body h3 {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.info-body ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 5px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}

.info-body li::marker {
    color: var(--muted);
}

/* --- OBS overlay mode (/overlay) --- */

html.overlay-mode,
html.overlay-mode body {
    background: transparent;
}

html.overlay-mode .feed-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

html.overlay-mode .scroll-bottom,
html.overlay-mode .player-pane,
html.overlay-mode .player-controls,
html.overlay-mode .hype-train-bar,
html.overlay-mode .empty-state {
    display: none;
}

html.overlay-mode .feed {
    scrollbar-width: none;
}

html.overlay-mode .feed::-webkit-scrollbar {
    display: none;
}

/* Bottom-anchored, so an expiring card's removal never moves the rest. */
html.overlay-mode .feed {
    justify-content: flex-end;
}

html.overlay-mode .message-card {
    background: transparent;
    border: none;
    font-size: var(--overlay-font, 1rem);
    /* Crisp 1px outline (zero-blur shadows) for readability on stream content. */
    text-shadow:
        1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000,
        1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
    animation: overlay-fade 2500ms linear forwards;
}

html.overlay-mode .message-text {
    font-size: calc(var(--overlay-font, 1rem) * 0.93);
}

html.overlay-mode .badge {
    width: 1em;
    height: 1em;
}

html.overlay-mode .message-time {
    display: none;
}

html.overlay-align-right .message-card {
    text-align: right;
}

html.overlay-no-icons .platform-pill {
    display: none;
}

@keyframes overlay-fade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* --- Expand (?expand=1): the main page expands into the popout layout --- */

body[data-mode="main"] .player-controls {
    display: none;
}

html.expand-mode,
html.expand-mode body {
    height: 100%;
    overflow: hidden;
}

html.expand-mode body {
    padding: 0;
}

html.expand-mode .app-shell {
    max-width: none;
    height: 100%;
}

/* Promotes the feed panel to a direct flex child of the app shell. */
html.expand-mode .layout-grid {
    display: contents;
}

html.expand-mode .hero,
html.expand-mode .side-column,
html.expand-mode .feed-panel > .panel-header {
    display: none;
}

html.expand-mode .feed-panel {
    flex: 1;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

html.expand-mode .feed {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
}

/* Keeps the hype train percentage clear of the floating player/exit buttons. */
body[data-mode="popout"] .hype-train-bar {
    padding-right: 48px;
}

html.expand-mode .hype-train-bar {
    padding-right: 86px;
}

html.expand-mode .player-controls {
    display: flex;
}

.feed-panel.expand-anim {
    position: relative;
    z-index: 50;
    will-change: transform;
}

#expand-toggle {
    gap: 7px;
}

#expand-toggle svg {
    height: 12px;
    width: auto;
}

.expand-exit {
    border-color: rgba(255, 123, 123, 0.4);
    color: var(--danger);
}

.expand-exit:hover {
    background: rgba(255, 59, 48, 0.25);
}
