/* ==========================================================================
   Surprise Birthday Gift Website - Stylesheet
   Theme: Elegant & Romantic + Playful Kids Education
   ========================================================================== */

:root {
    /* Color Palette */
    --color-primary: #D97706;       /* Rich Amber Gold */
    --color-primary-hover: #B45309; /* Darker Gold */
    --color-secondary: #EAB308;     /* Sunflower Yellow */
    --color-accent: #F59E0B;        /* Golden Orange */
    --color-background-grad: linear-gradient(135deg, #FFFDF0 0%, #FEF9C3 100%); /* Elegant Soft Sunflower Gold-Cream Gradient */
    --color-card-bg: rgba(255, 255, 255, 0.9);
    --color-text-main: #1E293B;     /* Slate 800 */
    --color-text-muted: #475569;    /* Slate 600 */
    --color-border: rgba(234, 179, 8, 0.25); /* Sunflower Gold Border */
    --font-heading: 'Baloo 2', 'Playpen Sans', cursive;
    --font-body: 'Outfit', sans-serif;
    
    /* Layout Tokens */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;
    --shadow-premium: 0 20px 40px -15px rgba(217, 119, 6, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= Reset & Base Styles ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--color-background-grad);
    color: var(--color-text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Background floating elements */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-size: 20px;
    user-select: none;
    animation: floatUp 8s linear infinite;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Music Control Button */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.music-btn:hover {
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.15);
}

.music-btn .icon {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.music-btn.playing {
    animation: rotate 6s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================= App Container & Page Transitions ================= */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.page.active {
    display: block;
    opacity: 1;
    transform: none !important;
}

.card-glass {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px) saturate(180%);
    padding: 40px;
}

/* ================= PAGE 1: ENVELOPE (INTRO) ================= */
.intro-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.intro-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-primary);
    line-height: 1.3;
}

.intro-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.envelope-wrapper {
    height: 280px;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    background: #F59E0B; /* Sunflower Yellow */
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.2);
    cursor: pointer;
    transition: transform 0.4s ease;
}

.envelope:hover {
    transform: translateY(-8px) scale(1.02);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 100px solid #FCD34D; /* Soft Sunflower Yellow Flap */
    transform-origin: top;
    transition: transform 0.4s 0.2s ease, z-index 0.2s 0.4s;
    z-index: 4;
}

.envelope-pocket {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-left: 140px solid #D97706; /* Golden Amber sides */
    border-right: 140px solid #D97706;
    border-bottom: 90px solid #B45309; /* Dark Sunflower Core bottom */
    border-top: 90px solid transparent;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 3;
}

.envelope-letter {
    position: absolute;
    bottom: 10px;
    left: 20px;
    width: 240px;
    height: 130px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 15px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
    transition: transform 0.4s ease, bottom 0.4s ease;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.letter-preview {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.envelope-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: #fff;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.heart-svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    animation: heartbeat 1.4s infinite alternate;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.click-hint {
    margin-top: 15px;
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 500;
    animation: blink 2s infinite;
}

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

/* Envelope Open State */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .envelope-letter {
    transform: translateY(-80px);
    z-index: 3;
}

.envelope.open .envelope-heart {
    transform: translate(-50%, -50%) scale(0);
}

/* ================= PAGE 2: WISHES (LOVE LETTER) ================= */
.letter-container {
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.letter-header {
    border-bottom: 2px dashed var(--color-border);
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stamp {
    background: #FCE7F3;
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.letter-greeting {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    font-weight: 700;
}

.letter-content {
    font-family: 'Playpen Sans', 'Outfit', sans-serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text-main);
    text-align: justify;
    min-height: 200px;
    margin-bottom: 30px;
}

/* Cursor typewriter effect */
.letter-content::after {
    content: '|';
    animation: cursorBlink 0.8s steps(2, start) infinite;
    color: var(--color-accent);
}
.letter-content.typing-done::after {
    content: '';
    display: none;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.letter-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.letter-signature {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.letter-signature-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 25px;
}

/* Buttons */
.btn-primary {
    align-self: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 8px 20px -6px rgba(217, 119, 6, 0.4);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(217, 119, 6, 0.5);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* ================= PAGE 3: CAMERA & OVERLAYS ================= */
.camera-layout {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 60px;
    align-items: start;
}

@media (max-width: 992px) {
    .camera-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Bezel Smartphone Mockup */
.phone-mockup {
    position: relative;
    width: 340px;
    height: 600px;
    background: #000;
    border: 12px solid #1E293B; /* Matte dark frame */
    border-radius: 44px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 20px rgba(217, 119, 6, 0.1);
    margin: 0 auto;
    overflow: hidden;
}

/* Phone notch */
.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 25px;
    background: #1E293B;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-notch::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #0f172a;
    border-radius: 2px;
}

.phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0f172a;
    overflow: hidden;
}

.camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #090d16;
}

/* Fallback Screen styling */
.fallback-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: linear-gradient(180deg, #090d16 0%, #1e1b4b 100%);
    z-index: 2;
    text-align: center;
}

.fallback-graphic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.avatar-svg {
    width: 80px;
    height: 80px;
    color: var(--color-accent);
}

.teacher-board {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.fallback-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #94A3B8;
    margin-bottom: 20px;
}

.btn-upload {
    background: #fff;
    color: var(--color-text-main);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255,255,255,0.1);
    transition: var(--transition-smooth);
    border: 1px solid #e2e8f0;
}

.btn-upload:hover {
    transform: translateY(-2px);
    background: #f8fafc;
}

.fallback-preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hidden-input {
    display: none;
}

/* Hearts Tap Overlay */
.hearts-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

/* ================= Platform Overlays ================= */
.overlay-platform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none; /* Let clicks pass to stream for tim bay */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-platform.active {
    display: block;
    opacity: 1;
}

/* Let sidebars and interactive areas capture events */
.tiktok-top-bar,
.tiktok-sidebar, 
.tiktok-caption, 
.comments-feed-container,
.youtube-chat-container,
.youtube-bottom-info,
.fb-bottom-bar,
.btn-upload {
    pointer-events: auto;
}

/* --- 1. TIKTOK OVERLAY STYLE --- */
/* TikTok Live Top Bar */
.tiktok-top-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.tiktok-host-pill {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 3px 8px 3px 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    max-width: 150px;
}

.tiktok-host-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #FF0050;
    object-fit: cover;
}

.tiktok-host-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tiktok-host-name {
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.tiktok-live-viewers {
    font-size: 0.55rem;
    opacity: 0.9;
    line-height: 1;
}

.tiktok-host-follow {
    background: #FF0050;
    color: #fff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.65rem;
    font-weight: bold;
}

.tiktok-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiktok-viewer-avatars {
    display: flex;
    align-items: center;
}

.tiktok-viewer-avatars img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.6);
    object-fit: cover;
    margin-right: -6px;
}

.tiktok-viewer-count {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.65rem;
    color: #fff;
    font-weight: bold;
}

.tiktok-sidebar {
    position: absolute;
    right: 12px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 8;
}

.tiktok-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    margin-bottom: 5px;
}

.tiktok-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tiktok-plus {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1.5px solid #000;
}

.tiktok-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.2s;
}

.tiktok-action-btn:hover {
    transform: scale(1.08);
}

.sidebar-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.sidebar-icon.active {
    color: #EF4444; /* TikTok Red */
}

.tiktok-music-disc {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 6px solid #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    animation: rotate 4s linear infinite;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.tiktok-caption {
    position: absolute;
    left: 12px;
    bottom: 25px;
    width: 210px;
    color: #fff;
    z-index: 8;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.tiktok-username {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.tiktok-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tiktok-music {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #fff;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.music-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Chat overlay simulator */
.comments-feed-container {
    position: absolute;
    left: 12px;
    bottom: 55px; /* Pushed down to clear the face area */
    width: 220px;
    max-height: 110px;
    overflow: hidden;
    z-index: 7;
}

.comments-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: slideUpComments 20s infinite linear;
}

.comment-item {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.05);
    line-height: 1.35;
}

.comment-author {
    font-weight: 700;
    color: #818CF8;
    margin-right: 5px;
}

/* TikTok Live Bottom Bar */
.tiktok-live-bottom-bar {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9;
}

.tiktok-live-input {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    flex-grow: 1;
    margin-right: 8px;
    text-align: left;
}

.tiktok-live-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tiktok-live-action-btn {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.tiktok-live-action-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.6);
}

/* --- 2. YOUTUBE OVERLAY STYLE --- */
.youtube-top-bar {
    position: absolute;
    top: 40px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 8;
}

.yt-live-badge {
    background: #FF0000;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.yt-viewers {
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 3px;
}

.youtube-chat-container {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 115px;
    height: 140px;
    overflow: hidden;
    z-index: 7;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.youtube-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yt-chat-item {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #fff;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.yt-chat-avatar {
    width: 16px;
    height: 16px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    flex-shrink: 0;
}

.yt-chat-name {
    font-weight: 700;
    color: #AAAAAA;
    margin-right: 4px;
}

.yt-chat-name.vip {
    color: #FBBF24;
}

.yt-chat-text {
    line-height: 1.3;
}

.youtube-bottom-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0) 100%);
    padding: 15px 12px;
    z-index: 8;
    color: #fff;
}

.youtube-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.youtube-channel-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yt-avatar {
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

.yt-channel-meta {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.yt-channel-name {
    font-size: 0.8rem;
    font-weight: 700;
}

.yt-subs {
    font-size: 0.65rem;
    color: #AAAAAA;
}

.yt-subscribe-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

/* --- 3. FACEBOOK OVERLAY STYLE --- */
.fb-header {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    padding: 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 8;
}

.fb-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.fb-avatar {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    border: 1px solid rgba(255,255,255,0.2);
}

.fb-name {
    font-size: 0.8rem;
    font-weight: 700;
}

.fb-meta {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
}

.fb-live-indicators {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fb-live-tag {
    background: #E41E3F;
    color: #fff;
    font-weight: 700;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.fb-viewers-tag {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    color: #fff;
    font-weight: 700;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.fb-reactions-bar {
    position: absolute;
    right: 15px;
    bottom: 120px;
    height: 200px;
    width: 40px;
    overflow: hidden;
    z-index: 7;
}

.fb-react-icon {
    position: absolute;
    bottom: 0;
    font-size: 22px;
    animation: fbFloatUp 3.5s ease-out forwards;
    opacity: 0;
}

@keyframes fbFloatUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
        left: 10px;
    }
    15% {
        opacity: 1;
        transform: translateY(-30px) scale(1.1);
    }
    50% {
        left: 2px;
    }
    75% {
        left: 18px;
    }
    100% {
        transform: translateY(-200px) scale(0.8);
        opacity: 0;
        left: 8px;
    }
}

.fb-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0) 100%);
    padding: 15px 12px 25px 12px; /* Extra bottom padding to avoid rounded corners truncation */
    z-index: 8;
    color: #fff;
}

.fb-stats {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
}

.fb-comment-preview-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 75px;
    overflow: hidden;
}

.fb-comment-row {
    font-size: 11px;
    animation: fadeIn 0.3s ease;
}

.fb-comment-author {
    font-weight: 700;
    color: #60A5FA;
}

/* ================= Control Panel Styling ================= */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.panel-header p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* Platform Tabs */
.platform-tabs {
    display: flex;
    background: #F1F5F9;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid #E2E8F0;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: #fff;
    color: var(--color-text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tiktok-dot { background: #00f2fe; }
.youtube-dot { background: #FF0000; }
.facebook-dot { background: #1877F2; }

/* Camera Capture Actions */
.action-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #FFFDF0;
    border: 1px dashed rgba(217,119,6,0.2);
    border-radius: var(--radius-md);
}

.btn-capture {
    width: 100%;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(217,119,6,0.3);
    transition: var(--transition-smooth);
}

.btn-capture:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 20px rgba(217,119,6,0.4);
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.capture-hint {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* Inspiration block */
.inspiration-quote {
    background: #fff;
    border-left: 4px solid var(--color-primary);
    padding: 15px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.inspiration-quote blockquote {
    font-family: 'Playpen Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-main);
    margin-bottom: 8px;
    font-style: italic;
}

.inspiration-quote cite {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
    text-align: right;
}

/* Flash Screen Effect */
.camera-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: flashEffect 0.5s ease-out;
}

@keyframes flashEffect {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ================= Animations & Fades ================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpComments {
    0%, 15% { transform: translateY(0); }
    20%, 35% { transform: translateY(-27px); }
    40%, 55% { transform: translateY(-54px); }
    60%, 75% { transform: translateY(-81px); }
    80%, 95% { transform: translateY(-108px); }
    100% { transform: translateY(-135px); }
}

/* ================= Captured Photo Modal ================= */
.captured-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000; /* Hàng đầu tiên */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.captured-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.captured-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--color-border);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.captured-modal.active .captured-modal-content {
    transform: translateY(0);
}

.captured-modal-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.captured-modal-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.captured-card-img {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 2px solid #E2E8F0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.captured-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-close {
    background: #E2E8F0;
    color: var(--color-text-main);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.btn-modal-close:hover {
    background: #CBD5E1;
}

.btn-modal-download {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
    transition: var(--transition-smooth);
}

.btn-modal-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
}

/* ================= TikTok Profile View ================= */
.profile-layout {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px) saturate(180%);
    padding: 30px;
    animation: fadeIn 0.8s ease;
}

.profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
}

@media (max-width: 576px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
}

.profile-avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.profile-avatar-live-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid #FE2C55;
    border-radius: 50%;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0; }
}

.profile-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-username-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .profile-username-row {
        justify-content: center;
    }
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.2;
}

.profile-username-sub {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.verified-icon {
    width: 18px;
    height: 18px;
    color: #20D5EC; /* TikTok blue verify badge */
}

.profile-stats {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

@media (max-width: 576px) {
    .profile-stats {
        justify-content: center;
    }
}

.profile-stats strong {
    color: var(--color-text-main);
    font-weight: 600;
}

.profile-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 576px) {
    .profile-actions {
        justify-content: center;
    }
}

.btn-profile-follow {
    background: #FE2C55; /* TikTok Red */
    color: #fff;
    border: none;
    padding: 8px 32px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-profile-follow:hover {
    background: #E02447;
}

.btn-profile-message {
    background: #F1F5F9;
    color: var(--color-text-main);
    border: 1px solid #E2E8F0;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-profile-message:hover {
    background: #E2E8F0;
}

.btn-profile-action {
    background: #F1F5F9;
    color: var(--color-text-main);
    border: 1px solid #E2E8F0;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-profile-action:hover {
    background: #E2E8F0;
}

.profile-bio {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-main);
    margin-top: 5px;
    font-weight: 400;
    white-space: pre-line;
}

/* Tabs */
.profile-tabs-row {
    display: flex;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 20px;
    gap: 30px;
    padding-top: 10px;
}

@media (max-width: 576px) {
    .profile-tabs-row {
        justify-content: center;
    }
}

.profile-tab {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    position: relative;
}

.profile-tab.active {
    color: var(--color-text-main);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #000;
}

/* Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

@media (max-width: 992px) {
    .videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    background: #1E293B;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-views {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 3px;
}

.video-title {
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--color-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 2px;
}

/* Live Video Card Special Styling */
.live-card .video-thumbnail-wrapper {
    border: 3px solid #FE2C55;
    animation: liveBorderPulse 1.5s infinite;
}

@keyframes liveBorderPulse {
    0% { border-color: #FE2C55; box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.4); }
    70% { border-color: #FE2C55; box-shadow: 0 0 10px 4px rgba(254, 44, 85, 0.2); }
    100% { border-color: #FE2C55; box-shadow: 0 0 0 0 rgba(254, 44, 85, 0); }
}

.live-pulse-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #FE2C55;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    animation: pulse 1.2s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.live-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .live-click-overlay {
    opacity: 1;
}

.play-btn-circle {
    width: 44px;
    height: 44px;
    background: #FE2C55;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    padding-left: 3px; /* visual center */
    box-shadow: 0 4px 12px rgba(254,44,85,0.4);
}

.live-action-text {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- Thumbnail CSS Filters for distinct look --- */
.thumbnail-filter-1 { filter: saturate(1.1) brightness(0.9); object-position: center top; }
.thumbnail-filter-2 { filter: sepia(0.1) contrast(1.05); object-position: center bottom; }
.thumbnail-filter-3 { filter: hue-rotate(10deg) brightness(0.95); object-position: center center; }
.thumbnail-filter-4 { filter: saturate(1.2) contrast(0.95); object-position: top; }
.thumbnail-filter-5 { filter: hue-rotate(-10deg) brightness(0.9); object-position: center; }
.thumbnail-filter-6 { filter: contrast(1.1) sepia(0.05); object-position: bottom; }
.thumbnail-filter-7 { filter: saturate(0.9) brightness(0.85); object-position: top center; }
.thumbnail-filter-8 { filter: hue-rotate(15deg) contrast(1.05); object-position: bottom center; }

/* ================= LIVE BROADCAST MODAL ================= */
.broadcast-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Fix vertical centering cut-off */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 60px 20px; /* Spacing for vertical scrolling */
}

.broadcast-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.broadcast-modal-content {
    width: 100%;
    max-width: 960px;
    padding: 40px 30px; /* Better grid spacing */
    position: relative;
}

.btn-close-broadcast {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--color-text-main);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
}

.btn-close-broadcast:hover {
    background: #EF4444;
    border-color: #EF4444;
    color: #fff;
}

/* Avatar overlays custom sizes */
.tiktok-avatar-img-round,
.yt-avatar-img-round,
.fb-avatar-img-round {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Dreams Grid */
.dreams-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 992px) {
    .dreams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dreams-grid {
        grid-template-columns: 1fr;
    }
}

.dream-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.dream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(255, 0, 80, 0.1);
    border-color: rgba(255, 0, 80, 0.3);
}

.dream-thumbnail-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #000;
    overflow: hidden;
}

.dream-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dream-card:hover .dream-thumbnail {
    transform: scale(1.04);
}

.dream-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dream-card:hover .dream-overlay {
    opacity: 1;
}

.dream-view-btn {
    background: var(--color-primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    border: none;
}

.dream-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dream-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 8px;
}

.dream-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 40px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 85%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease-out;
}

.lightbox-caption {
    margin: auto;
    display: block;
    width: 85%;
    max-width: 900px;
    text-align: center;
    color: #f1f5f9;
    padding: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f5f9;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 100000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--color-primary);
    text-decoration: none;
}

@keyframes zoomIn {
    from {transform: scale(0.9); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.hidden {
    display: none !important;
}

/* Draggable/AI Sticker */
.draggable-sticker {
    position: absolute;
    width: 100px;
    height: 100px; /* Tỷ lệ mũ chóp nón 1:1 */
    cursor: pointer;
    z-index: 100;
    user-select: none;
    touch-action: none;
    transform-origin: bottom center; /* Quay và giãn từ chân mũ */
}

/* Hiệu ứng lấp lánh (sparkle glow) cho mũ sinh nhật công chúa */
@keyframes hatGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.65)) brightness(1);
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(244, 114, 182, 0.95)) brightness(1.15);
    }
}

.draggable-sticker svg {
    animation: hatGlow 2s infinite ease-in-out;
}

/* Sticker Controls Styling */
.sticker-control-group {
    background: #FFFDF0;
    border: 1px dashed rgba(217, 119, 6, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sticker-control-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-primary);
    margin: 0;
}

.sticker-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 8px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Nhãn trạng thái AI */
.ai-status-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ai-status-tag.loading {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.ai-status-tag.ready {
    background: #D1FAE5;
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.ai-status-tag.error {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.sticker-sliders {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(217, 119, 6, 0.1);
    padding-top: 10px;
}

.slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.slider-row input[type="range"] {
    width: 100%;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.sticker-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
}

/* Birthday Filter Overlay on Phone Screen */
.birthday-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 10px 105px 10px; /* Safe padding for status header and platform comments */
    z-index: 90; /* Right behind platform controls but in front of video/canvas */
}

/* Birthday Filter Overlay on Phone Screen */
.birthday-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    pointer-events: none;
    padding: 60px 10px;
    z-index: 90; /* Right behind platform controls but in front of video/canvas */
}

.filter-top-banner {
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff;
    background: rgba(217, 119, 6, 0.85); /* Sunflower Gold semi-transparent */
    padding: 5px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    border: 1.5px solid rgba(251, 191, 36, 0.6);
    backdrop-filter: blur(1.5px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    margin: 0 auto;
    max-width: 80%;
    letter-spacing: 1px;
    animation: filterGlow 2.5s infinite ease-in-out;
}

.balloons-left {
    position: absolute;
    top: 45px;
    left: 12px;
    font-size: 1.6rem;
    animation: floatBalloonLeft 4s infinite ease-in-out;
    z-index: 85;
}

.balloons-right {
    position: absolute;
    top: 45px;
    right: 12px;
    font-size: 1.6rem;
    animation: floatBalloonRight 4.5s infinite ease-in-out;
    z-index: 85;
}

@keyframes floatBalloonLeft {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-6px) rotate(5deg); }
}

@keyframes floatBalloonRight {
    0%, 100% { transform: translateY(0) rotate(5deg); }
    50% { transform: translateY(-8px) rotate(-5deg); }
}

@keyframes filterGlow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 6px rgba(217, 119, 6, 0.9), 0 2px 4px rgba(0,0,0,0.6);
    }
    50% {
        transform: scale(1.04);
        text-shadow: 0 0 14px rgba(251, 191, 36, 1), 0 2px 6px rgba(0,0,0,0.7);
    }
}

.action-buttons-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #D97706;
    background: rgba(251, 191, 36, 0.12);
    border: 2px solid rgba(217, 119, 6, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-action:hover {
    background: rgba(251, 191, 36, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

@media (min-width: 768px) {
    .action-buttons-row {
        flex-direction: row;
    }
    .btn-secondary-action {
        flex: 1;
    }
    #btn-capture {
        flex: 1.2;
    }
}


