/* ============ Multiplayer UI ============ */

/* Overlay */
.mp-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #0a0a0f; z-index: 9000;
    overflow-y: auto;
}

/* ============ LOBBY ============ */
.mp-lobby { max-width: 800px; margin: 0 auto; padding: 20px; }
.mp-lobby-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.mp-lobby-title { font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: 2px; }
.mp-lobby-title .cyan { color: #00d4ff; }
.mp-online { color: #0f8; font-size: 13px; }
.mp-lobby-actions { display: flex; gap: 8px; }

.btn { padding: 10px 20px; border-radius: 8px; border: 1px solid; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: 'Rajdhani', sans-serif; letter-spacing: 1px; }
.mp-btn-create { color: #0f8; border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.1); }
.mp-btn-create:hover { background: rgba(0,255,136,0.2); box-shadow: 0 0 15px rgba(0,255,136,0.2); }
.mp-btn-back { color: #888; border-color: rgba(255,255,255,0.15); background: transparent; }
.mp-btn-back:hover { color: #fff; border-color: rgba(255,255,255,0.3); }

/* Room list */
.mp-room-list { display: flex; flex-direction: column; gap: 8px; }
.mp-room-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(0,212,255,0.08);
    border-radius: 12px; cursor: pointer; transition: 0.2s;
}
.mp-room-card:hover { border-color: rgba(0,212,255,0.25); background: rgba(0,212,255,0.04); box-shadow: 0 0 12px rgba(0,212,255,0.06); }
.mp-room-num { font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 700; color: #555; width: 30px; }
.mp-room-info { flex: 1; }
.mp-room-name { font-size: 15px; font-weight: 600; color: #eee; }
.mp-room-meta { font-size: 11px; color: #888; margin-top: 2px; }
.mp-room-players { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: #00d4ff; }
.mp-room-status { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.mp-status-waiting { background: rgba(0,255,136,0.12); color: #0f8; }
.mp-status-playing { background: rgba(255,165,0,0.12); color: #ffa500; }
.mp-room-lock { font-size: 14px; }
.mp-empty { text-align: center; padding: 40px; color: #555; font-size: 14px; }
.mp-loading { text-align: center; padding: 40px; color: #888; }
.mp-max-btn { padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); color: #aaa; cursor: pointer; }
.mp-max-btn.mp-max-active { border-color: #00d4ff; color: #00d4ff; background: rgba(0,212,255,0.1); }

/* ============ ROOM VIEW ============ */
.mp-room-view { max-width: 900px; margin: 0 auto; padding: 20px; }
.mp-room-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px; border-radius: 10px; margin-bottom: 16px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(0,212,255,0.1);
}
.mp-rh-name { font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; }

/* Player slots */
.mp-player-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.mp-slot {
    padding: 16px; border-radius: 12px; text-align: center; min-height: 140px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: 0.3s; position: relative;
}
.mp-slot-empty {
    border: 2px dashed rgba(255,255,255,0.1); background: rgba(255,255,255,0.02);
    animation: mpEmptyPulse 2.5s ease-in-out infinite;
}
@keyframes mpEmptyPulse { 0%,100%{border-color:rgba(255,255,255,0.08);} 50%{border-color:rgba(255,255,255,0.2);} }
.mp-slot-label { color: #555; font-size: 12px; }

.mp-slot-occupied { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.mp-slot-ready { border-color: rgba(0,255,136,0.3) !important; background: rgba(0,255,136,0.05) !important; box-shadow: 0 0 15px rgba(0,255,136,0.08); }
.mp-slot-dj { border-color: rgba(255,215,0,0.3) !important; background: rgba(255,215,0,0.05) !important; box-shadow: 0 0 15px rgba(255,215,0,0.08); }

.mp-slot-avatar { width: 48px; height: 48px; border-radius: 50%; margin-bottom: 6px; display: flex; justify-content: center; align-items: center; font-size: 24px; background: linear-gradient(135deg, #0f3460, #533483); overflow: hidden; }
.mp-slot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mp-slot-name { font-size: 14px; font-weight: 600; color: #eee; }
.mp-slot-level { font-size: 11px; color: #a855f7; }
.mp-slot-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-top: 4px; letter-spacing: 0.5px; }
.mp-badge-dj { background: rgba(255,215,0,0.2); color: #ffd700; }
.mp-badge-ready { background: rgba(0,255,136,0.15); color: #0f8; animation: mpReadyGlow 1.5s ease-in-out infinite; }
@keyframes mpReadyGlow { 0%,100%{box-shadow:0 0 5px rgba(0,255,136,0.2);} 50%{box-shadow:0 0 12px rgba(0,255,136,0.4);} }
.mp-badge-waiting { background: rgba(255,255,255,0.06); color: #888; }
.mp-kick-btn { position: absolute; top: 6px; right: 6px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(233,69,96,0.1); border: 1px solid rgba(233,69,96,0.2); color: #e94560; cursor: pointer; opacity: 0; transition: 0.2s; }
.mp-slot:hover .mp-kick-btn { opacity: 1; }

/* Song bar */
.mp-song-bar {
    display: flex; align-items: center; gap: 14px; padding: 12px 18px;
    background: rgba(168,85,247,0.05); border: 1px solid rgba(168,85,247,0.15);
    border-radius: 10px; margin-bottom: 16px;
}
.mp-song-icon { font-size: 24px; }
.mp-song-info { flex: 1; }
.mp-song-name { font-size: 16px; font-weight: 700; font-family: 'Rajdhani', sans-serif; color: #eee; }
.mp-song-artist { font-size: 12px; color: #888; }
.mp-song-bpm { font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700; color: #00d4ff; }

/* Controls */
.mp-controls { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mp-btn-dj { color: #ffd700; border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.08); }
.mp-btn-dj:hover { background: rgba(255,215,0,0.15); box-shadow: 0 0 12px rgba(255,215,0,0.15); }
.mp-btn-start { color: #fff; background: linear-gradient(135deg, #0f8, #00b36b); border: none; font-size: 15px; padding: 12px 32px; box-shadow: 0 0 20px rgba(0,255,136,0.2); }
.mp-btn-start:hover { filter: brightness(1.15); box-shadow: 0 0 30px rgba(0,255,136,0.35); }
.mp-btn-start:disabled { opacity: 0.4; cursor: not-allowed; filter: none; box-shadow: none; }
.mp-btn-ready { color: #0f8; border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.1); padding: 12px 32px; font-size: 15px; }
.mp-btn-ready:hover { box-shadow: 0 0 20px rgba(0,255,136,0.25); }
.mp-btn-ready.mp-ready-active { background: #0f8; color: #000; }

/* Chat */
.mp-room-bottom { display: grid; grid-template-columns: 1fr 180px; gap: 16px; }
.mp-chat-box {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 12px; display: flex; flex-direction: column; height: 200px;
}
.mp-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.mp-chat-msg { animation: mpChatIn 0.25s ease-out; }
@keyframes mpChatIn { from{transform:translateY(10px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.mp-chat-msg .mp-chat-name { color: #00d4ff; font-weight: 600; }
.mp-chat-msg .mp-chat-text { color: #ccc; }
.mp-chat-msg.mp-chat-system { color: #888; font-style: italic; font-size: 12px; }
.mp-chat-msg.mp-chat-fading { animation: mpChatFade 5s ease-in forwards; }
@keyframes mpChatFade { 0%,70%{opacity:1;} 100%{opacity:0;transform:translateX(-10px);} }
.mp-chat-input-wrap { display: flex; gap: 6px; margin-top: 8px; }
.mp-chat-input { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: #fff; font-size: 13px; }
.mp-chat-input:focus { border-color: #00d4ff; outline: none; }
.mp-chat-send { padding: 8px 14px; border-radius: 8px; border: none; background: rgba(0,212,255,0.15); color: #00d4ff; font-weight: 600; cursor: pointer; }

/* Observers */
.mp-observer-box {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 12px;
}
.mp-obs-title { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.mp-obs-item { font-size: 12px; color: #aaa; padding: 3px 0; }

/* Song picker */
.mp-sp-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 8px; cursor: pointer; transition: 0.15s;
}
.mp-sp-item:hover { background: rgba(0,212,255,0.08); }
.mp-sp-name { flex: 1; font-size: 14px; font-weight: 500; color: #eee; }
.mp-sp-artist { font-size: 12px; color: #888; min-width: 80px; }
.mp-sp-bpm { font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 700; color: #00d4ff; }

/* ============ COUNTDOWN ============ */
.mp-countdown-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 99999;
    display: flex; justify-content: center; align-items: center;
}
.mp-cd-num {
    font-family: 'Rajdhani', sans-serif; font-size: 120px; font-weight: 700;
    position: absolute; animation: mpCdAnim 1s ease-out forwards;
}
@keyframes mpCdAnim {
    0% { transform: scale(3); opacity: 0; filter: blur(10px); }
    30% { transform: scale(0.9); opacity: 1; filter: blur(0); }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.5); opacity: 0; filter: blur(5px); }
}
.mp-cd-3 { color: #e94560; text-shadow: 0 0 30px rgba(233,69,96,0.5); }
.mp-cd-2 { color: #ffa500; text-shadow: 0 0 30px rgba(255,165,0,0.5); }
.mp-cd-1 { color: #00d4ff; text-shadow: 0 0 30px rgba(0,212,255,0.5); }
.mp-cd-go {
    font-family: 'Rajdhani', sans-serif; font-size: 100px; font-weight: 700;
    color: #fff; letter-spacing: 10px;
    text-shadow: 0 0 40px #00ffcc, 0 0 80px rgba(0,255,204,0.5);
}
@keyframes mpCdGo {
    0% { transform: scale(4) rotate(-10deg); opacity: 0; }
    40% { transform: scale(0.9) rotate(2deg); opacity: 1; }
    70% { transform: scale(1.2) rotate(0); }
    100% { transform: scale(1) rotate(0); opacity: 0; }
}

/* ============ LIVE SCORE ============ */
.mp-live-score {
    position: fixed; top: 10px; right: 10px; z-index: 9500;
    width: 280px; padding: 10px 14px;
    background: rgba(0,0,0,0.85); border: 1px solid rgba(0,212,255,0.2);
    border-radius: 10px; backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0,212,255,0.08);
}
.mp-live-title { font-family: 'Rajdhani', sans-serif; font-size: 11px; font-weight: 700; color: #888; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.mp-live-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12px; }
.mp-live-row.mp-live-me { color: #00d4ff; }
.mp-live-pos { font-family: 'Rajdhani', sans-serif; font-weight: 700; width: 20px; }
.mp-live-name { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-live-combo { font-size: 10px; color: #a855f7; min-width: 30px; }
.mp-live-bar-bg { width: 40px; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.mp-live-bar { height: 100%; background: linear-gradient(90deg, #00d4ff, #0088ff); border-radius: 2px; transition: width 0.5s ease; }
.mp-live-score-num { font-family: 'Rajdhani', sans-serif; font-weight: 700; color: #00d4ff; min-width: 60px; text-align: right; }

/* ============ RESULTS ============ */
.mp-results { max-width: 600px; margin: 40px auto; padding: 20px; }
.mp-results-title { font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700; text-align: center; letter-spacing: 3px; color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,0.3); margin-bottom: 20px; }
.mp-result-row {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-radius: 12px; margin-bottom: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    opacity: 0; animation: mpResultReveal 0.6s ease-out forwards;
}
@keyframes mpResultReveal {
    0% { transform: translateY(30px) scale(0.95); opacity: 0; }
    60% { transform: translateY(-3px) scale(1.01); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.mp-result-winner { border-color: rgba(255,215,0,0.3) !important; background: rgba(255,215,0,0.06) !important; }
.mp-r-pos { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 700; width: 36px; text-align: center; }
.mp-r-1 { color: #ffd700; } .mp-r-2 { color: #c0c0c0; } .mp-r-3 { color: #cd7f32; }
.mp-r-name { flex: 1; font-size: 15px; font-weight: 600; color: #eee; }
.mp-r-score { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: #00d4ff; }
.mp-r-combo { font-size: 11px; color: #a855f7; }
.mp-crown { font-size: 24px; animation: mpCrownDrop 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards, mpCrownPulse 2s ease-in-out infinite 1s; }
@keyframes mpCrownDrop { 0%{transform:translateY(-30px) rotate(-20deg);opacity:0;} 60%{transform:translateY(3px) rotate(3deg);opacity:1;} 100%{transform:translateY(0) rotate(0);} }
@keyframes mpCrownPulse { 0%,100%{filter:drop-shadow(0 0 5px gold);} 50%{filter:drop-shadow(0 0 15px gold);} }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .mp-player-slots { grid-template-columns: repeat(2, 1fr); }
    .mp-room-bottom { grid-template-columns: 1fr; }
    .mp-live-score { width: 220px; font-size: 11px; }
    .mp-lobby-header { flex-direction: column; text-align: center; }
}
