/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a2332 100%);
    color: #f0f0f0;
    overflow: hidden;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* ===== Main Menu ===== */
.main-menu {
    background: rgba(10, 20, 40, 0.95);
    border: 3px solid #c89b3c;
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 0 40px rgba(200, 155, 60, 0.5);
    min-width: 500px;
}

.game-title {
    font-size: 48px;
    color: #c89b3c;
    text-shadow: 0 0 20px rgba(200, 155, 60, 0.8);
    margin-bottom: 40px;
    letter-spacing: 3px;
    font-weight: bold;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.player-name-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-name-section label {
    font-size: 18px;
    color: #c89b3c;
}

.player-name-section input {
    padding: 15px;
    font-size: 16px;
    border: 2px solid #3b5998;
    border-radius: 8px;
    background: rgba(20, 30, 50, 0.8);
    color: #f0f0f0;
    text-align: center;
}

.player-name-section input:focus {
    outline: none;
    border-color: #c89b3c;
    box-shadow: 0 0 15px rgba(200, 155, 60, 0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    padding: 18px 30px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #3b5998;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a7c 100%);
    color: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-btn:hover {
    background: linear-gradient(135deg, #2d4a7c 0%, #3b5998 100%);
    box-shadow: 0 0 20px rgba(59, 89, 152, 0.6);
    transform: translateY(-2px);
}

.menu-btn.primary {
    background: linear-gradient(135deg, #c89b3c 0%, #d4af37 100%);
    border-color: #c89b3c;
    color: #1a1a1a;
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, #e5c158 100%);
    box-shadow: 0 0 25px rgba(200, 155, 60, 0.8);
}

/* ===== Room List ===== */
.room-list-container {
    background: rgba(10, 20, 40, 0.95);
    border: 3px solid #c89b3c;
    border-radius: 15px;
    padding: 40px;
    min-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.room-list-container h2 {
    color: #c89b3c;
    margin-bottom: 30px;
    text-align: center;
    font-size: 32px;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    max-height: 500px;
    overflow-y: auto;
}

.room-item {
    background: rgba(20, 30, 50, 0.8);
    border: 2px solid #3b5998;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.room-item:hover {
    border-color: #c89b3c;
    background: rgba(30, 40, 60, 0.9);
    transform: translateX(5px);
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.room-name {
    font-size: 20px;
    font-weight: bold;
    color: #f0f0f0;
}

.room-players {
    font-size: 14px;
    color: #aaa;
}

.room-status {
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
}

.room-status.available {
    background: #2ecc71;
    color: #fff;
}

.room-status.playing {
    background: #e74c3c;
    color: #fff;
}

/* ===== Lobby/Champion Select ===== */
.lobby-container {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a2332 100%);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(20, 30, 50, 0.9);
    border: 2px solid #c89b3c;
    border-radius: 10px;
    margin-bottom: 20px;
}

.room-header h2 {
    color: #c89b3c;
    font-size: 28px;
}

.owner-badge {
    background: linear-gradient(135deg, #c89b3c 0%, #d4af37 100%);
    color: #1a1a1a;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.btn-small {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}

/* ===== Lobby Main Layout ===== */
.lobby-main {
    flex: 1 1 auto;
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    /* No overflow hidden - allow content to show */
    min-height: 0; /* Allow shrinking */
}

/* ===== Team Panels ===== */
.team-panel {
    width: 280px;
    background: rgba(20, 30, 50, 0.9);
    border: 3px solid;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-panel.red-team {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(20, 30, 50, 0.9) 100%);
}

.team-panel.blue-team {
    border-color: #3b5998;
    background: linear-gradient(135deg, rgba(59, 89, 152, 0.1) 0%, rgba(20, 30, 50, 0.9) 100%);
}

.team-header {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-shadow: 0 0 10px currentColor;
}

.red-team .team-header {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.blue-team .team-header {
    background: rgba(59, 89, 152, 0.3);
    color: #3b5998;
    border: 2px solid #3b5998;
}

.team-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* No scroll - compact design */
}

.team-slot {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-slot.filled {
    background: rgba(50, 60, 80, 0.6);
    border-color: #c89b3c;
}

.team-slot .champion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #c89b3c;
    background: rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.team-slot .player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.team-slot .player-name {
    font-weight: bold;
    font-size: 14px;
    color: #f0f0f0;
}

.team-slot .champion-name {
    font-size: 12px;
    color: #c89b3c;
}

.team-slot .owner-icon {
    color: #c89b3c;
    font-size: 16px;
}

.join-team-btn {
    padding: 12px;
    background: rgba(200, 155, 60, 0.2);
    border: 2px solid #c89b3c;
    border-radius: 8px;
    color: #c89b3c;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.join-team-btn:hover {
    background: rgba(200, 155, 60, 0.4);
    box-shadow: 0 0 15px rgba(200, 155, 60, 0.3);
}

.join-team-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Champion Select Panel ===== */
.champion-select-panel {
    flex: 1;
    background: rgba(20, 30, 50, 0.9);
    border: 3px solid #c89b3c;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #c89b3c;
}

.select-header h3 {
    color: #c89b3c;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(200, 155, 60, 0.5);
}

#championSearch {
    padding: 10px 15px;
    border: 2px solid #3b5998;
    border-radius: 8px;
    background: rgba(20, 30, 50, 0.8);
    color: #f0f0f0;
    font-size: 14px;
    width: 250px;
}

#championSearch:focus {
    outline: none;
    border-color: #c89b3c;
    box-shadow: 0 0 10px rgba(200, 155, 60, 0.3);
}

.champion-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding: 15px;
    align-content: start;
}

.champion-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    aspect-ratio: 1 / 1;
}

.champion-card::after {
    content: attr(data-name);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #c89b3c;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
    border: 1px solid #c89b3c;
}

.champion-card:hover::after {
    opacity: 1;
}

.champion-card img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 3px solid #3b5998;
    object-fit: cover;
    transition: all 0.3s ease;
}

.champion-card:hover img {
    border-color: #c89b3c;
    transform: scale(1.08);
    box-shadow: 0 5px 25px rgba(200, 155, 60, 0.6);
}

.champion-card.selected img {
    border-color: #c89b3c;
    box-shadow: 0 0 25px rgba(200, 155, 60, 0.8), inset 0 0 20px rgba(200, 155, 60, 0.3);
}

.champion-card .champion-name,
.champion-card .champion-desc {
    display: none;
}

.lobby-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    position: relative;
    z-index: 10;
    width: 100%;
}

.start-game-btn {
    padding: 20px 60px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #c89b3c 0%, #d4af37 100%);
    border: 3px solid #c89b3c;
    border-radius: 10px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 11;
}

.start-game-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d4af37 0%, #e5c158 100%);
    box-shadow: 0 0 30px rgba(200, 155, 60, 0.8);
    transform: scale(1.05);
}

.start-game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #555;
    border-color: #555;
}

.game-message {
    font-size: 14px;
    color: #aaa;
    text-align: center;
}

/* ===== Chat Container ===== */
.chat-container {
    height: 120px;
    background: rgba(10, 15, 25, 0.9);
    border: 2px solid #3b5998;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Hide chat toggle on desktop */
.chat-toggle-btn {
    display: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    font-size: 14px;
    color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(50, 60, 80, 0.4);
}

.chat-message .sender {
    color: #c89b3c;
    font-weight: bold;
    margin-right: 8px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    border-top: 2px solid #3b5998;
    background: rgba(20, 30, 50, 0.5);
}

#chatInput {
    flex: 1;
    padding: 10px;
    border: 2px solid #3b5998;
    border-radius: 5px;
    background: rgba(10, 15, 25, 0.8);
    color: #f0f0f0;
    font-size: 14px;
}

#chatInput:focus {
    outline: none;
    border-color: #c89b3c;
}

#sendChatBtn {
    padding: 10px 25px;
    background: #3b5998;
    border: none;
    border-radius: 5px;
    color: #f0f0f0;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#sendChatBtn:hover {
    background: #4a6bb8;
    box-shadow: 0 0 15px rgba(59, 89, 152, 0.5);
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 15, 25, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #3b5998;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a6bb8;
}

/* ===== Game UI (when playing) ===== */
#gameUI {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
}

#gameUI > * {
    pointer-events: auto;
}

.stats {
    position: fixed;
    top: 10px;
    left:10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    color: #f0f0f0;
}

.controls {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 4px;
    color: #f0f0f0;
}

#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* ===== Loading Screen ===== */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a2332 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

#loadingScreen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loading-text {
    font-size: 24px;
    font-weight: bold;
    color: #f0f0f0;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.progress-container {
    width: 400px;
    height: 30px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 10px,
        transparent 10px,
        transparent 20px
    );
    transition: width 0.3s ease;
    position: relative;
    animation: stripe-animation 0.8s linear infinite;
}

@keyframes stripe-animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 28px 0;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: #000;
    z-index: 1;
}

/* ===== MOBILE RESPONSIVE ===== */
@media screen and (max-width: 1024px) {
    /* Main Menu - Mobile */
    .main-menu {
        min-width: unset;
        width: 90%;
        padding: 20px;
    }
    
    .game-title {
        font-size: 24px;
        margin-bottom: 20px;
        letter-spacing: 1px;
    }
    
    .menu-content {
        gap: 15px;
    }
    
    .player-name-section label {
        font-size: 14px;
    }
    
    .player-name-section input {
        padding: 10px;
        font-size: 14px;
    }
    
    .menu-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Room List - Mobile */
    .room-list-container {
        min-width: unset;
        width: 90%;
        padding: 20px;
        max-height: 90vh;
    }
    
    .room-list-container h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .room-item {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .room-name {
        font-size: 16px;
    }
    
    .room-players {
        font-size: 12px;
    }
    
    /* Lobby Container - Mobile */
    .lobby-container {
        padding: 10px;
        overflow-y: auto; /* Allow scroll to see all content */
        overflow-x: hidden;
    }
    
    /* Room Header - Mobile */
    .room-header {
        padding: 10px 15px;
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .room-header h2 {
        font-size: 16px;
    }
    
    .owner-badge {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .btn-small {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Lobby Main - Stack Vertically on Mobile */
    .lobby-main {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 0; /* No margin, chat has margin */
        overflow-y: auto; /* Allow scroll to see blue team */
        overflow-x: hidden;
        flex: 1 1 auto; /* Flexible, can grow/shrink */
        min-height: 0; /* Allow shrinking */
    }
    
    /* Team Panels - Mobile */
    .team-panel {
        width: 100%;
        padding: 10px;
        gap: 6px;
        margin-bottom: 10px; /* Space before next element */
        /* No max-height - no scroll */
    }
    
    .team-header {
        font-size: 15px;
        padding: 6px;
    }
    
    .team-slot {
        padding: 8px;
        min-height: 50px;
        gap: 6px;
    }
    
    .team-slot .champion-avatar {
        width: 35px;
        height: 35px;
    }
    
    .team-slot .player-name {
        font-size: 12px;
    }
    
    .team-slot .champion-name {
        font-size: 10px;
    }
    
    .team-slot .owner-icon {
        font-size: 14px;
    }
    
    .join-team-btn {
        padding: 10px;
        font-size: 13px;
    }
    
    /* Champion Select Panel - Mobile */
    .champion-select-panel {
        padding: 12px;
        gap: 10px;
        flex: 1 1 auto; /* Allow grow */
        min-height: 320px; /* More space for champion grid */
    }
    
    .select-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding-bottom: 10px;
    }
    
    .select-header h3 {
        font-size: 18px;
        text-align: center;
    }
    
    #championSearch {
        width: 100%;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Champion Grid - Smaller on Mobile */
    .champion-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
        padding: 10px;
        min-height: 240px; /* Ensure grid has space */
    }
    
    .champion-card img {
        border-width: 2px;
    }
    
    .champion-card::after {
        font-size: 10px;
        padding: 4px 8px;
        bottom: -25px;
    }
    
    /* Lobby Footer - Mobile */
    .lobby-footer {
        padding: 10px;
        gap: 8px;
        background: rgba(10, 15, 25, 0.98);
        position: relative;
        z-index: 100;
        width: 100%;
        flex-shrink: 0; /* Don't shrink */
        border-top: 2px solid #c89b3c; /* Clear separation */
    }
    
    .start-game-btn {
        padding: 10px 20px;
        font-size: 14px;
        letter-spacing: 0.5px;
        position: relative;
        z-index: 101;
        width: 90%;
        max-width: 300px;
    }
    
    .game-message {
        font-size: 11px;
    }
    
    /* Chat Container - Smaller on Mobile */
    .chat-container {
        height: 80px; /* Reduced to give space for footer */
        position: relative;
        transition: height 0.3s ease, opacity 0.3s ease;
        z-index: 50; /* Above team panels */
        background: rgba(10, 15, 25, 0.98); /* More opaque */
        margin: 10px 0; /* Space top and bottom */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5); /* Depth */
        flex-shrink: 0; /* Don't shrink */
    }
    
    .chat-container.collapsed {
        height: 40px; /* Compact when collapsed */
        overflow: hidden;
        background: rgba(10, 15, 25, 0.95);
    }
    
    .chat-container.collapsed .chat-messages,
    .chat-container.collapsed .chat-input-container {
        display: none;
    }
    
    /* Chat Toggle Button */
    .chat-toggle-btn {
        display: block;
        position: absolute;
        top: 8px;
        right: 8px;
        background: rgba(200, 155, 60, 0.9);
        border: 2px solid #c89b3c;
        border-radius: 5px;
        color: #1a1a1a;
        font-weight: bold;
        font-size: 12px;
        padding: 6px 12px;
        cursor: pointer;
        z-index: 51; /* Above chat container */
        transition: all 0.2s ease;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
    
    .chat-toggle-btn:hover {
        background: rgba(200, 155, 60, 1);
        transform: scale(1.05);
        box-shadow: 0 3px 8px rgba(200, 155, 60, 0.5);
    }
    
    .chat-container.collapsed .chat-toggle-btn {
        position: static;
        margin: 8px;
        width: calc(100% - 16px);
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .chat-messages {
        padding: 10px;
        gap: 5px;
    }
    
    .chat-message {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .chat-input-container {
        padding: 8px 10px;
        gap: 8px;
    }
    
    #chatInput {
        padding: 8px;
        font-size: 12px;
    }
    
    #sendChatBtn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* Loading Screen - Mobile */
    .loading-text {
        font-size: 18px;
        letter-spacing: 2px;
    }
    
    .progress-container {
        width: 80%;
        height: 25px;
    }
    
    .progress-text {
        font-size: 12px;
    }
    
    /* Stats and Controls - Smaller on Mobile */
    .stats {
        padding: 8px;
        font-size: 11px;
        top: 5px;
        left: 5px;
    }
    
    .controls {
        padding: 8px;
        font-size: 11px;
        top: 10px;
        right: 10px;
    }
}

/* Portrait Mode Optimization (All Mobile/Tablet) */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    /* Stack layout vertically with optimized heights */
    .lobby-main {
        flex-direction: column;
    }
    
    .team-panel {
        width: 100%;
        /* No max-height - compact slots without scroll */
    }
    
    .champion-select-panel {
        flex: 1;
        min-height: 280px; /* More space for champions */
    }
    
    /* Make champion grid more compact in portrait */
    .champion-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 10px;
        min-height: 200px; /* Ensure visible champions */
    }
    
    /* Optimize room header for portrait */
    .room-header {
        padding: 8px 12px;
    }
    
    .room-header h2 {
        font-size: 15px;
    }
    
    /* Team headers smaller in portrait */
    .team-header {
        font-size: 15px;
        padding: 6px;
    }
    
    /* Chat slightly smaller in portrait */
    .chat-container {
        height: 180px; /* Smaller in portrait to save space */
        z-index: 50;
        background: rgba(10, 15, 25, 0.98);
        margin: 10px 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
        flex-shrink: 0;
    }
    
    .chat-container.collapsed {
        height: 60px;
        background: rgba(10, 15, 25, 0.95);
    }
    
    /* Lobby footer in portrait */
    .lobby-footer {
        flex-shrink: 0;
        border-top: 2px solid #c89b3c;
    }
    
    /* Start button optimized for portrait */
    .start-game-btn {
        padding: 10px 24px;
        font-size: 13px;
        width: 90%;
        max-width: 300px;
    }
}

/* Extra Small Mobile (Portrait) */
@media screen and (max-width: 480px) and (orientation: portrait) {
    .game-title {
        font-size: 20px;
    }
    
    .room-header h2 {
        font-size: 14px;
    }
    
    .team-header {
        font-size: 14px;
    }
    
    .select-header h3 {
        font-size: 16px;
    }
    
    .champion-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }
    
    .start-game-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* More compact team slots on very small screens */
    .team-slot {
        padding: 8px;
        min-height: 50px;
    }
    
    .team-slot .champion-avatar {
        width: 35px;
        height: 35px;
    }
}

/* Landscape Mobile Optimization */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .lobby-main {
        flex-direction: row;
    }
    
    .team-panel {
        width: 200px;
        max-height: unset;
    }
    
    .champion-select-panel {
        flex: 1;
    }
    
    .chat-container {
        height: 100px;
    }
    
    .room-header {
        padding: 8px 12px;
    }
    
    .room-header h2 {
        font-size: 14px;
    }
}
