
        * { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --room-bg-top: #1a2634;
            --room-bg-bottom: #0d1b2a;
            --room-accent: #4dd0b4;
            --room-text: #e0f2f1;
            --room-text-muted: #80cbc4;
            --room-accent-rgb: 77, 208, 180;
            --room-accent-a10: rgba(77, 208, 180, 0.1);
            --room-accent-a12: rgba(77, 208, 180, 0.12);
            --room-accent-a15: rgba(77, 208, 180, 0.15);
            --room-accent-a20: rgba(77, 208, 180, 0.2);
            --room-accent-a25: rgba(77, 208, 180, 0.25);
            --room-bg-top-a98: rgba(26, 38, 52, 0.98);
            --room-bg-bottom-a98: rgba(13, 27, 42, 0.98);
            --room-scrollbar-track: rgba(13, 27, 42, 0.85);
            --room-scrollbar-thumb: #4dd0b4;
            --room-scrollbar-thumb-hover: #6ae8cc;
            --room-bubble-bg: rgba(40, 55, 70, 0.72);
            --room-bubble-border: rgba(77, 208, 180, 0.2);
            --room-bubble-border-light: rgba(77, 208, 180, 0.12);
        }
        
        html, body {
            font-family: 'Malgun Gothic', 'Segoe UI', sans-serif;
            background: linear-gradient(180deg, var(--room-bg-top) 0%, var(--room-bg-bottom) 100%);
            color: var(--room-text);
            width: 100vw;
            height: 100vh;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        input,
        textarea {
            caret-color: var(--room-accent);
        }
        
        #container {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            width: 100vw;
            height: 100vh;
            position: relative;
            overflow: hidden;
        }
        
        #chat-area {
            position: relative;
            flex: 1 1 auto;
            min-width: 0;
            width: auto;
            height: 100vh;
            display: flex;
            flex-direction: column;
            order: 1;
        }

        #theme-settings-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 120;
            width: 34px;
            height: 34px;
            border: 1px solid var(--room-accent-a25);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.35);
            color: var(--room-accent);
            font-size: 16px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.15s ease, transform 0.15s ease;
        }

        #theme-settings-btn:hover {
            background: var(--room-accent-a15);
            transform: scale(1.05);
        }

        body.compact-users #theme-settings-btn {
            right: 8px;
        }

        #theme-popup {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 100001;
            justify-content: center;
            align-items: center;
        }

        #theme-popup.show {
            display: flex;
        }

        #theme-popup .theme-popup-content {
            background: linear-gradient(135deg, var(--room-bg-top-a98), var(--room-bg-bottom-a98));
            border: 1px solid var(--room-accent-a25);
            border-radius: 12px;
            width: min(320px, calc(100vw - 24px));
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
        }

        #theme-popup .theme-popup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 15px;
            border-bottom: 1px solid var(--room-accent-a20);
            font-size: 14px;
            font-weight: bold;
            color: var(--room-accent);
        }

        #theme-popup .theme-popup-help {
            font-size: 11px;
            color: var(--room-text-muted);
            margin-bottom: 12px;
            line-height: 1.45;
        }

        #theme-popup .theme-preset-label,
        #theme-popup .theme-custom-label {
            font-size: 11px;
            font-weight: 700;
            color: var(--room-text-muted);
            margin-bottom: 8px;
        }

        #theme-popup .theme-custom-label {
            margin-top: 14px;
        }

        #theme-popup .theme-preset-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        #theme-popup .theme-preset-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border: 1px solid var(--room-accent-a20);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.2);
            color: var(--room-text);
            font-size: 11px;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s ease, background 0.15s ease;
        }

        #theme-popup .theme-preset-btn:hover {
            border-color: var(--room-accent-a25);
            background: var(--room-accent-a10);
        }

        #theme-popup .theme-preset-btn.active {
            border-color: var(--room-accent);
            box-shadow: 0 0 0 1px var(--room-accent-a25);
        }

        #theme-popup .theme-preset-swatch {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            flex-shrink: 0;
            border: 1px solid rgba(255, 255, 255, 0.15);
        }

        #theme-popup .theme-color-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        #theme-popup .theme-color-grid label {
            display: flex;
            flex-direction: column;
            gap: 5px;
            font-size: 11px;
            color: var(--room-text-muted);
        }

        #theme-popup .theme-color-grid input[type="color"] {
            width: 100%;
            height: 36px;
            padding: 2px;
            border: 1px solid var(--room-accent-a20);
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.2);
            cursor: pointer;
        }

        #theme-popup .theme-popup-footer {
            display: flex;
            gap: 8px;
            padding: 12px 15px 15px;
        }

        #theme-popup .theme-popup-footer button {
            flex: 1;
            border: none;
            border-radius: 8px;
            padding: 10px;
            font-size: 13px;
            cursor: pointer;
        }

        #theme-reset-btn {
            background: rgba(255, 255, 255, 0.08);
            color: var(--room-text-muted);
        }

        #theme-apply-btn {
            background: linear-gradient(135deg, var(--room-accent), var(--room-accent));
            color: #0d1b2a;
            font-weight: 700;
        }

        #ignore-list-popup {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 100001;
            justify-content: center;
            align-items: center;
        }

        #ignore-list-popup.show {
            display: flex;
        }

        #ignore-list-popup .theme-popup-content {
            width: min(340px, calc(100vw - 24px));
        }

        #ignore-list-items {
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 280px;
            overflow-y: auto;
        }

        .ignore-list-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 8px 10px;
            border: 1px solid var(--room-accent-a15);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.15);
        }

        .ignore-list-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
            flex: 1;
        }

        .ignore-list-nick {
            font-size: 13px;
            font-weight: 600;
            color: var(--room-text);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .ignore-list-remain {
            font-size: 10px;
            color: var(--room-text-muted);
        }

        .ignore-unblock-btn {
            flex-shrink: 0;
            border: 1px solid var(--room-accent-a25);
            border-radius: 6px;
            background: var(--room-accent-a15);
            color: var(--room-accent);
            font-size: 11px;
            font-weight: 700;
            padding: 6px 10px;
            cursor: pointer;
        }

        .ignore-unblock-btn:hover {
            background: var(--room-accent-a25);
        }

        .ignore-list-empty {
            padding: 18px 8px;
            text-align: center;
            font-size: 12px;
            color: var(--room-text-muted);
        }

        /* 접속자 접기 버튼 (좁은 화면) */
        #user-list-toggle {
            display: none;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
            width: 100%;
            padding: 8px 12px;
            border: none;
            border-bottom: 1px solid var(--room-accent-a25);
            background: rgba(0, 0, 0, 0.35);
            color: var(--room-text-muted);
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            text-align: left;
            gap: 8px;
        }

        #user-list-toggle:hover {
            background: var(--room-accent-a12);
        }

        #user-list-toggle .toggle-arrow {
            color: var(--room-accent);
            font-size: 10px;
            transition: transform 0.2s ease;
        }

        body.users-panel-open #user-list-toggle .toggle-arrow {
            transform: rotate(180deg);
        }

        /* 좁은 화면: 접속자 사이드바 접기 (펼치면 우측 고정 폭) */
        body.compact-users #chat-area {
            flex: 1 1 auto;
        }

        body.compact-users #user-list-toggle {
            display: flex;
            position: relative;
            top: auto;
            right: auto;
            left: auto;
            width: 100%;
            min-width: 0;
            max-width: none;
            height: auto;
            min-height: 0;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            border: none;
            border-bottom: 1px solid var(--room-accent-a25);
            z-index: 201;
            font-size: 12px;
            line-height: 1.2;
            text-align: left;
            gap: 8px;
            box-shadow: none;
        }

        body.compact-users.users-panel-open #user-list-toggle {
            display: none;
        }

        body.compact-users #user-list {
            display: none;
            position: absolute;
            top: 0;
            right: 0;
            left: auto;
            width: 160px;
            height: 100%;
            max-height: none;
            min-height: 0;
            z-index: 200;
            border-left: 1px solid var(--room-accent-a20);
            border-bottom: none;
            box-shadow: -4px 0 16px rgba(0, 0, 0, 0.35);
        }

        body.compact-users.users-panel-open #user-list {
            display: flex;
        }

        body.compact-users #messages {
            margin-right: 0;
        }
        
        #messages {
            flex: 1;
            overflow-y: scroll;
            overflow-x: hidden;
            padding: 10px;
            padding-right: 5px;
            display: flex;
            flex-direction: column;
            gap: 3px;
            min-height: 0;
            margin-right: 5px;
        }
        
        /* 유저 리스트 - 전체 높이 */
        #user-list {
            position: relative;
            flex: 0 0 160px;
            order: 3;
            width: 160px;
            height: 100%;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: linear-gradient(180deg, var(--room-bg-top-a98) 0%, var(--room-bg-bottom-a98) 100%);
            border-left: 1px solid var(--room-accent-a20);
            overflow-y: auto;
            box-sizing: border-box;
        }
        
        #user-list-header {
            padding: 8px 3px;
            font-size: 11px;
            font-weight: 700;
            color: var(--room-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            background: var(--room-accent-a10);
            border-bottom: 1px solid var(--room-accent-a15);
            text-align: center;
            flex-shrink: 0;
        }
        
        #user-list-header span {
            color: var(--room-accent);
            font-weight: 700;
        }

        .user-item .pg-chat-badge,
        .msg .pg-chat-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: bold;
            color: #0d3d32;
            background: var(--room-accent);
            border-radius: 3px;
            padding: 0 4px;
            margin-left: 4px;
            vertical-align: middle;
            line-height: 1.35;
            letter-spacing: -0.02em;
        }
        .user-item.pg-chat-other {
            opacity: 0.82;
            font-size: 11px;
        }
        .user-item.pg-chat-other .user-nick {
            color: var(--room-text-muted);
            background: transparent;
            border-color: var(--room-accent-a15);
        }
        .pg-chat-users-divider {
            font-size: 10px;
            color: var(--room-text-muted);
            padding: 8px 4px 4px;
            border-top: 1px solid var(--room-accent-a15);
            margin-top: 4px;
        }
        #user-items {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
        }
        
        .user-item {
            display: flex;
            align-items: center;
            padding: 5px 3px;
            cursor: pointer;
            transition: all 0.15s ease;
            position: relative;
            gap: 3px;
            flex-wrap: wrap;
        }
        .user-item .pg-chat-badge {
            flex-shrink: 0;
        }
        
        .user-item:hover {
            background: var(--room-accent-a15);
        }
        
        .user-item:active {
            background: var(--room-accent-a25);
            transform: scale(0.98);
        }
        
        .user-level {
            height: 18px;
            flex-shrink: 0;
        }
        
        .user-profile {
            height: auto;
            width: auto;
            max-height: 50px;
            flex-shrink: 0;
        }
        
        .user-nick {
            font-size: 12px;
            color: var(--room-text);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .user-nick.admin {
            color: var(--room-accent);
            font-weight: 600;
        }

        .user-hover-tip {
            display: none;
            position: absolute;
            right: 0;
            bottom: 100%;
            margin-bottom: 4px;
            background: rgba(0, 0, 0, 0.9);
            color: #fff;
            font-size: 11px;
            line-height: 1.35;
            padding: 4px 8px;
            border-radius: 4px;
            white-space: nowrap;
            z-index: 300;
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        }
        .user-item:hover .user-hover-tip,
        .msg-user-wrap:hover .user-hover-tip,
        .user-item.user-tip-ip-visible .user-hover-tip,
        .msg-user-wrap.user-tip-ip-visible .user-hover-tip {
            display: block;
        }
        .user-item.user-tip-ip-visible .user-hover-tip,
        .msg-user-wrap.user-tip-ip-visible .user-hover-tip {
            pointer-events: auto;
        }
        .user-hover-tip .user-tip-ip {
            display: none;
            font-size: 10px;
            color: #8fd4ff;
            margin-top: 3px;
            padding-top: 3px;
            border-top: 1px solid rgba(255, 255, 255, 0.15);
            cursor: pointer;
            text-decoration: underline;
            pointer-events: auto;
        }
        .user-item.user-tip-ip-visible .user-tip-ip,
        .msg-user-wrap.user-tip-ip-visible .user-tip-ip {
            display: block;
        }
        .user-hover-tip .user-tip-ip:hover {
            color: #fff;
        }
        .user-hover-tip .user-tip-ip.copied {
            color: var(--room-accent);
            text-decoration: none;
        }
        .user-nick,
        .user-profile,
        .msg-nick,
        .msg-profile {
            cursor: pointer;
        }
        .msg-user-wrap {
            position: relative;
            display: inline-flex;
            flex-shrink: 0;
            align-items: center;
        }
        
        /* 메시지 스타일 */
        .msg {
            display: flex;
            align-items: center;
            gap: 3px;
            animation: popIn 0.2s ease-out;
            padding: 2px 0;
        }
        
        @keyframes popIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .msg-level {
            flex-shrink: 0;
            display: flex;
            align-items: center;
        }
        
        .msg-level img {
            height: auto;
            width: auto;
            max-height: 20px;
        }
        
        .msg-profile {
            height: auto;
            width: auto;
            max-height: 40px;
            flex-shrink: 0;
            cursor: pointer;
            transition: transform 0.15s ease;
            border-radius: 3px;
            display: block;
        }
        
        .msg-profile:hover {
            transform: scale(1.05);
        }
        
        /* 닉네임 텍스트 (프로필 이미지 없을 때) */
        .msg-nick {
            font-size: 11px;
            font-weight: 600;
            color: var(--room-accent);
            flex-shrink: 0;
            cursor: pointer;
            padding: 4px 8px;
            background: var(--room-accent-a10);
            border: 1px solid var(--room-accent-a20);
            border-radius: 4px;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
        }
        
        .msg-nick:hover {
            background: var(--room-accent-a25);
            color: var(--room-text);
        }
        
        /* 말풍선 - 컴팩트 스타일 */
        .msg-bubble {
            background: var(--room-bubble-bg);
            border: 1px solid var(--room-bubble-border);
            border-radius: 3px 10px 10px 10px;
            padding: 4px 6px;
            max-width: 70%;
            display: flex;
            align-items: flex-start;
            flex: 0 1 auto;
            min-width: 0;
        }

        .msg-bubble:has(.chat-sticker),
        .msg-bubble:has(.chat-image):not(:has(.chat-image-caption)),
        .msg-bubble:has(.msg-text > img.chat-image:only-child),
        .msg-bubble:has(.msg-text > img.chat-sticker:only-child),
        .msg-bubble:has(.msg-text > video.chat-sticker:only-child),
        .msg-bubble:has(.msg-text > img:only-child):not(:has(.chat-image-caption)) {
            width: max-content;
            max-width: min(208px, 70%);
            padding: 2px;
            border-color: var(--room-bubble-border-light);
            flex: 0 0 auto;
            align-self: flex-start;
        }

        .msg-bubble:has(.chat-image):has(.chat-image-caption) {
            width: max-content;
            max-width: min(280px, 70%);
            padding: 4px 6px;
            flex: 0 0 auto;
            align-self: flex-start;
        }

        .msg-bubble:has(.chat-sticker) .msg-text,
        .msg-bubble:has(.chat-image):not(:has(.chat-image-caption)) .msg-text,
        .msg-bubble:has(.msg-text > img.chat-sticker:only-child),
        .msg-bubble:has(.msg-text > video.chat-sticker:only-child) .msg-text,
        .msg-bubble:has(.msg-text > img.chat-image:only-child) .msg-text,
        .msg-bubble:has(.msg-text > img:only-child):not(:has(.chat-image-caption)) .msg-text {
            line-height: 0;
            width: max-content;
            max-width: 200px;
            min-width: 0;
            display: block;
        }

        .msg-bubble:has(.chat-image):has(.chat-image-caption) .msg-text {
            width: max-content;
            max-width: 200px;
            min-width: 0;
            line-height: 1.35;
            display: block;
        }

        .msg-bubble:has(.chat-image) .msg-text,
        .msg-bubble:has(.chat-sticker) .msg-text {
            width: max-content;
            max-width: 200px;
            min-width: 0;
        }
        
        .msg-text {
            word-break: break-word;
            overflow-wrap: anywhere;
            line-height: 1.25;
            color: var(--room-text);
            font-size: 13px;
            min-width: 0;
        }

        .msg-text:has(.chat-image) {
            line-height: 1.35;
        }

        .msg-text .chat-image-caption {
            display: block;
            margin-top: 4px;
            line-height: 1.35;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .msg-text .chat-emoji {
            font-size: 2.5em;
            line-height: 1;
            vertical-align: -0.12em;
            display: inline-block;
        }
        
        .msg-text img:not(.chat-image):not(.chat-sticker) {
            max-width: min(300px, 100%);
            max-height: 200px;
            border-radius: 4px;
            margin-top: 2px;
            cursor: pointer;
        }
        
        .msg-time {
            font-size: 10px;
            color: var(--room-text-muted);
            flex-shrink: 0;
            white-space: nowrap;
            align-self: flex-end;
            margin-bottom: 1px;
        }
        
        .msg-delete {
            font-size: 12px;
            color: #ff6b6b;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
            padding: 2px 5px;
            flex-shrink: 0;
            align-self: flex-start;
            margin-top: 3px;
        }
        
        .msg:hover .msg-delete {
            opacity: 0.7;
        }
        
        .msg-delete:hover {
            opacity: 1 !important;
            color: #ff4444;
        }

        .msg.msg-pending {
            opacity: 0.88;
        }

        .msg.msg-own:not(.msg-whisper) .msg-bubble {
            border: 2px solid var(--room-accent);
            background: var(--room-accent-a12);
            box-shadow: 0 0 0 1px var(--room-accent-a20);
        }

        .msg.msg-own.msg-whisper .msg-bubble {
            border: 2px solid rgba(255, 167, 38, 0.75);
            background: rgba(255, 152, 0, 0.14);
        }
        
        .msg-hidden .msg-text {
            color: #888 !important;
            font-style: italic;
        }
        
        .whisper-label {
            font-size: 11px;
            color: #ff9800;
            font-weight: 600;
            flex-shrink: 0;
            background: rgba(255, 152, 0, 0.15);
            padding: 2px 6px;
            border-radius: 4px;
        }
        
        .whisper-label.whisper-admin {
            color: #e1bee7;
            background: rgba(171, 120, 255, 0.22);
            border: 1px solid rgba(171, 120, 255, 0.35);
        }
        
        /* 귓속말 말풍선 */
        .msg-whisper .msg-bubble {
            background: rgba(70, 55, 40, 0.7);
            border: 1px solid rgba(255, 180, 100, 0.3);
            border-left: 2px solid rgba(255, 152, 0, 0.6);
        }

        /* 운영자에게만 보이는 타인 간 귓속말 */
        .msg-whisper.msg-whisper-admin-view .msg-bubble {
            background: rgba(62, 40, 95, 0.72);
            border: 1px solid rgba(171, 120, 255, 0.35);
            border-left: 2px solid rgba(171, 120, 255, 0.8);
        }

        .msg-whisper.msg-whisper-admin-view .msg-text {
            color: #dcc8ff;
        }

        .msg-whisper.msg-whisper-admin-view .msg-nick {
            color: #ce93d8;
        }

        .msg-whisper.msg-whisper-admin-view .msg-time {
            color: rgba(206, 147, 216, 0.65);
        }
        
        .msg-system {
            text-align: center;
            font-size: 11px;
            color: #607d8b;
            padding: 3px 8px;
            background: rgba(77, 208, 180, 0.08);
            border-radius: 10px;
            margin: 2px auto;
            max-width: fit-content;
        }

        .msg-system.msg-highlight {
            color: #ffb74d;
            background: rgba(255, 152, 0, 0.16);
            border: 1px solid rgba(255, 152, 0, 0.35);
            font-size: 12px;
            font-weight: 600;
            padding: 4px 8px;
        }

        .msg-system.msg-event-notice {
            display: flex;
            justify-content: center;
            max-width: 100%;
            margin: 3px auto;
            padding: 0;
            background: transparent;
            border: none;
            text-align: center;
        }

        .event-notice-bar {
            display: inline-flex;
            flex-wrap: nowrap;
            align-items: center;
            justify-content: center;
            gap: 4px;
            max-width: min(98%, 560px);
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 11px;
            line-height: 1.2;
            border: 1px solid var(--enb-border);
            background: var(--enb-bg);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
            animation: eventNoticeIn 0.2s ease-out;
            overflow: hidden;
            white-space: nowrap;
        }

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

        .event-notice-bar.event-notice-rune {
            --enb-border: rgba(186, 104, 255, 0.35);
            --enb-bg: rgba(45, 24, 72, 0.55);
            --enb-tag: #ce93d8;
            --enb-main: #fff8e1;
            --enb-sub: #b39ddb;
            --enb-btn-bg: rgba(156, 39, 176, 0.85);
            --enb-btn-border: rgba(225, 190, 231, 0.35);
        }

        .event-notice-bar.event-notice-abc {
            --enb-border: rgba(255, 152, 0, 0.35);
            --enb-bg: rgba(62, 36, 16, 0.55);
            --enb-tag: #ffb74d;
            --enb-main: #fff3e0;
            --enb-sub: #ffcc80;
            --enb-btn-bg: rgba(245, 81, 30, 0.88);
            --enb-btn-border: rgba(255, 224, 178, 0.35);
        }

        .event-notice-bar.event-notice-shop {
            /* One line: bubble grows with content up to full width; 바로가기 never clipped. */
            flex-wrap: nowrap;
            box-sizing: border-box;
            width: max-content;
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            border-radius: 999px;
            justify-content: flex-start;
            align-items: center;
            text-align: left;
            gap: 4px;
        }

        /* Item name takes the slack and only shortens as a last resort so the
           button always stays inside the bubble. */
        .event-notice-bar.event-notice-shop .enc-title {
            max-width: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-break: keep-all;
            overflow-wrap: normal;
            flex: 1 1 auto;
            min-width: 0;
        }

        .event-notice-bar.event-notice-shop .enc-meta {
            max-width: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-break: keep-all;
            overflow-wrap: normal;
            flex: 0 1 auto;
            min-width: 0;
        }

        .event-notice-bar.event-notice-shop .event-notice-btn {
            flex: 0 0 auto;
            margin-left: 6px;
        }

        .event-notice-bar.event-notice-shop.event-notice-sold {
            --enb-border: rgba(255, 167, 38, 0.45);
            --enb-bg: rgba(55, 36, 12, 0.58);
            --enb-tag: #ffcc80;
            --enb-main: #fff8e1;
            --enb-btn-bg: rgba(239, 108, 0, 0.9);
        }

        .event-notice-bar .enc-icon,
        .event-notice-bar .enc-tag,
        .event-notice-bar .enc-main,
        .event-notice-bar .enc-sep,
        .event-notice-bar .event-notice-btn {
            flex-shrink: 0;
        }

        .event-notice-bar .enc-sub,
        .event-notice-bar .enc-meta {
            flex-shrink: 1;
            min-width: 0;
        }

        .event-notice-bar .enc-title {
            color: var(--enb-sub, #a7ffeb);
            font-weight: 700;
            max-width: 12em;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 1;
            min-width: 0;
        }

        .event-notice-bar .enc-icon {
            font-size: 13px;
            line-height: 1;
        }

        .event-notice-bar .enc-tag {
            font-size: 10px;
            font-weight: 800;
            color: var(--enb-tag);
            white-space: nowrap;
        }

        .event-notice-bar .enc-sep {
            color: rgba(255, 255, 255, 0.25);
            font-size: 10px;
            user-select: none;
        }

        .event-notice-bar .enc-main {
            font-size: 11px;
            font-weight: 700;
            color: var(--enb-main);
            white-space: nowrap;
        }

        .event-notice-bar .enc-sub {
            font-size: 10px;
            font-weight: 500;
            color: var(--enb-sub);
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .event-notice-bar .enc-meta {
            font-size: 10px;
            color: var(--enb-sub);
            white-space: nowrap;
            opacity: 0.9;
            max-width: 88px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .event-notice-btn {
            border: 1px solid var(--enb-btn-border, rgba(255, 255, 255, 0.25));
            background: var(--enb-btn-bg, rgba(255, 255, 255, 0.15));
            color: #fff;
            border-radius: 999px;
            padding: 2px 8px;
            font-size: 10px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
            margin-left: 1px;
            line-height: 1.3;
            transition: filter 0.15s;
        }

        .event-notice-btn:hover {
            filter: brightness(1.12);
        }
        
        /* 가위바위보 게임 카드 - 컴팩트 가로 레이아웃 */
        .game-card {
            background: linear-gradient(135deg, rgba(30, 60, 80, 0.95), rgba(20, 40, 60, 0.95));
            border: 1px solid rgba(77, 208, 180, 0.4);
            border-radius: 10px;
            padding: 8px 12px;
            margin: 4px 0;
            display: inline-flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }
        
        .game-header {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }
        
        .game-dealer {
            font-size: 11px;
            font-weight: bold;
            color: var(--room-accent);
        }
        
        .game-points {
            font-size: 12px;
            font-weight: bold;
            color: #ffd700;
            background: rgba(255, 215, 0, 0.15);
            padding: 2px 6px;
            border-radius: 8px;
        }
        
        .game-choices {
            display: flex;
            gap: 6px;
        }

        .game-choices-host {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .game-footer {
            display: none;
        }
        
        /* 채팅 링크 스타일 */
        .chat-link {
            color: var(--room-accent);
            text-decoration: none;
        }
        
        .chat-link:hover {
            text-decoration: underline;
        }
        
        /* 채팅 이미지 — 100%는 부모 fit-content와 순환되어 말풍선이 가로로 커지므로 px만 사용 */
        .chat-image {
            max-width: 200px;
            max-height: 200px;
            width: auto;
            height: auto;
            border-radius: 4px;
            cursor: pointer;
            margin: 0;
            display: block;
            vertical-align: top;
        }

        /* 이모티콘 스티커 (세로 90px, 가로 비율 유지) — img/video 공통 */
        .chat-sticker {
            height: 90px;
            width: auto;
            max-height: 90px;
            object-fit: contain;
            border-radius: 4px;
            cursor: pointer;
            margin: 0;
            display: inline-block;
            vertical-align: middle;
            background: transparent;
        }
        video.chat-sticker {
            pointer-events: auto;
        }
        
        .result-players {
            font-size: 12px;
            color: #fff;
            white-space: nowrap;
        }

        .result-hands {
            font-size: 11px;
            color: #aaa;
            white-space: nowrap;
        }
        
        .result-status {
            font-size: 12px;
            font-weight: bold;
            padding: 4px 8px;
            border-radius: 6px;
            white-space: nowrap;
        }
        
        .result-status.win {
            background: rgba(77, 208, 180, 0.2);
            color: var(--room-accent);
        }
        
        .result-status.draw {
            background: rgba(150, 150, 150, 0.2);
            color: #aaa;
        }
        
        .result-points {
            font-size: 13px;
            font-weight: bold;
            color: #ffd700;
        }
        
        .result-penalty {
            font-size: 12px;
            color: #f44336;
        }
        
        .result-loser {
            font-size: 11px;
            color: #888;
        }
        
        .sw-cancelled {
            display: inline-block;
            padding: 8px 12px;
            background: rgba(99, 110, 114, 0.3);
            border-radius: 8px;
            color: #b2bec3;
            font-size: 13px;
        }
        @keyframes sw-container-pulse {
            from { transform: scale(1); }
            to { transform: scale(1.02); }
        }
        @keyframes sw-land-shake {
            0%, 100% { transform: scale(1) rotate(0deg); }
            20% { transform: scale(1.04) rotate(-1.5deg); }
            40% { transform: scale(1.03) rotate(1.5deg); }
            60% { transform: scale(1.02) rotate(-0.8deg); }
            80% { transform: scale(1.01) rotate(0.5deg); }
        }
        @keyframes sw-pointer-tick {
            from { transform: translateX(-50%) translateY(0); }
            to { transform: translateX(-50%) translateY(-5px); }
        }
        @keyframes sw-status-pulse {
            from { opacity: 0.85; transform: scale(1); }
            to { opacity: 1; transform: scale(1.03); }
        }
        @keyframes sw-status-flash {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }
        @keyframes sw-winner-pop {
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        @keyframes sw-winner-pop-gold {
            0% { opacity: 0; transform: scale(0.4) translateY(20px); }
            60% { opacity: 1; transform: scale(1.12) translateY(-4px); }
            100% { opacity: 1; transform: scale(1) translateY(0); box-shadow: 0 0 24px rgba(255, 215, 0, 0.55); }
        }
        @keyframes sw-confetti-fall {
            to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
        }
        
        /* 룰렛/레이스 진행 알림 스택 (하단 60px 기준, 동시 진행 시 10px 간격) */
        #game-active-notices-stack {
            position: fixed;
            bottom: 60px;
            right: 190px;
            z-index: 10000;
            display: flex;
            flex-direction: column-reverse;
            align-items: stretch;
            gap: 10px;
            width: 180px;
            pointer-events: none;
        }
        #game-active-notices-stack > * {
            pointer-events: auto;
        }

        body.compact-users #game-active-notices-stack {
            right: 8px;
            bottom: 52px;
            width: min(168px, calc(100vw - 16px));
            align-items: flex-end;
        }
        
        @keyframes float-in {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .sw-popup-content {
            background: linear-gradient(135deg, rgba(30, 60, 80, 0.98), rgba(20, 40, 60, 0.98));
            border: 1px solid rgba(255, 107, 107, 0.4);
            border-radius: 12px;
            width: 280px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.5);
        }
        
        .sw-popup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 15px;
            border-bottom: 1px solid rgba(255, 107, 107, 0.2);
            font-size: 14px;
            font-weight: bold;
            color: #ff6b6b;
        }
        
        .sw-popup-close {
            background: none;
            border: none;
            color: #888;
            font-size: 20px;
            cursor: pointer;
        }
        
        .sw-popup-body {
            padding: 15px;
        }
        
        .sw-popup-row {
            margin-bottom: 15px;
        }
        
        .sw-popup-row label {
            display: block;
            font-size: 12px;
            color: #aaa;
            margin-bottom: 6px;
        }
        
        .sw-popup-row input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid rgba(255, 107, 107, 0.3);
            border-radius: 8px;
            background: rgba(0,0,0,0.3);
            color: #fff;
            font-size: 16px;
            box-sizing: border-box;
        }
        
        .sw-popup-row input:focus {
            outline: none;
            border-color: #ff6b6b;
        }
        
        .sw-popup-info {
            font-size: 11px;
            color: #888;
            margin-bottom: 15px;
        }
        
        .sw-mode-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 12px;
        }
        
        .sw-mode-tab {
            flex: 1;
            padding: 8px 6px;
            border: 1px solid rgba(255, 107, 107, 0.35);
            border-radius: 8px;
            background: rgba(0,0,0,0.2);
            color: #ccc;
            font-size: 12px;
            cursor: pointer;
        }
        
        .sw-mode-tab.active {
            background: rgba(255, 107, 107, 0.25);
            border-color: #ff6b6b;
            color: #fff;
            font-weight: bold;
        }
        
        .sw-event-prizes {
            font-size: 11px;
            color: #ffd166;
            margin: 4px 0 6px;
        }
        
        .sw-event-badge {
            display: inline-block;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(255, 209, 102, 0.2);
            color: #ffd166;
            margin-left: 6px;
        }
        
        .sw-popup-footer {
            padding: 12px 15px;
            border-top: 1px solid rgba(255, 107, 107, 0.2);
        }
        
        .sw-popup-submit {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 8px;
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
            color: #fff;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
        }
        
        .sw-popup-submit:hover {
            opacity: 0.9;
        }
        
        /* 유저 컨텍스트 메뉴 */
        #user-menu {
            display: none;
            position: fixed;
            background: linear-gradient(135deg, #1a2634 0%, #0d1b2a 100%);
            border: 1px solid rgba(77, 208, 180, 0.4);
            border-radius: 8px;
            padding: 5px 0;
            min-width: 140px;
            max-width: min(280px, calc(100vw - 16px));
            max-height: min(calc(100vh - 16px), 420px);
            overflow-x: hidden;
            overflow-y: auto;
            z-index: 999999;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        }
        
        #user-menu.show {
            display: block;
        }
        
        .user-menu-header {
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 600;
            color: var(--room-accent);
            border-bottom: 1px solid rgba(77, 208, 180, 0.2);
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }

        .user-menu-ip {
            display: none;
            padding: 4px 12px 8px;
            font-size: 11px;
            color: #8fd4ff;
            border-bottom: 1px solid rgba(77, 208, 180, 0.2);
            cursor: pointer;
            text-decoration: underline;
            word-break: break-all;
        }

        .user-menu-ip:hover {
            color: #fff;
        }

        .user-menu-ip.copied {
            color: var(--room-accent);
            text-decoration: none;
        }
        
        .user-menu-item {
            padding: 10px 15px;
            cursor: pointer;
            font-size: 13px;
            color: #e0f2f1;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s;
        }
        
        .user-menu-item:hover {
            background: rgba(77, 208, 180, 0.2);
        }
        
        .user-menu-item .icon {
            font-size: 14px;
        }
        
        /* 플러그인 메뉴 영역 */
        #user-menu-plugin:not(:empty) {
            border-top: 1px solid rgba(77, 208, 180, 0.2);
            margin-top: 5px;
            padding-top: 5px;
        }
        
        /* 운영자 메뉴 영역 */
        #user-menu-admin:not(:empty),
        #user-menu-self-admin:not(:empty) {
            border-top: 1px solid rgba(255, 100, 100, 0.3);
            margin-top: 5px;
            padding-top: 5px;
        }
        
        #user-menu-admin,
        #user-menu-self-admin,
        #user-menu-self {
            display: none;
        }

        #user-menu-self:not(:empty) {
            border-top: 1px solid var(--room-accent-a20);
            margin-top: 5px;
            padding-top: 5px;
        }
        
        .user-menu-item.admin-item {
            color: #ff8a80;
        }
        
        .user-menu-item.admin-item:hover {
            background: rgba(255, 100, 100, 0.2);
        }
        
        .admin-ban-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            padding: 8px 12px;
            gap: 4px;
            border-top: 1px solid rgba(255, 138, 128, 0.2);
            border-bottom: 1px solid rgba(255, 138, 128, 0.2);
        }
        
        .ban-btn {
            background: rgba(255, 100, 100, 0.3);
            border: 1px solid rgba(255, 138, 128, 0.5);
            border-radius: 4px;
            padding: 6px 8px;
            cursor: pointer;
            font-size: 11px;
            color: #fff;
            transition: all 0.2s;
            text-align: center;
        }
        
        .ban-btn:hover {
            background: rgba(255, 100, 100, 0.6);
        }
        
        .ban-btn.ban-unban {
            background: rgba(76, 175, 80, 0.3);
            border-color: rgba(76, 175, 80, 0.5);
        }
        
        .ban-btn.ban-unban:hover {
            background: rgba(76, 175, 80, 0.6);
        }
        
        .ban-btn[data-action="kick"] {
            background: rgba(255, 50, 50, 0.4);
            border-color: rgba(255, 50, 50, 0.6);
        }
        
        .ban-btn[data-action="kick"]:hover {
            background: rgba(255, 50, 50, 0.7);
        }
        
        /* 차단된 유저 화면 */
        #kicked-screen {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(26, 38, 52, 0.98);
            z-index: 9999;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #ff6b6b;
        }
        
        #kicked-screen.show {
            display: flex;
        }
        
        #kicked-screen .kicked-icon {
            font-size: 64px;
            margin-bottom: 20px;
        }
        
        #kicked-screen .kicked-title {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 10px;
        }
        
        #kicked-screen .kicked-msg {
            font-size: 14px;
            color: #aaa;
        }

        #connection-error-screen {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(26, 38, 52, 0.97);
            z-index: 9998;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #ffb74d;
            padding: 24px;
            text-align: center;
        }

        #connection-error-screen.show {
            display: flex;
        }

        #connection-error-screen .conn-error-icon {
            font-size: 56px;
            margin-bottom: 16px;
        }

        #connection-error-screen .conn-error-title {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 10px;
            color: #ffe0b2;
        }

        #connection-error-screen .conn-error-detail {
            font-size: 14px;
            color: #cfd8dc;
            line-height: 1.5;
            max-width: 420px;
            margin-bottom: 8px;
        }

        #connection-error-screen .conn-error-code {
            font-size: 13px;
            font-weight: 700;
            color: #ff9800;
            margin: 10px 0 6px;
            letter-spacing: 0.5px;
        }

        #connection-error-screen .conn-error-hint {
            font-size: 12px;
            color: #90a4ae;
            max-width: 420px;
            line-height: 1.45;
            margin-bottom: 18px;
        }

        #connection-error-screen .conn-error-retry {
            border: none;
            border-radius: 8px;
            padding: 10px 18px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            background: #ff9800;
            color: #1a2634;
        }

        #connection-error-screen .conn-error-retry:hover {
            background: #ffb74d;
        }
        
        /* 차단된 유저 목록 (관리자용) */
        #kicked-list {
            display: none;
            padding: 10px;
            border-top: 1px solid rgba(255, 100, 100, 0.3);
            background: rgba(255, 0, 0, 0.05);
        }
        
        #kicked-list.show {
            display: block;
        }
        
        #kicked-list .kicked-title {
            color: #ff6b6b;
            font-size: 11px;
            font-weight: bold;
            margin-bottom: 8px;
        }
        
        .kicked-user-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 8px;
            margin-bottom: 4px;
            background: rgba(255, 100, 100, 0.1);
            border-radius: 4px;
            font-size: 12px;
        }
        
        .kicked-user-item .kicked-nick {
            color: #ff8a80;
            text-decoration: line-through;
        }
        
        .kicked-user-item .unkick-btn {
            background: rgba(76, 175, 80, 0.3);
            border: 1px solid rgba(76, 175, 80, 0.5);
            border-radius: 3px;
            padding: 2px 8px;
            cursor: pointer;
            font-size: 10px;
            color: #4caf50;
        }
        
        .kicked-user-item .unkick-btn:hover {
            background: rgba(76, 175, 80, 0.5);
        }
        
        /* + 버튼 플러그인 메뉴 - 2열 그리드 (입력바 바로 위) */
        #plugin-menu {
            display: none;
            position: fixed;
            left: 10px;
            bottom: 8px;
            background: rgba(26, 38, 52, 0.98);
            border: 1px solid rgba(77, 208, 180, 0.3);
            border-radius: 8px;
            padding: 6px;
            width: 196px;
            max-width: calc(100vw - 20px);
            box-sizing: border-box;
            max-height: min(320px, calc(100vh - 24px));
            overflow-x: hidden;
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            z-index: 99999;
        }
        
        #plugin-menu.show {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 4px;
            align-content: start;
        }
        
        .plugin-menu-item {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
            width: 100%;
            box-sizing: border-box;
            padding: 7px 4px;
            cursor: pointer;
            transition: background 0.15s;
            font-size: 10px;
            line-height: 1.25;
            color: #e0f2f1;
            text-align: center;
            border-radius: 4px;
            background: rgba(77, 208, 180, 0.1);
            white-space: normal;
            word-break: keep-all;
            overflow: hidden;
        }
        
        .plugin-menu-item:hover {
            background: rgba(77, 208, 180, 0.3);
        }
        
        .plugin-menu-item[data-admin="true"] {
            display: none;
            color: #ff8a80;
            background: rgba(255, 100, 100, 0.1);
        }
        
        .plugin-menu-item[data-admin="true"]:hover {
            background: rgba(255, 100, 100, 0.3);
        }
        
        .plugin-menu-item[data-admin="true"].show-admin {
            display: flex;
        }

        /* 좁은 화면에서만 + 메뉴에 게임 노출 (넓은 화면은 입력바 아이콘 사용) */
        .plugin-menu-item.plugin-menu-game {
            display: none;
        }
        body.compact-users #plugin-menu.show .plugin-menu-item.plugin-menu-game {
            display: flex;
        }

        @media (max-width: 720px) {
            #plugin-menu.show .plugin-menu-item.plugin-menu-game {
                display: flex;
            }
        }

        /* 유튜브 라이브 방송 — PIP 플로팅 창 (콘텐츠 높이만 사용) */
        #live-stream-panel {
            display: none;
            position: fixed;
            top: 8px;
            right: 168px;
            width: 300px;
            max-width: calc(100vw - 16px);
            height: auto;
            z-index: 150;
            background: var(--room-bg-top-a98);
            border: 1px solid var(--room-accent-a25);
            border-radius: 8px;
            padding: 0;
            box-sizing: border-box;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
            overflow: hidden;
        }
        body.compact-users #live-stream-panel {
            right: 8px;
        }
        body.compact-users.users-panel-open #live-stream-panel {
            right: 168px;
        }
        #live-stream-panel.open {
            display: block;
        }
        #live-stream-panel-header {
            display: flex;
            flex-direction: column;
            gap: 0;
            padding: 0;
            cursor: default;
            border-bottom: 1px solid var(--room-accent-a15);
            background: var(--room-accent-a10);
            user-select: none;
        }
        #live-stream-panel-dragbar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 8px;
            cursor: grab;
            touch-action: none;
            border-bottom: 1px solid var(--room-accent-a10);
        }
        #live-stream-panel-dragbar:active {
            cursor: grabbing;
        }
        .live-stream-drag-handle {
            flex: 0 0 auto;
            color: var(--room-text-muted);
            font-size: 14px;
            line-height: 1;
            opacity: 0.85;
        }
        .live-stream-drag-label {
            flex: 1 1 auto;
            font-size: 10px;
            font-weight: 600;
            color: var(--room-text-muted);
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        #live-stream-panel-header:active {
            cursor: default;
        }
        #live-stream-panel-body {
            padding: 6px 8px 8px;
        }
        #live-stream-tabs {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
            flex: 1 1 auto;
            min-width: 0;
            margin-bottom: 0;
            padding: 4px 8px 5px;
        }
        .live-stream-tab {
            border: 1px solid var(--room-accent-a25);
            background: var(--room-accent-a10);
            color: var(--room-text);
            border-radius: 999px;
            padding: 3px 10px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            line-height: 1.3;
        }
        .live-stream-tab.active {
            background: var(--room-accent-a25);
            border-color: var(--room-accent);
            color: var(--room-accent);
        }
        #live-stream-player-wrap {
            position: relative;
            width: 100%;
            aspect-ratio: 16 / 9;
            background: #000;
            border-radius: 6px;
            overflow: hidden;
        }
        #live-stream-player-wrap.live-stream-interactive #live-stream-player {
            pointer-events: auto;
        }
        #live-stream-player-wrap.live-stream-interactive #live-stream-touch-shield {
            display: none;
        }
        #live-stream-player {
            width: 100%;
            height: 100%;
            border: 0;
            display: block;
            pointer-events: none;
        }
        #live-stream-touch-shield {
            position: absolute;
            inset: 0;
            z-index: 2;
            cursor: default;
            background: transparent;
        }
        #live-stream-panel-actions {
            display: flex;
            gap: 6px;
            margin-top: 6px;
        }
        #live-stream-panel-actions button {
            border: 1px solid var(--room-accent-a25);
            background: var(--room-accent-a10);
            color: var(--room-text);
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
        }
        #live-stream-viewer-stats {
            display: none;
            padding: 5px 8px 6px;
            border-bottom: 1px solid var(--room-accent-a10);
            background: rgba(0, 0, 0, 0.12);
        }
        #live-stream-panel.open #live-stream-viewer-stats {
            display: block;
        }
        .live-stream-viewer-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 4px;
        }
        .live-stream-viewer-label {
            font-size: 10px;
            font-weight: 600;
            color: var(--room-text-muted);
        }
        #live-stream-viewer-count {
            font-size: 12px;
            font-weight: 700;
            color: #4dd0b4;
        }
        #live-stream-viewer-feed {
            display: block;
            font-size: 10px;
            line-height: 1.45;
            max-height: 32px;
            overflow: hidden;
            color: #81c784;
            word-break: break-all;
        }
        .live-stream-viewer-name {
            display: inline;
            white-space: nowrap;
        }
        .live-stream-viewer-name:not(:last-child)::after {
            content: ', ';
            color: var(--room-text-muted);
        }
        .live-stream-viewer-name-empty {
            color: var(--room-text-muted);
        }
        #live-stream-stop-btn {
            border-color: #ef5350 !important;
            color: #ff8a80 !important;
        }
        #live-stream-volume-wrap {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            gap: 4px;
            width: auto;
            max-width: 88px;
            padding: 2px 5px;
            border: 1px solid var(--room-accent-a25);
            border-radius: 6px;
            background: var(--room-accent-a10);
        }
        #live-stream-volume-wrap.muted {
            border-color: #ef5350 !important;
            background: rgba(239, 83, 80, 0.12) !important;
        }
        #live-stream-volume-icon {
            flex: 0 0 auto;
            font-size: 11px;
            line-height: 1;
            opacity: 0.9;
        }
        #live-stream-volume {
            flex: 0 0 56px;
            width: 56px;
            height: 3px;
            margin: 0;
            accent-color: var(--room-accent);
            cursor: pointer;
        }
        #live-stream-fullscreen-btn {
            flex: 0 0 auto;
            min-width: 34px;
            padding: 4px 8px !important;
            font-size: 13px !important;
            line-height: 1;
        }
        #live-stream-panel.live-stream-fullscreen {
            position: fixed !important;
            inset: 0 !important;
            left: 0 !important;
            top: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            height: 100% !important;
            z-index: 600;
            border-radius: 0;
            display: flex;
            flex-direction: column;
            box-shadow: none;
        }
        #live-stream-panel.live-stream-fullscreen .live-stream-resize-handle {
            display: none;
        }
        #live-stream-panel.live-stream-fullscreen #live-stream-panel-body {
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            min-height: 0;
            padding: 8px;
        }
        #live-stream-panel.live-stream-fullscreen #live-stream-player-wrap {
            flex: 1 1 auto;
            aspect-ratio: auto;
            min-height: 0;
            height: auto;
        }
        #live-stream-panel.live-stream-fullscreen #live-stream-panel-actions {
            flex: 0 0 auto;
        }
        .live-stream-resize-handle {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 20px;
            height: 20px;
            z-index: 160;
            cursor: nwse-resize;
            touch-action: none;
        }
        .live-stream-resize-handle::after {
            content: '';
            position: absolute;
            right: 5px;
            bottom: 5px;
            width: 9px;
            height: 9px;
            border-right: 2px solid var(--room-text-muted);
            border-bottom: 2px solid var(--room-text-muted);
            opacity: 0.75;
            pointer-events: none;
        }
        .live-stream-resize-handle:hover::after {
            border-color: var(--room-accent);
            opacity: 1;
        }
        #live-stream-popup {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 500;
            background: rgba(0, 0, 0, 0.55);
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        #live-stream-popup.show {
            display: flex;
        }
        #live-stream-popup .live-stream-popup-content {
            width: min(420px, 100%);
            background: linear-gradient(180deg, var(--room-bg-top-a98), var(--room-bg-bottom-a98));
            border: 1px solid var(--room-accent-a25);
            border-radius: 10px;
            padding: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
        }
        #live-stream-popup h3 {
            margin: 0 0 8px;
            color: var(--room-accent);
            font-size: 15px;
        }
        #live-stream-popup p {
            margin: 0 0 10px;
            color: var(--room-text-muted);
            font-size: 12px;
            line-height: 1.4;
        }
        #live-stream-url-input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid var(--room-accent-a25);
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.25);
            color: var(--room-text);
            padding: 8px 10px;
            font-size: 12px;
            margin-bottom: 12px;
        }
        #live-stream-popup .live-stream-popup-buttons {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }
        #live-stream-popup .live-stream-popup-buttons button {
            border: none;
            border-radius: 6px;
            padding: 7px 14px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }
        #live-stream-start-btn {
            background: linear-gradient(135deg, var(--room-accent), var(--room-accent-a25));
            color: #0d1b2a;
        }
        #live-stream-popup-cancel {
            background: rgba(255, 255, 255, 0.08);
            color: var(--room-text-muted);
        }
        
        /* 이미지 업로드 알림 */
        #upload-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        
        #upload-overlay.active {
            display: flex;
        }

        #upload-overlay-close {
            position: absolute;
            top: 12px;
            right: 14px;
            border: none;
            background: transparent;
            color: #cfd8dc;
            font-size: 14px;
            cursor: pointer;
            padding: 6px 10px;
            border-radius: 6px;
            z-index: 1001;
        }

        #upload-overlay-close:hover {
            background: rgba(255,255,255,0.08);
            color: #fff;
        }
        
        #upload-box {
            background: #1a2634;
            border: 2px dashed #4dd0b4;
            border-radius: 16px;
            padding: 40px;
            text-align: center;
            pointer-events: none;
        }
        
        #upload-box h3 {
            color: var(--room-accent);
            margin-bottom: 10px;
        }
        
        #upload-box p {
            color: #607d8b;
            font-size: 12px;
        }
        
        /* 채팅 영역 스크롤바 - 항상 보이는 둥근 디자인 */
        #messages {
            overflow-y: scroll !important;
            overflow-x: hidden;
        }

        #new-messages-pill {
            position: absolute;
            bottom: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 110;
            display: none;
            padding: 7px 14px;
            border-radius: 999px;
            border: 1px solid var(--room-accent-a25);
            background: var(--room-bubble-bg);
            color: var(--room-accent);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
            white-space: nowrap;
        }

        #new-messages-pill:hover {
            background: var(--room-accent-a10);
        }

        #live-stream-view-pill {
            position: absolute;
            bottom: 8px;
            right: 16px;
            left: auto;
            transform: none;
            z-index: 110;
            display: none;
            padding: 7px 12px;
            border-radius: 999px;
            border: 2px solid #64b5f6;
            background: linear-gradient(145deg, rgba(26, 36, 56, 0.96), rgba(16, 24, 40, 0.96));
            color: #90caf9;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(100, 181, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            white-space: nowrap;
            max-width: calc(100% - 40px);
            overflow: hidden;
            text-overflow: ellipsis;
            animation: liveStreamPillIn 0.25s ease;
        }
        #live-stream-view-pill.show {
            display: block;
        }
        #live-stream-view-pill:hover {
            border-color: #90caf9;
            background: linear-gradient(145deg, rgba(36, 52, 80, 0.98), rgba(22, 34, 56, 0.98));
            color: #e3f2fd;
            box-shadow: 0 5px 18px rgba(100, 181, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }
        @keyframes liveStreamPillIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        #messages::-webkit-scrollbar { 
            width: 10px;
        }
        #messages::-webkit-scrollbar-track { 
            background: var(--room-scrollbar-track);
            border-radius: 10px;
            margin: 5px 0;
        }
        #messages::-webkit-scrollbar-thumb { 
            background: var(--room-scrollbar-thumb);
            border-radius: 10px;
            border: 2px solid var(--room-scrollbar-track);
            min-height: 40px;
        }
        #messages::-webkit-scrollbar-thumb:hover { 
            background: var(--room-scrollbar-thumb-hover);
        }
        
        /* 접속자 목록은 스크롤바 숨김 */
        #user-list::-webkit-scrollbar,
        #user-items::-webkit-scrollbar { 
            width: 0;
            display: none;
        }
        
        /* Firefox */
        #messages {
            scrollbar-width: auto;
            scrollbar-color: var(--room-scrollbar-thumb) var(--room-scrollbar-track);
        }
        #user-list, #user-items {
            scrollbar-width: none;
            overflow-y: auto;
            overflow-x: hidden;
        }
        
        /* 반응형 - 세부 조정 */
        @media (max-width: 600px) {
            .user-profile { max-height: 40px; }
            .user-nick { font-size: 10px; }
            .msg-bubble { padding: 3px 5px; max-width: 75%; }
            .msg-bubble:has(.chat-sticker),
            .msg-bubble:has(.chat-image),
            .msg-bubble:has(.msg-text > img.chat-image:only-child),
            .msg-bubble:has(.msg-text > img.chat-sticker:only-child),
        .msg-bubble:has(.msg-text > video.chat-sticker:only-child),
            .msg-bubble:has(.msg-text > img:only-child) {
                padding: 2px;
                width: max-content;
                max-width: min(208px, 75%);
                flex: 0 0 auto;
            }
            .msg-profile { max-height: 50px; }
            .msg-level { height: 16px; }
        }
        
        @media (max-width: 400px) {
            .user-nick { font-size: 9px; }
            .user-level { height: 14px; }
        }
    