* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-brown: #A65C2E;
    --dark-brown: #5D3319;
    --golden: #E5A033;
    --cream: #E8D4B8;
    --taupe: #8B7355;
    --header-bg: #FFFFFF;
    --bg-light: #FDF8F3;
    --text-dark: #5D3319;
    /* Legacy aliases for compatibility */
    --primary-blue: #A65C2E;
    --dark-blue: #5D3319;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
}

/* Header */
.site-header {
    background: var(--header-bg);
    color: var(--text-dark);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(93,51,25,0.1);
    border-bottom: 1px solid var(--cream);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-hamburger {
    background: none;
    border: none;
    color: var(--dark-brown);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.header-hamburger:hover {
    opacity: 0.8;
}

.site-name {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-brown);
    text-decoration: none;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    display: block;
    width: auto;
}

.live-count {
    color: #4CAF50;
    font-size: 14px;
}

.live-count::before {
    content: '●';
    margin-right: 5px;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: 1px solid var(--cream);
    border-radius: 25px;
    font-size: 14px;
    background: #f5f5f5;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--dark-blue);
}

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

.btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--dark-blue);
}

.btn-outline {
    background: transparent;
    color: var(--dark-brown);
    border: 2px solid var(--primary-brown);
}

.btn-outline:hover {
    background: rgba(166,92,46,0.1);
}

/* Gender Navigation */
.gender-nav {
    background: var(--dark-brown);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(93,51,25,0.2);
    position: relative;
}

.gender-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Desktop Get Tokens Button */
.desktop-tokens-btn {
    position: absolute;
    right: 95px;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-align: center;
    padding: 10px 24px;
    border-radius: 6px;
    border: 2px solid #c62828;
    transition: background 0.2s, transform 0.1s;
}

.desktop-tokens-btn:hover {
    background: #c62828;
}

.desktop-tokens-btn:active {
    transform: scale(0.98);
}

.gender-tab {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.gender-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.gender-tab.active {
    color: #fff;
    border-bottom-color: var(--golden);
    background: rgba(229, 160, 51, 0.15);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    margin-left: 20px;
}

.nav-dropdown-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-dropdown-btn:hover {
    color: #fff;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dark-brown);
    min-width: 180px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(93,51,25,0.3);
    z-index: 100;
    overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block !important;
}

.nav-dropdown-content a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 12px 20px;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background: rgba(229, 160, 51, 0.2);
    color: #fff;
}

/* Mobile Menu */
.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: var(--dark-brown);
    z-index: 2001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-title {
    color: var(--golden);
    font-size: 1.3rem;
    font-weight: bold;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-section {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-menu-label {
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px 10px;
}

.mobile-menu-link {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    transition: background 0.2s;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background: rgba(229, 160, 51, 0.15);
    color: var(--golden);
}

.gender-nav-mobile {
    display: none;
}

/* Main Layout */
.main-container {
    display: flex;
    height: calc(100vh - 60px - 51px); /* 60px header + 51px gender nav */
    background: var(--bg-light);
}

.video-area {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.model-info {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.model-avatar {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 15px auto;
}

.model-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.model-username {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
    cursor: pointer;
}

.model-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-number {
    font-weight: bold;
    color: var(--text-dark);
}

.sidebar-content {
    padding: 20px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.placeholder-text {
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Room Subject */
.room-subject-section {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.room-subject {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

/* Model Details (Age, Location) */
.model-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.model-age,
.model-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.model-age:before {
    content: '';
}

.model-location:before {
    content: '';
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    transition: background 0.2s;
}

.tag:hover {
    background: #e0e0e0;
}

/* Sidebar Embed */
.sidebar-embed {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-embed iframe {
    display: block !important;
    width: 320px !important;
    height: 800px !important;
    border: none !important;
    border-radius: 8px;
    margin: 0 auto !important;
}

/* Modal styles */
.modal {
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.modal-content {
    width: 100%;
    height: 100%;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

#wheel-catcher {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    pointer-events: all; /* Capture events for wheel/swipe */
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Desktop only - wheel catcher only in video area */
@media (min-width: 1025px) {
    #wheel-catcher {
        /* Confined to video area, won't overlap header/sidebar */
        pointer-events: all;
    }
}

/* Loading and error states */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #333;
    z-index: 2000;
    display: none; /* Hidden by default */
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ff4444;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    z-index: 2000;
    display: none; /* Hidden by default */
}

/* Info badge (for mobile) */
#info {
    position: fixed;
    top: 70px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
}

.close-btn, .nav-arrow {
    display: none;
}

/* Mobile Header */
.mobile-header {
    display: none;
}

/* Mobile Styles */
@media (max-width: 1024px) {
    html, body {
        overflow: hidden;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: #000;
    }

    .site-header {
        display: none;
    }

    .gender-nav {
        display: none;
    }

    .desktop-tokens-btn {
        display: none;
    }

    .nav-dropdown {
        display: none;
    }

    .gender-nav-mobile {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: var(--dark-brown);
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 1999;
        padding: 0;
        box-shadow: 0 2px 4px rgba(93,51,25,0.3);
    }

    .gender-nav-mobile .gender-tab {
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        padding: 12px 15px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        border-bottom: 3px solid transparent;
        flex: 1;
        text-align: center;
    }

    .gender-nav-mobile .gender-tab.active {
        color: #fff;
        border-bottom-color: var(--golden);
        background: rgba(229, 160, 51, 0.15);
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--dark-brown);
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        height: 50px;
    }

    .mobile-header .hamburger,
    .mobile-header .hamburger-btn {
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        text-decoration: none;
        background: none;
        border: none;
    }

    .mobile-header .logo {
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        text-decoration: none;
        display: flex;
        align-items: center;
    }

    .mobile-header .logo img {
        display: block;
        width: auto;
    }

    .mobile-header .search-icon {
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
    }

    /* Mobile Menu - show on mobile */
    .mobile-menu {
        display: block;
    }

    .mobile-menu.active {
        transform: translateX(0);
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    .main-container {
        height: 100vh;
        padding-top: 95px; /* 50px mobile header + 45px gender nav */
    }

    .video-area {
        width: 100vw;
        height: calc(100vh - 95px); /* Adjusted for both headers */
        background: #000;
        position: relative;
    }

    .sidebar {
        display: none;
    }

    #info {
        display: none; /* Hide the info badge, we'll show username on video */
    }

    .modal {
        position: fixed;
        z-index: 1000;
        top: 95px; /* Mobile header + gender nav */
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: calc(100vh - 95px);
        background: #000;
        overflow: hidden;
    }

    .modal-content {
        position: relative;
        width: 100vw;
        height: calc(100vh - 95px);
        background: #000;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-content iframe {
        width: 100vw;
        height: 56.25vw; /* 16:9 aspect ratio */
        max-height: calc(100vh - 95px);
        border: none;
        background: #000;
        transform: scale(1.25); /* Zoom in to fill more vertical space */
    }

    /* Ensure no horizontal overflow */
    body.mobile-view {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    html {
        overflow-x: hidden !important;
    }

    /* Username overlay on video - TOP */
    .video-username-overlay {
        position: absolute;
        top: 10px;
        left: 15px;
        right: 15px;
        z-index: 1500;
        pointer-events: none;
    }

    .video-username-overlay .username {
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.7);
        margin-bottom: 2px;
        pointer-events: auto;
        cursor: pointer;
    }

    .video-username-overlay .subtitle {
        font-size: 13px;
        color: rgba(255,255,255,0.95);
        text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.7);
        margin-bottom: 4px;
    }

    .video-username-overlay .room-subject-mobile {
        font-size: 12px;
        color: rgba(255,255,255,0.9);
        text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.7);
        line-height: 1.4;
        max-height: 2.8em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

/* Mobile Landscape Mode - hide headers for more video */
@media (max-width: 1024px) and (orientation: landscape) {
    .mobile-header {
        display: none !important;
    }

    .gender-nav-mobile {
        display: none !important;
    }

    .main-container {
        padding-top: 0 !important;
        height: 100vh !important;
        width: 100vw !important;
    }

    .video-area {
        height: 100vh !important;
        width: 100vw !important;
    }

    .modal {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 100vh !important;
        width: 100vw !important;
    }

    .modal-content {
        height: 100vh !important;
        width: 100vw !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-content iframe {
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        object-fit: cover !important;
        transform: none !important;
    }

    /* Move username overlay to safe position in landscape */
    .video-username-overlay {
        top: 10px;
        left: 10px;
        right: auto;
        max-width: 40%;
    }

    .video-username-overlay .username {
        font-size: 16px;
    }

    .video-username-overlay .subtitle {
        font-size: 12px;
    }

    .video-username-overlay .room-subject-mobile {
        display: none;
    }

    /* Move swipe hint to avoid landscape UI */
    .swipe-hint-overlay {
        bottom: 10px;
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    #info {
        display: none;
    }

    .video-username-overlay {
        display: none;
    }

    .search-container {
        display: flex;
    }
}

/* Responsive header */
@media (max-width: 768px) {
    .search-container {
        display: none;
    }

    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* ===== POPUP STYLES ===== */

/* Footer Popup (Slider) */
.footer-popup {
    position: fixed;
    bottom: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 320px;
    animation: slideIn 0.4s ease-out;
}

.footer-popup.position-right {
    right: 20px;
}

.footer-popup.position-left {
    left: 20px;
}

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

.footer-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-brown);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.footer-popup h3 {
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-bottom: 10px;
    padding-right: 30px;
}

.footer-popup p {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.footer-popup-btn {
    display: inline-block;
    background: var(--primary-brown);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.footer-popup-btn:hover {
    background: var(--dark-brown);
}

/* Account Popup (Full Screen Modal) */
.account-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 30, 50, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.account-popup-modal {
    background: linear-gradient(135deg, #1a2a3e 0%, #1a1a2e 100%);
    border-radius: 16px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease-out;
}

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

.account-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.account-popup-title-link {
    text-decoration: none;
    cursor: pointer;
}

.account-popup-title-link:hover h2 {
    color: #2196F3;
}

.model-preview a {
    cursor: pointer;
    display: inline-block;
}

.account-popup-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
    transition: color 0.2s;
}

.account-popup-close {
    background: var(--primary-brown);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-popup-content {
    padding: 15px 20px;
    text-align: center;
}

.account-popup-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    text-align: left;
}

.account-popup-left {
    flex-shrink: 0;
    text-align: center;
}

.account-popup-right {
    flex: 1;
}

.speech-bubble {
    background: rgba(40, 60, 90, 0.8);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 12px;
    position: relative;
}

.speech-bubble::after {
    display: none;
}

.speech-bubble p {
    color: #ddd;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.model-preview {
    margin: 0 0 10px 0;
}

.model-preview img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-brown);
    transition: transform 0.2s, border-color 0.2s;
}

.model-preview a:hover img {
    transform: scale(1.05);
    border-color: var(--golden);
}

.model-preview span {
    display: block;
    color: #aaa;
    font-size: 0.8rem;
    margin-top: 6px;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 15px;
}

.benefits-list li {
    color: #ddd;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.benefits-list li::before {
    content: '';
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefits-list li:nth-child(1)::before { content: '💬'; background: none; }
.benefits-list li:nth-child(2)::before { content: '🎮'; background: none; }
.benefits-list li:nth-child(3)::before { content: '❤️'; background: none; }
.benefits-list li:nth-child(4)::before { content: '🎁'; background: none; }
.benefits-list li:nth-child(5)::before { content: '🔖'; background: none; }

.account-popup-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%);
    color: #fff;
    padding: 12px 50px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.account-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(166, 92, 46, 0.4);
}

/* Restricted Popup (Full Screen Overlay) */
.restricted-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.restricted-popup-content {
    text-align: center;
    max-width: 700px;
    padding: 40px 20px;
}

.restricted-popup-content h1 {
    color: var(--golden);
    font-size: 2.5rem;
    font-style: italic;
    margin-bottom: 25px;
}

.restricted-popup-content > p {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.benefits-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.benefits-row .benefit-item {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 30px;
    padding: 12px 25px;
    color: #fff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.benefits-row .benefit-item:nth-child(1)::before { content: '▶'; }
.benefits-row .benefit-item:nth-child(2)::before { content: '💬'; }
.benefits-row .benefit-item:nth-child(3)::before { content: '🪙'; }

.restricted-popup-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%);
    color: #fff;
    padding: 18px 50px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.restricted-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(166, 92, 46, 0.4);
}

/* Mobile adjustments for popups */
@media (max-width: 768px) {
    .footer-popup {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .footer-popup.position-right,
    .footer-popup.position-left {
        left: 10px;
        right: 10px;
    }

    .account-popup-modal {
        width: 92%;
        max-height: 85vh;
    }

    .account-popup-header {
        padding: 12px 15px;
    }

    .account-popup-header h2 {
        font-size: 1.1rem;
    }

    .account-popup-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .account-popup-content {
        padding: 12px 15px 15px 15px;
    }

    .account-popup-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .account-popup-left {
        order: -1;
    }

    .speech-bubble {
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .speech-bubble p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .model-preview {
        margin: 0 0 10px 0;
    }

    .model-preview img {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }

    .model-preview span {
        font-size: 0.75rem;
        margin-top: 5px;
    }

    .benefits-list {
        margin: 0 0 12px 0;
        grid-template-columns: 1fr;
        text-align: left;
    }

    .benefits-list li {
        padding: 4px 0;
        font-size: 0.8rem;
        gap: 8px;
    }

    .account-popup-btn {
        padding: 10px 35px;
        font-size: 0.9rem;
    }

    .restricted-popup-content h1 {
        font-size: 1.8rem;
    }

    .benefits-row {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== DEBUG PANEL ===== */
.debug-panel {
    background: #1a1a2e;
    border: 1px solid #ff0000;
    border-top: none;
    padding: 12px;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.debug-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.debug-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.debug-title {
    color: var(--golden);
    font-weight: bold;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    color: #aaa;
}

.debug-row span:last-child {
    color: #fff;
    font-weight: 500;
}

.debug-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.debug-status.on {
    background: #22c55e;
    color: #fff;
}

.debug-status.off {
    background: #666;
    color: #ccc;
}

.debug-countdown {
    color: #fbbf24 !important;
}

.debug-warning {
    color: #f97316 !important;
}

.debug-active {
    color: #22c55e !important;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}

.search-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #333;
}

.search-overlay-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.search-overlay-close {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-overlay-close:hover {
    background: #555;
}

.search-overlay-input {
    padding: 20px 30px;
    border-bottom: 1px solid #333;
}

.search-overlay-input input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #333;
    border-radius: 30px;
    font-size: 18px;
    background: #1a1a1a;
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.search-overlay-input input:focus {
    border-color: var(--primary-blue);
}

.search-overlay-input input::placeholder {
    color: #666;
}

.search-overlay-results {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.search-result-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-result-item:hover {
    transform: scale(1.05);
}

.search-result-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px auto;
    border: 3px solid #333;
    transition: border-color 0.2s;
}

.search-result-item:hover .search-result-image {
    border-color: var(--primary-brown);
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-viewers {
    color: #888;
    font-size: 12px;
}

.search-result-viewers::before {
    content: '●';
    color: #4CAF50;
    margin-right: 5px;
}

.search-no-results {
    text-align: center;
    color: #888;
    font-size: 1.1rem;
    padding: 60px 20px;
}

.search-loading {
    text-align: center;
    color: #888;
    font-size: 1rem;
    padding: 60px 20px;
}

/* Mobile adjustments for search overlay */
@media (max-width: 768px) {
    .search-overlay-header {
        padding: 15px 20px;
    }

    .search-overlay-header h2 {
        font-size: 1.2rem;
    }

    .search-overlay-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .search-overlay-input {
        padding: 15px 20px;
    }

    .search-overlay-input input {
        padding: 12px 18px;
        font-size: 16px;
    }

    .search-overlay-results {
        padding: 20px;
    }

    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }

    .search-result-image {
        width: 80px;
        height: 80px;
    }

    .search-result-name {
        font-size: 12px;
    }

    .search-result-viewers {
        font-size: 10px;
    }
}

/* ===== SWIPE HINT OVERLAY ===== */
.swipe-hint-overlay {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 14px 50px 14px 24px;
    border-radius: 25px;
    font-size: 17px;
    z-index: 1600;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.swipe-hint-overlay span {
    white-space: nowrap;
}

.swipe-hint-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.swipe-hint-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Mobile swipe hint adjustments */
@media (max-width: 1024px) {
    .swipe-hint-overlay {
        /* Position below the chat bar */
        bottom: calc(15px + env(safe-area-inset-bottom, 0px));
        font-size: 16px;
        padding: 12px 46px 12px 20px;
    }

    .swipe-hint-close {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Mobile landscape swipe hint */
@media (max-width: 1024px) and (orientation: landscape) {
    .swipe-hint-overlay {
        bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    }
}

/* Hide swipe hint on very small screens if too cramped */
@media (max-width: 360px) {
    .swipe-hint-overlay {
        font-size: 12px;
        padding: 8px 36px 8px 14px;
    }
}

/* ==========================================
   Offline Room Overlay
   ========================================== */
#offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.offline-content {
    text-align: center;
    padding: 30px;
    max-width: 500px;
}

.offline-thumb {
    width: 280px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.offline-info {
    margin-bottom: 24px;
}

.offline-username {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 600;
}

.offline-status {
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-weight: 500;
}

.offline-last-seen {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
}

.offline-subject {
    font-size: 0.95rem;
    color: #aaa;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-cta {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-bottom: 16px;
}

.offline-cta:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

.offline-swipe-hint {
    font-size: 1.1rem;
    color: #888;
}

/* Offline tag in sidebar */
.offline-tag {
    background: #e74c3c !important;
    color: #fff !important;
}

/* Search results offline badge */
.search-result-image {
    position: relative;
}

.search-offline-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.search-result-item.is-offline {
    opacity: 0.85;
}

.search-result-item.is-offline:hover {
    opacity: 1;
}

/* Mobile adjustments for offline overlay */
@media (max-width: 1024px) {
    .offline-content {
        padding: 20px;
    }

    .offline-thumb {
        width: 200px;
        margin-bottom: 20px;
    }

    .offline-username {
        font-size: 1.4rem;
    }

    .offline-status {
        font-size: 1rem;
    }

    .offline-cta {
        padding: 12px 28px;
        font-size: 1rem;
    }
}

/* ==========================================
   Mobile Get Tokens Button
   ========================================== */
.mobile-chat-bar {
    display: none;
}

@media (max-width: 1024px) {
    /* Hide original swipe hint on mobile */
    .swipe-hint-overlay {
        display: none !important;
    }

    /* Mobile Get Tokens - positioned at bottom */
    .mobile-chat-bar {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(15px + env(safe-area-inset-bottom, 0px));
        z-index: 99999;
        gap: 8px;
    }

    .get-tokens-btn {
        display: block;
        background: #e53935;
        color: #fff;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 1px;
        text-decoration: none;
        text-align: center;
        padding: 14px 40px;
        border-radius: 8px;
        border: 2px solid #c62828;
        width: 100%;
        max-width: 300px;
        transition: background 0.2s, transform 0.1s;
    }

    .get-tokens-btn:active {
        background: #c62828;
        transform: scale(0.98);
    }

    .chat-bar-swipe-hint {
        text-align: center;
        color: rgba(255, 255, 255, 0.8);
        font-size: 14px;
        padding: 4px 0;
    }
}

/* Hide button in landscape */
@media (max-width: 1024px) and (orientation: landscape) {
    .mobile-chat-bar {
        display: none;
    }
}
