/* ============================================
   LOBBY SYSTEM - CACTUS CLASH v1.0
   ============================================ */

/* === PAGE SCROLL FIX: prevent auto-scroll on load (desktop + mobile) === */
/* The page has game UI elements below #main-menu that make body scrollable.
   When scripts init and modify DOM, browser auto-scrolls down. Fix: lock body. */
html, body {
    scroll-behavior: auto;
    overflow: hidden !important;  /* Prevent body scroll — all content is in fixed overlays */
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}
#main-menu {
    scroll-behavior: auto;
}

/* Overlay */
#lobby-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lobbyFadeIn 0.3s ease;
}

@keyframes lobbyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lobby-container {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.3);
}

.lobby-header h2 {
    color: #4caf50;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lobby-header-btns {
    display: flex;
    gap: 8px;
}

/* Toolbar */
.lobby-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lobby-room-count {
    color: #888;
    font-size: 13px;
}

/* Buttons */
.lobby-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lobby-btn .lucide-icon {
    width: 14px;
    height: 14px;
}

.lobby-btn-primary {
    background: #4caf50;
    color: #000;
}
.lobby-btn-primary:hover {
    background: #66bb6a;
    transform: translateY(-1px);
}

.lobby-btn-accent {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}
.lobby-btn-accent:hover {
    background: rgba(255, 193, 7, 0.25);
}

.lobby-btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
}
.lobby-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lobby-btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
}
.lobby-btn-sm:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Room List */
.lobby-room-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.lobby-room-list::-webkit-scrollbar {
    width: 4px;
}
.lobby-room-list::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.3);
    border-radius: 2px;
}

/* Empty state */
.lobby-empty {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.lobby-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.lobby-empty p {
    margin: 4px 0;
}

.lobby-empty-sub {
    font-size: 13px;
    color: #444;
}

/* Room Card */
.lobby-room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(76, 175, 80, 0.15);
    border-radius: 10px;
    padding: 14px 18px;
    transition: all 0.2s ease;
}

.lobby-room-card:hover {
    background: rgba(76, 175, 80, 0.05);
    border-color: rgba(76, 175, 80, 0.4);
}

.lobby-room-card.playing {
    border-color: rgba(250, 204, 21, 0.2);
}

.room-card-left {
    flex: 1;
    min-width: 0;
}

.room-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.room-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.room-tag .lucide-icon {
    width: 11px;
    height: 11px;
}

.room-tag-mode {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.room-tag-map {
    background: rgba(33, 150, 243, 0.15);
    color: #42a5f5;
}

.room-tag-host {
    color: #888;
    background: rgba(255, 255, 255, 0.05);
}

.room-card-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.room-card-players {
    text-align: center;
}

.room-player-count {
    font-size: 18px;
    font-weight: 800;
    color: #4caf50;
    display: block;
}

.room-player-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.room-card-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.room-join-btn {
    background: #4caf50;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.room-join-btn:hover {
    background: #66bb6a;
    transform: scale(1.05);
}

/* ============================================
   CREATE ROOM MODAL
   ============================================ */
.lobby-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lobbyFadeIn 0.2s ease;
}

.lobby-modal {
    background: #1a1a1a;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 14px;
    padding: 28px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lobby-modal-sm {
    max-width: 360px;
}

.lobby-modal h3 {
    color: #4caf50;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.lobby-field {
    margin-bottom: 16px;
}

.lobby-field label {
    display: block;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lobby-field input[type="text"],
.lobby-field input[type="number"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.lobby-field input:focus {
    border-color: #4caf50;
}

.lobby-field-row {
    display: flex;
    gap: 12px;
}

.lobby-field-row .lobby-field {
    flex: 1;
}

/* Select button group */
.lobby-select-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lobby-select-btn {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.lobby-select-btn:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #ccc;
}

.lobby-select-btn.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
    color: #4caf50;
}

/* Checkbox */
.lobby-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #aaa !important;
    font-size: 13px !important;
}

.lobby-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4caf50;
}

.lobby-modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.lobby-modal-btns .lobby-btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
}

/* ============================================
   IN-GAME ROOM CODE BADGE
   ============================================ */
#room-code-badge {
    display: none !important; /* v2.1: Badge removed - code only in Pause Menu + Scoreboard */
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 500;
    backdrop-filter: blur(8px);
}

.room-code-label {
    color: #666;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.room-code-value {
    color: #4caf50;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.room-code-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #666;
    transition: color 0.2s;
}

.room-code-copy:hover {
    color: #4caf50;
}

.room-code-copy .lucide-icon {
    width: 14px;
    height: 14px;
}

/* ===========================================
   INVITE CODE POPUP
   =========================================== */
#invite-code-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.invite-popup-content {
    background: linear-gradient(135deg, #1a2a1a, #0d1a0d);
    border: 2px solid #4caf50;
    border-radius: 16px;
    padding: 32px 48px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.3);
}

.invite-popup-title {
    color: #4caf50;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.invite-popup-room {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
}

.invite-popup-label {
    color: #ccc;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.invite-popup-code {
    font-family: 'Courier New', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    background: rgba(76, 175, 80, 0.15);
    border: 2px dashed #4caf50;
    border-radius: 12px;
    padding: 16px 24px;
    letter-spacing: 12px;
    margin-bottom: 24px;
    user-select: all;
    cursor: pointer;
}

.invite-popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.invite-popup-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.invite-popup-copy {
    background: #4caf50;
    color: #000;
}

.invite-popup-copy:hover {
    background: #66bb6a;
    transform: scale(1.05);
}

.invite-popup-close {
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
}

.invite-popup-close:hover {
    color: #fff;
    border-color: #888;
}

.invite-popup-hint {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.invite-popup-join {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #000;
    font-size: 16px;
    padding: 14px 36px;
    animation: joinPulse 2s infinite;
}

.invite-popup-join:hover {
    background: linear-gradient(135deg, #ffb74d, #ff9800);
    transform: scale(1.08);
}

@keyframes joinPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(255, 152, 0, 0.4); }
}

/* ===========================================
   PAUSE MENU - ROOM CODE
   =========================================== */
#pause-room-code {
    margin-bottom: 16px;
    text-align: center;
}

.pause-code-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
}

.pause-code-label {
    color: #888;
    font-size: 12px;
    letter-spacing: 1px;
}

.pause-code-value {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 900;
    color: #4caf50;
    letter-spacing: 4px;
}

.pause-code-copy-btn {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.pause-code-copy-btn:hover {
    background: #4caf50;
    color: #000;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .lobby-container {
        width: 95%;
    }
    
    .lobby-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lobby-header-btns {
        width: 100%;
        justify-content: flex-end;
    }
    
    .lobby-room-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .room-card-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .lobby-field-row {
        flex-direction: column;
    }
}

/* ============================================
   MOBILE TOUCH POLISH — Hub, Lobby, Team
   ============================================ */
@media (max-width: 768px), (pointer: coarse) {
    /* === LOBBY BUTTONS: min 44px tap target === */
    .lobby-btn {
        min-height: 44px;
        padding: 12px 18px !important;
        font-size: 14px !important;
    }
    
    .lobby-btn-primary {
        min-height: 48px;
        font-size: 15px !important;
    }
    
    /* Room cards: bigger tap area */
    .lobby-room-card {
        padding: 16px !important;
        min-height: 60px;
    }
    
    .room-card-join {
        min-width: 80px;
        min-height: 44px;
        font-size: 14px !important;
    }
    
    /* Select buttons in create modal */
    .lobby-select-btn {
        min-height: 42px;
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    
    /* Inputs: taller, prevent iOS zoom */
    .lobby-field input,
    .lobby-field select {
        min-height: 44px;
        font-size: 16px !important; /* Prevents iOS auto-zoom */
        padding: 10px 14px !important;
    }
    
    /* Checkbox labels */
    .lobby-checkbox-label {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
    }
    
    .lobby-checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
    
    /* Close buttons */
    .lobby-close, .hub-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Match lobby: bigger ready/leave buttons */
    .ml-btn {
        min-height: 48px !important;
        padding: 14px 20px !important;
        font-size: 14px !important;
    }
    
    /* Match lobby player rows */
    .ml-p-row {
        min-height: 40px;
        padding: 8px 12px !important;
    }
    
    /* Match lobby chat input */
    #ml-chat-input {
        min-height: 40px;
        font-size: 16px !important;
        padding: 10px !important;
    }
    
    /* Team page: bigger buttons */
    .team-create-btn,
    .team-invite-btn,
    .team-leave-btn,
    .team-disband-btn {
        min-height: 44px;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    .team-create-form input,
    .team-invite-input {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    /* Team member rows */
    .team-member-row {
        min-height: 48px;
        padding: 10px 12px !important;
    }
    
    .team-action-btn {
        opacity: 1 !important; /* Always visible on touch — no hover */
        min-width: 36px;
        min-height: 36px;
        font-size: 18px;
    }
    
    /* Team chat input */
    .team-chat-input {
        min-height: 40px;
        font-size: 16px !important;
    }
}

/* ============================================
   HUB SOCIAL — IRC-Style Chat
   ============================================ */
#hub-overlay {
    font-family: 'Courier New', monospace;
}

#hub-chat-messages::-webkit-scrollbar {
    width: 6px;
}
#hub-chat-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}
#hub-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(50,205,50,0.3);
    border-radius: 3px;
}

#hub-chat-input:focus {
    border-bottom: 1px solid #32CD32;
}

.hub-btn:hover {
    background: linear-gradient(135deg, #16213e, #1a1a2e) !important;
    box-shadow: 0 0 15px rgba(50,205,50,0.3);
    transform: scale(1.02);
}

#hub-ranked-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

/* Match found popup animation */
#ranked-match-found {
    animation: matchFoundFade 0.3s ease-out;
}
@keyframes matchFoundFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile hub responsive */
@media (max-width: 768px), (max-height: 500px) {
    #hub-overlay > div {
        flex-direction: column !important;
        padding: 6px !important;
        gap: 6px !important;
    }
    
    /* Sidebar goes horizontal on mobile */
    #hub-overlay > div > div:last-child {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        max-height: 120px;
        overflow-y: auto;
    }
    
    #hub-chat-messages {
        min-height: 150px !important;
        font-size: 13px !important;
        -webkit-overflow-scrolling: touch;
    }
    
    #hub-chat-input {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 44px !important;
        padding: 10px 12px !important;
    }
    
    /* Ranked section compact */
    #hub-overlay > div > div:last-child > div:first-child {
        flex: 1;
        min-width: 200px;
    }
    
    /* Players list compact */
    #hub-overlay > div > div:last-child > div:nth-child(2) {
        flex: 1;
        min-width: 150px;
        max-height: 100px;
    }
    
    /* Hub buttons: touch-friendly */
    .hub-btn {
        min-height: 44px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    #hub-ranked-btn {
        min-height: 48px !important;
        font-size: 14px !important;
    }
}

/* Touch device specific (coarse pointer = finger) */
@media (pointer: coarse) {
    /* Hub panel: bigger tabs */
    .hub-tab {
        min-height: 40px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    /* Hub send button */
    #hub-send-btn {
        min-width: 48px;
        min-height: 44px;
    }
    
    /* Chat messages: bigger tap targets for nicknames */
    .hub-msg {
        padding: 4px 0 !important;
        min-height: 28px;
    }
    .hub-nick {
        padding: 2px 6px;
        border-radius: 4px;
    }
    
    /* Player rows in hub */
    .hub-player-row {
        min-height: 44px !important;
        padding: 8px 12px !important;
    }
    
    /* LFG join buttons */
    .lfg-join-btn, .lfg-cancel-btn {
        min-height: 44px !important;
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
    
    /* Hub close button */
    .hub-close {
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 24px !important;
    }
    
    /* Report modal buttons */
    .report-cat-btn {
        min-height: 44px !important;
        padding: 12px 10px !important;
    }
    .report-btn-cancel, .report-btn-submit {
        min-height: 44px !important;
        padding: 10px 20px !important;
    }
    .report-message {
        min-height: 70px !important;
        font-size: 16px !important;
    }
    
    /* Ranked dashboard buttons */
    .ranked-find-btn {
        min-height: 52px !important;
    }
    .ranked-cancel-btn {
        min-height: 44px !important;
    }
    
    /* Smooth scrolling everywhere */
    .lobby-room-list,
    .hub-messages,
    .team-chat-messages,
    #hub-chat-messages,
    .bp-track-container,
    .lb-table-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   LANDSCAPE MOBILE — Menu Layout Fix
   Phone in landscape: ~640x360 viewport
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    /* Compact topbar: single row, smaller */
    .menu-topbar {
        flex-direction: row !important;
        padding: 4px 12px !important;
        gap: 8px;
        min-height: auto;
    }
    .menu-logo {
        gap: 6px;
    }
    .logo-icon { font-size: 1.2em !important; }
    .logo-text { font-size: 1em !important; }
    
    .menu-user-info {
        gap: 6px;
    }
    .user-currency { padding: 3px 8px !important; font-size: 0.8em; }
    .auth-login-btn { padding: 4px 10px !important; font-size: 0.8em !important; }
    .guest-badge { font-size: 0.7em; padding: 2px 6px; }
    .user-profile { padding: 3px 8px !important; }
    .user-info-text { display: none; } /* Hide name+level in landscape — too wide */
    .user-avatar-container { width: 28px; height: 28px; }
    .dropdown-arrow { display: none; }
    
    /* Compact nav: horizontal scroll, icons only, single row */
    .menu-nav {
        padding: 2px 8px !important;
        gap: 2px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tab {
        padding: 4px 10px !important;
        flex-shrink: 0;
    }
    .nav-icon { font-size: 1em !important; }
    .nav-text { display: none !important; }
    .nav-tab::after { height: 2px; }
    
    /* Content: maximize vertical space */
    .menu-content {
        padding: 6px 10px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide footer in landscape — wastes space */
    .menu-footer { display: none !important; }
    
    /* ===== PLAY TAB: horizontal layout ===== */
    .play-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 6px !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Hide character preview in landscape, keep map select compact */
    .play-left { display: none !important; }
    .play-right {
        display: block !important;
        order: 3;
    }
    .play-right .player-card { display: none !important; }
    .play-right .region-select { display: none !important; }
    .play-right .section-label { display: none !important; }
    .play-right .map-select-container { margin: 0; padding: 0; }
    .play-right .map-carousel {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        -webkit-overflow-scrolling: touch;
    }
    .play-right .map-card {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 130px;
        padding: 6px 10px !important;
        flex-direction: row !important;
        gap: 8px;
        align-items: center;
    }
    .play-right .map-preview {
        width: 32px !important;
        height: 32px !important;
        min-height: auto !important;
        border-radius: 6px !important;
        flex-shrink: 0;
    }
    .play-right .map-info { text-align: left; }
    .play-right .map-name { font-size: 0.75em !important; white-space: nowrap; }
    .play-right .map-type { font-size: 0.65em !important; }
    
    /* Quick Play button: compact single row */
    .main-play-btn {
        padding: 8px 16px !important;
        flex-direction: row !important;
        gap: 12px;
        align-items: center;
        min-height: auto !important;
    }
    .main-play-btn .play-card-icon { font-size: 1.3em !important; animation: none !important; margin: 0 !important; }
    .main-play-btn .play-card-title { font-size: 1em !important; margin: 0 !important; }
    .main-play-btn .play-card-desc { display: none; }
    .main-play-btn .play-card-glow { display: none; }
    .main-play-btn .play-card-players { font-size: 0.75em; margin: 0 !important; }
    
    /* Mode cards: horizontal scrollable row */
    .play-modes {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    
    .mode-card {
        flex: 0 0 auto !important;
        width: 120px !important;
        min-width: 120px !important;
        padding: 10px 8px !important;
        text-align: center;
    }
    .mode-card .play-card-icon {
        font-size: 1.3em !important;
        animation: none !important;
        margin-bottom: 4px;
    }
    .mode-card .play-card-title {
        font-size: 0.7em !important;
        letter-spacing: 0.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mode-card .play-card-desc { display: none !important; }
    
    /* ===== OTHER TABS: compact in landscape ===== */
    /* Loadout */
    .loadout-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .loadout-preview { max-height: 200px !important; }
    
    /* Shop */
    .shop-featured { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
    .shop-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; }
    .shop-item { padding: 10px 8px !important; }
    
    /* Stats */
    .stats-header-card { padding: 10px !important; }
    .stats-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; }
    .stat-card { padding: 10px !important; }
    .stat-card-value { font-size: 1.3em !important; }
    
    /* Settings */
    .settings-container { max-height: none; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .settings-tab { flex-shrink: 0; padding: 8px 12px !important; font-size: 0.8em; }
    
    /* Ranked dashboard */
    .ranked-dashboard-panel { max-height: 90vh; overflow-y: auto; }
    .ranked-stats-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
}