/* mechanic.stream — terminal-grade streaming dashboard */

:root {
    --stream-dark: #0e0e10;
    --card-surface: #18181b;
    --sidebar-surface: #26262c;
    --stream-white: #efeff1;
    --info-gray: #adadb8;
    --live-purple: #9147ff;
    --recording-red: #eb0400;

    --border-soft: rgba(255, 255, 255, 0.06);
    --border-stronger: rgba(255, 255, 255, 0.12);
    --hover-surface: rgba(255, 255, 255, 0.04);
    --purple-fade: rgba(145, 71, 255, 0.15);
    --purple-fade-strong: rgba(145, 71, 255, 0.28);
    --red-fade: rgba(235, 4, 0, 0.15);

    --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Fira Mono", "Menlo", "Consolas", monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--stream-dark);
    color: var(--stream-white);
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

input {
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: 0;
    outline: 0;
}

/* ---------- App layout ---------- */
.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-surface);
    border-right: 1px solid var(--border-soft);
    padding: 18px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--stream-dark);
    border-radius: 6px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-stronger);
    position: relative;
    overflow: hidden;
}

.brand-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(145, 71, 255, 0.08) 4px,
        rgba(145, 71, 255, 0.08) 5px
    );
}

.brand-dot {
    width: 10px;
    height: 10px;
    background: var(--recording-red);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(235, 4, 0, 0.18), 0 0 12px rgba(235, 4, 0, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
    z-index: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.brand-accent {
    color: var(--live-purple);
}

.brand-sub {
    font-family: var(--font-mono);
    color: var(--info-gray);
    font-size: 0.7rem;
    margin-top: 4px;
    letter-spacing: 0.03em;
}

.side-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.side-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--info-gray);
    padding: 4px 6px;
    font-weight: 600;
}

.side-heading-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--info-gray);
    letter-spacing: 0;
}

.side-heading-count.live-count {
    color: var(--live-purple);
}

.category-list,
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.category-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--stream-white);
}

.category-item:hover {
    background: var(--hover-surface);
}

.category-item.active {
    background: var(--purple-fade);
    color: var(--live-purple);
}

.cat-icon {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--info-gray);
}

.category-item.active .cat-icon {
    color: var(--live-purple);
}

.cat-name {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--info-gray);
}

.channel-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.channel-item:hover {
    background: var(--hover-surface);
}

.ch-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--avatar, var(--live-purple));
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.ch-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.ch-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-game {
    font-size: 0.7rem;
    color: var(--info-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--info-gray);
}

.ch-status.live {
    color: var(--recording-red);
}

.ch-status.offline {
    color: rgba(173, 173, 184, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Live dot */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--recording-red);
    box-shadow: 0 0 0 2px rgba(235, 4, 0, 0.15);
    animation: pulse 1.5s ease-in-out infinite;
    flex: none;
}

/* Sidebar chat */
.sidechat {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.18);
    padding: 8px 8px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    flex: 0 0 auto;
}

.chat-pulse {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--live-purple);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.chat-pulse .live-dot {
    background: var(--live-purple);
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.18);
}

.chat-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-msg {
    word-break: break-word;
    animation: chatIn 0.35s ease both;
}

.chat-user {
    color: var(--c, var(--live-purple));
    font-weight: 600;
    margin-right: 6px;
}

.chat-text {
    color: var(--stream-white);
}

.chat-input {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--stream-dark);
    border-radius: 4px;
    border: 1px solid var(--border-soft);
    margin-top: 4px;
}

.chat-prompt {
    font-family: var(--font-mono);
    color: var(--live-purple);
    font-size: 0.85rem;
    line-height: 1;
}

.chat-input input {
    width: 100%;
    font-size: 0.78rem;
    color: var(--stream-white);
}

.chat-input input::placeholder {
    color: var(--info-gray);
}

/* ---------- Main column ---------- */
.main {
    grid-column-start: 2;
    min-width: 0;
    padding: 18px 28px 12px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background:
        radial-gradient(ellipse at top right, rgba(145, 71, 255, 0.06), transparent 60%),
        var(--stream-dark);
}

/* Topbar */
.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

.search-box {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    background: var(--card-surface);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.search-box:focus-within {
    border-color: var(--live-purple);
    background: rgba(145, 71, 255, 0.05);
}

.search-icon {
    font-family: var(--font-mono);
    color: var(--info-gray);
    font-size: 0.95rem;
}

.search-field {
    font-size: 0.85rem;
    width: 100%;
    color: var(--stream-white);
}

.search-field::placeholder {
    color: var(--info-gray);
}

.search-hint {
    font-family: var(--font-mono);
    color: var(--info-gray);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    border: 1px solid var(--border-soft);
}

.topnav {
    display: flex;
    gap: 4px;
}

.topnav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--info-gray);
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.topnav-link:hover {
    color: var(--stream-white);
    background: var(--hover-surface);
}

.topnav-link.active {
    color: var(--live-purple);
    background: var(--purple-fade);
}

.status-readout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: var(--card-surface);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    overflow: hidden;
}

.readout-row {
    display: flex;
    flex-direction: column;
    padding: 6px 12px;
    border-right: 1px solid var(--border-soft);
    line-height: 1.1;
}

.readout-row:last-child {
    border-right: 0;
}

.readout-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--info-gray);
    letter-spacing: 0.12em;
}

.readout-val {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--stream-white);
    font-weight: 500;
    margin-top: 2px;
}

/* ---------- Featured stream ---------- */
.featured {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.player {
    position: relative;
    aspect-ratio: 16/9;
    max-height: 60vh;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    cursor: pointer;
}

.player-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(145, 71, 255, 0.18), transparent 55%),
        radial-gradient(circle at 75% 70%, rgba(235, 4, 0, 0.12), transparent 50%),
        linear-gradient(135deg, #18181b 0%, #0e0e10 60%, #1a1325 100%);
}

.player-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 3px
        );
    pointer-events: none;
    opacity: 0.7;
}

.player-overlay {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px;
}

.overlay-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.55);
    color: var(--stream-white);
    border: 1px solid var(--border-soft);
}

.live-badge {
    background: var(--recording-red);
    color: #fff;
    letter-spacing: 0.08em;
    border-color: transparent;
}

.live-badge .live-dot {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.category-pill {
    background: var(--purple-fade-strong);
    color: var(--live-purple);
    border-color: rgba(145, 71, 255, 0.35);
}

.resolution-pill {
    font-family: var(--font-mono);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.6);
    color: var(--info-gray);
}

.overlay-center {
    display: grid;
    place-items: center;
    flex: 1;
}

.play-btn {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(14, 14, 16, 0.55);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.08);
    background: rgba(145, 71, 255, 0.4);
    border-color: var(--live-purple);
}

.play-btn.playing .play-triangle {
    clip-path: polygon(20% 20%, 40% 20%, 40% 80%, 20% 80%, 60% 20%, 80% 20%, 80% 80%, 60% 80%);
}

.play-triangle {
    width: 32px;
    height: 32px;
    background: var(--stream-white);
    clip-path: polygon(35% 25%, 35% 75%, 70% 50%);
    transition: clip-path 0.2s ease, background 0.2s ease;
}

.play-btn:hover .play-triangle {
    background: #fff;
}

.overlay-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 38%;
    background: linear-gradient(90deg, var(--live-purple), var(--recording-red));
    border-radius: 2px;
    transition: width 0.3s linear;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--info-gray);
    letter-spacing: 0.04em;
}

.progress-meta .ts:last-child {
    color: var(--recording-red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Stream info */
.stream-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    padding: 4px 0;
}

.streamer-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: flex-start;
}

.streamer-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--avatar, var(--live-purple));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--recording-red);
    box-shadow: 0 0 0 1px var(--stream-dark), 0 0 18px rgba(235, 4, 0, 0.25);
}

.streamer-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.stream-title {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.01em;
}

.streamer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--info-gray);
}

.streamer-name {
    color: var(--stream-white);
    font-weight: 600;
}

.meta-sep {
    color: rgba(173, 173, 184, 0.4);
}

.cat-pill {
    background: var(--purple-fade);
    color: var(--live-purple);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    color: var(--info-gray);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.stream-desc {
    margin: 4px 0 0;
    color: var(--info-gray);
    max-width: 720px;
    font-size: 0.88rem;
}

.stream-info-side {
    display: grid;
    grid-template-columns: repeat(3, auto) auto;
    align-items: center;
    gap: 12px;
}

.info-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: var(--card-surface);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    min-width: 86px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--info-gray);
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: var(--stream-white);
    font-weight: 500;
    margin-top: 2px;
}

.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--live-purple);
    color: #fff;
    border-radius: 6px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.follow-btn:hover {
    background: #a163ff;
    transform: translateY(-1px);
}

.follow-btn.following {
    background: var(--card-surface);
    color: var(--live-purple);
    border: 1px solid var(--live-purple);
}

.follow-btn .heart {
    font-size: 1rem;
    line-height: 1;
}

/* ---------- Sections ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 16px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.section-tabs {
    display: flex;
    gap: 4px;
    background: var(--card-surface);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
}

.tab {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--info-gray);
    padding: 5px 12px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
    color: var(--stream-white);
}

.tab.active {
    background: var(--purple-fade);
    color: var(--live-purple);
}

.section-link {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--live-purple);
    transition: color 0.15s ease;
}

.section-link:hover {
    color: #b58dff;
}

/* ---------- Stream grid ---------- */
.stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.stream-card {
    background: var(--card-surface);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.stream-card:hover {
    transform: translateY(-2px);
    border-color: var(--live-purple);
    box-shadow: 0 6px 24px rgba(145, 71, 255, 0.16);
}

.stream-card.is-hidden {
    display: none;
}

.thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #18181b, #26262c);
    overflow: hidden;
}

.thumb-grad {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 35%, rgba(145, 71, 255, 0.22), transparent 50%),
        radial-gradient(circle at 75% 65%, rgba(235, 4, 0, 0.15), transparent 55%);
    transition: opacity 0.2s ease;
}

.thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: var(--live-purple);
    opacity: 0.3;
    clip-path: polygon(35% 25%, 35% 75%, 70% 50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.stream-card:hover .thumb-play {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.05);
}

.thumb-live {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--recording-red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1;
}

.thumb-live .live-dot {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.thumb-viewers {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--stream-white);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 3px;
}

.thumb-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--info-gray);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 3px;
}

.card-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px;
}

.card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--avatar, var(--live-purple));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.card-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--stream-white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-streamer {
    font-size: 0.78rem;
    color: var(--info-gray);
}

.card-tags {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* ---------- Recent list ---------- */
.recent-section .section-header {
    margin-bottom: 8px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-surface);
}

.recent-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.15s ease;
    cursor: pointer;
}

.recent-item:last-child {
    border-bottom: 0;
}

.recent-item:hover {
    background: rgba(145, 71, 255, 0.06);
}

.recent-time {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--live-purple);
}

.recent-title {
    font-size: 0.88rem;
    color: var(--stream-white);
}

.recent-meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--info-gray);
    text-align: right;
}

/* ---------- Bottom bar ---------- */
.bottombar {
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid var(--border-soft);
    background: var(--card-surface);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.78rem;
}

.bb-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--info-gray);
}

.bb-prompt {
    font-family: var(--font-mono);
    color: var(--live-purple);
}

.bb-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-soft);
    color: var(--info-gray);
    font-size: 0.74rem;
}

.bb-pill.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.bb-pill .live-dot {
    background: var(--live-purple);
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.18);
}

/* ---------- Animations ---------- */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

@keyframes chatIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flash {
    0% {
        background: rgba(145, 71, 255, 0.0);
    }
    30% {
        background: rgba(145, 71, 255, 0.18);
    }
    100% {
        background: rgba(145, 71, 255, 0.0);
    }
}

.viewer-flash {
    animation: flash 0.6s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 1fr auto;
    }
    .status-readout {
        display: none;
    }
}

@media (max-width: 880px) {
    .app {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
        padding: 14px;
    }
    .sidechat {
        margin-top: 0;
    }
    .main {
        grid-column-start: 1;
        padding: 16px;
    }
    .stream-info {
        grid-template-columns: 1fr;
    }
    .stream-info-side {
        grid-template-columns: repeat(3, 1fr) auto;
    }
    .topnav {
        display: none;
    }
    .topbar {
        grid-template-columns: 1fr;
    }
    .recent-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .recent-meta {
        text-align: left;
    }
}

@media (max-width: 540px) {
    .stream-info-side {
        grid-template-columns: repeat(3, 1fr);
    }
    .follow-btn {
        grid-column: span 3;
        justify-content: center;
    }
    .section-tabs {
        overflow-x: auto;
        max-width: 100%;
    }
}
