.watch-party-launch-btn {
    position: relative;
    z-index: 2;
    min-width: 52px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(18, 23, 33, 0.82);
    color: #f6f3ec;
    font-size: 13px;
    font-weight: 700;
}

.watch-party-launch-btn.connected {
    background: rgba(31, 72, 53, 0.88);
    border-color: rgba(126, 190, 152, 0.55);
}

.watch-party-launch-btn.watch-party-launch-btn-light {
    background: #f3eee3;
    border-color: #d8d2c4;
    color: #3b4756;
}

.watch-party-launch-btn.watch-party-launch-btn-light.connected {
    background: #e7efe4;
    border-color: #bfd0b8;
    color: #244030;
}

.watch-party-launch-btn.is-open {
    visibility: hidden;
    pointer-events: none;
}

.watch-party-launch-btn-floating {
    position: fixed;
    right: 16px;
    bottom: 84px;
    z-index: 3204;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.watch-party-panel {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px;
    background: rgba(17, 15, 13, 0.94);
    color: #f4efe5;
    box-shadow: 0 18px 60px rgba(0,0,0,0.45);
    backdrop-filter: blur(14px);
    z-index: 3205;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.watch-party-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.watch-party-panel.watch-party-panel-light {
    background: rgba(250, 249, 246, 0.985);
    color: #1f2933;
    border-color: #e4e3dc;
    box-shadow: 0 14px 36px rgba(31, 41, 51, 0.10);
}

.watch-party-panel.watch-party-panel-light .watch-party-panel-title,
.watch-party-panel.watch-party-panel-light .watch-party-card h3,
.watch-party-panel.watch-party-panel-light .watch-party-participant-name,
.watch-party-panel.watch-party-panel-light .watch-party-chat-text {
    color: #1f2933;
}

.watch-party-panel.watch-party-panel-light .watch-party-panel-subtitle,
.watch-party-panel.watch-party-panel-light .watch-party-muted,
.watch-party-panel.watch-party-panel-light .watch-party-participant-meta,
.watch-party-panel.watch-party-panel-light .watch-party-draw-notice,
.watch-party-panel.watch-party-panel-light .watch-party-chat-empty {
    color: #6b7280;
}

.watch-party-panel.watch-party-panel-light .watch-party-close-btn {
    background: #f3eee3;
    border: 1px solid #ddd4c5;
    color: #334155;
}

.watch-party-panel.watch-party-panel-light .watch-party-status {
    background: #f3f1eb;
    color: #425061;
}

.watch-party-panel.watch-party-panel-light .watch-party-status.error {
    background: #f7d8d6;
    color: #7a241e;
}

.watch-party-panel.watch-party-panel-light .watch-party-status.success {
    background: #dbead8;
    color: #25533a;
}

.watch-party-panel.watch-party-panel-light .watch-party-card {
    background: #fffdf8;
    border-color: #e4ddd0;
}

.watch-party-panel.watch-party-panel-light .watch-party-room-code {
    background: #f3eee3;
    border: 1px solid #ddd4c5;
    color: #475569;
}

.watch-party-panel.watch-party-panel-light .watch-party-badge {
    background: #f3eee3;
    color: #5b6470;
}

.watch-party-panel.watch-party-panel-light .watch-party-badge.host {
    background: #d6e8d1;
    color: #23402d;
}

.watch-party-panel.watch-party-panel-light .watch-party-field label {
    color: #59626b;
}

.watch-party-panel.watch-party-panel-light .watch-party-field input,
.watch-party-panel.watch-party-panel-light .watch-party-chat-form input {
    background: transparent;
    color: #2f2419;
}

.watch-party-panel.watch-party-panel-light .watch-party-field input {
    border-color: #ddd8ce;
    background: #fffdf9;
}

.watch-party-panel.watch-party-panel-light .watch-party-field input::placeholder,
.watch-party-panel.watch-party-panel-light .watch-party-chat-form input::placeholder {
    color: #8a8f98;
}

.watch-party-panel.watch-party-panel-light .watch-party-actions button,
.watch-party-panel.watch-party-panel-light .watch-party-inline-actions button,
.watch-party-panel.watch-party-panel-light .watch-party-chip-button,
.watch-party-panel.watch-party-panel-light .watch-party-toggle-button,
.watch-party-panel.watch-party-panel-light .watch-party-chat-form button {
    background: #f3eee3;
    color: #3b4756;
    border: 1px solid #d8d2c4;
    box-shadow: 0 6px 14px rgba(51, 65, 85, 0.08);
}

.watch-party-panel.watch-party-panel-light .watch-party-actions button.secondary,
.watch-party-panel.watch-party-panel-light .watch-party-inline-actions button.secondary,
.watch-party-panel.watch-party-panel-light .watch-party-chip-button.secondary,
.watch-party-panel.watch-party-panel-light .watch-party-toggle-button.secondary {
    background: #f7f5ef;
    color: #59626b;
    border: 1px solid #e3dfd5;
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-item {
    background: #f7f3ea;
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-item.system {
    background: #f3eee3;
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-author {
    color: #8a5b28;
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-system-text {
    color: #6b7280;
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-compose {
    border-color: #ddd4c5;
    background: linear-gradient(180deg, #fffdf9 0%, #f7f3ea 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.watch-party-panel.watch-party-panel-light .watch-party-chat-compose-badge {
    background: #f3eee3;
    color: #6b7280;
}

.watch-party-panel.watch-party-panel-light .watch-party-range-value {
    color: #59626b;
}

.watch-party-panel.watch-party-panel-light .watch-party-section-tab {
    background: #f7f3ea;
    border-color: #e3dfd5;
    color: #6b7280;
}

.watch-party-panel.watch-party-panel-light .watch-party-section-tab.active {
    background: #f3eee3;
    border-color: #d8d2c4;
    color: #3b4756;
}

.watch-party-panel.watch-party-panel-light .watch-party-section-tab-count {
    background: rgba(89, 98, 107, 0.10);
}

.watch-party-panel.watch-party-panel-light .watch-party-card-toggle {
    background: #f7f3ea;
    border-color: #e3dfd5;
    color: #6b7280;
}

.watch-party-panel-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-right: 52px;
}

.watch-party-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
}

.watch-party-panel-subtitle {
    margin: 4px 0 0;
    color: rgba(244,239,229,0.68);
    font-size: 12px;
    line-height: 1.5;
}

.watch-party-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #f4efe5;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.watch-party-close-btn:hover {
    background: rgba(255,255,255,0.14);
}

.watch-party-status {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    color: #f4efe5;
    font-size: 13px;
    line-height: 1.5;
}

.watch-party-status.error {
    background: rgba(120, 28, 28, 0.35);
    color: #ffd3d3;
}

.watch-party-status.success {
    background: rgba(27, 86, 49, 0.35);
    color: #d9ffe8;
}

.watch-party-panel-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 225, 191, 0.32) transparent;
}

.watch-party-panel-body::-webkit-scrollbar,
.watch-party-chat-log::-webkit-scrollbar {
    width: 8px;
}

.watch-party-panel-body::-webkit-scrollbar-track,
.watch-party-chat-log::-webkit-scrollbar-track {
    background: transparent;
}

.watch-party-panel-body::-webkit-scrollbar-thumb,
.watch-party-chat-log::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(244, 225, 191, 0.32);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.watch-party-panel-body::-webkit-scrollbar-thumb:hover,
.watch-party-chat-log::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 225, 191, 0.48);
    background-clip: padding-box;
}

.page-viewer.watch-party-follow-only .viewer-nav,
.page-viewer.watch-party-follow-only .viewer-zoom-controls,
.page-viewer.watch-party-follow-only .viewer-close,
.page-viewer.watch-party-follow-only .viewer-help-btn,
.page-viewer.watch-party-follow-only .viewer-info-btn,
.page-viewer.watch-party-follow-only .viewer-comments-btn,
.page-viewer.watch-party-follow-only .thumbnail-navigation,
.page-viewer.watch-party-follow-only .viewer-help-panel,
.page-viewer.watch-party-follow-only .viewer-detail-panel,
.page-viewer.watch-party-follow-only .dual-nav-controls,
.page-viewer.watch-party-follow-only .dual-nav-btn,
.page-viewer.watch-party-follow-only .dual-icon-btn,
.page-viewer.watch-party-follow-only .dual-single-btn,
.page-viewer.watch-party-follow-only .dual-basis-btn {
    display: none !important;
}

.watch-party-card {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

.watch-party-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.watch-party-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

.watch-party-card-toggle {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: rgba(244,239,229,0.72);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.watch-party-muted {
    color: rgba(244,239,229,0.66);
    font-size: 12px;
    line-height: 1.55;
}

.watch-party-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.watch-party-field label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(244,239,229,0.72);
}

.watch-party-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(12, 11, 10, 0.64);
    color: #f4efe5;
    font-size: 14px;
}

.watch-party-actions,
.watch-party-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.watch-party-actions button,
.watch-party-inline-actions button,
.watch-party-chip-button,
.watch-party-toggle-button {
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: #f2e1bf;
    color: #33261b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.watch-party-actions button.secondary,
.watch-party-inline-actions button.secondary,
.watch-party-chip-button.secondary,
.watch-party-toggle-button.secondary {
    background: rgba(255,255,255,0.08);
    color: #f4efe5;
}

.watch-party-actions button.danger,
.watch-party-inline-actions button.danger {
    background: rgba(139, 35, 35, 0.82);
    color: #fff3f3;
}

.watch-party-room-meta {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.watch-party-room-elapsed {
    font-weight: 800;
    color: #f6e8cb;
}

.watch-party-room-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.watch-party-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255,255,255,0.1);
    color: #f5f0e6;
}

.watch-party-badge.host {
    background: rgba(227, 190, 112, 0.2);
    color: #ffebc2;
}

.watch-party-participants {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 225, 191, 0.32) transparent;
}

.watch-party-participant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
}

.watch-party-participant-main {
    min-width: 0;
}

.watch-party-participant-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff7eb;
}

.watch-party-participant-meta {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(244,239,229,0.66);
}

.watch-party-draw-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.watch-party-color-palette {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.watch-party-color-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.watch-party-color-button.active {
    border-color: #fff6e7;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

.watch-party-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.watch-party-range input {
    flex: 1;
}

.watch-party-range-value {
    flex: 0 0 auto;
    min-width: 76px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: rgba(244,239,229,0.82);
}

.watch-party-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    height: 320px;
    overflow: hidden;
}

.watch-party-chat-log {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: none;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.watch-party-chat-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
}

.watch-party-chat-item.system {
    justify-content: center;
    background: rgba(255,255,255,0.035);
}

.watch-party-chat-author {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #ffe6b3;
}

.watch-party-chat-system-text {
    color: rgba(244,239,229,0.72);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.watch-party-chat-text {
    flex: 1 1 auto;
    color: #f4efe5;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.watch-party-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    padding-top: 4px;
}

.watch-party-chat-compose {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.watch-party-chat-compose-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: rgba(244,239,229,0.7);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.watch-party-chat-form input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f6f1e7;
    font-size: 14px;
    outline: none;
}

.watch-party-chat-form input::placeholder {
    color: rgba(244,239,229,0.45);
}

.watch-party-chat-form button {
    flex: 0 0 auto;
    min-width: 76px;
    height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    border: 0;
    background: #f2e1bf;
    color: #33261b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.watch-party-chat-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.watch-party-section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.watch-party-section-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: rgba(244,239,229,0.72);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.watch-party-section-tab.active {
    background: #f2e1bf;
    border-color: #f2e1bf;
    color: #33261b;
}

.watch-party-section-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 800;
}

.watch-party-section-tab.active .watch-party-section-tab-count {
    background: rgba(51,38,27,0.12);
}

.watch-party-chat-empty {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: rgba(244,239,229,0.68);
    font-size: 12px;
    line-height: 1.5;
}

.watch-party-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1004;
    pointer-events: none;
}

.watch-party-overlay-canvas.drawing-enabled {
    pointer-events: auto;
    cursor: crosshair;
}

.watch-party-draw-notice {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(244,239,229,0.66);
    line-height: 1.5;
}

.watch-party-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .watch-party-launch-btn {
        min-width: 56px;
        height: 38px;
        padding: 0 12px;
        font-size: 12px;
    }

    .watch-party-launch-btn-floating {
        right: 12px;
        bottom: 78px;
    }

    .watch-party-panel {
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - 24px);
        border-radius: 18px;
        padding: 14px;
    }

    .watch-party-panel-body {
        gap: 12px;
    }

    .watch-party-chat-log {
        min-height: 150px;
    }

    .watch-party-range {
        align-items: flex-start;
        flex-direction: column;
    }

    .watch-party-range-value {
        min-width: 0;
        text-align: left;
    }
}
