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

/* Utility Classes */
.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #FAFAFA;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Map Background */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background-color: #FAFAFA;
}

.world-map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: mapZoomPan 120s linear infinite;
}

.world-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    /* Duplicate map side by side for seamless loop */
    background-image: url('map.svg'), url('map.svg');
    background-size: 50% auto, 50% auto;
    background-position: 0 center, 100% center;
    background-repeat: no-repeat;
    /* Match the subtle look of the reference page */
    opacity: 0.4;
    filter: grayscale(100%) brightness(1.1);
    pointer-events: none;
}

@keyframes mapZoomPan {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Active User Dots */
#dots-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Dots are now inside .world-map so they move with the animation */
}

.user-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #BF3143;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
    transition: transform 0.2s ease;
    z-index: 200;
    pointer-events: auto;
}

.user-dot:hover {
    transform: translate(-50%, -50%) scale(1.5);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(191, 49, 67, 0.4);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 8px rgba(191, 49, 67, 0);
    }
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    min-width: 220px;
    max-width: 280px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 6px;
}

.tooltip-languages {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.tooltip-interests {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* Center Container */
.center-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
    pointer-events: none;
}

/* Card */
.card {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
    transition: box-shadow 0.3s ease;
    pointer-events: auto;
    cursor: move;
    position: relative;
}

.card.dragging {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    cursor: grabbing;
}

.card-drag-handle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #E5E5E5;
    border-radius: 2px;
    cursor: grab;
}

.card-drag-handle:active {
    cursor: grabbing;
}

.card-content {
    transition: opacity 0.3s ease;
}

.card-content.hidden {
    display: none;
    opacity: 0;
}

.card-content.fade-out {
    opacity: 0;
}

.card-content.fade-in {
    opacity: 1;
}

/* Card Title */
.card-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.3;
}

.beta-badge {
    display: inline-block;
    color: #888;
    font-size: 16px;
    font-weight: 600;
    margin-left: 8px;
}

.live-badge {
    display: inline-block;
    color: #BF3143;
    font-size: 16px;
    font-weight: 600;
}

/* Language Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.language-btn {
    height: 56px;
    border-radius: 12px;
    background: white;
    border: 1px solid #DDDDDD;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.language-btn:hover {
    background: #FAFAFA;
    border-color: #CFCFCF;
}

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

/* Request Link */
.request-link {
    display: block;
    text-align: center;
    color: #333;
    font-size: 14px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.request-link:hover {
    color: #BF3143;
}

/* Level Buttons */
.level-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.level-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    border-radius: 12px;
    background: white;
    border: 1px solid #DDDDDD;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.level-btn:hover {
    background: #FAFAFA;
    border-color: #CFCFCF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.level-btn.disabled,
.level-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F7F7F8;
    border-color: #E5E5E7;
}

.level-btn.disabled:hover,
.level-btn:disabled:hover {
    background: #F7F7F8;
    border-color: #E5E5E7;
    box-shadow: none;
    transform: none;
}

.level-btn.disabled .level-name,
.level-btn:disabled .level-name {
    color: #A1A1A6;
}

.level-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.level-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.level-duration {
    font-size: 13px;
    color: #999;
}

/* Back Link */
.back-link {
    display: block;
    text-align: center;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #BF3143;
}

/* Video Chat Interface */
.video-chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f5f5f7;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.video-chat-container.hidden {
    display: none;
}

/* Header */
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: white;
    border-bottom: 1px solid #e5e5e5;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 0;
}

.header-btn {
    background: white;
    border: 1px solid #E5E5E7;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4A4A4D;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.header-btn:hover {
    background: #F7F7F8;
    border-color: #A1A1A6;
}

.timer-btn {
    cursor: default;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

.timer-btn:hover {
    background: white;
    border-color: #E5E5E7;
}

.leave-btn {
    background: white;
    color: #BF3143;
    border-color: #BF3143;
}

.leave-btn svg {
    stroke: #BF3143;
}

.leave-btn:hover {
    background: #FFF6F7;
}

.video-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.partner-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
}

.partner-name:hover {
    color: #BF3143;
    text-decoration: underline;
}

.session-count {
    font-size: 14px;
    color: #666;
}

/* Favorite Button */
.favorite-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
}

.favorite-btn svg {
    transition: all 0.2s ease;
    stroke: #999;
}

.favorite-btn:hover {
    background: rgba(191, 49, 67, 0.1);
}

.favorite-btn:hover svg {
    stroke: #BF3143;
}

.favorite-btn.favorited svg {
    fill: #BF3143;
    stroke: #BF3143;
}

.favorite-btn.favorited:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Favorite Tooltip - Focusmate Style */
.favorite-tooltip {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.favorite-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #2c3e50;
    transform: rotate(45deg);
}

.favorite-btn:hover .favorite-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Video Grid */
.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

.video-panel {
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Mirror our own camera feed (standard self-view); leave the partner's normal. */
#local-video-panel video {
    transform: scaleX(-1);
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
}

.video-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: underline;
}

/* Bottom Controls */
.video-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 30px 40px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.control-btn {
    background: white;
    border: 1px solid #d1d1d1;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 110px;
}

.control-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.control-btn[data-active="false"] {
    color: #666;
    border-color: #d1d1d1;
}

.control-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    position: relative;
}

.control-label {
    font-size: 15px;
}

/* Icon wrapper for crossed-out effect */
.icon-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Red slash for disabled state */
.control-btn[data-active="false"] .icon-slash {
    display: block;
}

.icon-slash {
    display: none;
    position: absolute;
    width: 28px;
    height: 2px;
    background: #ff4757;
    transform: rotate(-45deg);
    z-index: 1;
}

/* AI Chat Box */
.ai-chat-box {
    position: fixed;
    width: 320px;
    height: 450px;
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    right: 40px;
    bottom: 120px;
}

.ai-chat-box.hidden {
    display: none;
}

.chat-header,
.channel-header {
    padding: 16px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-radius: 14px 14px 0 0;
}

.chat-title,
.channel-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.popout-btn,
.close-chat-btn,
.close-channel-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.popout-btn svg,
.close-chat-btn svg,
.close-channel-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.popout-btn:hover {
    background: #d4e5ff;
    color: #0066cc;
}

.close-chat-btn:hover,
.close-channel-btn:hover {
    background: #e5e5e5;
}

.chat-messages,
.channel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.4;
}

.ai-message {
    background: #F7F7F8;
    border: 1px solid #E5E5E7;
    align-self: flex-start;
}

.ai-message strong {
    color: #BF3143;
    font-weight: 600;
}

.user-message {
    background: #BF3143;
    color: white;
    align-self: flex-end;
}

/* Partner's messages in the session message channel */
.partner-message {
    background: #F7F7F8;
    border: 1px solid #E5E5E7;
    color: #333;
    align-self: flex-start;
}

/* Links inside chat bubbles — inherit the bubble's text color so they stay
   readable on both the red (user) and light (partner) backgrounds. */
.chat-message a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

/* Unread-message indicator on the Chat control button */
#toggle-chat {
    position: relative;
}

.chat-unread-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: #BF3143;
    border: 2px solid white;
    border-radius: 50%;
}

.chat-unread-dot.hidden {
    display: none;
}

/* Loading message animation */
.loading-message {
    opacity: 0.7;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: loadingDot 1.4s infinite;
    display: inline-block;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Error message */
.error-message {
    background: #FFF6F7;
    border: 1px solid #D64545;
    color: #D64545;
}

.system-message {
    background: #e8f4f8;
    color: #666;
    align-self: center;
    font-size: 12px;
    padding: 6px 12px;
}

/* AI Quick Actions */
.ai-quick-actions {
    padding: 12px 16px;
    border-top: 1px solid #E5E5E7;
    display: flex;
    gap: 8px;
    background: #F7F7F8;
}

.quick-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: #FFFFFF;
    border: 1px solid #E5E5E7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    color: #4A4A4D;
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
    stroke: #4A4A4D;
    transition: stroke 0.2s ease;
}

.quick-action-btn:hover {
    background: #BF3143;
    border-color: #BF3143;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.2);
}

.quick-action-btn:hover svg {
    stroke: #FFFFFF;
}

.quick-action-btn:active {
    transform: translateY(0);
}

.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-input:focus {
    border-color: #BF3143;
}

.send-btn {
    background: #BF3143;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.send-btn:hover {
    background: #a02838;
}

/* Message Channel */
.message-channel {
    position: fixed;
    width: 360px;
    height: 500px;
    background: white;
    border: 2px solid #d1d1d1;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    right: 40px;
    bottom: 120px;
    /* User-resizable via the bottom-right corner handle. */
    resize: both;
    overflow: hidden;
    min-width: 280px;
    min-height: 320px;
}

.message-channel.hidden {
    display: none;
}

/* Help Menu */
.help-menu {
    position: absolute;
    top: 60px;
    left: 140px;
    background: white;
    border: 1px solid #d1d1d1;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    min-width: 250px;
}

.help-menu.hidden {
    display: none;
}

.help-menu-item {
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-menu-item:last-child {
    border-bottom: none;
}

.help-menu-item:hover {
    background: #f8f8f8;
}

.help-menu-item.danger {
    color: #ff4757;
}

.help-menu-item.danger:hover {
    background: #fff5f6;
}

/* Custom Modal - Redesigned */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111214;
    margin: 0;
}

.modal-body {
    padding: 24px;
    color: #4A4A4D;
    font-size: 15px;
    line-height: 1.5;
}

.modal-body p {
    margin: 0 0 10px 0;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e5e5e5;
}

.modal-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    min-width: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-btn-secondary {
    background: white;
    color: #4A4A4D;
    border: 2px solid #E5E5E7;
}

.modal-btn-secondary:hover {
    background: #F7F7F8;
    border-color: #A1A1A6;
}

.modal-btn-primary {
    background: #BF3143;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(191, 49, 67, 0.3);
}

.modal-btn-primary:hover {
    background: #a52938;
    box-shadow: 0 4px 16px rgba(191, 49, 67, 0.4);
    transform: translateY(-1px);
}

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

.modal-btn-danger:hover {
    background: #a02838;
}

/* Modal input */
.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-top: 12px;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #BF3143;
}

.modal-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.menu-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Responsive */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 300px;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .video-header {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .header-left,
    .header-right {
        font-size: 13px;
        gap: 8px;
    }
    
    .header-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .video-title {
        font-size: 18px;
    }
    
    .video-controls {
        padding: 20px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 24px;
        border-radius: 16px;
    }

    .card-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .beta-badge,
    .live-badge {
        font-size: 14px;
    }

    .language-btn {
        height: 52px;
        font-size: 15px;
    }

    .level-btn {
        height: 58px;
        padding: 0 16px;
    }

    .level-name {
        font-size: 15px;
    }

    .level-duration {
        font-size: 12px;
    }

    .tooltip {
        min-width: 180px;
        max-width: 220px;
        padding: 10px 14px;
    }

    .tooltip-name {
        font-size: 14px;
    }

    .tooltip-languages {
        font-size: 12px;
    }

    .tooltip-interests {
        font-size: 11px;
    }
    
    .match-name {
        font-size: 16px;
    }
    
    .avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }
    
    .local-avatar {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}


/* Session Summary */
.session-summary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #FFF6F7 0%, #FFFFFF 100%);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.summary-container {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111214;
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #F7F7F8;
    border-radius: 8px;
    border: 1px solid #E5E5E7;
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #A1A1A6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4A4A4D;
}

.summary-actions {
    display: flex;
    justify-content: center;
}

.summary-btn {
    background: #BF3143;
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(191, 49, 67, 0.3);
}

.summary-btn:hover {
    background: #a52938;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(191, 49, 67, 0.4);
}

@media (max-width: 768px) {
    .summary-container {
        padding: 2rem 1.5rem;
    }
    
    .summary-title {
        font-size: 1.5rem;
    }
    
    .summary-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .summary-value {
        font-size: 1rem;
    }
}

.session-id {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    color: #BF3143;
    font-weight: 700;
}

/* Session Summary Phrases */
.summary-phrases {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #F7F7F8;
}

.phrases-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111214;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.phrases-subtitle {
    font-size: 0.8rem;
    color: #A1A1A6;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.phrases-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* Scrollbar styling for phrases list */
.phrases-list::-webkit-scrollbar {
    width: 6px;
}

.phrases-list::-webkit-scrollbar-track {
    background: #F7F7F8;
    border-radius: 3px;
}

.phrases-list::-webkit-scrollbar-thumb {
    background: #BF3143;
    border-radius: 3px;
}

.phrases-list::-webkit-scrollbar-thumb:hover {
    background: #a52938;
}

.phrase-item {
    background: #FFF6F7;
    border-left: 4px solid #BF3143;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.phrase-text {
    font-size: 1rem;
    font-weight: 600;
    color: #4A4A4D;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.phrase-meaning {
    font-size: 0.9rem;
    color: #A1A1A6;
    font-style: italic;
}

/* TabbiMate branding */
.tabbi-red {
    color: #BF3143;
}

/* Matching Screen — shown while waiting for a partner in the queue */
#matching-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#matching-screen.hidden {
    display: none;
}

.matching-container {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.matching-content {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.matching-spinner {
    margin-bottom: 32px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #BF3143;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.matching-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.matching-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.matching-timer {
    font-size: 24px;
    font-weight: 700;
    color: #BF3143;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.matching-info {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.matching-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.matching-detail:not(:last-child) {
    border-bottom: 1px solid #E5E5E5;
}

.detail-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 600;
}

.cancel-matching-btn {
    background: white;
    color: #666;
    border: 2px solid #E5E5E5;
    padding: 12px 32px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-matching-btn:hover {
    background: #F7F7F8;
    border-color: #BF3143;
    color: #BF3143;
}

/* Prepare Screen — 10s green room with camera preview before the call starts */
#prepare-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prepare-screen.hidden {
    display: none;
}

.prepare-container {
    text-align: center;
    max-width: 560px;
    padding: 40px;
}

.prepare-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.prepare-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.prepare-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

.prepare-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.prepare-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror — feels natural for a self-preview */
}

.prepare-countdown {
    font-size: 22px;
    font-weight: 700;
    color: #BF3143;
    font-variant-numeric: tabular-nums;
}
