/* ============================================
   LOBBY & HOME SCREEN STYLES
   ============================================ */

/* Screen management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen.hidden {
    display: none;
}

/* ---- HOME SCREEN ---- */
.home-screen {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.home-content {
    text-align: center;
    padding: 2rem;
}

.home-title {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.home-title .title-uno {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-title .title-ludo {
    background: linear-gradient(135deg, #4d96ff, #6bcb77);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 280px;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.home-btn:active {
    transform: translateY(0);
}

.home-btn-primary {
    background: linear-gradient(135deg, #6bcb77, #4d96ff);
    color: #fff;
}

.home-btn-primary:hover {
    background: linear-gradient(135deg, #5ab868, #3d86ef);
}

.home-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.home-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
}

.home-btn-icon {
    font-size: 1.4rem;
}

.home-version {
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

/* ---- LOBBY SCREEN ---- */
.lobby-screen {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.lobby-content {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.lobby-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.lobby-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.lobby-back-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.lobby-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.lobby-name-section {
    margin-bottom: 2rem;
}

.lobby-name-section label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lobby-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.lobby-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.lobby-input:focus {
    border-color: rgba(107, 203, 119, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lobby-btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.lobby-btn:active {
    transform: translateY(0);
}

.lobby-btn-create {
    background: linear-gradient(135deg, #6bcb77, #4d96ff);
    color: #fff;
}

.lobby-btn-join {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
    color: #1a1a2e;
    flex-shrink: 0;
}

.lobby-divider {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.lobby-join-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lobby-input-code {
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
}

.lobby-source-note {
    position: absolute;
    left: 1.5rem;
    bottom: 1.5rem;
    max-width: 360px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(77, 150, 255, 0.35);
    border-radius: 10px;
    background: rgba(10, 24, 52, 0.72);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    line-height: 1.45;
    backdrop-filter: blur(12px);
}

.lobby-source-note a {
    color: #6bcbff;
    font-weight: 700;
    text-decoration: none;
}

.lobby-source-note a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ---- ROOM WAITING SCREEN ---- */
.room-screen {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.room-content {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.room-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.room-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.room-code-display {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.room-code-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.room-code-value {
    color: #fff;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.4em;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
}

.room-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.3rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.room-copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.room-players {
    margin-bottom: 1.5rem;
}

.room-players h3 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.room-player-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.room-player-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 0.95rem;
}

.room-player-list li .player-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.room-player-list li .player-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    margin-left: auto;
}

.room-status {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ---- CPU PLAYER STYLES ---- */
.cpu-add-area {
    margin-top: 0.75rem;
    text-align: center;
}

.cpu-add-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cpu-add-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.cpu-player-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-style: dashed !important;
}

.cpu-tag {
    display: inline-block;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cpu-remove-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    margin-left: auto;
    transition: all 0.2s;
    border-radius: 4px;
}

.cpu-remove-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.12);
}

.room-start-btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #6bcb77, #4d96ff);
    color: #fff;
    margin-top: 1rem;
}

.room-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(107, 203, 119, 0.35);
}

.room-start-btn:active {
    transform: translateY(0);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .home-title {
        font-size: 3rem;
    }

    .home-btn {
        width: 240px;
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }

    .lobby-content,
    .room-content {
        padding: 1.5rem;
    }

    .lobby-source-note {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
        font-size: 0.78rem;
    }

    .room-code-value {
        font-size: 2.2rem;
    }
}
