#live-studio-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
}

#local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect for front camera */
}

/* Header */
.live-header {
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.live-badge {
    background-color: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.viewer-count {
    background-color: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    color: white;
}

.close-btn {
    width: 30px;
    height: 30px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* Setup Overlay */
.setup-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 30;
    transition: transform 0.3s ease;
}

.setup-overlay.hidden {
    transform: translateY(100%);
}

.setup-overlay h2 {
    color: white;
    text-shadow: 1px 1px 2px black;
}

#stream-title {
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
}

#stream-title::placeholder {
    color: rgba(255,255,255,0.7);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

/* Bottom Controls */
.live-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    z-index: 20;
}

.live-controls.hidden {
    display: none;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
}

.control-btn.danger {
    background-color: #ff3b30;
    width: auto;
    padding: 0 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
}

/* ── Live Chat Overlay ── */
.live-chat-container {
    position: absolute;
    bottom: 95px;
    left: 15px;
    width: min(320px, calc(100vw - 30px));
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 25;
    pointer-events: none;
}

.live-chat-container.hidden {
    display: none;
}

.chat-messages {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    mask-image: linear-gradient(to top, black 80%, transparent 100%);
    padding-bottom: 8px;
    scrollbar-width: none;
}
.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-message-bubble {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 6px 12px;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.3;
    animation: slideUp 0.25s ease-out;
    max-width: 90%;
    word-break: break-word;
    border-left: 2px solid var(--accent-cyan);
}

.chat-message-bubble.gift-message {
    border-left: 2px solid #f59e0b;
    background: rgba(245, 158, 11, 0.25);
    color: #fef08a;
    font-weight: 600;
}

.chat-username {
    font-weight: 700;
    color: #20d5ec;
    margin-right: 6px;
}

.live-chat-input-bar {
    pointer-events: auto;
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.live-chat-input-bar input {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 14px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
}

.live-chat-input-bar button {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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