/* hangout.css - FINAL FIXES: Speech Bubble Positioning + Relationship Display */

.hangout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(8px);
    animation: hangoutModalOpen 0.5s ease-out;
}

@keyframes hangoutModalOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hangout-scene {
    width: 90%;
    height: 85%;
    max-width: 1200px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Location Backgrounds - Enhanced for Visual Appeal */
.hangout-scene.location-coffee {
    background: linear-gradient(135deg, #8b4513, #deb887);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 69, 19, 0.3), transparent 50%);
}

.hangout-scene.location-park {
    background: linear-gradient(135deg, #90EE90, #228B22);
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1), transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(34, 139, 34, 0.3), transparent 50%);
}

.hangout-scene.location-home {
    background: linear-gradient(135deg, #F5DEB3, #DEB887);
    background-image: 
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1), transparent 50%);
}

.hangout-scene.location-mall {
    background: linear-gradient(135deg, #E6E6FA, #D8BFD8);
    background-image: 
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.1), transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(216, 191, 216, 0.3), transparent 50%);
}

.hangout-scene.location-beach {
    background: linear-gradient(135deg, #87CEEB, #F0E68C);
    background-image: 
        radial-gradient(circle at 50% 90%, rgba(240, 230, 140, 0.4), transparent 50%);
}

/* Scene Header */
.hangout-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.hangout-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hangout-location {
    font-size: 1em;
    opacity: 0.9;
    margin-top: 5px;
}

.hangout-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.hangout-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* FIXED: Main Scene Area - Use margins instead of padding */
.hangout-content {
    flex: 1;
    display: flex;
    position: relative;
    padding: 20px;
    gap: 20px;
    min-height: 0;
    overflow: hidden;
}

/* Character Portraits - FIXED POSITIONING */
.portrait-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.portrait-left {
    right: 10px; /* SWAPPED: Put right portrait on left side */
}

.portrait-right {
    left: 10px; /* SWAPPED: Put left portrait on right side */
}

/* CRITICAL FIX: Force relationship display to show */
.relationship-indicator {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    margin-top: 5px;
}

.character-portrait {
    width: 200px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.8);
    position: relative;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
}

.character-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-portrait.speaking {
    border-color: #4a90e2;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    animation: speakingGlow 2s ease-in-out infinite alternate;
    transform: scale(1.05);
}

@keyframes speakingGlow {
    from { 
        box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
        border-color: #4a90e2;
    }
    to { 
        box-shadow: 0 8px 35px rgba(74, 144, 226, 0.6);
        border-color: #357abd;
    }
}

.portrait-name {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

/* FIXED: Use absolute positioning for precise dialogue area placement */
.dialogue-area {
    position: absolute;
    top: 40px;
    left: 240px;
    right: 240px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar for dialogue area */
.dialogue-area::-webkit-scrollbar {
    width: 6px;
}

.dialogue-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.dialogue-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.dialogue-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* SIMPLE BUBBLE POSITIONING: Normal alignment within smaller dialogue area */
.speech-bubble {
    background: white;
    border-radius: 20px;
    padding: 20px 25px;
    margin: 12px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 75%;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: bubbleAppear 0.5s ease-out;
    flex-shrink: 0;
    word-wrap: break-word;
}

/* FIXED: Put positioning BACK to what was working */
.speech-bubble.player {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    align-self: flex-end; /* RIGHT side for player */
    margin-left: auto;
}

.speech-bubble.character {
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
    color: #1f2937;
    align-self: flex-start; /* LEFT side for character */
    margin-right: auto;
}

/* Character-specific bubble colors */
.speech-bubble.character.ava {
    background: linear-gradient(135deg, #fce7f3, #f8bbd9);
    border: 2px solid #e91e63;
}

.speech-bubble.character.tyler {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border: 2px solid #4caf50;
}

.speech-bubble.character.jessica {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border: 2px solid #9c27b0;
}

.speech-bubble.character.anthony {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #ff9800;
}

.speech-bubble.character.hector {
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    border: 2px solid #3f51b5;
}

.speech-bubble.character.sean {
    background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
    border: 2px solid #009688;
}

.speech-bubble.character.laura {
    background: linear-gradient(135deg, #fdf2e9, #f4e2c1);
    border: 2px solid #8d6e63;
}

.speech-bubble.character.heather {
    background: linear-gradient(135deg, #f1f8e9, #dcedc8);
    border: 2px solid #689f38;
}

.speech-bubble.character.specterella {
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border: 2px solid #8b5a96;
    color: #ffffff;
}

.speech-bubble.character.emma {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2px solid #ffc107;
}

.speech-bubble.character.frank {
    background: linear-gradient(135deg, #efebe9, #d7ccc8);
    border: 2px solid #795548;
}

.speech-bubble.character.cindy {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border: 2px solid #673ab7;
}

/* Summary bubble special styling */
.speech-bubble.summary {
    align-self: center !important;
    margin: 20px auto !important;
    max-width: 90% !important;
    font-weight: 500;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    color: #065f46 !important;
    border: 2px solid #10b981 !important;
}

/* Speech bubble tails - FIXED DIRECTIONS */
.speech-bubble::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.speech-bubble.player::before {
    right: -18px; /* Player (Reuben) tail points RIGHT toward his new position */
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #4a90e2;
    border-right-color: transparent;
}

.speech-bubble.character::before {
    left: -18px; /* Character (Jessica) tail points LEFT toward her new position */
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #9c27b0;
    border-left-color: transparent;
}

.speech-bubble.character.ava::before {
    border-right-color: #e91e63;
}

.speech-bubble.character.tyler::before {
    border-right-color: #4caf50;
}

.speech-bubble.character.jessica::before {
    border-right-color: #9c27b0;
}

.speech-bubble.character.anthony::before {
    border-right-color: #ff9800;
}

.speech-bubble.character.hector::before {
    border-right-color: #3f51b5;
}

.speech-bubble.character.sean::before {
    border-right-color: #009688;
}

.speech-bubble.character.laura::before {
    border-right-color: #8d6e63;
}

.speech-bubble.character.heather::before {
    border-right-color: #689f38;
}

.speech-bubble.character.specterella::before {
    border-right-color: #8b5a96;
}

.speech-bubble.character.emma::before {
    border-right-color: #ffc107;
}

.speech-bubble.character.frank::before {
    border-right-color: #795548;
}

.speech-bubble.character.cindy::before {
    border-right-color: #673ab7;
}

/* Dialogue Text */
.dialogue-text {
    font-size: 1.05em;
    line-height: 1.5;
    color: #333;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.speech-bubble.character.specterella .dialogue-text {
    color: #ffffff;
}

.speech-bubble.player .dialogue-text {
    color: white;
}

/* Choice Buttons - IMPROVED */
.hangout-choices {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
    max-height: 200px;
    overflow-y: auto;
}

.choice-button {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.choice-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.choice-button:active {
    transform: translateY(0);
}

/* ===== LOCATION SELECTION MODAL ===== */
.hangout-modal.location-selection {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.location-selection-scene {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.location-selection-content {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.location-option {
    background: linear-gradient(135deg, #2a2a3e, #1e1e32);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.location-option.available:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.3);
    border-color: #4a90e2;
}

.location-option.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
}

.location-preview {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 15px;
}

.location-background {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.location-background.locked {
    filter: grayscale(100%) blur(2px);
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-info h4 {
    color: #4a90e2;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.location-info p {
    color: #cccccc;
    margin-bottom: 10px;
    line-height: 1.4;
}

.intimacy-level {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.intimacy-public {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.intimacy-social {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.intimacy-private {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid #a855f7;
}

.intimacy-intimate {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
    border: 1px solid #ec4899;
}

.intimacy-very_intimate {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

/* ===== SECTION HEADERS ===== */
.available-locations h3,
.unavailable-locations h3 {
    color: #4a90e2;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
}

.unavailable-locations {
    margin-top: 30px;
}

.unavailable-locations h3 {
    color: #94a3b8;
    border-bottom-color: rgba(148, 163, 184, 0.3);
}

/* ===== BACKGROUND LOCATION STYLES ===== */
/* Mall Background */
.location-mall, .location-bg-mall, .hangout-scene.location-mall {
    background: 
        linear-gradient(135deg, rgba(255, 20, 147, 0.15), rgba(138, 43, 226, 0.15)),
        url('../assets/hangouts/backgrounds/mall.png'),
        linear-gradient(135deg, #ff1493, #8a2be2);
    background-size: cover;
    background-position: center;
}

.hangout-background.location-bg-mall {
    background: 
        linear-gradient(135deg, rgba(255, 20, 147, 0.2), rgba(138, 43, 226, 0.2)),
        url('../assets/hangouts/backgrounds/mall.png'),
        linear-gradient(135deg, #ff1493, #8a2be2);
    background-size: cover;
    background-position: center;
}

/* Coffee Shop Background */
.location-coffee_shop, .location-bg-coffee_shop, .hangout-scene.location-coffee_shop {
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.15), rgba(160, 82, 45, 0.15)),
        url('../assets/hangouts/backgrounds/coffee_shop.png'),
        linear-gradient(135deg, #8B4513, #D2691E);
    background-size: cover;
    background-position: center;
}

.hangout-background.location-bg-coffee_shop {
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(160, 82, 45, 0.2)),
        url('../assets/hangouts/backgrounds/coffee_shop.png'),
        linear-gradient(135deg, #8B4513, #D2691E);
    background-size: cover;
    background-position: center;
}

/* Church Background */
.location-church, .location-bg-church, .hangout-scene.location-church {
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.15), rgba(160, 82, 45, 0.15)),
        url('../assets/hangouts/backgrounds/church.png'),
        linear-gradient(135deg, #8B4513, #A0522D);
    background-size: cover;
    background-position: center;
}

.hangout-background.location-bg-church {
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(160, 82, 45, 0.2)),
        url('../assets/hangouts/backgrounds/church.png'),
        linear-gradient(135deg, #8B4513, #A0522D);
    background-size: cover;
    background-position: center;
}

/* Restaurant Background */
.location-restaurant, .location-bg-restaurant {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.05)),
                url('../assets/hangouts/backgrounds/restaurant.png');
    background-size: cover;
    background-position: center;
}

/* House Living Room Background */
.location-house_living, .location-bg-house_living {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(160, 82, 45, 0.05)),
                url('../assets/hangouts/backgrounds/house_living.png');
    background-size: cover;
    background-position: center;
}

/* Bedroom Casual Background */
.location-bedroom_casual, .location-bg-bedroom_casual {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.1), rgba(138, 43, 226, 0.05)),
                url('../assets/hangouts/backgrounds/bedroom.png');
    background-size: cover;
    background-position: center;
}

/* Bedroom Intimate Background */
.location-bedroom_intimate, .location-bg-bedroom_intimate {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(255, 69, 0, 0.05)),
                url('../assets/hangouts/backgrounds/bedroom.png');
    background-size: cover;
    background-position: center;
    filter: sepia(20%) saturate(120%) hue-rotate(330deg);
}

/* ===== AVA'S LOCATION BACKGROUNDS - FIXED ===== */

/* Coffee Shop Background */
.hangout-scene.location-coffee_shop,
.location-coffee_shop,
.location-bg-coffee_shop {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.3), rgba(160, 82, 45, 0.2)),
                url('../assets/hangouts/backgrounds/coffee_shop.png'),
                linear-gradient(135deg, #8B4513, #D2691E);
    background-size: cover;
    background-position: center;
}

/* Music Venue Background */
.hangout-scene.location-music_venue,
.location-music_venue,
.location-bg-music_venue {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.3), rgba(138, 43, 226, 0.2)),
                url('../assets/hangouts/backgrounds/music_venue.png'),
                linear-gradient(135deg, #4B0082, #8A2BE2);
    background-size: cover;
    background-position: center;
}

/* Ava's Apartment Background */
.hangout-scene.location-ava_apartment,
.location-ava_apartment,
.location-bg-ava_apartment {
    background: linear-gradient(135deg, rgba(205, 133, 63, 0.3), rgba(222, 184, 135, 0.2)),
                url('../assets/hangouts/backgrounds/ava_apartment.png'),
                linear-gradient(135deg, #CD853F, #DEB887);
    background-size: cover;
    background-position: center;
}

/* Rooftop Garden Background */
.hangout-scene.location-rooftop_garden,
.location-rooftop_garden,
.location-bg-rooftop_garden {
    background: linear-gradient(135deg, rgba(25, 25, 112, 0.3), rgba(72, 61, 139, 0.2)),
                url('../assets/hangouts/backgrounds/rooftop_garden.png'),
                linear-gradient(135deg, #191970, #483D8B);
    background-size: cover;
    background-position: center;
}

/* Ava's Bedroom Background */
.hangout-scene.location-ava_bedroom,
.location-ava_bedroom,
.location-bg-ava_bedroom {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.3), rgba(156, 39, 176, 0.2)),
                url('../assets/hangouts/backgrounds/ava_bedroom.png'),
                linear-gradient(135deg, #E91E63, #9C27B0);
    background-size: cover;
    background-position: center;
}


/* Park Background - Complete coverage for all contexts */

/* Location selection preview */
.location-background.location-park {
    background: 
        linear-gradient(135deg, rgba(34, 139, 34, 0.3), rgba(50, 205, 50, 0.2)),
        url('../assets/hangouts/backgrounds/park.png'),
        linear-gradient(135deg, #228B22, #32CD32);
    background-size: cover;
    background-position: center;
}

/* Hangout scene background */
.hangout-scene.location-park {
    background: 
        linear-gradient(135deg, rgba(34, 139, 34, 0.3), rgba(50, 205, 50, 0.2)),
        url('../assets/hangouts/backgrounds/park.png'),
        linear-gradient(135deg, #228B22, #32CD32);
    background-size: cover;
    background-position: center;
}

/* Hangout background element */
.hangout-background.location-bg-park {
    background: 
        linear-gradient(135deg, rgba(34, 139, 34, 0.2), rgba(50, 205, 50, 0.2)),
        url('../assets/hangouts/backgrounds/park.png'),
        linear-gradient(135deg, #228B22, #32CD32);
    background-size: cover;
    background-position: center;
}

/* Generic park classes */
.location-park, .location-bg-park {
    background: 
        linear-gradient(135deg, rgba(34, 139, 34, 0.3), rgba(50, 205, 50, 0.2)),
        url('../assets/hangouts/backgrounds/park.png'),
        linear-gradient(135deg, #228B22, #32CD32);
    background-size: cover;
    background-position: center;
}


/* Default location fallbacks with gradients */
.location-coffee, .location-bg-coffee {
    background: linear-gradient(135deg, #8B4513, #D2691E);
}

.location-park, .location-bg-park {
    background: linear-gradient(135deg, #228B22, #32CD32);
}

.location-home, .location-bg-home {
    background: linear-gradient(135deg, #4682B4, #87CEEB);
}

/* RESPONSIVE DESIGN FIXES */
@media (max-width: 1200px) {
    .hangout-scene {
        width: 95%;
        height: 90%;
    }
    
    .character-portrait {
        width: 200px;
        height: 200px;
        font-size: 2.2em;
    }
    
    .dialogue-area {
        margin: 15px 220px 15px 220px; /* Adjust for smaller portraits */
    }
    
    .speech-bubble {
        max-width: 80%;
        padding: 18px 22px;
        font-size: 0.95em;
    }
}

@media (max-width: 900px) {
    .hangout-scene {
        width: 98%;
        height: 95%;
    }
    
    .character-portrait {
        width: 170px;
        height: 170px;
        font-size: 2em;
    }
    
    .dialogue-area {
        margin: 10px 190px 10px 190px; /* Adjust for smaller space */
    }
    
    .speech-bubble {
        max-width: 85%;
        padding: 15px 18px;
        font-size: 0.9em;
    }
    
    .hangout-title {
        font-size: 1.4em;
    }
    
    .choice-button {
        font-size: 0.9em;
        padding: 10px 15px;
    }
}

@media (max-width: 768px) {
    .hangout-scene {
        width: 98%;
        max-height: 98vh;
        border-radius: 15px;
    }
    
    .hangout-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .hangout-title {
        font-size: 1.3em;
    }
    
    .portrait-container {
        position: static;
        margin: 10px auto;
    }
    
    .character-portrait {
        width: 150px;
        height: 225px;
    }
    
    .dialogue-area {
        margin: 20px 10px; /* FIXED: Full width on mobile */
        max-height: 250px;
        padding: 15px;
    }
    
    .speech-bubble {
        max-width: 85%; /* FIXED: Wider on mobile */
    }
    
    .location-grid {
        grid-template-columns: 1fr;
    }
    
    .location-option {
        padding: 15px;
    }
    
    .location-preview {
        height: 100px;
    }
}

/* Additional fixes for edge cases */
.hangout-modal * {
    box-sizing: border-box;
}

/* Ensure modals don't conflict */
.hangout-modal {
    isolation: isolate;
}

/* Animation improvements */
@media (prefers-reduced-motion: reduce) {
    .hangout-modal,
    .speech-bubble,
    .character-portrait.speaking {
        animation: none;
    }
    
    .choice-button:hover {
        transform: none;
    }
}