/* =========================================================
   LOBBY SCREEN
   ========================================================= */

.hidden { display: none !important; }

#dashboard-hero { overflow: hidden; }
#dashboard-hero::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: min(47%, 430px);
    background: linear-gradient(90deg, rgba(8,16,28,1), rgba(8,16,28,.06)), url("../images/draughts-board-3d.png") center / cover no-repeat;
    opacity: .82;
    pointer-events: none;
}
#dashboard-hero .dashboard-hero-content { position: relative; z-index: 1; }
@media (max-width: 700px) { #dashboard-hero::after { width: 100%; opacity: .22; } }
.draughts-room-summary { padding: 11px 13px; border: 1px solid rgba(255,215,0,.24); border-radius: 10px; background: rgba(255,215,0,.07); color: #f4d35e; font-size: 13px; font-weight: 700; }
.draughts-clock-select { margin: 0; }

#lobby {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
    transition: opacity 0.5s ease;
}

#lobby.fade-out {
    opacity: 0;
    pointer-events: none;
}

#lobby-card {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    margin: auto;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

#lobby-logo {
    text-align: center;
    margin-bottom: 26px;
}

#lobby-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 28px;
    font-weight: bold;
    color: gold;
    letter-spacing: 1px;
}

#lobby-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
}

/* Fields */
.field-group {
    margin-bottom: 18px;
}

.field-label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.lobby-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.lobby-input:focus {
    border-color: gold;
}

.lobby-input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* Stake buttons */
#stake-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.stake-btn {
    padding: 9px 4px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s;
}

.stake-btn:hover  { background: rgba(255,215,0,0.1); border-color: gold; }
.stake-btn.active { background: gold; color: #111; border-color: gold; }

#custom-stake-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

/* Player count */
#player-count-options {
    display: flex;
    gap: 10px;
}

.count-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s;
}

.count-btn:hover  { border-color: gold; }
.count-btn.active { background: gold; color: #111; border-color: gold; }

/* Action buttons */
#action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

#join-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.lobby-btn {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.lobby-btn.primary {
    background: gold;
    color: #111;
}

.lobby-btn.primary:hover   { background: #ffd000; transform: scale(1.02); }
.lobby-btn.primary:active  { transform: scale(0.97); }
.lobby-btn.primary:disabled {
    background: rgba(255,215,0,0.25);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
    transform: none;
}

.lobby-btn.secondary {
    background: rgba(255,255,255,0.07);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
}

.lobby-btn.secondary:hover { background: rgba(255,255,255,0.12); }

.lobby-btn.ghost {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    width: 100%;
}

.lobby-btn.ghost:hover { color: white; border-color: rgba(255,255,255,0.3); }

/* Waiting room */
#room-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

#room-code-display {
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 6px;
    color: gold;
    margin-top: 4px;
}

#copy-code-btn {
    background: rgba(255,215,0,0.15);
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.1s;
}

#copy-code-btn:hover  { transform: scale(1.1); }
#copy-code-btn:active { transform: scale(0.95); }

#stake-info-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

#stake-info-bar strong { color: white; }

/* Player slots */
#player-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 14px;
}

.slot-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.slot-dot.filled { border: none; }

.slot-name { color: rgba(255,255,255,0.4); flex: 1; }
.slot-name.filled { color: white; font-weight: bold; }

.slot-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,215,0,0.15);
    color: gold;
}

/* Payout info */
#payout-info {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

#payout-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.payout-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.payout-row span:last-child { color: gold; font-weight: bold; }

/* Compact lobby for short phone screens */
@media (max-height: 700px) {
    #lobby { padding: 10px; }
    #lobby-card { padding: 16px 18px; }
    #lobby-logo { margin-bottom: 12px; }
    #lobby-title { font-size: 22px; }
    #lobby-sub { margin-top: 2px; }
    .field-group { margin-bottom: 10px; }
    .field-label { margin-bottom: 4px; }
    .lobby-input { padding: 8px 12px; font-size: 14px; }
    #stake-options { gap: 5px; margin-bottom: 6px; }
    .stake-btn { padding: 6px 4px; font-size: 12px; }
    .count-btn { padding: 7px; font-size: 14px; }
    .lobby-btn { padding: 9px 12px; font-size: 13px; }
    #room-info-box { padding: 10px 12px; margin-bottom: 10px; }
    #room-code-display { font-size: 22px; letter-spacing: 4px; }
    #stake-info-bar { padding: 7px 12px; margin-bottom: 10px; }
    .player-slot { padding: 7px 12px; font-size: 13px; }
    #player-slots { gap: 5px; margin-bottom: 10px; }
    #payout-info { padding: 8px 12px; margin-bottom: 12px; }
    #action-row { margin-bottom: 8px; }
}

.brand-logo-lobby {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 7px 14px rgba(255,190,0,.2));
}

@media (max-width: 480px) {
    #lobby { padding: 12px; }
    #lobby-card { padding: 20px 16px; border-radius: 16px; }
    #lobby-logo { margin-bottom: 16px; }
    #lobby-title { font-size: 23px; }
    #start-game-btn, #back-to-dash-btn { min-height: 44px; }
}

#start-game-btn.match-start-countdown,
.mq-continue.match-start-countdown,
[data-lp-start].match-start-countdown {
    animation: match-start-pulse .72s ease-in-out infinite alternate;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, .25), 0 0 22px rgba(255, 215, 0, .38);
}

@keyframes match-start-pulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.018); filter: brightness(1.18); }
}

@media (prefers-reduced-motion: reduce) {
    #start-game-btn.match-start-countdown,
    .mq-continue.match-start-countdown,
    [data-lp-start].match-start-countdown { animation: none; }
}

