/* ═══════════════════════════════════════════════════════ */
/* Room Browser — Multiplayer Room List + Create          */
/* ═══════════════════════════════════════════════════════ */

.room-browser-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.room-browser {
    background: #1A1E28;
    border: 1px solid #333;
    border-radius: 12px;
    min-width: 380px;
    max-width: 460px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* ── Header ── */
.rb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a40;
}

.rb-header h2 {
    margin: 0;
    color: #e0e0e0;
    font-size: 18px;
}

.rb-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.rb-close:hover {
    color: #fff;
}

/* ── Body ── */
.rb-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

/* ── Notice (not logged in) ── */
.rb-notice {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.rb-login-btn {
    display: block;
    width: 100%;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.rb-login-btn:hover {
    background: #5a52d5;
}

/* ── Actions bar ── */
.rb-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.rb-refresh,
.rb-create {
    flex: 1;
    padding: 8px 0;
    border: 1px solid #444;
    border-radius: 6px;
    background: #0f0f23;
    color: #c0c0c0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.rb-refresh:hover,
.rb-create:hover {
    border-color: #6c63ff;
    color: #e0e0e0;
}

.rb-create {
    border-color: #6c63ff;
    color: #6c63ff;
}

.rb-create:hover {
    background: #6c63ff;
    color: #fff;
}

/* ── Room list ── */
.rb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-loading,
.rb-empty {
    color: #777;
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}

.rb-room {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #0f0f23;
    border: 1px solid #2a2a40;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.rb-room:hover {
    border-color: #444;
}

.rb-room-name {
    flex: 1;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rb-room-info {
    display: flex;
    gap: 8px;
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

.rb-join {
    padding: 5px 14px;
    border: 1px solid #6c63ff;
    border-radius: 4px;
    background: transparent;
    color: #6c63ff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.rb-join:hover:not(:disabled) {
    background: #6c63ff;
    color: #fff;
}

.rb-join:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
}

/* ── Current room bar ── */
.rb-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #2a2a40;
    background: #12122a;
}

.rb-current span {
    color: #aaa;
    font-size: 13px;
}

.rb-leave {
    padding: 5px 12px;
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    background: transparent;
    color: #ff6b6b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.rb-leave:hover {
    background: #ff6b6b;
    color: #fff;
}

/* ── Create form ── */
.rb-create-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rb-input {
    background: #0f0f23;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 13px;
    color: #e0e0e0;
    outline: none;
    transition: border-color 0.2s;
}

.rb-input:focus {
    border-color: #6c63ff;
}

.rb-input::placeholder {
    color: #666;
}

select.rb-input {
    cursor: pointer;
}

select.rb-input option {
    background: #0f0f23;
    color: #e0e0e0;
}

.rb-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.rb-btn-cancel,
.rb-btn-confirm {
    flex: 1;
    padding: 9px 0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.rb-btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
}

.rb-btn-cancel:hover {
    border-color: #888;
    color: #e0e0e0;
}

.rb-btn-confirm {
    background: #6c63ff;
    border: none;
    color: #fff;
}

.rb-btn-confirm:hover {
    background: #5a52d5;
}

.rb-error {
    color: #ff6b6b;
    font-size: 13px;
    min-height: 16px;
    text-align: center;
}
