/* ============================================================
   MULTIPLAYER.CSS - All multiplayer/party mode related styles
   Extracted from lexilayers.css for better organization
   ============================================================ */

/* ============================================================
   MP HUB PAGE & PARTY MODE HUB PAGE
   ============================================================ */
#mp-hub-page,
#party-mode-hub-page {
    flex: 1 0 auto;
    width: 100%;
    min-height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #4c90c9 0%, #ffffff 60%);
    text-align: center;
    padding: 20px;
    padding-top: calc(-14px + var(--header-h, 52px));
    padding-bottom: 40px;
    box-sizing: border-box;
    transition: opacity 0.8s ease-in-out;
}

#mp-hub-page .hub-title,
#party-mode-hub-page .hub-title {
    margin: 0;
}

body.dark-mode #mp-hub-page,
body.dark-mode #party-mode-hub-page {
    background: linear-gradient(180deg, #1a3a5c 0%, #1e293b 60%);
}

/* ============================================================
   MP HUB CARDS (Party Mode, Survival, Teams selection)
   ============================================================ */
.mp-hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 24px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.mp-hub-card:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.mp-hub-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mp-hub-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.mp-hub-select-btn {
    width: 100%;
    margin-top: auto;
}

body.dark-mode .mp-hub-card {
    border: 2px solid rgba(100, 181, 246, 0.4) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .mp-hub-card h3,
body.dark-mode .mp-hub-card h4,
body.dark-mode .mp-hub-card p {
    color: #ffffff !important;
}

body.dark-mode .mp-hub-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .mp-hub-card .lp-card-title {
    color: #ffffff !important;
}

body.dark-mode .mp-hub-card .lp-card-text {
    color: #e8eaed !important;
}

/* ============================================================
   PARTY MODE SELECTION CARDS (Normal, Fast, Blitz, Ultra)
   ============================================================ */
.party-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid #1487c6;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

body.dark-mode .party-mode-card {
    border: 2px solid rgba(100, 181, 246, 0.4) !important;
}

.party-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.party-mode-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.party-mode-details {
    font-size: 0.9rem;
    color: #a0b0c0;
    margin: 12px 0 16px;
}

.party-mode-play-btn {
    width: 100%;
    margin-top: auto;
}

/* ============================================================
   MP LOBBY (Game Browser)
   ============================================================ */
#mp-lobby {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(180deg, #4c90c9 0%, #ffffff 60%);
    min-height: calc(100vh - var(--header-h));
    padding: 20px;
    padding-top: calc(-14px + var(--header-h, 52px));
    box-sizing: border-box;
    text-align: center;
}

#mp-lobby h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    text-align: center;
}

body.dark-mode #mp-lobby {
    background: linear-gradient(180deg, #1a3a5c 0%, #1e293b 60%);
}

.mp-lobby-header {
    text-align: center;
    margin-bottom: 24px;
}

.mp-lobby-header h2 {
    font-size: 2rem;
    margin: 8px 0 20px;
    color: var(--ink);
}

/* Legacy standalone mode info - now moved to games header */
.mp-lobby-mode-info {
    display: none;
}

/* ============================================================
   MP LOBBY LAYOUT (3-column: Games, Chat, Leaderboard)
   ============================================================ */
.mp-lobby-layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr 220px;
    gap: 16px;
    width: 100%;
    align-items: stretch;
    position: relative;
}

/* Games Section */
.mp-lobby-games {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.25), rgba(100, 181, 246, 0.2));
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 144, 201, 0.5);
    overflow: hidden;
}

/* Games header with inline mode pills */
.mp-lobby-games-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 2px solid #64b5f6;
    margin-bottom: 10px;
}

.mp-lobby-games-header h3 {
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
    color: var(--ink);
}

/* Mode pills inline in games header */
.mp-lobby-mode-pills {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.mp-lobby-mode-pills .pill-wrap {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    grid-template-columns: none;
    margin-bottom: 0;
}

.mp-lobby-mode-pills .pill {
    font-size: 0.7rem;
    padding: 3px 8px;
}

.mp-lobby-games .lobby-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

body.dark-mode .mp-lobby-games {
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.15), rgba(100, 181, 246, 0.1)) !important;
    border-color: rgba(100, 181, 246, 0.4) !important;
}

body.dark-mode .mp-lobby-games h3 {
    color: #ffffff !important;
}

body.dark-mode .mp-lobby-games-header {
    border-color: rgba(100, 181, 246, 0.4) !important;
}

/* ============================================================
   CHAT AND STATS COLUMN CONTAINER
   ============================================================ */
.mp-lobby-chat-stats-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* ============================================================
   LOBBY CHAT SECTION
   ============================================================ */
.mp-lobby-chat {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.2), rgba(33, 150, 243, 0.15));
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.4);
    height: 320px;
}

.mp-lobby-chat h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--ink);
    border-bottom: 2px solid #64b5f6;
    padding-bottom: 10px;
}

body.dark-mode .mp-lobby-chat {
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.12), rgba(33, 150, 243, 0.08)) !important;
    border-color: rgba(100, 181, 246, 0.3) !important;
}

body.dark-mode .mp-lobby-chat h3 {
    color: #ffffff !important;
    border-color: rgba(100, 181, 246, 0.3) !important;
}

.lobby-chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px;
    background: #26a397e0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.lobby-chat-message {
    padding: 0;
    background: none;
    text-align: left;
}

.lobby-chat-message-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.lobby-chat-message-text {
    font-size: 0.8rem;
    color: #000;
    word-break: break-word;
}

.lobby-chat-input-wrap {
    display: flex;
    max-width: 85%;
}

.lobby-chat-input-wrap input {
    flex: 1;
    padding: 4px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.lobby-chat-input-wrap input:focus {
    outline: none;
    border-color: #f9a825;
}


.lobby-chat-empty {
    text-align: center;
    color: #e9e1e1;
    font-size: 0.9rem;
    padding: 40px 20px;
}

/* Dark mode chat messages */
body.dark-mode .lobby-chat-messages {
    background: none;
}

body.dark-mode .lobby-chat-message {
    background: none;
}

body.dark-mode .lobby-chat-message-name {
    color: #ffffff;
}

body.dark-mode .lobby-chat-message-text {
    color: #e0e0e0;
}

body.dark-mode .lobby-chat-input-wrap input {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border-color: rgba(100, 181, 246, 0.4);
    color: #ffffff;
}

body.dark-mode .lobby-chat-input-wrap input::placeholder {
    color: #8ab4e8;
}

body.dark-mode .lobby-chat-empty {
    color: #8ab4e8;
}

/* Chat container with sidebar */
.lobby-chat-container {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.lobby-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Player sidebar */
.lobby-chat-players {
    width: 120px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(100, 181, 246, 0.2);
    overflow: hidden;
}

.lobby-chat-players-header {
    padding: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: #36ff88;
    background: rgba(100, 181, 246, 0.15);
    border-bottom: 1px solid rgba(100, 181, 246, 0.2);
}

.lobby-chat-players-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.lobby-chat-player {
    font-size: 0.8rem;
    padding: 2px 6px;
    background: none;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-status-dot {
    font-size: 0.5rem;
    line-height: 1;
}

/* Fade players who are currently in a game */
.lobby-chat-player.in-game {
    opacity: 0.5;
}

/* Dark mode player sidebar */
body.dark-mode .lobby-chat-players {
    background: rgba(76, 144, 201, 0.1);
    border-color: rgba(100, 181, 246, 0.2);
}

body.dark-mode .lobby-chat-players-header {
    color: #66bb6a;
    background: rgba(100, 181, 246, 0.2);
    border-color: rgba(100, 181, 246, 0.2);
}

body.dark-mode .lobby-chat-player {
    background: none;
    color: #e0e0e0;
}

/* ============================================================
   MP LOBBY LEADERBOARD
   ============================================================ */
.mp-lobby-leaderboard {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.15), rgba(100, 181, 246, 0.2));
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(76, 144, 201, 0.4);
    overflow: hidden;
}

.mp-lobby-leaderboard h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--ink);
    border-bottom: 2px solid #64b5f6;
    padding-bottom: 10px;
}

body.dark-mode .mp-lobby-leaderboard {
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.15), rgba(100, 181, 246, 0.1)) !important;
    border-color: rgba(100, 181, 246, 0.4) !important;
}

body.dark-mode .mp-lobby-leaderboard h2,
body.dark-mode .mp-lobby-leaderboard h3 {
    color: #ffffff !important;
    border-color: rgba(100, 181, 246, 0.4) !important;
}

/* ============================================================
   PARTY HUB WRAPPER (like Face-Off)
   ============================================================ */
.party-hub {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================================
   PARTY MODE HEADER BAR (like Face-Off)
   ============================================================ */
.party-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 16px;
    border: 2px solid #64b5f6;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.party-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.party-title-icon {
    font-size: 1.8rem;
}

.party-title-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1565c0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.party-back-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-bottom: 24px;
}

.party-coin-balance-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
}

.party-coin-amount {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f9a825, #e65100);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.party-coin-icon-large {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

body.dark-mode .party-header-bar {
    background: linear-gradient(135deg, #1a237e, #283593) !important;
    border-color: #5c6bc0 !important;
}

body.dark-mode .party-title-text {
    color: #90caf9 !important;
}

body.dark-mode .party-coin-amount {
    background: linear-gradient(135deg, #ffd54f, #ffab40) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ============================================================
   COMPACT GAME CARDS - List Style Design
   ============================================================ */
.lobby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mp-card-compact {
    background: #a9d3e3;
    border-radius: 10px;
    padding: 4px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #3796f4f5;
}

.mp-card-compact:hover {
    background: #5bb8dc;
    border-color: #2080d9;
    box-shadow: 0 4px 12px rgba(55, 150, 244, 0.3);
}

.mp-card-compact.expanded {
    background: #5bb8dc;
    border-color: #2080d9;
}

.mp-card-compact-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mp-card-compact-info {
    flex: 1;
    min-width: 0;
}

.mp-card-compact-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.mp-card-compact-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 1rem;
    color: #666;
}

.mp-card-compact-players {
    font-weight: 600;
}

.mp-card-compact-status {
    margin-bottom: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    background: #e8f5e9;
    color: #2e7d32;
}

.mp-card-compact-status.countdown {
    background: #fff3e0;
    color: #e65100;
    animation: pulse-status 1s ease-in-out infinite;
}

.mp-card-compact-status.playing {
    background: #e3f2fd;
    color: #1565c0;
}

.mp-card-compact-status.finished {
    background: #f3e5f5;
    color: #7b1fa2;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.mp-card-compact-join {
    padding: 6px 14px;
    background: linear-gradient(135deg, #40c455 0%, #2e9a3d 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.mp-card-compact-join:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(64, 196, 85, 0.4);
}

.mp-card-compact-join:disabled {
    background: #bbb;
    cursor: not-allowed;
}

.mp-card-compact-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.mp-card-compact.expanded .mp-card-compact-details {
    max-height: 200px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.mp-card-compact-player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mp-card-compact-player {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.75rem;
}

.mp-card-compact-player-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    overflow: hidden;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #666;
}

.mp-card-compact-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-card-compact-player-name {
    font-weight: 600;
    color: var(--ink);
}

.mp-card-compact-player-rating {
    color: #888;
    font-size: 0.7rem;
}

.mp-card-compact-empty {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    padding: 20px;
}

/* Dark mode compact cards */
body.dark-mode .mp-card-compact {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%) !important;
    border-color: rgba(100, 181, 246, 0.4) !important;
}

body.dark-mode .mp-card-compact:hover {
    background: linear-gradient(135deg, #1f4570 0%, #305580 100%) !important;
    border-color: #64b5f6 !important;
}

body.dark-mode .mp-card-compact.expanded {
    background: linear-gradient(135deg, #1f4570 0%, #305580 100%) !important;
    border-color: #64b5f6 !important;
}

body.dark-mode .mp-card-compact-name {
    color: #ffffff !important;
}

body.dark-mode .mp-card-compact-meta {
    color: #aaa !important;
}

body.dark-mode .mp-card-compact-details {
    border-color: var(--border-color) !important;
}

body.dark-mode .mp-card-compact-player {
    background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .mp-card-compact-player-name {
    color: #fff !important;
}

body.dark-mode .mp-card-compact-player-rating {
    color: #aaa !important;
}

body.dark-mode .mp-card-compact-empty {
    color: #888 !important;
}

/* ============================================================
   LEGACY GAME CARDS (Grid View)
   ============================================================ */
.lobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    justify-content: center;
    width: 100%;
    max-width: 900px;
}

.mp-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.15);
}

.mp-card .room-status {
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    padding: 0 6px;
}

.mp-card .join-btn {
    width: 50%;
    padding: 10px 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #40c455, #2ea344);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(64, 196, 85, .3);
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.mp-card .join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(64, 196, 85, .4);
}

.mp-card .join-btn.disabled,
.mp-card .join-btn[disabled] {
    background: #888;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.75;
    box-shadow: none;
    transform: none;
}

.mp-card .join-btn.disabled:hover,
.mp-card .join-btn[disabled]:hover {
    background: #888;
    color: #fff;
    box-shadow: none;
    transform: none;
}

.mp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mp-card-header .room-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}

.mp-card-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    align-items: flex-start;
}

.mp-card-room-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
}

.mp-card-status-badge {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.mp-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* Dark mode mp-card */
body.dark-mode .mp-card {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%) !important;
    border: 2px solid rgba(100, 181, 246, 0.4) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .mp-card-header {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #ffffff !important;
}

body.dark-mode .mp-card-room-name,
body.dark-mode .mp-card h3,
body.dark-mode .mp-card h4 {
    color: #ffffff !important;
}

body.dark-mode .mp-card-body {
    background: transparent !important;
}

body.dark-mode .mp-card-player {
    background: rgba(76, 144, 201, 0.15) !important;
    border-color: rgba(100, 181, 246, 0.3) !important;
}

body.dark-mode .mp-card-player-name,
body.dark-mode .mp-card-player-rating,
body.dark-mode .mp-card-player-tier {
    color: var(--text-primary) !important;
}

/* ============================================================
   PLAYER LIST IN GAME CARDS
   ============================================================ */
.mp-card-players {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.mp-card-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 2px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.mp-card-player:hover {
    background: #f0f0f0;
}

.mp-card-player-avatar {
    width: 20px;
    height: 20px;
    border-radius: 12%;
    overflow: hidden;
    background: #e0e0e0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-card-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-card-player-avatar-placeholder {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1487c6, #0c74b0);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-card-player-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.mp-card-player-rating {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    flex: 0 0 48px;
    text-align: right;
}

.mp-card-player-tier-icon {
    display: inline-flex;
    align-items: center;
    width: 16px;
    height: 16px;
    flex: 0 0 50px;
    text-align: right;
}

.mp-card-player-tier-icon svg {
    width: 16px;
    height: 16px;
}

.mp-card-player-tier {
    font-size: 0.8rem;
    color: #666;
    text-transform: capitalize;
    flex: 0 0 50px;
    text-align: left;
}

/* ============================================================
   LEADERBOARD PLAYER ITEMS
   ============================================================ */
.mp-lb-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.mp-lb-player:hover {
    background: #f9f9f9;
}

.mp-lb-player:last-child {
    border-bottom: none;
}

.mp-lb-rank {
    font-size: 0.9rem;
    font-weight: 700;
    color: #666;
    min-width: 20px;
    text-align: center;
}

.mp-lb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 12%;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mp-lb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-lb-avatar-placeholder {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1487c6, #0c74b0);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-lb-info {
    flex: 1;
    min-width: 0;
}

.mp-lb-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-lb-stats {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.mp-lb-stats svg {
    width: 11px;
    height: 11px;
    display: inline-block;
    vertical-align: middle;
}

body.dark-mode .mp-lb-player {
    border-color: rgba(100, 181, 246, 0.2);
}

body.dark-mode .mp-lb-player:hover {
    background: rgba(100, 181, 246, 0.1);
}

body.dark-mode .mp-lb-rank {
    color: #8ab4e8;
}

body.dark-mode .mp-lb-name {
    color: #ffffff;
}

body.dark-mode .mp-lb-stats {
    color: #8ab4e8;
}

/* ============================================================
   MP ROOM (Waiting Room)
   ============================================================ */
#mp-room {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#mp-room .pill-wrap {
    margin-bottom: 36px;
}

#mp-room .btn {
    margin-top: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
}

#room-name {
    display: inline-block;
    background: linear-gradient(180deg,#1487c6 0%,#0c74b0 100%);
    border: 1px solid #0c74b0;
    color: #fff;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw + .2rem, 1.3rem);
    padding: 6px 46px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 12px;
    width: auto;
    max-width: 90%;
}

#player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
    width: 100%;
    max-width: 600px;
}

.player-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
    padding: 10px;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.player-card .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg,#ccc,#eee);
    margin-bottom: 6px;
}

.player-card .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.player-card .badge {
    font-size: 0.7rem;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 8px;
}

.player-card .badge.host {
    background: gold;
    color: #333;
}

.player-card .badge.ready {
    background: #4caf50;
    color: #fff;
}

.player-card.me {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 8px rgba(59,130,246,.5);
}

.room-countdown {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 12px 0;
    color: #444;
    text-align: center;
}

#leave-game {
    display: block;
    margin: 20px auto;
}

/* ============================================================
   MP WAITING ROOM (styled like elimination mode)
   ============================================================ */
.mp-waiting-room {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.dark-mode .mp-waiting-room {
    background: #2a2a3e;
}

.mp-waiting-room-header {
    text-align: center;
    margin-bottom: 24px;
}

.mp-waiting-room-header h2 {
    font-size: 1.8rem;
    margin: 16px 0 8px;
    color: var(--ink);
}

.mp-waiting-status {
    font-size: 1.1rem;
    color: #ff8c00;
    font-weight: 600;
}

.mp-leave-btn {
    font-size: 0.95rem;
    padding: 8px 16px;
}

.mp-waiting-room-info {
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

body.dark-mode .mp-waiting-room-info {
    background: rgba(59, 130, 246, 0.15);
}

.mp-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.mp-info-label {
    color: #888;
}

body.dark-mode .mp-info-label {
    color: #aaa;
}

.mp-info-value {
    font-weight: 600;
    color: var(--ink);
}

body.dark-mode .mp-info-value {
    color: #fff;
}

.mp-waiting-room-players {
    margin-bottom: 24px;
}

.mp-waiting-room-players h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--ink);
}

.mp-player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mp-player-pill {
    padding: 8px 14px;
    border-radius: 20px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    border: 2px solid;
}

.mp-player-pill.empty {
    background: rgba(0, 0, 0, 0.05);
    color: #aaa;
    border: 2px dashed #ccc;
}

body.dark-mode .mp-player-pill.empty {
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    border-color: #555;
}

.mp-player-pill.is-me {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.mp-you-badge {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

.mp-waiting-message {
    text-align: center;
    color: #888;
    font-style: italic;
    margin-bottom: 16px;
}

body.dark-mode .mp-waiting-message {
    color: #aaa;
}

/* Orange countdown bar (matching elimination style) */
.mp-game-starting-message {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, #ff8c00, #ff6600);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    font-style: normal;
    margin-bottom: 16px;
    animation: pulse 1.5s infinite;
}

.mp-invite-container {
    text-align: center;
}

/* ============================================================
   MP REWARDS CONTAINER
   ============================================================ */
#mp-rewards-container > div {
    text-align: center;
    padding: 0 10px;
}

#mp-rewards-container [style*="font-size: 1.8rem"] {
    text-align: center;
}

/* ============================================================
   MP LOBBY YOUR STATS SECTION
   ============================================================ */
.mp-lobby-stats {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.12), rgba(33, 150, 243, 0.08));
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 144, 201, 0.3);
    min-height: 210px;
}

.mp-lobby-stats h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--ink);
    border-bottom: 2px solid #64b5f6;
    padding-bottom: 10px;
}

.mp-lobby-stats-subtitle {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

body.dark-mode .mp-lobby-stats {
    background: linear-gradient(135deg, rgba(76, 144, 201, 0.15), rgba(33, 150, 243, 0.1)) !important;
    border-color: rgba(100, 181, 246, 0.3) !important;
}

body.dark-mode .mp-lobby-stats h3 {
    color: #ffffff !important;
    border-color: rgba(100, 181, 246, 0.4) !important;
}

/* Stats grid - reuse faceoff compact styles but with blue theme */
.mp-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.mp-stat-box {
    background: linear-gradient(180deg, #fafafa 0%, #e9edf3 100%);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    border: 1px solid #d0d5dd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark-mode .mp-stat-box {
    background: linear-gradient(180deg, #1a3a5c 0%, #2a4a6c 100%);
    border-color: rgba(100, 181, 246, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mp-stat-box .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.mp-stat-box .stat-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Tier badge styling inside stat box */
.mp-stat-box .tier-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Stats note at bottom */
.mp-lobby-stats-note {
    font-size: 0.65rem;
    color: var(--text-secondary, #888);
    text-align: center;
    margin: 20px 0 0;
    font-style: italic;
}

body.dark-mode .mp-lobby-stats-note {
    color: #8ab4e8;
}

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */
@media (max-width: 1200px) {
    .mp-lobby-leaderboard {
        display: none;
    }

    .party-hub {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .mp-lobby-layout {
        grid-template-columns: 1fr;
    }

    .mp-lobby-games {
        max-width: none;
    }

    .mp-lobby-chat-stats-column {
        max-width: none;
    }

    .mp-lobby-chat {
        max-width: none;
        height: 280px;
    }

    .mp-lobby-stats {
        max-width: none;
        min-height: 166px;
    }

    .mp-lobby-leaderboard {
        max-width: none;
        position: static;
        max-height: none;
        display: none;
    }

    .party-header-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .party-title-text {
        font-size: 1.4rem;
    }

    .party-coin-amount {
        font-size: 1.8rem;
    }

    .party-coin-icon-large {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }

    .mp-lobby-layout {
        grid-template-columns: 1fr;
    }

    .lobby-chat-main {
        overflow: hidden;
    }

    .lobby-chat-input-wrap {
        max-width: calc(100% - 140px) !important;
        width: calc(100% - 140px);
    }

    .mp-lobby-games {
        overflow: visible;
        min-height: 200px;
    }

    .mp-lobby-games .lobby-list {
        min-height: 150px;
    }

    .mp-lobby-leaderboard {
        display: none;
    }

    .mp-card-compact {
        padding: 10px 12px;
    }

    .party-header-bar {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .party-header-title {
        flex: 1;
    }

    .party-title-icon {
        font-size: 1.5rem;
    }

    .party-title-text {
        font-size: 1.2rem;
    }

    .party-coin-balance-display {
        padding: 6px 10px;
        gap: 8px;
    }

    .party-coin-amount {
        font-size: 1.4rem;
    }

    .party-coin-icon-large {
        width: 32px;
        height: 32px;
    }
}

/* Mobile bottom padding and touch device fixes */
@media (pointer: coarse), (max-width: 768px) {
    #mp-lobby,
    #mp-hub-page,
    #party-mode-hub-page {
        padding-bottom: 110px !important;
    }

    .lobby-chat-main {
        overflow: hidden;
    }

    .lobby-chat-input-wrap {
        max-width: calc(100% - 140px) !important;
        width: calc(100% - 140px) !important;
    }
}

/* ============================================================
   MULTIPLAYER HUB PAGES - Card-based navigation
   (Moved from lexilayers.css)
   ============================================================ */

/* MP Hub Page & Party Mode Hub Page - blue gradient background */
#mp-hub-page,
#party-mode-hub-page {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(180deg, #4c90c9 0%, #ffffff 60%);
    text-align: center;
    padding: 20px;
    padding-top: calc(-14px + var(--header-h, 52px));
    padding-bottom: 40px;
    box-sizing: border-box;
    transition: opacity 0.8s ease-in-out;
}

/* MP Hub Game Type Cards (Party Mode, Survival, Teams) */
.mp-hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 24px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.mp-hub-card:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.mp-hub-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mp-hub-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.mp-hub-select-btn {
    width: 100%;
    margin-top: auto;
}

.coming-soon-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8c44f, #e6b037);
    color: #333;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* Party Mode grid: 3 columns on desktop, 1 on mobile */
#party-mode-list {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    #party-mode-list {
        grid-template-columns: 1fr;
    }
}

/* Party Mode Selection Cards (Normal, Fast, Blitz, Ultra) */
.party-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.party-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.party-mode-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.party-mode-details {
    font-size: 0.9rem;
    color: #a0b0c0;
    margin: 12px 0 16px;
}

.party-mode-play-btn {
    width: 100%;
    margin-top: auto;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* ============================================================
   MP HUB DARK MODE
   ============================================================ */

body.dark-mode .mp-hub-card {
    background: rgba(26, 31, 46, 0.9) !important;
}

body.dark-mode .mp-hub-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .mp-hub-card .lp-card-title {
    color: #ffffff !important;
}

body.dark-mode .mp-hub-card .lp-card-text {
    color: #e8eaed !important;
}
