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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #141420;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --accent-glow: rgba(99, 102, 241, 0.4);
    --danger: #ef4444;
    --success: #10b981;
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari */
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text size adjustment on iOS */
    -webkit-text-size-adjust: 100%;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: contain;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: block;
}

/* Grey Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #ffffff;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

.loading-content h2 {
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

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

/* Ensure waiting screen is completely hidden when chat screen is active */
#chat-screen.active ~ #waiting-screen,
#chat-screen.active + #waiting-screen {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure waiting screen is hidden when chat screen is active */
#chat-screen.active {
    z-index: 10;
}

#waiting-screen:not(.active) {
    display: none !important;
}

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

/* Glass Card Effect */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Welcome Card */
.welcome-card {
    padding: var(--spacing-xl);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.welcome-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.welcome-card p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    font-weight: 400;
}

/* Filters Container */
.filters-container {
    margin-bottom: var(--spacing-lg);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.filter-group {
    width: 100%;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.filter-select:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

/* Legacy support for country-filter */
.country-filter {
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

.country-filter label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.country-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.country-select:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.country-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.country-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn svg {
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Spinner */
.spinner-wrapper {
    margin-bottom: var(--spacing-md);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Waiting Screen */
#waiting-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: var(--spacing-lg);
}

#waiting-screen .video-preview {
    width: 100%;
    max-width: 600px;
}

#waiting-screen .video-preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#waiting-screen .video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#waiting-screen .waiting-card {
    padding: var(--spacing-lg);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

#waiting-screen .waiting-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

#waiting-screen .waiting-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    width: 100%;
    max-width: 1600px;
    min-height: 400px;
}

/* Video Container */
.video-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    width: 100%;
    min-height: 400px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    aspect-ratio: 16/9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.video-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

#local-video {
    transform: scaleX(-1);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
}

.video-label {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.video-wrapper:has(#remote-video:not([srcObject]))::before {
    content: 'Waiting for connection...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    z-index: 1;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.control-btn {
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-glass);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    /* Better touch targets on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 44px; /* Minimum touch target size for mobile */
}

.control-btn:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.control-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.control-btn .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.btn-next {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-next:hover {
    box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

/* Status Message */
.status-message {
    text-align: center;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Chat Box */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    max-height: 600px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.chat-box.collapsed {
    max-height: 50px;
    min-height: 50px;
}

.chat-box.collapsed .chat-messages,
.chat-box.collapsed .chat-input-container {
    display: none;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-glass-hover);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.toggle-chat-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 4px;
}

.toggle-chat-btn:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.chat-box.collapsed .toggle-chat-btn .icon {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-height: 0;
    /* Cross-platform scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
    /* Better scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-welcome {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: var(--spacing-md);
    font-style: italic;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    max-width: 80%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    animation: slideIn 0.3s ease-out;
    /* Cross-platform text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.chat-message-text {
    line-height: 1.5;
    white-space: pre-wrap; /* Preserve line breaks */
}

.chat-link {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
    word-break: break-all;
}

.chat-link:hover {
    opacity: 1;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

.chat-message.own {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other {
    align-self: flex-start;
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.chat-input-container {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-glass-hover);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.95rem;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    /* Cross-platform compatibility */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Better mobile support */
    touch-action: manipulation;
    /* Prevent zoom on iOS */
    font-size: 16px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.chat-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Prevent iOS input styling */
.chat-input,
.chat-input:focus {
    -webkit-appearance: none;
    border-radius: var(--border-radius-sm);
}

/* Better mobile keyboard handling */
@media (max-width: 768px) {
    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.send-chat-btn {
    padding: 10px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.send-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.send-chat-btn:active {
    transform: translateY(0);
}

.send-chat-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-muted);
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 400;
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* Responsive */
@media (max-width: 1200px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
    
    .chat-box {
        max-height: 300px;
        min-height: 300px;
    }
}

/* Mobile First - Complete Redesign */
@media (max-width: 768px) {
    .container {
        padding: 12px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    header {
        margin-bottom: 20px;
        padding-top: 10px;
    }
    
    header h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-top: 4px;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 0;
        width: 100%;
    }
    
    /* Start Screen */
    .welcome-card {
        padding: 24px 16px;
        width: 100%;
        max-width: 100%;
    }
    
    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .welcome-card h2 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }
    
    .welcome-card p {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .country-filter {
        margin-bottom: 20px;
    }
    
    .country-filter label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .country-select {
        padding: 14px 16px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        min-height: 52px;
    }
    
    /* Waiting Screen */
    #waiting-screen {
        gap: 16px;
        padding: 0;
    }
    
    #waiting-screen .video-preview {
        width: 100%;
        max-width: 100%;
    }
    
    #waiting-screen .video-preview-wrapper {
        aspect-ratio: 9/16;
        max-width: 100%;
        border-radius: 12px;
    }
    
    #waiting-screen .waiting-card {
        padding: 20px 16px;
        width: 100%;
        max-width: 100%;
    }
    
    #waiting-screen .waiting-card h2 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    
    #waiting-screen .waiting-card p {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }
    
    /* Chat Screen - Mobile Layout */
    #chat-screen {
        width: 100%;
        padding: 0;
    }
    
    .chat-layout {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
        min-height: auto;
    }
    
    .video-container {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        min-height: auto;
    }
    
    .video-wrapper {
        width: 100%;
        aspect-ratio: 9/16;
        min-height: 200px;
        border-radius: 12px;
    }
    
    .video-wrapper video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .video-label {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .chat-box {
        order: 2;
        width: 100%;
        max-height: 280px;
        min-height: 280px;
        border-radius: 12px;
    }
    
    .chat-header {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .chat-messages {
        padding: 12px;
        font-size: 0.85rem;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .chat-message {
        padding: 8px 12px;
        font-size: 0.85rem;
        max-width: 80%;
        margin-bottom: 6px;
    }
    
    .chat-message-time {
        font-size: 0.7rem;
        margin-top: 2px;
    }
    
    .chat-input-container {
        padding: 10px 12px;
    }
    
    .chat-input {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .send-chat-btn {
        padding: 12px 16px;
        min-width: 50px;
    }
    
    .send-chat-btn .icon {
        width: 18px;
        height: 18px;
    }
    
    /* Controls */
    .controls {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        justify-content: center;
        width: 100%;
        margin-top: 8px;
    }
    
    .control-btn {
        padding: 14px 16px;
        min-width: 56px;
        min-height: 56px;
        border-radius: 14px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }
    
    .control-btn .icon {
        width: 22px;
        height: 22px;
    }
    
    .control-btn span {
        display: none;
    }
    
    .btn-next,
    .btn-danger {
        padding: 14px 20px;
        min-width: 90px;
        flex: 1 1 auto;
        max-width: 120px;
    }
    
    .btn-next span,
    .btn-danger span {
        display: inline;
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .status-message {
        font-size: 0.85rem;
        padding: 10px 14px;
        margin-top: 8px;
        width: 100%;
        max-width: 100%;
    }
    
    footer {
        margin-top: 20px;
        padding-bottom: 12px;
        font-size: 0.75rem;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 16px;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .welcome-card {
        padding: 20px 14px;
    }
    
    .welcome-card h2 {
        font-size: 1.3rem;
    }
    
    .welcome-card p {
        font-size: 0.85rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .video-wrapper {
        min-height: 180px;
    }
    
    .chat-box {
        max-height: 250px;
        min-height: 250px;
    }
    
    .chat-messages {
        max-height: 170px;
    }
    
    .controls {
        gap: 6px;
        padding: 10px;
    }
    
    .control-btn {
        min-width: 52px;
        min-height: 52px;
        padding: 12px 14px;
    }
    
    .btn-next,
    .btn-danger {
        min-width: 80px;
        padding: 12px 16px;
    }
}

/* Very Small Phones */
@media (max-width: 375px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .welcome-card h2 {
        font-size: 1.2rem;
    }
    
    .video-wrapper {
        min-height: 160px;
    }
    
    .chat-box {
        max-height: 220px;
        min-height: 220px;
    }
    
    .control-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .btn-next,
    .btn-danger {
        min-width: 70px;
    }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 8px;
    }
    
    header {
        margin-bottom: 12px;
        padding-top: 8px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .chat-layout {
        flex-direction: row;
        gap: 10px;
        max-height: calc(100vh - 200px);
    }
    
    .video-container {
        flex-direction: row;
        flex: 1;
        gap: 8px;
    }
    
    .video-wrapper {
        aspect-ratio: 16/9;
        min-height: 120px;
        flex: 1;
    }
    
    .chat-box {
        width: 300px;
        max-height: 100%;
        min-height: 200px;
        flex-shrink: 0;
    }
    
    .controls {
        flex-wrap: nowrap;
        padding: 8px;
    }
    
    .control-btn {
        min-width: 48px;
        min-height: 48px;
        padding: 10px 12px;
    }
}
