@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

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

:root {
    --primary-color: #D4654A;
    --primary-dark: #B8503A;
    --primary-light: #E8856E;
    --secondary-color: #E8C468;
    --background: #FBF6F0;
    --background-warm: #F5ECE2;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #FFFFFF;
    --text-primary: #2D2420;
    --text-secondary: #8C7B72;
    --error: #C9463D;
    --success: #5B9E6F;
    --success-light: #6DB882;
    --accent: #6B8FAD;
    --border: rgba(45, 36, 32, 0.08);
    --shadow-sm: 0 1px 3px rgba(45, 36, 32, 0.06), 0 1px 2px rgba(45, 36, 32, 0.04);
    --shadow-md: 0 4px 16px rgba(45, 36, 32, 0.08), 0 2px 4px rgba(45, 36, 32, 0.04);
    --shadow-lg: 0 12px 40px rgba(45, 36, 32, 0.12), 0 4px 12px rgba(45, 36, 32, 0.06);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Warm grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease;
}

.loading-spinner.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-text {
    margin-top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

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

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

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

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

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 101, 74, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(212, 101, 74, 0); }
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

#call-screen.screen.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    animation: none;
}

/* Login & Invite Container */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease both;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 500;
    font-size: 1rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.form-group {
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    transition: all 0.25s ease;
    background: var(--surface-solid);
    color: var(--text-primary);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(212, 101, 74, 0.1);
}

/* Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    box-shadow: 0 2px 8px rgba(212, 101, 74, 0.25);
    animation: fadeInUp 0.6s ease 0.3s both;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(212, 101, 74, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: var(--background-warm);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-icon:hover {
    background: rgba(45, 36, 32, 0.06);
}

.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.error-message {
    color: var(--error);
    margin-top: 1rem;
    text-align: center;
    display: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.error-message.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* App Screen Header */
header {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    flex: 1;
    min-width: 0;
    letter-spacing: -0.01em;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: rgba(45, 36, 32, 0.06);
    color: var(--text-primary);
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    margin-top: -0.25rem;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.notification-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}

.notification-status.enabled {
    color: var(--success);
    background: rgba(91, 158, 111, 0.1);
}

.notification-status.disabled {
    color: var(--text-secondary);
    background: rgba(140, 123, 114, 0.1);
    text-decoration: none;
    cursor: pointer;
}

.notification-status.disabled:hover {
    color: var(--primary-color);
    background: rgba(212, 101, 74, 0.08);
}

.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher select {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    background: var(--surface-solid);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s;
}

.language-switcher select:hover,
.language-switcher select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Main Content */
main {
    padding: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Group Call Button */
#group-call-section {
    margin-bottom: 1.25rem;
}

#start-group-call-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #5A7E9A 100%);
    color: white;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 3px 14px rgba(107, 143, 173, 0.25);
    border: none;
    position: relative;
    overflow: hidden;
}

#start-group-call-btn:hover {
    box-shadow: 0 5px 20px rgba(107, 143, 173, 0.35);
    transform: translateY(-1px);
}

#start-group-call-btn:active {
    transform: translateY(0);
}

#start-group-call-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

#start-group-call-btn:hover::before {
    left: 100%;
}

#start-group-call-btn:hover {
    box-shadow: 0 6px 28px rgba(212, 101, 74, 0.4);
    transform: translateY(-2px);
}

/* Contacts List */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.contact-item {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.25s ease;
    animation: fadeInUp 0.4s ease both;
}

.contact-item:nth-child(1) { animation-delay: 0s; }
.contact-item:nth-child(2) { animation-delay: 0.05s; }
.contact-item:nth-child(3) { animation-delay: 0.1s; }
.contact-item:nth-child(4) { animation-delay: 0.15s; }
.contact-item:nth-child(5) { animation-delay: 0.2s; }
.contact-item:nth-child(6) { animation-delay: 0.25s; }

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(212, 101, 74, 0.15);
}

.contact-info {
    width: 100%;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.contact-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 0.75rem;
    display: inline-block;
    line-height: 1;
    flex-shrink: 0;
    padding: 0.25rem;
}

.status-indicator.online {
    opacity: 1;
}

.status-indicator.offline {
    opacity: 0.35;
}

.push-indicator {
    font-size: 0.85rem;
    display: inline-block;
    opacity: 0.6;
    line-height: 1;
    flex-shrink: 0;
    padding: 0.25rem;
}

.contact-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.contact-actions .btn-icon {
    font-size: 1.2rem;
    padding: 0.4rem;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    background: rgba(45, 36, 32, 0.03);
}

.contact-actions .btn-icon:hover {
    background: rgba(212, 101, 74, 0.1);
    transform: scale(1.08);
}

.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Pending Invites Section */
.pending-invites-section {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.invites-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.invite-item {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.invite-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.invite-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.invite-name {
    font-weight: 600;
    color: var(--text-primary);
}

.invite-link-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
    font-family: 'SF Mono', 'Fira Code', monospace;
    opacity: 0.7;
}

.invite-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 36, 32, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--surface-solid);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.modal-actions .btn {
    flex: 1;
}

.invite-link-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.invite-link-container input {
    flex: 1;
    font-size: 0.85rem;
}

/* Incoming Call Screen */
.incoming-call-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
}

.incoming-call-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

.incoming-call-icon {
    font-size: 4rem;
    animation: incoming-ring 1.5s ease-in-out infinite;
}

@keyframes incoming-ring {
    0%, 100% { transform: rotate(0deg) scale(1); }
    10% { transform: rotate(-15deg) scale(1.1); }
    20% { transform: rotate(15deg) scale(1.1); }
    30% { transform: rotate(-15deg) scale(1.1); }
    40% { transform: rotate(15deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1); }
}

.incoming-call-caller {
    font-family: 'Quicksand', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.incoming-call-type {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    opacity: 0.7;
    margin: 0;
}

.incoming-call-actions {
    display: flex;
    gap: 4rem;
}

.incoming-call-btn {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.incoming-call-btn:active {
    transform: scale(0.95);
}

.decline-btn {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
}

.decline-btn:hover {
    box-shadow: 0 6px 28px rgba(231, 76, 60, 0.6);
}

.accept-btn {
    background: #2ecc71;
    color: #fff;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4);
}

.accept-btn:hover {
    box-shadow: 0 6px 28px rgba(46, 204, 113, 0.6);
}

/* Call Screen */
.call-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: #0A0A0A;
    overflow: hidden;
}

.video-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#remote-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

#local-video {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 140px;
    height: 186px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: #0A0A0A;
    cursor: move;
    touch-action: none;
    z-index: 10;
    user-select: none;
    display: block;
    visibility: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7));
    position: relative;
}

.call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.call-btn:active {
    transform: scale(0.95);
}

.call-btn.end-call {
    background: var(--error);
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(201, 70, 61, 0.4);
}

.call-btn.end-call:hover {
    background: #D9524A;
    box-shadow: 0 4px 20px rgba(201, 70, 61, 0.5);
}

.audio-output-container {
    position: relative;
}

.audio-output-menu {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-md);
    min-width: 250px;
    max-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.audio-output-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.audio-output-list {
    display: flex;
    flex-direction: column;
    padding: 0.375rem;
}

.audio-output-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: white;
    transition: background 0.2s;
    font-weight: 500;
}

.audio-output-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.audio-output-item.active {
    background: rgba(212, 101, 74, 0.25);
}

.audio-output-item.active:hover {
    background: rgba(212, 101, 74, 0.35);
}

.audio-output-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.audio-output-label {
    flex: 1;
    font-size: 0.9rem;
    word-break: break-word;
}

.call-info {
    position: absolute;
    top: 16px;
    left: 20px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 5;
    pointer-events: none;
}

.call-info p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
}

/* Install & Notification Prompts */
.install-prompt {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(212, 101, 74, 0.06);
    border: 1px solid rgba(212, 101, 74, 0.12);
    border-radius: var(--radius-md);
    text-align: center;
}

.prompt-banner {
    background: var(--surface-solid);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    animation: fadeInUp 0.4s ease;
}

.prompt-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.prompt-content > span {
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 0;
    word-break: break-word;
    color: var(--text-primary);
    line-height: 1.4;
}

.prompt-content > .btn-small {
    flex: 0 0 auto;
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 700;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    width: auto;
}

.prompt-content > .btn-small:hover {
    background: var(--primary-dark);
}

.prompt-content > .btn-icon {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.2rem;
    min-width: auto;
}

.prompt-content .btn-icon:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.invite-message {
    margin: 2rem 0;
    padding: 1.75rem;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.invite-message p {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
}

/* Mobile Menu */
.mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--surface-solid);
    box-shadow: -4px 0 24px rgba(45, 36, 32, 0.15);
    z-index: 2000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 36, 32, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.35s ease;
}

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

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-header h3 {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
}

.menu-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.menu-close:hover {
    background: rgba(45, 36, 32, 0.06);
    color: var(--text-primary);
}

.mobile-menu-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-menu-item select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    background: var(--surface-solid);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.mobile-menu-item select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.mobile-menu-item .btn {
    width: 100%;
}

/* ===============================
   Group Call Screen
   =============================== */

#group-call-screen.screen.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    animation: none;
}

.group-call-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    background: #0A0A0A;
    overflow: hidden;
    position: relative;
}

.group-call-info-bar {
    position: absolute;
    top: 14px;
    left: 18px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-call-info-bar p {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Video Grid */
.video-grid {
    flex: 1;
    display: grid;
    gap: 3px;
    padding: 3px;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.video-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.video-grid.grid-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.video-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.video-grid.grid-5,
.video-grid.grid-6 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.video-grid.grid-many {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
}

/* Video Tile */
.video-tile {
    position: relative;
    background: #141414;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-tile-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: white;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    pointer-events: none;
    letter-spacing: 0.01em;
}

/* Group Local Video (PiP) */
.group-local-video {
    position: absolute;
    bottom: 100px;
    right: 12px;
    width: 110px;
    height: 146px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: #0A0A0A;
    z-index: 10;
    display: block;
    visibility: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Group Call Invite Banner */
.group-call-invite-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    padding: 0.875rem 1.25rem;
    z-index: 3000;
    box-shadow: 0 4px 20px rgba(91, 158, 111, 0.35);
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-call-invite-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.group-call-invite-content span {
    flex: 1;
    font-weight: 600;
}

.group-call-invite-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.group-call-invite-actions .btn {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 700;
    animation: pulseGlow 2s ease infinite;
}

.group-call-invite-actions .btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.group-call-invite-actions .btn-icon {
    color: white;
    font-size: 1.5rem;
    padding: 0;
    opacity: 0.8;
}

.group-call-invite-actions .btn-icon:hover {
    opacity: 1;
    background: transparent;
}

/* ===============================
   Responsive
   =============================== */

@media (max-width: 600px) {
    .container {
        padding: 1.25rem;
    }

    h1 {
        font-size: 2rem;
    }

    header {
        padding: 0.75rem 1rem;
    }

    header h2 {
        font-size: 1.2rem;
    }

    .mobile-menu {
        width: 280px;
    }

    .contact-item {
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .contact-name {
        font-size: 0.95rem;
    }

    .status-indicator,
    .push-indicator {
        font-size: 0.85rem;
        padding: 0.2rem;
    }

    .contact-actions {
        gap: 0.3rem;
    }

    .contact-actions .btn-icon {
        font-size: 1.1rem;
        padding: 0.35rem;
        min-width: 2.3rem;
        height: 2.3rem;
    }

    .prompt-content {
        gap: 0.5rem;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .prompt-content > span {
        font-size: 0.8rem;
    }

    .prompt-content > .btn-small {
        width: auto;
    }

    #local-video {
        width: 110px;
        height: 146px;
    }

    .group-local-video {
        width: 85px;
        height: 113px;
        bottom: 90px;
        right: 8px;
    }

    .video-grid.grid-2 {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}
