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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.8rem;
    padding: 0 1rem;
}

.main-nav a {
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover {
    color: #667eea;
    text-decoration: underline;
}

.site-name {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
}

.tagline {
    font-size: 0.9rem;
    color: #666;
    margin-left: 1rem;
}

.user-info {
    font-size: 0.9rem;
    color: #666;
}

.online-count {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
}

.screen {
    width: 100%;
    max-width: 1200px;
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
}

.welcome-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.preferences {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.preference-group {
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.preference-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.preference-group input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 0.5rem;
}

.preference-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #444;
}

.radio-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    font-weight: 400;
    color: #444;
}

.radio-row input {
    margin-top: 0.2rem;
}

.preference-group input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.preference-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.rules {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.rules h3 {
    margin-bottom: 1rem;
    color: #555;
}

.rules ul {
    list-style: none;
    padding: 0;
}

.rules li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
}

.rules li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Mobile Notice */
.mobile-notice {
    display: none !important;
    background: #eef1ff;
    border: 1px solid #d8defc;
    color: #39426d;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin: 1rem auto;
    max-width: 500px;
    width: 90%;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.12);
}

.mobile-notice-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.mobile-notice-text {
    font-size: 1rem;
    color: #39426d;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3838;
}

.btn-warning {
    background: #ffa502;
    color: white;
}

.btn-warning:hover {
    background: #ff8c00;
}

.revenue-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-left: 10px;
}

.revenue-btn:hover {
    background: linear-gradient(135deg, #218838, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.withdraw-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.withdraw-btn:hover {
    background: linear-gradient(135deg, #ff5252, #d63031);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.premium-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.premium-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.preferences select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #fff;
}

.preferences select:focus {
    outline: none;
    border-color: #667eea;
}

.premium-only select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f6f6f6;
}

.premium-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.premium-chip {
    appearance: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 999px;
    color: #333;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.25);
    line-height: 1;
}

.premium-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6b7280;
}

.rewarded-ad-btn {
    width: 100%;
    margin-top: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.rewarded-ad-btn:hover:not(:disabled) {
    background: #1f2937;
    transform: translateY(-1px);
}

.rewarded-ad-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.connection-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    z-index: 10002;
    text-align: center;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.success-icon {
    font-size: 48px;
}

.success-text h4 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.success-text p {
    margin: 10px 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 10003;
    font-weight: 600;
    max-width: 300px;
}

.notification.success {
    background: #d4edda;
    color: #155724;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
}

.btn-control {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid #e1e1e1;
    padding: 0.6rem 1rem;
    font-size: 1.2rem;
}

.btn-control:hover {
    background: #f0f0f0;
}

.camera-filter-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.35rem 0.55rem;
    border: 2px solid #c7d2fe;
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.12);
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
}

.camera-filter-control::before {
    content: '';
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 4px;
    background: linear-gradient(135deg, #64748b, #cbd5e1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.camera-filter-control[data-filter='warm']::before {
    background: linear-gradient(135deg, #f97316, #facc15);
}

.camera-filter-control[data-filter='cool']::before {
    background: linear-gradient(135deg, #0ea5e9, #2dd4bf);
}

.camera-filter-control[data-filter='mono']::before {
    background: linear-gradient(135deg, #111827, #94a3b8);
}

.camera-filter-control[data-filter='vivid']::before {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

.camera-filter-title {
    white-space: nowrap;
}

.camera-filter-control select {
    min-width: 88px;
    padding: 0.2rem 0.3rem;
    border: 1px solid #dbeafe;
    border-radius: 5px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    cursor: pointer;
}

.camera-filter-control select:focus {
    outline: none;
}

.camera-filter-control:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

/* Chat Screen */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
}

.video-container {
    position: relative;
    display: block;
    margin-bottom: 1rem;
    flex: 0 1 min(62vh, 640px);
    min-height: 360px;
    height: clamp(420px, 58vh, 680px);
}

.chat-screen.text-only-session .video-container {
    display: none;
}

.chat-screen.text-only-session .chat-messages {
    max-height: min(55vh, 520px);
}

.video-wrapper {
    position: relative;
    background: #e8edf5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-height: 0;
}

.video-wrapper:last-child {
    width: 100%;
    height: 100%;
}

.video-wrapper:first-child {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: clamp(180px, 24%, 310px);
    height: clamp(120px, 28%, 210px);
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.video-local,
.video-remote {
    width: 100%;
    height: 100%;
}

.video-local {
    object-fit: cover;
}

.video-remote {
    object-fit: contain;
    object-position: center;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.chat-messages {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1rem;
    overflow-y: auto;
    margin-bottom: 1rem;
    min-height: 90px;
    max-height: 180px;
}

.message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    max-width: 80%;
}

.message.system {
    background: #f0f0f0;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

.message.you {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.stranger {
    background: #f0f0f0;
    color: #333;
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.message-input-container input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
}

.message-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.btn-send:hover {
    opacity: 0.9;
}

.controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

/* SEO Content */
.seo-content {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 3rem 1.5rem;
}

.seo-content-inner {
    max-width: 980px;
    margin: 0 auto;
}

.seo-kicker {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.seo-content h2 {
    color: #222;
    font-size: 1.8rem;
    margin: 1.8rem 0 0.75rem;
}

.seo-content h2:first-of-type {
    margin-top: 0;
}

.seo-content h3 {
    color: #333;
    font-size: 1.2rem;
    margin: 1.25rem 0 0.6rem;
}

.seo-content p {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.content-page {
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, #f7f8ff 0%, #ffffff 52%, #f2fbf7 100%);
}

.seo-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem 1.2rem;
    max-width: 980px;
    margin: 0 auto 20px;
}

.seo-nav a {
    color: #4b5563;
    font-weight: 700;
    text-decoration: none;
}

.seo-nav a:hover {
    color: #667eea;
    text-decoration: underline;
}

.content-card {
    max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(31, 41, 55, 0.08);
    padding: 40px;
}

.content-card h1 {
    color: #222;
    font-size: 2.4rem;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.content-card h2 {
    color: #333;
    font-size: 1.45rem;
    margin: 1.8rem 0 0.75rem;
}

.content-card p {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.content-card .back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #667eea;
    font-weight: 700;
    text-decoration: none;
}

.content-card .back-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.seo-footer {
    max-width: 920px;
    margin: 20px auto 0;
    border-radius: 8px;
}

/* Connecting Screen */
.connecting-screen {
    text-align: center;
}

.connecting-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.connecting-content p {
    color: #666;
    font-size: 1.1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

/* Disconnected Screen */
.disconnected-screen {
    text-align: center;
}

.disconnected-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.disconnected-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.disconnected-content .btn {
    margin: 0 0.5rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .site-name {
        font-size: 1.5rem;
    }
    
    .tagline {
        display: none;
    }

    .main-nav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0.75rem 0 0;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }

    .seo-content {
        padding: 2.25rem 1rem;
    }
    
    .mobile-notice {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .video-container {
        position: relative;
        display: block;
        flex: 0 1 45vh;
        height: min(58vh, 560px);
        min-height: 220px;
    }
    
    .video-wrapper:first-child {
        top: 10px;
        right: 10px;
        width: 34%;
        height: 24%;
        min-height: 95px;
    }
    
    .video-wrapper:last-child {
        height: 100%;
        width: 100%;
    }
    
    .controls {
        gap: 0.3rem;
    }
    
    .btn-control {
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
    }

    .camera-filter-control {
        min-height: 38px;
        padding: 0.25rem 0.45rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        background: #f7f8ff;
    }

    .app-container {
        background: #f7f8ff;
    }

    .header {
        padding: 0.65rem 0.9rem;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .site-name {
        font-size: 1rem;
    }

    .main-nav {
        gap: 0.7rem;
    }

    .main-nav a {
        font-size: 0.82rem;
    }

    .main-content {
        align-items: flex-start;
        padding: 0.75rem;
    }

    .preferences {
        padding: 1rem;
    }
    
    .rules {
        padding: 1rem;
    }
    
    .chat-screen {
        height: auto;
        min-height: calc(100dvh - 130px);
        overflow-y: auto;
    }

    .video-container {
        position: relative;
        display: block;
        flex: none;
        height: min(58dvh, 520px);
        min-height: 380px;
        margin-bottom: 0.7rem;
    }

    .video-wrapper:last-child {
        position: relative;
        height: 100%;
        width: 100%;
        border-radius: 14px;
    }

    .video-wrapper:first-child {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        width: 34%;
        height: 24%;
        min-height: 95px;
        border: 2px solid rgba(255, 255, 255, 0.9);
        border-radius: 12px;
    }

    .video-label {
        bottom: 7px;
        left: 7px;
        padding: 0.25rem 0.55rem;
        font-size: 0.7rem;
    }

    .chat-messages {
        min-height: 72px;
        max-height: 108px;
        margin-bottom: 0.7rem;
        padding: 0.7rem;
        border-radius: 10px;
    }
    
    .message {
        max-width: 90%;
        margin-bottom: 0.55rem;
        padding: 0.6rem;
    }

    .message-input-container {
        gap: 0.45rem;
        margin-bottom: 0.7rem;
    }

    .message-input-container input {
        min-width: 0;
        padding: 0.72rem;
        font-size: 0.9rem;
    }

    .btn-send {
        padding: 0.72rem 1rem;
    }

    .controls {
        gap: 0.4rem;
    }

    .camera-filter-control {
        flex: 1 0 100%;
        justify-content: space-between;
        min-height: 48px;
        padding: 0.45rem 0.65rem;
        order: -1;
    }

    .camera-filter-control select {
        min-width: 132px;
        min-height: 34px;
    }

    .controls .btn {
        min-width: 48px;
    }

    .seo-content h2,
    .content-card h1 {
        font-size: 1.6rem;
    }

    .content-page {
        padding: 14px;
    }

    .content-card {
        padding: 24px 18px;
    }
    
    .mobile-notice {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.65rem 0.8rem;
        margin: 0.75rem auto 1rem;
        font-size: 0.9rem;
    }
    
    .mobile-notice-icon {
        font-size: 1.2rem;
    }
    
    .mobile-notice-text {
        font-size: 0.9rem;
    }
}
