* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --bg: #0e0e10;
    --bg-surface: #18181b;
    --bg-elevated: #2f2f35;
    --bg-hover: #3f3f46;
    --bg-input: #0e0e10;
    --text: #efeff1;
    --text-muted: #adadb8;
    --border: #2f2f35;
    --thumb-bg: #000;
}
body.light {
    --bg: #f5f5f5;
    --bg-surface: #ffffff;
    --bg-elevated: #e4e4e7;
    --bg-hover: #d4d4d8;
    --bg-input: #ffffff;
    --text: #18181b;
    --text-muted: #71717a;
    --border: #d4d4d8;
    --thumb-bg: #e4e4e7;
}
body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition:
        background 0.3s,
        color 0.3s;
}

/* 스크롤바 얇게, 호버시 두께 확장 */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--bg-hover);
    border: 4px solid transparent;
    background-clip: padding-box;
    border-radius: 7px;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
    border: 2px solid transparent;
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}
body.light .header-title img {
    filter: invert(1);
}
.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.title-text {
    font-family:
        "Pretendard",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.header-actions {
    display: flex;
    gap: 8px;
}
.btn {
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.btn-primary {
    background: #5c16c5;
    color: #fff;
}
.btn-primary:hover {
    background: #7b2ff2;
}
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
}
.btn-secondary:hover {
    background: var(--bg-hover);
}
.btn-icon {
    background: var(--bg-elevated);
    color: var(--text);
    display: flex;
    align-items: center;
    padding: 8px;
}
.btn-icon:hover {
    background: var(--bg-hover);
}
.btn-auto {
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.btn-auto:hover {
    background: var(--bg-hover);
}
.btn-auto.active {
    background: #1a6b2c;
    color: #2eff5e;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.btn-auto.active svg {
    animation: spin 1.5s linear infinite;
}

.container {
    padding: 24px;
}
.live-count {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: none;
}
.live-count span {
    color: #e91916;
    font-weight: 700;
}
.status {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.loader {
    width: 40px;
    height: 40px;
    position: relative;
}
.loader span {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}
.loader span:nth-child(1) {
    border-top-color: #5c16c5;
    animation: spin 1s ease-in-out infinite;
}
.loader span:nth-child(2) {
    border-right-color: #7b2ff2;
    animation: spin 1.2s ease-in-out infinite reverse;
}
.loader span:nth-child(3) {
    border-bottom-color: #9b59f5;
    animation: spin 1.5s ease-in-out infinite;
}
@keyframes pulse-text {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}
.status-text {
    font-size: 14px;
    letter-spacing: 1px;
    animation: pulse-text 1.8s ease-in-out infinite;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.card {
    background: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.15s;
}
.card:hover {
    transform: translateY(-2px);
}
.card a {
    text-decoration: none;
    color: inherit;
}
.card-info-link {
    flex: 1;
    overflow: hidden;
}
.thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--thumb-bg);
}
.thumb-wrap .thumb-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.thumb-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
}
.thumb-wrap .thumb-new {
    opacity: 0;
    z-index: 1;
}
.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e91916;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.viewer-count:before {
    content: "";
    display: inline-block;
    background: #ff2424;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
}
.viewer-count {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.start-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}
.card-body {
    padding: 10px 12px;
    display: flex;
    gap: 10px;
}
.card-body .profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.card-info {
    overflow: hidden;
}
.card-info .title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-info .nickname {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.card-info .tags {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.card-info .tag {
    font-size: 11px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 10px;
}

/* modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 24px;
    width: 380px;
    max-width: 90vw;
}
.modal h2 {
    font-size: 18px;
}
.modal input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}
.modal .btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* toast */
.toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid #e91916;
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
    max-width: 300px;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast .toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}
.toast .toast-msg {
    color: var(--text-muted);
    font-size: 12px;
}

.streamer-list {
    margin-bottom: 12px;
    max-height: 240px;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h2 {
    font-size: 18px;
    margin-bottom: 0;
}
.data-textarea {
    width: 100%;
    height: 260px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text);
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    resize: vertical;
    margin-bottom: 12px;
}
.add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.add-row input {
    flex: 1;
    margin-bottom: 0;
}
.add-row .btn {
    flex-shrink: 0;
}
.streamer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.streamer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.streamer-info:hover .streamer-nick {
    color: #9b59f5;
}
.streamer-profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.streamer-nick {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.streamer-id {
    font-size: 11px;
    color: var(--text-muted);
}
.streamer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.streamer-notice-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}
.streamer-notice-btn:hover {
    color: #9b59f5;
}
.streamer-item .remove-btn {
    background: none;
    border: none;
    color: #e91916;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.dataModal .btn-secondary {
    padding: 0px 19px;
}

/* 멀티뷰 레이아웃 */
.main-wrapper {
    display: flex;
    height: calc(100vh - 52px);
}
.main-content {
    flex: 1;
    overflow-y: auto;
}

/* 멀티뷰 사이드바 */
.multiview-sidebar {
    width: 320px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.multiview-sidebar.collapsed {
    width: 0;
    border-left: none;
    overflow: hidden;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}
.sidebar-header .count {
    background: #5c16c5;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}
.multiview-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.multiview-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.multiview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-elevated);
    margin-bottom: 8px;
}
.multiview-item:hover {
    background: var(--bg-hover);
}
.multiview-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.multiview-item-info {
    flex: 1;
    overflow: hidden;
}
.multiview-item-nick {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.multiview-item-id {
    font-size: 11px;
    color: var(--text-muted);
}
.multiview-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    flex-shrink: 0;
}
.multiview-item .remove-btn:hover {
    color: #e91916;
}
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}
.multiview-watch-btn {
    width: 100%;
    padding: 12px;
    background: #5c16c5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.multiview-watch-btn:hover {
    background: #7b2ff2;
}
.multiview-watch-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* 썸네일 우측 상단 버튼 그룹 */
.thumb-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    gap: 4px;
}
.thumb-actions .thumb-action-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: background 0.2s;
}
.thumb-actions .thumb-action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}
.thumb-actions .thumb-action-btn.active {
    background: #5c16c5;
}
.thumb-actions .thumb-action-btn.active:hover {
    background: #7b2ff2;
}

/* 게시글 사이드 패널 */
.post-panel {
    width: 320px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s;
}
.post-panel.collapsed {
    width: 0;
    border-left: none;
    overflow: hidden;
}
.post-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.post-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-panel-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.post-panel-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px;
    line-height: 1.6;
}
.post-panel-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.notice-text {
    margin: 8px 10px 4px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-left: 3px solid #8b5cf6;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.6;
}
.post-list {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}
.post-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.15s;
}
.post-item:hover {
    background: var(--bg-hover, rgba(139,92,246,0.08));
    border-color: #8b5cf6;
}
.post-item-today {
    border-left: 3px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
}
.post-item-today .post-item-date {
    color: #9b59f5;
    font-weight: 600;
}
.post-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-item-summary {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}
.post-item-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* 채팅 사이드 패널 */
.chat-panel {
    width: 360px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s;
}
.chat-panel.collapsed {
    width: 0;
    border-left: none;
    overflow: hidden;
}
.chat-panel.expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 200;
    border-left: none;
    transition: none;
}
.chat-panel.expanded .chat-messages {
    /* Set variable for expanded mode */
    --chat-font-size: calc(var(--chat-font-size-base, 13px) + 2px);
}
.chat-panel.expanded .chat-msg {
    padding: 5px 16px;
}
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-panel-header .btn-icon {
    flex-shrink: 0;
}
.chat-panel-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-msg {
    font-size: var(--chat-font-size, var(--chat-font-size-base, 13px));
    line-height: 1.5;
    word-break: break-word;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.chat-msg-multiline {
    align-items: flex-start;
}
.chat-msg-multiline .chat-text {
    width: 100%;
    padding-top: 2px;
}
.chat-nick {
    font-weight: 400;
    color: #8b5cf6;
    margin-right: 6px;
    text-decoration: none;
}
.chat-nick-bold {
    font-weight: 700;
}
a.chat-nick:hover {
    text-decoration: underline;
}
.chat-text {
    color: var(--text);
}
.chat-notice {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0;
}
.chat-donation {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    margin: 2px 0;
    background: rgba(255, 180, 0, 0.1);
    border-left: 2px solid #ffb400;
    border-radius: 0 4px 4px 0;
    font-size: var(--chat-font-size-base, 13px);
    line-height: 1.5;
}
.chat-donation-icon {
    font-size: 12px;
    flex-shrink: 0;
}
.chat-donation-nick {
    font-weight: 700;
    color: #f59e0b;
    text-decoration: none;
    flex-shrink: 0;
}
a.chat-donation-nick:hover {
    text-decoration: underline;
}
.chat-donation-text {
    color: var(--text-muted);
}
.chat-donation-text strong {
    color: #f59e0b;
}
.chat-msg-balloon-reply {
    background: rgba(245, 158, 11, 0.12);
    border-left: 2px solid #f59e0b;
    border-radius: 0 4px 4px 0;
    padding: 2px 6px;
}
/* 채팅 정보 바 */
.chat-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    gap: 8px;
}
.chat-info-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-info-viewers {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.chat-info-viewers:hover {
    background: var(--bg-elevated);
}
.chat-info-balloon {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    padding: 2px 6px;
}
.balloon-icon {
    font-size: 11px;
}
.chat-info-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.chat-info-expand-btn:hover {
    background: var(--bg-elevated);
    color: var(--text);
}
.chat-info-viewers svg {
    opacity: 0.7;
}
.chat-info-balloon {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}
.balloon-donor {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    white-space: nowrap;
}
.balloon-donor img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* 채팅 뱃지 */
.chat-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    margin-right: 3px;
    vertical-align: middle;
    line-height: 1.2;
}
.chat-badge.bj {
    background: #e91916;
    color: #fff;
}
.chat-badge.manager {
    background: #2196f3;
    color: #fff;
}
.chat-badge.hotfan {
    background: #ef4444;
    color: #fff;
}
.chat-badge.fan {
    background: #ff9800;
    color: #fff;
}
.chat-badge.sub {
    background: #9b59f5;
    color: #fff;
}
.chat-badge.owner {
    padding: 0 2px;
    font-size: 12px;
    background: none;
}
.chat-msg-owner {
    background: rgba(255, 215, 0, 0.08);
    border-left: 2px solid #ffd700;
    padding-left: 6px;
    margin-left: -8px;
    padding-right: 8px;
}
/* 채팅 이모티콘/이미지 */
.chat-emote {
    max-width: 80px;
    max-height: 80px;
    vertical-align: middle;
    border-radius: 4px;
    margin: 2px 0;
}
.chat-link {
    color: #60a5fa;
    text-decoration: underline;
    word-break: break-all;
}
/* 채팅 스크롤 버튼 */
.chat-scroll-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    transition: background 0.15s;
    max-width: 80%;
}
.chat-scroll-btn:hover {
    background: var(--bg-hover);
}
#chatScrollPreview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 채팅 참여자 팝업 */
.chat-viewer-popup {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    z-index: 20;
    display: flex;
    flex-direction: column;
}
.chat-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.chat-viewer-search {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
    outline: none;
    flex-shrink: 0;
}
.chat-viewer-search:focus {
    background: var(--bg-elevated);
}
.chat-viewer-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.chat-viewer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
}
.chat-viewer-item:hover {
    background: var(--bg-elevated);
}
.chat-viewer-item .chat-badge {
    flex-shrink: 0;
}
.chat-viewer-nick {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-viewer-id {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}
/* 채팅방 참여자 전체화면 모달 */
.viewer-fullscreen-modal {
    width: min(720px, 94vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.viewer-fs-total {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}
.viewer-fs-search-row {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.viewer-fs-search-row .chat-viewer-search {
    border-bottom: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
}
.viewer-fs-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    align-content: start;
    gap: 2px;
    padding: 8px;
}
.viewer-fs-list .chat-viewer-item {
    padding: 7px 10px;
    border-radius: 6px;
}
.viewer-fs-list .chat-viewer-item:hover {
    background: var(--bg-elevated);
}
.viewer-fs-empty {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.chat-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px;
    text-align: center;
}

/* 사이드바 토글 버튼 */
.sidebar-toggle-btn {
    position: relative;
}
.sidebar-toggle-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #5c16c5;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 멀티뷰 플레이어 모달 */
.multiview-player-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    flex-direction: column;
}
.multiview-player-overlay.active {
    display: flex;
}
.multiview-player {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.multiview-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.multiview-player-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.multiview-player-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.layout-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.layout-select:focus {
    outline: none;
    border-color: #5c16c5;
}
.multiview-player-grid {
    flex: 1;
    display: grid;
    gap: 4px;
    padding: 4px;
    background: #000;
    overflow: hidden;
}
.multiview-player-grid.layout-1x1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}
.multiview-player-grid.layout-2x1 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
}
.multiview-player-grid.layout-1x2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, 1fr);
}
.multiview-player-grid.layout-2x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}
.multiview-player-grid.layout-3x2 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}
.multiview-player-grid.layout-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}
.multiview-cell {
    position: relative;
    background: #18181b;
    border-radius: 4px;
    overflow: hidden;
}
.multiview-cell iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.multiview-cell-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}
.multiview-cell:hover .multiview-cell-overlay {
    opacity: 1;
}
.multiview-cell-remove {
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.multiview-cell-remove:hover {
    background: #e91916;
}
