/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh; /* Mobile viewport fix */
    color: #ffffff;
    background: #000;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BACKGROUND
   ============================================ */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('https://images.unsplash.com/photo-1540747913346-19e32dc3e97e?q=80&w=2000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    filter: grayscale(20%);
}

/* ============================================
   VIEWER COUNT (POJOK KANAN ATAS)
   ============================================ */
.viewer-count {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.viewer-count svg {
    flex-shrink: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    max-width: min(500px, 90%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0 0 1rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

p {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ============================================
   BUTTON
   ============================================ */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    color: #000000;
    text-decoration: none;
    padding: clamp(0.875rem, 2vw, 1.125rem) clamp(1.5rem, 4vw, 2.75rem);
    border-radius: 50px;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 2rem;
    cursor: pointer;
    border: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Shimmer effect */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                0 0 20px rgba(34, 197, 94, 0.2);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.15s ease;
}

/* Pulse animation for attention */
@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2),
                    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    }
    50% {
        box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3),
                    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                    0 0 20px rgba(34, 197, 94, 0.3);
    }
}

.btn {
    animation: btnPulse 2.5s ease-in-out infinite;
}

.btn:hover {
    animation: none;
}

/* ============================================
   AD CONTAINER
   ============================================ */
.ad-container {
    width: 320px;
    max-width: 100%;
    height: 50px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-fallback {
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notifications-container {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.viewer-notification {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    max-width: 280px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.3s ease-out;
}

.viewer-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #22c55e;
}

.notification-avatar svg {
    width: 16px;
    height: 16px;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.notification-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-action {
    font-size: 0.75rem;
    color: #22c55e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TABLET (768px - 1024px)
   ============================================ */
@media (min-width: 481px) and (max-width: 1024px) {
    .content {
        max-width: 450px;
        padding: 30px;
    }

    h1 {
        font-size: 2.25rem;
    }

    p {
        font-size: 1.05rem;
    }

    .viewer-count {
        top: 25px;
        right: 25px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .notifications-container {
        left: 25px;
        bottom: 25px;
    }

    .viewer-notification {
        max-width: 300px;
    }
}

/* ============================================
   MOBILE (<= 480px)
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .viewer-count {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.7rem;
        gap: 6px;
    }

    .viewer-count svg {
        width: 12px;
        height: 12px;
    }

    .content {
        width: 100%;
        max-width: 100%;
        padding: 80px 20px 40px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        width: 100%;
        max-width: 280px;
    }

    .ad-container {
        width: 100%;
        max-width: 300px;
        height: 50px;
        margin-bottom: 1.25rem;
    }

    .status {
        font-size: 0.7rem;
        gap: 6px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }

    /* Notifications - Full width on small mobile */
    .notifications-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .viewer-notification {
        padding: 10px 12px;
        max-width: 100%;
    }

    .notification-avatar {
        width: 28px;
        height: 28px;
    }

    .notification-avatar svg {
        width: 14px;
        height: 14px;
    }

    .notification-name {
        font-size: 0.8rem;
    }

    .notification-action {
        font-size: 0.7rem;
    }

    .notification-text {
        font-size: 0.65rem;
    }
}

/* ============================================
   SMALL MOBILE (<= 360px)
   ============================================ */
@media (max-width: 360px) {
    .content {
        padding: 70px 15px 30px;
    }

    h1 {
        font-size: 1.35rem;
    }

    p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.9rem;
    }

    .viewer-notification {
        padding: 8px 10px;
        gap: 8px;
    }
}

/* ============================================
   LARGE DESKTOP (>= 1440px)
   ============================================ */
@media (min-width: 1440px) {
    .content {
        max-width: 550px;
    }

    .viewer-count {
        top: 30px;
        right: 30px;
        padding: 12px 20px;
    }

    .notifications-container {
        left: 30px;
        bottom: 30px;
    }

    .viewer-notification {
        max-width: 320px;
    }
}

/* ============================================
   UTILITY - Safe Area for Mobile
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .notifications-container {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    @media (max-width: 480px) {
        .notifications-container {
            bottom: calc(12px + env(safe-area-inset-bottom));
        }
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   DARK MODE ALREADY (no need to change)
   ============================================ */
@media (prefers-color-scheme: light) {
    /* Keep dark theme for streaming site */
}
