/* =========================================
   1. ROOT VARIABLES
   ========================================= */
:root {
    /* Dark theme (default) */
    --bg-main: #09090b;
    --bg-panel: #18181b;
    --bg-chat: #131316;
    --bg-card: #1a1a1e;
    --bg-input: rgba(9, 9, 11, 0.6);
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-card: rgba(255, 255, 255, 0.08);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --text-secondary: #71717a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 50px 120px -20px rgba(0, 0, 0, 0.9);
    --ticket-bg: #fdf6e3;
    --ticket-text: #1a1a1e;
    --ticket-border: #d4a373;

    /* Bubble colors */
    --bubble-mine: #3b82f6;
    --bubble-others: #27272a;
    --radius-lg: 14px;
    --radius-md: 8px;
    --transition-fast: 0.15s ease;
}

/* Light theme - TIX ID Style */
[data-theme="light"] {
    --bg-main: #f5f7fa;
    --bg-panel: #ffffff;
    --bg-chat: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-soft: rgba(0, 0, 0, 0.06);
    --border-card: rgba(0, 0, 0, 0.08);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #1a1a1e;
    --text-muted: #6b7280;
    --text-secondary: #9ca3af;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 50px 120px -20px rgba(0, 0, 0, 0.1);
    --ticket-bg: #fdf6e3;
    --ticket-text: #1a1a1e;
    --ticket-border: #d4a373;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); height: 100vh; width: 100vw; overflow: hidden; font-size: 14px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* =========================================
   BIOSKOP PREMIUM - LIKE TIX ID / M-TIX
   ========================================= */

.bioskop-modal {
    background: rgba(10, 10, 14, 0.98);
    border-radius: 28px;
    width: 94%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 60px 140px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    animation: modalSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.bioskop-step {
    display: none;
    padding: 28px 32px 32px;
}

.bioskop-step.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

/* ===== STEP 1: MOVIE INFO ===== */

.movie-info-card {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.movie-poster {
    width: 80px;
    height: 110px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    overflow: hidden;
    position: relative;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.poster-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
}

.movie-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-title {
    font-size: 18px;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 4px;
}

.movie-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #a1a1aa;
    margin-bottom: 8px;
}

.movie-rating {
    color: #fbbf24;
}

.movie-schedule {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.schedule-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 20px;
    color: #a1a1aa;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== STEP 2: CINEMA LAYOUT ===== */

.cinema-screen {
    position: relative;
    margin: 8px auto 24px;
    max-width: 85%;
    text-align: center;
}

.screen-curve {
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-bottom: none;
    box-shadow: 0 -20px 60px rgba(59, 130, 246, 0.1);
}

.screen-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #52525b;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: rgba(10, 10, 14, 0.9);
    padding: 0 16px;
}

/* ===== SEAT LEGEND ===== */

.seat-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #a1a1aa;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
}

.legend-box.available {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.legend-box.selected {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.legend-box.taken {
    background: #27272a;
    border-color: #3f3f46;
    opacity: 0.6;
}

.legend-box.vip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
}

/* ===== SEAT GRID ===== */

.seat-grid-container {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 4px 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto;
    padding: 8px;
}

.seat {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #71717a;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 30px;
    min-height: 30px;
    position: relative;
}

.seat::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.05);
}

.seat:hover:not(.taken) {
    transform: scale(1.08);
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.seat.selected {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.3);
}

.seat.selected::before {
    background: rgba(255, 255, 255, 0.1);
}

.seat.taken {
    background: #1a1a1e;
    border-color: #2a2a2e;
    color: #3f3f46;
    cursor: not-allowed;
    opacity: 0.5;
}

.seat.vip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border-color: rgba(245, 158, 11, 0.3);
}

.seat.vip::after {
    content: '⭐';
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 8px;
}

/* ===== BOOKING SUMMARY ===== */

.booking-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-left {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 11px;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-price {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
}

.summary-right {
    text-align: right;
}

.summary-seats {
    font-size: 12px;
    color: #a1a1aa;
}

/* ===== HEADER ===== */

.bioskop-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    padding: 0 40px;
}

.bioskop-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bioskop-subtitle {
    color: #71717a;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.bioskop-title {
    font-size: 20px;
    font-weight: 700;
    color: #fafafa;
}

.bioskop-back {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: #71717a;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
}

.bioskop-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.bioskop-info {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #a1a1aa;
}

.seat-count {
    font-weight: 700;
    color: #60a5fa;
    font-size: 16px;
}

.seat-label {
    font-size: 12px;
}

.total-price {
    font-weight: 700;
    color: #fbbf24;
    font-size: 14px;
    margin-left: 8px;
}

/* ===== FIELDS ===== */

.bioskop-field {
    margin-bottom: 16px;
}

.bioskop-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.bioskop-input {
    width: 100%;
    background: rgba(9, 9, 11, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 14px 44px 14px 16px;
    border-radius: 12px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s ease;
}

.bioskop-input:focus {
    border-color: #3b82f6;
    background: rgba(24, 24, 27, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.bioskop-input::placeholder {
    color: #52525b;
}

.input-icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #52525b;
    font-size: 16px;
}

/* ===== BUTTONS ===== */

.bioskop-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.bioskop-btn {
    width: 100%;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.bioskop-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.bioskop-btn.primary:hover {
    box-shadow: 0 12px 48px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.bioskop-btn.primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.bioskop-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bioskop-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .bioskop-modal {
        border-radius: 20px;
        max-width: 100%;
        margin: 8px;
        max-height: 95vh;
    }

    .bioskop-step {
        padding: 20px 18px 24px;
    }

    .movie-info-card {
        padding: 12px;
        gap: 12px;
    }

    .movie-poster {
        width: 60px;
        height: 85px;
    }
    .poster-placeholder {
        font-size: 28px;
    }

    .movie-title {
        font-size: 16px;
    }

    .seat-grid {
        gap: 4px;
        max-width: 300px;
        padding: 4px;
    }

    .seat {
        min-width: 26px;
        min-height: 26px;
        font-size: 9px;
    }

    .bioskop-title {
        font-size: 17px;
    }

    .bioskop-back {
        font-size: 24px;
    }

    .bioskop-info {
        font-size: 11px;
        gap: 4px;
    }

    .seat-count {
        font-size: 14px;
    }

    .total-price {
        font-size: 12px;
        margin-left: 4px;
    }

    .booking-summary {
        padding: 10px 12px;
    }

    .summary-price {
        font-size: 17px;
    }

    .seat-legend {
        gap: 10px;
        font-size: 10px;
        padding: 6px 10px;
    }

    .legend-box {
        width: 16px;
        height: 16px;
    }

    .cinema-screen {
        max-width: 90%;
    }

    .screen-curve {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .seat-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
        max-width: 240px;
    }

    .seat {
        min-width: 22px;
        min-height: 22px;
        font-size: 8px;
        border-radius: 6px;
    }

    .seat::before {
        inset: 1px;
    }

    .bioskop-step {
        padding: 16px 14px 20px;
    }

    .movie-poster {
        width: 50px;
        height: 70px;
    }
    .poster-placeholder {
        font-size: 22px;
    }

    .movie-title {
        font-size: 14px;
    }

    .movie-meta {
        font-size: 10px;
        gap: 10px;
    }

    .schedule-badge {
        font-size: 9px;
        padding: 2px 8px;
    }

    .bioskop-input {
        padding: 10px 40px 10px 14px;
        font-size: 14px;
    }

    .bioskop-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ===== PAYMENT ===== */

.payment-summary {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.payment-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #a1a1aa;
}

.payment-item.total {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 18px;
    color: #fafafa;
}

.payment-item.total span:last-child {
    color: #fbbf24;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.payment-method {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

.payment-method.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.method-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.method-name {
    font-size: 12px;
    font-weight: 600;
    color: #fafafa;
}

/* ===== DIGITAL TICKET ===== */

.digital-ticket {
    background: linear-gradient(135deg, #1a1a1e, #0a0a0e);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.ticket {
    background: linear-gradient(135deg, #fafafa, #f0f0f0);
    border-radius: 12px;
    padding: 20px;
    color: #1a1a1e;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #d1d1d1;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.ticket-logo {
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ticket-barcode {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #71717a;
    letter-spacing: 2px;
}

.ticket-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    padding: 4px 0;
}

.ticket-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.ticket-row:last-child {
    border-bottom: none;
}

.ticket-label {
    font-size: 11px;
    color: #71717a;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-value {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1e;
}

.ticket-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed #d1d1d1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-qr {
    font-size: 24px;
    letter-spacing: 4px;
    color: #1a1a1e;
}

.ticket-terms {
    font-size: 9px;
    color: #71717a;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .payment-method {
        padding: 10px;
    }

    .method-icon {
        font-size: 22px;
    }

    .ticket-body {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .ticket {
        padding: 14px;
    }

    .ticket-logo {
        font-size: 16px;
    }
}

/* =========================================
   2. ENHANCED MODAL
   ========================================= */
.room-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a0a0f 0%, #000000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.room-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    animation: ambientPulse 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes ambientPulse {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 20px) scale(1); }
}

.room-modal {
    background: rgba(16, 16, 20, 0.92);
    padding: 56px 40px 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 
        0 40px 100px -20px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: modalSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes modalSlideUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-wrapper {
    text-align: center;
    margin-bottom: 8px;
}

.meirawatch-logo {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.logo-underline {
    width: 60px;
    height: 3px;
    margin: 6px auto 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    opacity: 0.6;
    animation: underlinePulse 3s ease-in-out infinite;
}

@keyframes underlinePulse {
    0%, 100% { width: 60px; opacity: 0.6; }
    50% { width: 80px; opacity: 1; }
}

.modal-subtitle {
    text-align: center;
    color: #a1a1aa;
    font-size: 15px;
    margin-bottom: 36px;
    line-height: 1.6;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.modal-input-wrapper {
    margin-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-icon {
    font-size: 18px;
    color: #52525b;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.input-group {
    flex: 1;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.modal-input {
    width: 100%;
    background: rgba(9, 9, 11, 0.6);
    border: 1.5px solid #27272a;
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 12px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal-input:focus {
    border-color: #3b82f6;
    background: rgba(24, 24, 27, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 24px -8px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.modal-input::placeholder {
    color: #52525b;
    font-weight: 300;
    font-size: 14px;
}

.input-group:focus-within label {
    color: #60a5fa;
}

.modal-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

.modal-btn:hover::before {
    left: 100%;
}

.modal-btn:hover {
    box-shadow: 0 16px 40px -12px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: scale(0.97) translateY(0);
    box-shadow: 0 4px 12px -6px rgba(59, 130, 246, 0.3);
}

.btn-text {
    font-weight: 700;
}

.btn-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.modal-btn:hover .btn-icon {
    transform: translateX(4px) rotate(-5deg);
}

@media (max-width: 480px) {
    .room-modal {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }
    .meirawatch-logo {
        font-size: 32px;
    }
    .modal-subtitle {
        font-size: 13px;
        margin-bottom: 28px;
    }
    .modal-input {
        padding: 12px 14px;
        font-size: 14px;
    }
    .modal-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* =========================================
   3. LAYOUT UTAMA
   ========================================= */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    width: 100vw;
    overflow: hidden;
}

.video-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.chat-section {
    display: flex;
    flex-direction: column;
    height: 40%;
    min-height: 200px;
    max-height: 50vh;
    background: var(--bg-chat);
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
}

@media screen and (min-width: 768px) {
    .app-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .video-section {
        flex: 0 0 75%;
        max-width: 75%;
        height: 100vh;
        padding: 20px;
        border-right: 1px solid var(--border-soft);
        background: var(--bg-main);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .video-wrapper {
        flex: 1;
        min-height: 0;
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    .controls-panel {
        flex-shrink: 0;
        margin-top: 12px;
    }
    .chat-section {
        flex: 0 0 25%;
        max-width: 25%;
        height: 100vh;
        border-top: none;
        max-height: none;
        display: flex;
        flex-direction: column;
        background: var(--bg-chat);
        position: relative;
    }
    .chat-header {
        flex-shrink: 0;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-soft);
    }
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 16px 20px;
        min-height: 0;
    }
    .chat-input-wrapper {
        flex-shrink: 0;
        background: var(--bg-chat);
        border-top: 1px solid var(--border-soft);
        width: 100%;
        position: relative;
        bottom: 0;
    }
    .chat-input-area {
        display: flex;
        padding: 12px 20px;
        gap: 10px;
        background: var(--bg-chat);
        align-items: center;
        width: 100%;
        border-top: none;
    }
    #usernameInput {
        width: 80px;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-soft);
        background: var(--bg-main);
        color: white;
        text-align: center;
    }
    #messageInput {
        flex: 1;
        padding: 10px 14px;
        font-size: 15px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-soft);
        background: var(--bg-main);
        color: white;
    }
    .chat-input-area button {
        padding: 10px 20px;
        font-size: 14px;
        background: var(--accent);
        color: white;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        white-space: nowrap;
    }
    .reaction-bar {
        flex-shrink: 0;
        padding: 8px 16px;
        border-top: 1px solid var(--border-soft);
        background: var(--bg-panel);
        display: flex;
        gap: 6px;
        overflow-x: auto;
    }
    .typing-indicator {
        flex-shrink: 0;
        padding: 4px 20px;
        height: 24px;
    }
}

/* =========================================
   4. AREA VIDEO
   ========================================= */
.video-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#videoPlayer, #screenPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =========================================
   5. KONTROL PANEL
   ========================================= */
.controls-panel {
    background: var(--bg-panel);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

.controls-panel h3 {
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#hostLabel {
    font-size: 11px;
    color: #fbbf24;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

#userCounter {
    font-size: 13px;
    color: #60a5fa;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#userCount {
    font-weight: 700;
    min-width: 16px;
    display: inline-block;
    text-align: center;
}

.upload-section, .stream-section {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

input[type="file"], input[type="text"] {
    flex: 1;
    min-width: 130px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--bg-main);
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

input[type="file"] {
    padding: 8px;
    color: var(--text-muted);
}

input[type="file"]::file-selector-button {
    background: #27272a;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    margin-right: 10px;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: background var(--transition-fast);
}

button:hover {
    background: var(--accent-hover);
}

.stream-section button:last-child {
    background: #10b981;
}

.stream-section button:last-child:hover {
    background: #059669;
}

.btn-reset {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-reset:hover {
    background-color: #dc2626;
}

/* =========================================
   LOCK/UNLOCK USERNAME
   ========================================= */
.lock-section {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
}

.lock-btn {
    background: #27272a;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 130px;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
}

.lock-btn:hover {
    background: #3f3f46;
}

.lock-btn.locked {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.lock-btn.locked:hover {
    background: #dc2626;
}

.lock-btn.unlocked {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.lock-btn.unlocked:hover {
    background: #059669;
}

/* =========================================
   BROADCAST SECTION
   ========================================= */
.broadcast-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.broadcast-input-group {
    display: flex;
    gap: 8px;
}

.broadcast-input-group input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--bg-main);
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

.broadcast-input-group input:focus {
    border-color: var(--accent);
}

.broadcast-btn {
    background: #f59e0b;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.broadcast-btn:hover {
    background: #d97706;
}

/* =========================================
   PARTICIPANTS SECTION
   ========================================= */
.participants-section {
    margin-top: 10px;
    border-top: 1px solid var(--border-soft);
    padding-top: 10px;
}

.participants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.participant-count {
    background: var(--bg-main);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}

.participant-name {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

.participant-name .host-badge {
    font-size: 10px;
    color: #fbbf24;
    margin-left: 4px;
}

.participant-actions {
    display: flex;
    gap: 4px;
}

.participant-actions button {
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.kick-btn {
    background: #ef4444;
    color: white;
}

.kick-btn:hover {
    background: #dc2626;
}

.transfer-host-btn {
    background: #3b82f6;
    color: white;
}

.transfer-host-btn:hover {
    background: #2563eb;
}

/* =========================================
   BROADCAST NOTIFICATION (Dynamic Island Style)
   ========================================= */
.broadcast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000000;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.8);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90%;
    min-width: 300px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.broadcast-notification.active {
    transform: translateX(-50%) translateY(0);
}

.broadcast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.broadcast-content {
    flex: 1;
    min-width: 0;
}

.broadcast-title {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.broadcast-message {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.broadcast-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #a1a1aa;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.broadcast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* =========================================
   6. LIVE CHAT - BUBBLES KANAN/KIRI
   ========================================= */
.chat-messages {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.msg-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.msg-wrapper.mine {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.msg-wrapper.mine .msg-bubble {
    background: var(--bubble-mine);
    border-radius: 12px 2px 12px 12px;
    color: white;
    border: none;
}

.msg-wrapper.mine .msg-name {
    color: #93c5fd;
    text-align: right;
}

.msg-wrapper.mine .msg-actions {
    flex-direction: row-reverse;
}

.msg-wrapper.others {
    flex-direction: row;
    justify-content: flex-start;
}

.msg-wrapper.others .msg-bubble {
    background: var(--bubble-others);
    border-radius: 2px 12px 12px 12px;
    color: #d4d4d8;
    border: 1px solid var(--border-soft);
}

.msg-bubble {
    padding: 10px 14px;
    max-width: 80%;
    word-break: break-word;
    line-height: 1.5;
    position: relative;
}

.msg-name {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.msg-content {
    font-size: 14px;
}

.msg-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.msg-wrapper:hover .msg-actions {
    opacity: 1;
}

.reply-btn, .edit-btn {
    padding: 4px 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-size: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    white-space: nowrap;
}

.reply-btn:hover, .edit-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.msg-quoted {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent);
    padding: 6px 10px;
    border-radius: 4px 8px 8px 4px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.msg-quoted-name {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.edited-label {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 4px;
}

/* =========================================
   7. TYPING INDICATOR
   ========================================= */
.typing-indicator {
    padding: 2px 20px 4px 20px;
    font-size: 12px;
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
    height: 22px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    flex-shrink: 0;
}

.typing-indicator.active {
    opacity: 1;
    visibility: visible;
}

.typing-dots span {
    animation: typingBlink 1.4s infinite both;
    font-size: 14px;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* =========================================
   8. REPLY PREVIEW
   ========================================= */
.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-soft);
    background: var(--bg-chat);
    flex-shrink: 0;
    width: 100%;
}

.reply-preview {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent);
    font-size: 12px;
    flex-shrink: 0;
}

.reply-preview-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reply-preview-name {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.reply-preview-text {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.cancel-reply-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 10px;
}

.cancel-reply-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: none;
}

.chat-input-area {
    display: flex;
    padding: 10px 14px;
    gap: 8px;
    background: var(--bg-chat);
    flex-shrink: 0;
    width: 100%;
    align-items: center;
    border-top: none;
}

#usernameInput {
    width: 70px;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--bg-main);
    color: white;
    text-align: center;
}

#messageInput {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: var(--bg-main);
    color: white;
}

#usernameInput:focus, #messageInput:focus {
    border-color: var(--accent);
    outline: none;
}

#sendButton {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
}

#sendButton:hover {
    background: var(--accent-hover);
}

/* =========================================
   9. SYSTEM MESSAGE
   ========================================= */
.system-msg {
    text-align: center;
    font-size: 11px;
    color: #52525B;
    margin: 4px 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* =========================================
   10. FLOATING REACTIONS - FIX SCROLL LAPTOP
   ========================================= */
.reaction-bar {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
    overflow-x: auto;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #3f3f46 transparent;
}

.reaction-bar::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

.reaction-bar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.reaction-bar::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.reaction-bar::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

.reaction-bar:active {
    cursor: grabbing;
}

.reaction-bar.dragging {
    scroll-behavior: auto;
    cursor: grabbing;
}

.reaction-bar button {
    background: transparent;
    border: none;
    font-size: 20px;
    padding: 4px 6px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
    flex: 0 0 auto;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.reaction-bar button:hover {
    transform: scale(1.3);
    background: rgba(255,255,255,0.08);
}

.reaction-bar button:active {
    transform: scale(0.9);
}

.floating-emoji {
    position: absolute;
    bottom: 10%;
    font-size: 36px;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 2.5s ease-out forwards;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
    will-change: transform, opacity;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, 0) scale(0.3);
        opacity: 0;
    }
    10% {
        transform: translate(-50%, -20px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x, -50%), -300px) scale(1);
        opacity: 0;
    }
}

/* =========================================
   11. BUFFERING INDICATOR
   ========================================= */
.buffering-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    pointer-events: none;
}

.buffering-indicator.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   12. FIX MOBILE KEYBOARD + TOMBOL HIDDEN
   ========================================= */
@media screen and (max-width: 767px) {
    .app-container {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
    .video-section {
        flex: 1;
        min-height: 0;
        padding: 8px;
        gap: 8px;
    }
    .chat-section {
        height: 45%;
        min-height: 200px;
        max-height: 50vh;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 8px 12px;
        min-height: 0;
    }
    .chat-input-wrapper {
        flex-shrink: 0;
        background: var(--bg-chat);
        border-top: 1px solid var(--border-soft);
        width: 100%;
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
    .chat-input-area {
        display: flex;
        padding: 8px 12px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        gap: 6px;
        background: var(--bg-chat);
        align-items: center;
        width: 100%;
    }
    #usernameInput {
        width: 60px;
        padding: 8px;
        font-size: 12px;
    }
    #messageInput {
        font-size: 16px;
        padding: 8px 12px;
        min-height: 40px;
    }
    #sendButton {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
        white-space: nowrap;
    }
    .reaction-bar {
        padding: 4px 8px;
        gap: 4px;
    }
    .reaction-bar button {
        font-size: 16px;
        padding: 4px;
    }
    .typing-indicator {
        padding: 2px 12px 4px 12px;
        height: 20px;
        font-size: 11px;
    }
    
    .msg-actions {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .msg-wrapper.active .msg-actions,
    .msg-wrapper:active .msg-actions,
    .msg-wrapper:focus-within .msg-actions {
        opacity: 1;
    }
    
    .reply-btn, .edit-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 32px;
    }
    
    .msg-actions {
        gap: 6px;
    }
}

@media screen and (max-width: 480px) {
    .video-section {
        flex: 1;
        min-height: 40vh;
        padding: 8px;
        gap: 8px;
    }
    .video-wrapper {
        min-height: 30vh;
        border-radius: 8px;
    }
    .chat-section {
        height: 50%;
        min-height: 180px;
    }
    .chat-input-area {
        padding: 6px 10px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        gap: 4px;
    }
    #usernameInput {
        width: 50px;
        font-size: 11px;
        padding: 6px;
    }
    #messageInput {
        font-size: 14px;
        padding: 6px 10px;
        min-height: 36px;
    }
    #sendButton {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 36px;
    }
    .reaction-bar button {
        font-size: 14px;
        padding: 2px;
    }

    /* Mobile Host Controls */
    .controls-panel {
        padding: 10px;
        max-height: 25vh;
        overflow-y: auto;
        position: relative;
        z-index: 10;
    }
    .controls-panel h3 {
        font-size: 11px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    #hostLabel, #userCounter {
        font-size: 10px;
        padding: 3px 8px;
    }
    .upload-section, .stream-section, .lock-section {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 6px;
        position: relative;
        z-index: 5;
    }
    .upload-section input, .stream-section input {
        width: 100%;
        min-width: unset;
        font-size: 12px;
        padding: 8px;
    }
    .upload-section button, .stream-section button, .lock-btn {
        width: 100%;
        padding: 8px;
        font-size: 12px;
        position: relative;
        z-index: 6;
        pointer-events: auto !important;
    }
    .broadcast-section {
        margin-bottom: 6px;
        position: relative;
        z-index: 5;
    }
    .broadcast-input-group {
        flex-direction: column;
        gap: 6px;
    }
    .broadcast-input-group input {
        width: 100%;
        font-size: 12px;
        padding: 8px;
    }
    .broadcast-btn {
        width: 100%;
        padding: 8px;
        font-size: 12px;
        position: relative;
        z-index: 6;
        pointer-events: auto !important;
    }
    .participants-section {
        margin-bottom: 6px;
        position: relative;
        z-index: 5;
    }
    .participants-header {
        font-size: 11px;
        padding: 6px 10px;
    }
    .participants-list {
        max-height: 100px;
        overflow-y: auto;
    }
}

/* --- SYNC MONITOR --- */
.sync-monitor {
    position: fixed;
    bottom: 80px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    z-index: 1000;
    min-width: 280px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sync-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sync-monitor-title {
    font-weight: bold;
    color: #4ade80;
}

.sync-monitor-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
}

.sync-monitor-content div {
    margin: 3px 0;
    display: flex;
    justify-content: space-between;
}

.sync-monitor-label {
    color: #94a3b8;
}

.sync-monitor-value {
    color: white;
    font-weight: bold;
}

.sync-status-synced {
    color: #4ade80;
}

.sync-status-drift {
    color: #fbbf24;
}

.sync-status-large-drift {
    color: #f87171;
}

.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.sync-indicator-synced {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.sync-indicator-drift {
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
    animation: pulse 1s infinite;
}

.sync-indicator-large-drift {
    background: #f87171;
    box-shadow: 0 0 12px #f87171;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@media (max-width: 768px) {
    .sync-monitor {
        bottom: 100px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}

/* =========================================
   13. VIDEO LOADER
   ========================================= */
.loader {
    position: absolute;
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 100;
}

/* =========================================
   SUPPORT MODAL - FIX POSITION (CENTER)
   ========================================= */
.support-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 16px;
    cursor: pointer;
    color: #a1a1aa;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 12px;
    position: relative;
    z-index: 20;
    pointer-events: auto !important;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.support-trigger:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
}

.support-trigger span:first-child {
    font-size: 20px;
}

.support-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    animation: fadeIn 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.support-modal-content {
    background: #18181b;
    border-radius: 24px;
    width: 92%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 50px 120px -20px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    margin: 0 !important;
}

@keyframes slideUp {
    0% { transform: translateY(40px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.support-header {
    padding: 28px 32px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    text-align: center;
}

.support-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 4px;
}

.support-header p {
    font-size: 14px;
    color: #a1a1aa;
}

.support-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #a1a1aa;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.support-body {
    padding: 24px 32px 32px;
}

.support-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.support-method {
    background: #131316;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.support-method:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

.support-method.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 1px #3b82f6;
}

.method-icon {
    font-size: 32px;
    margin-bottom: 6px;
    display: block;
}

.method-name {
    font-size: 13px;
    font-weight: 600;
    color: #fafafa;
}

.payment-details {
    animation: fadeIn 0.4s ease;
    margin-top: 8px;
}

.payment-info {
    margin-bottom: 16px;
}

.payment-label {
    font-size: 12px;
    font-weight: 600;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.payment-number {
    font-size: 20px;
    font-weight: 700;
    color: #fafafa;
    background: #09090b;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: monospace;
}

.copy-btn {
    background: #27272a;
    border: none;
    color: #fafafa;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.copy-btn:hover {
    background: #3b82f6;
}

.payment-name {
    font-size: 16px;
    font-weight: 500;
    color: #fafafa;
    padding: 8px 0;
}

.payment-amount {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-amount input {
    flex: 1;
    background: #09090b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fafafa;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.payment-amount input:focus {
    border-color: #3b82f6;
}

.payment-amount span {
    color: #a1a1aa;
    font-weight: 500;
}

.payment-instruction {
    font-size: 14px;
    color: #a1a1aa;
    line-height: 1.5;
    padding: 12px 16px;
    background: #131316;
    border-radius: 10px;
    border-left: 3px solid #3b82f6;
}

.confirm-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.confirm-btn:hover {
    box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* =========================================
   SUCCESS MODAL
   ========================================= */
.success-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center !important;
    align-items: center !important;
    z-index: 100000 !important;
    animation: fadeIn 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
}

.success-modal-content {
    background: #18181b;
    border-radius: 24px;
    width: 92%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 50px 120px -20px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    margin: 0 !important;
}

.success-header {
    padding: 32px 32px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.success-icon {
    font-size: 56px;
    margin-bottom: 8px;
    display: block;
    animation: bounceIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.success-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fafafa;
    margin-bottom: 4px;
}

.success-header p {
    font-size: 14px;
    color: #a1a1aa;
}

.success-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #a1a1aa;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.success-body {
    padding: 24px 32px 32px;
}

.success-details {
    background: #131316;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.success-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.success-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #71717a;
    font-size: 14px;
}

.detail-value {
    color: #fafafa;
    font-size: 14px;
    font-weight: 500;
}

.success-instruction {
    text-align: center;
    padding: 12px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--accent);
    margin-bottom: 16px;
}

.success-instruction p {
    color: #a1a1aa;
    font-size: 14px;
    line-height: 1.5;
}

.instruction-note {
    color: #fbbf24;
    font-weight: 500;
    margin-top: 4px;
}

.success-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-btn:hover {
    box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .support-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .support-method {
        padding: 12px;
    }
    .method-icon {
        font-size: 24px;
    }
    .payment-number {
        font-size: 16px;
        padding: 10px 14px;
    }
    .support-header h2 {
        font-size: 18px;
    }
}

/* ============================================================
   PROFANITY WARNING
   ============================================================ */

.profanity-warn {
    display: none;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    padding: 10px 16px;
    border-radius: 8px;
    flex-shrink: 0;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4),
                0 0 0 1px rgba(239, 68, 68, 0.2);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.profanity-warn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.profanity-warn::after {
    content: '⚠️';
    margin-right: 8px;
    font-size: 14px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4),
                    0 0 0 1px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6),
                    0 0 0 2px rgba(239, 68, 68, 0.3);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide sync monitor during transition */
#syncMonitorSimple,
#syncMonitor,
.sync-monitor,
#speedSyncDebug,
#bufferMonitor {
    transition: opacity 0.3s ease;
}

#syncMonitorSimple.hidden,
#syncMonitor.hidden,
.sync-monitor.hidden,
#speedSyncDebug.hidden,
#bufferMonitor.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Username Profanity Warning */
.username-profanity-warn {
    display: none;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    padding: 10px 16px;
    border-radius: 8px;
    margin-top: 12px;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), pulse 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4),
                0 0 0 1px rgba(245, 158, 11, 0.2);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.username-profanity-warn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.username-profanity-warn::after {
    content: '⚠️';
    margin-right: 8px;
    font-size: 14px;
    animation: shake 0.5s ease-in-out infinite;
}

/* =========================================
   TICKET XXI STYLE
   ========================================= */

.ticket-xxi {
    background: #fdf6e3;
    border-radius: 8px;
    padding: 16px 20px;
    font-family: 'Courier New', monospace;
    color: #1a1a1e;
    border: 2px solid #d4a373;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    margin: 0 auto;
    position: relative;
}

.ticket-xxi::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 1px solid rgba(212, 163, 115, 0.3);
    border-radius: 12px;
    pointer-events: none;
}

.ticket-xxi-header {
    text-align: center;
    border-bottom: 2px solid #d4a373;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.ticket-xxi-cinema {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #1a1a1e;
    text-transform: uppercase;
}

.ticket-xxi-sub {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #8b7355;
}

.ticket-xxi-body {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    padding: 4px 0;
}

.ticket-xxi-left {
    border-right: 2px solid #d4a373;
    padding-right: 12px;
}

.ticket-xxi-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
    border-bottom: 1px solid rgba(212, 163, 115, 0.15);
}

.ticket-xxi-row:last-child {
    border-bottom: none;
}

.ticket-xxi-label {
    color: #8b7355;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 9px;
}

.ticket-xxi-value {
    font-weight: 700;
    font-size: 12px;
    color: #1a1a1e;
}

.ticket-xxi-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 4px;
}

.ticket-xxi-movie-title {
    font-size: 16px;
    font-weight: 900;
    color: #1a1a1e;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.ticket-xxi-movie-sub {
    font-size: 10px;
    color: #8b7355;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ticket-xxi-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #d4a373;
    padding-top: 8px;
    margin-top: 6px;
}

.ticket-xxi-price {
    display: flex;
    flex-direction: column;
}

.ticket-xxi-price .ticket-xxi-label {
    font-size: 8px;
}

.ticket-xxi-price .ticket-xxi-value {
    font-size: 14px;
    color: #d4a373;
}

.ticket-xxi-barcode {
    font-size: 14px;
    letter-spacing: 2px;
    color: #1a1a1e;
}

.ticket-xxi-footer {
    text-align: center;
    font-size: 7px;
    color: #8b7355;
    letter-spacing: 1px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #d4a373;
    text-transform: uppercase;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .ticket-xxi {
        padding: 12px 14px;
        max-width: 300px;
    }
    
    .ticket-xxi-cinema {
        font-size: 18px;
    }
    
    .ticket-xxi-sub {
        font-size: 11px;
        letter-spacing: 4px;
    }
    
    .ticket-xxi-body {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .ticket-xxi-row {
        font-size: 9px;
        padding: 1px 0;
    }
    
    .ticket-xxi-value {
        font-size: 10px;
    }
    
    .ticket-xxi-movie-title {
        font-size: 13px;
    }
    
    .ticket-xxi-movie-sub {
        font-size: 8px;
    }
    
    .ticket-xxi-price .ticket-xxi-value {
        font-size: 12px;
    }
    
    .ticket-xxi-barcode {
        font-size: 11px;
    }
}