/* =====================================================================
   lobby.css — Lobby (waiting room), match creation & results styling.
   ===================================================================== */

.page-lobby {
    padding: 24px 16px 40px;
    display: flex;
    justify-content: center;
}
.lobby-wrap {
    width: 100%;
    max-width: 540px;
}

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.lobby-eyebrow {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ivory-dim);
}
.room-code {
    font-size: 34px;
    letter-spacing: 0.12em;
    margin: 0;
    color: var(--gold-400);
}

.lobby-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-game-mode {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(232, 194, 95, 0.15);
    border: 1px solid rgba(232, 194, 95, 0.4);
    color: var(--gold-400);
}
.badge-mode--ind {
    background: rgba(255, 140, 70, 0.18);
    border-color: rgba(255, 140, 70, 0.5);
    color: #ffaa77;
}

.matchmaking-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(8, 38, 28, 0.95), rgba(4, 20, 14, 0.95));
    border: 1px solid rgba(80, 227, 194, 0.4);
    box-shadow: 0 0 20px rgba(80, 227, 194, 0.15), inset 0 0 12px rgba(80, 227, 194, 0.05);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 12px 0 16px;
    backdrop-filter: blur(8px);
}
.matchmaking-status-card.matchmaking-status--full {
    border-color: rgba(232, 194, 95, 0.5);
    box-shadow: 0 0 20px rgba(232, 194, 95, 0.2);
}

.radar-pulse-ring {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.radar-icon {
    font-size: 20px;
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(80, 227, 194, 0.8));
    animation: radarFloat 2.5s ease-in-out infinite;
}
.radar-circle {
    position: absolute;
    border: 1.5px solid rgba(80, 227, 194, 0.6);
    border-radius: 50%;
    animation: radarPulse 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
    pointer-events: none;
}
.circle-1 { width: 100%; height: 100%; animation-delay: 0s; }
.circle-2 { width: 100%; height: 100%; animation-delay: 0.8s; }
.circle-3 { width: 100%; height: 100%; animation-delay: 1.6s; }

@keyframes radarPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}
@keyframes radarFloat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.matchmaking-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.matchmaking-info strong {
    font-size: 14px;
    color: #50e3c2;
    letter-spacing: 0.02em;
}
.matchmaking-info p {
    font-size: 12.5px;
    color: var(--ivory-dim);
    margin: 0;
}
#matchmaking-seated-count {
    font-weight: 700;
    color: var(--gold-400);
}

.seats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0;
}

.seat-card {
    background: rgba(5, 26, 18, 0.82);
    border: 1px solid rgba(232, 194, 95, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 14px;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
}
.seat-card.seat-card--empty {
    border-style: dashed;
    border-color: rgba(246, 241, 228, 0.2);
    align-items: center;
    justify-content: center;
    color: var(--ivory-dim);
    font-size: 13.5px;
    background: rgba(3, 16, 11, 0.4);
}
.empty-seat-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.seat-card.seat-card--team-a { border-left: 4px solid var(--team-a-color, #5da0ff); }
.seat-card.seat-card--team-b { border-left: 4px solid var(--gold-500); }
.seat-card.seat-card--player-0 { border-left: 4px solid #5da0ff; }
.seat-card.seat-card--player-1 { border-left: 4px solid #f3c250; }
.seat-card.seat-card--player-2 { border-left: 4px solid #50e3c2; }
.seat-card.seat-card--player-3 { border-left: 4px solid #e26df3; }
.seat-card.seat-card--me { box-shadow: 0 0 0 2px var(--gold-400) inset, var(--shadow-soft); }
.seat-card.seat-card--bot { background: rgba(8, 38, 28, 0.85); }

.seat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.seat-team-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ivory-dim);
}
.remove-bot-btn {
    background: rgba(224, 69, 90, 0.2);
    border: 1px solid rgba(224, 69, 90, 0.4);
    color: #ffadb8;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.remove-bot-btn:hover {
    background: rgba(224, 69, 90, 0.4);
    transform: scale(1.1);
}

.seat-nickname {
    font-size: 17px;
    font-weight: 700;
    color: var(--ivory);
    margin: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seat-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.seat-badge {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(246, 241, 228, 0.1);
    color: var(--ivory-dim);
    font-weight: 600;
}
.seat-badge--bot { background: rgba(93, 160, 255, 0.25); color: #8ec3ff; border: 1px solid rgba(93, 160, 255, 0.4); }
.seat-badge--host { background: rgba(232, 194, 95, 0.25); color: var(--gold-400); border: 1px solid rgba(232, 194, 95, 0.4); }
.seat-badge--ready { background: rgba(90, 200, 130, 0.25); color: #8fd6a8; border: 1px solid rgba(90, 200, 130, 0.4); }
.seat-badge--waiting { background: rgba(246, 241, 228, 0.08); }
.seat-badge--offline { background: rgba(224, 69, 90, 0.25); color: #ffadb8; }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.bot-control-bar {
    margin-bottom: 12px;
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-top: 8px;
}
.ready-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ivory);
    padding: 13px 16px;
    background: rgba(5, 26, 18, 0.82);
    border: 1px solid rgba(246, 241, 228, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}
.ready-toggle:hover { border-color: var(--gold-400); }
.ready-toggle input { width: 22px; height: 22px; accent-color: var(--gold-500); cursor: pointer; }

.lobby-hint { text-align: center; font-size: 13px; margin-top: 12px; }

/* --- Roster & Mode Selection (create-room.php) --- */
.roster-grid, .mode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.roster-card, .mode-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(3, 16, 11, 0.6);
    border: 1px solid rgba(246, 241, 228, 0.18);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.roster-card:hover, .mode-card:hover {
    border-color: var(--gold-400);
    background: rgba(5, 26, 18, 0.8);
}
.roster-card input, .mode-card input {
    margin-top: 3px;
    accent-color: var(--gold-500);
    cursor: pointer;
}
.roster-content, .mode-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.roster-content strong, .mode-content strong {
    font-size: 14px;
    color: var(--ivory);
}
.roster-content span, .mode-content span {
    font-size: 12px;
    color: var(--ivory-dim);
}

.custom-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(246, 241, 228, 0.2);
    background: rgba(2, 14, 10, 0.8);
    color: var(--ivory);
    outline: none;
    cursor: pointer;
}
.custom-select:focus {
    border-color: var(--gold-400);
}

.play-options-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 16px 0 20px;
}
.option-pill {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(246, 241, 228, 0.08);
    border: 1px solid rgba(232, 194, 95, 0.25);
    border-radius: 999px;
    color: var(--gold-400);
}

/* --- Result page --- */
.result-card { text-align: center; }
.final-scores { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.final-scores--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.score-pill {
    flex: 1;
    background: rgba(246, 241, 228, 0.06);
    border: 1px solid rgba(246, 241, 228, 0.15);
    border-radius: var(--radius-md);
    padding: 14px 10px;
}
.score-pill--winner {
    border-color: var(--gold-400);
    box-shadow: 0 0 0 1px var(--gold-400) inset, 0 0 20px rgba(232, 194, 95, 0.3);
}
.score-pill .score-label { display: block; font-size: 11px; color: var(--ivory-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.score-pill .score-value { display: block; font-size: 28px; font-weight: 700; color: var(--gold-400); font-family: var(--font-display); }
.score-pill .bag-count { display: block; font-size: 10.5px; color: var(--ivory-dim); margin-top: 2px; }

.history-heading { font-size: 16px; margin-top: 24px; text-align: left; }
.hand-history-list { display: flex; flex-direction: column; gap: 8px; text-align: left; max-height: 260px; overflow-y: auto; }
.hand-history-row {
    display: flex;
    gap: 12px;
    background: rgba(246, 241, 228, 0.05);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12.5px;
}
.hand-history-num { font-weight: 700; color: var(--gold-400); min-width: 56px; }
.hand-history-detail { color: var(--ivory-dim); line-height: 1.6; }

.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

@media (min-width: 520px) {
    .seats-grid { grid-template-columns: repeat(2, 1fr); }
    .roster-grid, .mode-grid { grid-template-columns: repeat(2, 1fr); }
}
