/* ─── Channel Layout ─────────────────────── */
.channel-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: calc(100vh - 60px);
}

.channel-main {
    padding: 0 0 60px;
    overflow: hidden;
}

/* ─── Player ─────────────────────────────── */
.player-wrap {
    background: #000;
    border-bottom: 1px solid var(--border);
}

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 60px - 220px);
    margin: 0 auto;
    overflow: hidden;
    cursor: pointer;
}

.player-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, #2a2a35 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, #3a3a45 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0e 0%, #1a1a22 100%);
}

.player-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, transparent 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.player .live-badge {
    top: 14px;
    left: 14px;
}

.player .hero-viewers {
    top: 14px;
    right: 14px;
}

.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8));
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.player-ctrl {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.player-ctrl:hover {
    background: rgba(255,255,255,0.15);
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-bar {
    width: 0;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    overflow: hidden;
    transition: width 0.2s ease;
}

.player-volume:hover .volume-bar {
    width: 70px;
}

.volume-fill {
    height: 100%;
    width: 65%;
    background: var(--text-0);
}

.player-time {
    color: var(--text-0);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 4px;
    background: rgba(245,245,247,0.15);
    padding: 3px 8px;
    border-radius: 4px;
}

.player-spacer {
    flex: 1;
}

/* ─── Stream Info Bar ────────────────────── */
.stream-info {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    border-bottom: 1px solid var(--border);
}

.stream-info-left {
    display: flex;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.streamer-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-strong);
}

.stream-info-meta {
    min-width: 0;
    flex: 1;
}

.streamer-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.channel-display-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-0);
    letter-spacing: -0.01em;
}

.verified-badge {
    color: var(--text-2);
    display: inline-flex;
}

.stream-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-game-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.game-link {
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
    transition: color 0.15s ease;
}

.game-link:hover {
    color: var(--text-0);
}

.stream-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stream-info-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.action-btn.ghost {
    background: var(--bg-3);
    color: var(--text-1);
    width: 36px;
    padding: 0;
    justify-content: center;
}

.action-btn.ghost:hover {
    background: var(--bg-4);
}

.action-btn.follow {
    background: var(--text-0);
    color: var(--bg-0);
}

.action-btn.follow:hover {
    opacity: 0.9;
}

.action-btn.follow.following {
    background: var(--bg-3);
    color: var(--text-0);
    border-color: var(--border-strong);
}

.action-btn.subscribe {
    background: var(--bg-3);
    color: var(--text-0);
    border-color: var(--border-strong);
}

.action-btn.subscribe:hover {
    background: var(--bg-4);
}

/* ─── Tabs ───────────────────────────────── */
.channel-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
    position: sticky;
    top: 60px;
    z-index: 5;
}

.channel-tab {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.channel-tab:hover {
    color: var(--text-0);
}

.channel-tab.active {
    color: var(--text-0);
    border-bottom-color: var(--text-0);
}

/* ─── Tab Content ────────────────────────── */
.tab-content {
    padding: 24px;
}

.tab-content.hidden {
    display: none;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-bottom: 32px;
}

.about-bio {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.about-bio-slim {
    padding: 18px 22px;
    margin-bottom: 28px;
}

.about-bio-slim .bio-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.about-bio-slim .bio-heading {
    font-size: 15px;
    margin-bottom: 6px;
}

.about-bio-slim .bio-text {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 12px;
}

.bio-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.follower-count {
    color: var(--text-2);
    font-size: 14px;
}

.follower-count strong {
    color: var(--text-0);
    font-weight: 700;
}

.bio-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-0);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.bio-text {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-3);
    color: var(--text-1);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid var(--border);
}

.social-link:hover {
    background: var(--bg-4);
    color: var(--text-0);
    border-color: var(--border-strong);
}

.about-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.panel-card:hover {
    border-color: var(--border-strong);
}

.panel-thumb {
    aspect-ratio: 4 / 1.5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-label {
    color: var(--text-0);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-meta {
    padding: 12px 14px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-0);
    margin-bottom: 2px;
}

.panel-sub {
    font-size: 12px;
    color: var(--text-3);
}

.section-sub-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-0);
    margin-bottom: 14px;
    margin-top: 28px;
    letter-spacing: -0.01em;
}

.section-sub-title:first-of-type {
    margin-top: 0;
}

/* ─── Partners ───────────────────────────── */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.partner-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

a.partner-card {
    cursor: pointer;
}

a.partner-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.partner-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

.partner-placeholder {
    aspect-ratio: 3 / 4;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(255,255,255,0.015) 12px, rgba(255,255,255,0.015) 24px),
        linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-3);
    border-bottom: 1px dashed var(--border);
}

.partner-placeholder-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

.partner-placeholder-sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.partner-code {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}

.partner-code-tag {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--bg-0);
    background: var(--text-0);
    padding: 4px 10px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.partner-code-text {
    font-size: 13px;
    color: var(--text-1);
    font-weight: 600;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.recent-card {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.recent-card:hover {
    transform: translateY(-2px);
}

.recent-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    transition: border-color 0.15s ease;
}

.recent-card:hover .recent-thumb {
    border-color: var(--border-strong);
}

.recent-thumb-bg {
    position: absolute;
    inset: 0;
}

.recent-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: var(--text-0);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.recent-views {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.7);
    color: var(--text-0);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.recent-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-0);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-meta {
    font-size: 12px;
    color: var(--text-3);
}

/* ─── Schedule ───────────────────────────── */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-row {
    display: grid;
    grid-template-columns: 100px 90px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.schedule-row:hover {
    border-color: var(--border-strong);
}

.schedule-day {
    font-weight: 700;
    color: var(--text-0);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.schedule-time {
    color: var(--text-1);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.schedule-title {
    color: var(--text-1);
    font-size: 14px;
    font-weight: 500;
}

.schedule-game {
    color: var(--text-3);
    font-size: 12px;
    margin-top: 2px;
}

.schedule-notify {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-3);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.schedule-notify:hover {
    background: var(--bg-4);
    color: var(--text-0);
}

/* ─── Chat ───────────────────────────────── */
.chat {
    background: var(--bg-1);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
}

.chat-header {
    height: 50px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: 0.02em;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-1);
    animation: fadeInChat 0.3s ease-out;
    word-wrap: break-word;
}

@keyframes fadeInChat {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-user {
    font-weight: 700;
    margin-right: 4px;
}

.chat-msg-user.mod { color: #c5e6a8; }
.chat-msg-user.vip { color: #d8c1ff; }
.chat-msg-user.sub { color: #a8c5e6; }
.chat-msg-user.regular { color: var(--text-0); }
.chat-msg-user.streamer { color: #ffd9a8; }

.chat-msg-badge {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
    background: var(--bg-3);
    color: var(--text-2);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    line-height: 14px;
    text-transform: uppercase;
}

.chat-msg-badge.broadcaster { background: var(--text-0); color: var(--bg-0); }
.chat-msg-badge.mod-badge { background: #4a5a3a; color: #c5e6a8; }
.chat-msg-badge.vip-badge { background: #4a3a5a; color: #d8c1ff; }
.chat-msg-badge.sub-badge { background: #3a4a5a; color: #a8c5e6; }

.chat-msg-system {
    font-size: 12px;
    color: var(--text-3);
    padding: 4px 8px;
    background: var(--bg-2);
    border-radius: 6px;
    text-align: center;
    border: 1px dashed var(--border);
}

.chat-input-wrap {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.chat-input {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px;
    height: 40px;
    transition: border-color 0.15s ease;
    margin-bottom: 8px;
}

.chat-input:focus-within {
    border-color: var(--border-strong);
}

.chat-input input {
    flex: 1;
    font-size: 13px;
    color: var(--text-1);
}

.chat-input input::placeholder {
    color: var(--text-3);
}

.emote-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emote-btn:hover {
    color: var(--text-0);
    background: var(--bg-3);
}

.chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-badge {
    font-size: 11px;
    color: var(--text-3);
}

.primary-btn.small {
    height: 30px;
    padding: 0 14px;
    font-size: 12px;
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 1100px) {
    .channel-layout {
        grid-template-columns: 1fr;
    }
    .chat {
        height: 420px;
        position: static;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .player {
        max-height: none;
    }
    .stream-info {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 14px 16px;
        gap: 14px;
    }
    .stream-info-left {
        gap: 12px;
    }
    .streamer-avatar-lg {
        width: 52px;
        height: 52px;
    }
    .channel-display-name {
        font-size: 18px;
    }
    .stream-title {
        font-size: 14px;
    }
    .stream-info-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .action-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }
    .action-btn.follow,
    .action-btn.subscribe {
        flex: 1;
    }
    .channel-tabs {
        padding: 0 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .channel-tabs::-webkit-scrollbar {
        display: none;
    }
    .channel-tab {
        padding: 12px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .tab-content {
        padding: 16px 14px;
    }
    .about-bio,
    .about-bio-slim {
        padding: 16px;
    }
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .recent-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .schedule-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 12px 14px;
    }
    .schedule-day {
        grid-column: 1 / 2;
        font-size: 12px;
    }
    .schedule-time {
        grid-column: 1 / 2;
        font-size: 13px;
    }
    .schedule-row > div:nth-child(3) {
        grid-column: 1 / 3;
    }
    .schedule-notify {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
    }
    .chat-header {
        height: 44px;
    }
    .partner-code {
        padding: 10px 12px;
    }
    .partner-code-tag {
        font-size: 12px;
    }
    .partner-code-text {
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .partner-grid {
        grid-template-columns: 1fr;
    }
    .stream-info-actions .action-btn.ghost {
        flex: 0 0 36px;
    }
}
