/* RESET */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: url("../img/cp_bg1.jpg") no-repeat center center fixed;
    background-size: cover;
    font-family: "Orbitron", Arial, sans-serif;
    color: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 1;
}

body > * {
    position: relative;
    z-index: 2;
}

/* INTRO SCREEN */
#intro-screen {
    position: fixed;
    inset: 0;
    background: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 1s ease forwards;
    animation-delay: 3s;
}

#intro-logo {
    width: 600px;
    height: auto;
    margin-bottom: 20px;
    transform: scale(3);
    animation: logoZoom 1.5s ease forwards;
}

#intro-title {
    color: #00ffe1;
    font-size: 48px;
    letter-spacing: 6px;
    text-shadow: 0 0 20px #00ffe1;
    transform: scale(2);
    animation: titleZoom 1.5s ease forwards;
}

/* ANIMACIONES */
@keyframes logoZoom {
    to {
        transform: scale(1);
    }
}

@keyframes titleZoom {
    to {
        transform: scale(1);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* SELECCIÓN */
.hidden {
    display: none;
}

/* LOGO */
.logo {
    width: 400px;
    display: block;
    margin: 0 auto;
    margin-bottom: 50px;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.7));
}

/* PERSONAJES */
.characters {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 30px 0;
}

/* CARTAS */
.card {
    width: 260px;
    height: 375px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform-origin: center;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card.rotated .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.7);
}

.card-face.back {
    transform: rotateY(180deg);
}

/* SELECCIÓN */
.card.selected .card-face {
    box-shadow: 0 0 14px yellow;
    border: 1px solid yellow;
}

/* NOMBRE */
.info {
    display: block;
    text-align: center;
    margin-top: 50px;
    font-size: 14px;
    letter-spacing: 1px;
    color: #c084fc;
}

/* DATOS */
.game-data {
    margin-top: 50px;
    text-align: center;
}

input {
    width: 100%;
    max-width: 350px;
    padding: 16px;
    background: #020617;
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #e5e7eb;
    font-size: 18px;
    letter-spacing: 2px;
    outline: none;
    text-align: center;
    font-family: "Orbitron", Arial, sans-serif;
    transition: all 0.3s ease;
}

input::placeholder {
    color: #6b7280;
}

input:focus {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

/* BOTÓN */
button {
    padding: 16px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    color: #020617;
    font-size: 18px;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
    transition: all 0.3s ease;
    font-family: "Orbitron", Arial, sans-serif;
    font-weight: bold;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 45px rgba(168, 85, 247, 0.9);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== NUEVA INTERFAZ CON 3 JUGADORES ===== */

/* PANTALLA DE ENTRADA A SALA - FLUJO PASO A PASO */
.room-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
}

/* PASOS */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 360px;
    animation: slideIn 0.4s ease forwards;
}

.step.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PASO 1: Nombre */
#step1-name {
    gap: 15px;
}

/* PASO 2: Elegir modo */
#step2-mode {
    gap: 20px;
}

.step-label {
    font-size: 18px;
    letter-spacing: 2px;
    color: #c084fc;
    text-align: center;
    margin-bottom: 15px;
}

.mode-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.mode-choice-btn {
    width: 160px;
    padding: 16px 20px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: "Orbitron", Arial, sans-serif;
    font-weight: bold;
}

.mode-choice-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.mode-choice-btn:active {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-color: #a855f7;
    color: #020617;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
    transform: translateY(0);
}

/* PASO 3A: Crear sala */
#step3-create {
    gap: 20px;
}

/* PASO 3B: Unirse a sala */
#step3-join {
    gap: 20px;
}

.room-code-display {
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    width: 100%;
}

.room-code-display p {
    margin: 5px 0;
    font-size: 12px;
    color: #9333ea;
    letter-spacing: 1px;
}

.room-code-big {
    display: block;
    font-size: 36px;
    color: #00ffe1;
    letter-spacing: 6px;
    margin: 15px 0;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 225, 0.5);
}

.copy-hint {
    font-size: 11px;
    color: #c084fc;
    margin-top: 10px;
}

.room-actions {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    width: 100%;
    max-width: 350px;
    padding: 14px 20px;
}

.action-btn.small {
    width: auto;
    padding: 8px 16px;
    font-size: 12px;
}

.action-btn.large {
    width: 100%;
    max-width: 350px;
}

.back-btn {
    width: 140px;
    padding: 12px 14px;
    background: rgba(100, 100, 100, 0.2);
    border: 1px solid rgba(100, 100, 100, 0.4);
    color: #9ca3af;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: "Orbitron", Arial, sans-serif;
    margin-top: 10px;
    font-weight: bold;
}

.back-btn:hover {
    background: rgba(100, 100, 100, 0.3);
    border-color: rgba(100, 100, 100, 0.6);
    color: #d1d5db;
    transform: translateY(-2px);
}

.back-btn:active {
    transform: translateY(1px);
}

.room-status {
    padding: 12px 20px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
}

.room-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.room-status.waiting {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #d8b4fe;
}

.room-status.success {
    background: rgba(134, 239, 172, 0.1);
    border: 1px solid rgba(134, 239, 172, 0.5);
    color: #86efac;
}

/* PANTALLA DE ESPERA EN SALA */
.wait-room {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.wait-room h2 {
    font-size: 28px;
    letter-spacing: 3px;
    color: #a855f7;
}

.players-waiting {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
}

.player-spot {
    width: 110px;
    height: 110px;
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-size: 13px;
}

.player-spot:hover {
    border-color: rgba(168, 85, 247, 0.8);
    background: rgba(168, 85, 247, 0.1);
}

.player-status {
    font-size: 13px;
    letter-spacing: 1px;
    color: #c084fc;
    text-align: center;
    word-break: break-word;
    padding: 8px;
    transition: all 0.3s ease;
}

.waitingMessage {
    font-size: 14px;
    letter-spacing: 1px;
    color: #9333ea;
}

.wait-room-code {
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.wait-room-code .code-label {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #9333ea;
    letter-spacing: 1px;
}

.wait-room-code .room-code-big {
    display: block;
    font-size: 32px;
    color: #00ffe1;
    letter-spacing: 4px;
    margin: 10px 0;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 225, 0.5);
}

/* PANTALLA DE SELECCIÓN DE PERSONAJE */
.character-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.character-selection h2 {
    font-size: 28px;
    letter-spacing: 3px;
    color: #a855f7;
    margin-bottom: 10px;
}

.other-players-status {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    min-height: 60px;
    flex-wrap: nowrap;
    align-items: center;
}

.other-player-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    transition: all 0.3s ease;
    min-width: auto;
    white-space: nowrap;
}

.other-player-status .player-id {
    font-size: 11px;
}

.other-player-status .selected-character {
    font-size: 12px;
}

.player-id {
    font-size: 12px;
    color: #d8b4fe;
    letter-spacing: 1px;
}

.selected-character {
    font-size: 14px;
    color: #a855f7;
    font-weight: bold;
    letter-spacing: 2px;
}

#character-selection-screen .card {
    opacity: 1;
    transition: opacity 0.3s;
}

#character-selection-screen .card.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#character-selection-screen .card.selected .card-face {
    box-shadow: 0 0 20px #a855f7;
    border: 2px solid #a855f7;
}

.character-name {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    letter-spacing: 2px;
    color: #c084fc;
    text-align: center;
}

.ready-btn {
    margin-top: 20px;
    width: 260px;
}

/* PANTALLA DE ESPERA FINAL */
.wait-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.wait-ready h2 {
    font-size: 28px;
    letter-spacing: 3px;
    color: #a855f7;
}

.ready-status {
    display: flex;
    gap: 30px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.ready-indicator {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: all 0.3s ease, transform 0.2s ease;
}

.ready-indicator.waiting {
    color: #9333ea;
    animation: pulse-indicator 1s ease-in-out infinite;
}

.ready-indicator.ready {
    color: #86efac;
    border-color: #86efac;
    box-shadow: 0 0 20px rgba(134, 239, 172, 0.5);
    transform: scale(1.05);
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.loading-text {
    font-size: 14px;
    letter-spacing: 1px;
    color: #c084fc;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ===== SELECCIÓN DE PERSONAJE - OTROS JUGADORES ===== */
#otherPlayersContainer {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 15px 0;
    min-height: 60px;
}

.other-player-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease forwards;
}

.other-player-status:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.other-player-status.own-selection {
    background: rgba(0, 255, 225, 0.1);
    border-color: rgba(0, 255, 225, 0.5);
    box-shadow: inset 0 0 12px rgba(0, 255, 225, 0.2);
}

.other-player-status.own-selection:hover {
    background: rgba(0, 255, 225, 0.15);
    border-color: rgba(0, 255, 225, 0.7);
    box-shadow: inset 0 0 16px rgba(0, 255, 225, 0.3), 0 4px 12px rgba(0, 255, 225, 0.3);
}

.player-id {
    font-size: 14px;
    font-weight: bold;
    color: #d8b4fe;
    letter-spacing: 1px;
}

.selected-character {
    font-size: 12px;
    color: #00ffe1;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 225, 0.5);
}

/* ===== PANTALLA DE ESPERA - CHECKMARKS ===== */
#readyStatusContainer {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
    min-height: 50px;
}

.ready-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid;
    transition: all 0.4s ease;
    animation: slideIn 0.5s ease forwards;
}

.ready-indicator.waiting {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
    animation: pulse 1.5s ease-in-out infinite;
}

.ready-indicator.ready {
    background: rgba(0, 255, 225, 0.2);
    border-color: #00ffe1;
    color: #00ffe1;
    box-shadow: 0 0 12px rgba(0, 255, 225, 0.5);
    animation: slideIn 0.5s ease forwards;
}

/* ===== TRANSICIONES SUAVES ENTRE PANTALLAS ===== */
.terminal {
    animation: fadeIn 0.5s ease forwards;
}

.terminal.hidden {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

/* ===== NOTIFICACIONES (TOAST) ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 20, 35, 0.95);
    border: 2px solid;
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    font-size: 14px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease forwards;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.toast.success {
    border-color: #00ffe1;
    color: #00ffe1;
}

.toast.error {
    border-color: #ff4757;
    color: #ff9999;
}

.toast.info {
    border-color: #c084fc;
    color: #d8b4fe;
}

.toast.warning {
    border-color: #ffa502;
    color: #ffb347;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.toast-close:hover {
    transform: scale(1.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast.removing {
    animation: slideOutRight 0.3s ease forwards;
}

/* ===== CÍRCULOS DE AYUDA ===== */
.help-icons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.help-icon-btn {
    width: auto;
    height: auto;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 24px;
    color: #8b5cf6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.help-icon-btn:hover {
    color: #a78bfa;
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.6));
}

/* ===== MODALES ===== */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s ease forwards;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(15, 15, 25, 0.98);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    padding: 25px 30px;
    max-width: 650px;
    width: 90vw;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(10px);
}

.modal-content h2 {
    color: #00ffe1;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 255, 225, 0.3);
}

.modal-content h3 {
    color: #a78bfa;
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.modal-body {
    color: #e5e7eb;
    line-height: 1.8;
    font-size: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Scrollbar personalizada para modales */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.8);
}

.modal-body p {
    margin: 12px 0;
}

.modal-body ul, .modal-body ol {
    margin: 15px 0;
    padding-left: 25px;
}

.modal-body li {
    margin: 10px 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #8b5cf6;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #ff4757;
    transform: scale(1.15);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== GRID DE SÍMBOLOS ===== */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
}

.symbol-option {
    aspect-ratio: 1;
    border: 2px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.05);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d8b4fe;
    min-width: 36px;
    min-height: 36px;
}

.symbol-option:hover {
    border-color: rgba(0, 255, 225, 0.6);
    background: rgba(0, 255, 225, 0.1);
    transform: scale(1.05);
    color: #00ffe1;
}

.symbol-option.selected {
    border-color: #00ffe1;
    background: rgba(0, 255, 225, 0.2);
    box-shadow: 0 0 12px rgba(0, 255, 225, 0.5);
    color: #00ffe1;
}

/* ===== OVERLAY PARA MODALES ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.3s ease forwards;
}

.modal-overlay.hidden {
    display: none;
}

/* ===== FIX V5 ACTUALIZADO: SELECCIÓN DE PERSONAJE EQUILIBRADA ===== */

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#character-selection-screen {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

#character-selection-screen.terminal {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

#character-selection-screen.hidden {
    display: none;
}

#character-selection-screen .character-selection {
    width: min(1200px, 94vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    padding: clamp(42px, 6vh, 68px) clamp(20px, 4vw, 56px) clamp(18px, 3vh, 28px);
    gap: clamp(8px, 1.2vh, 14px);
}

/* TÍTULO */
#character-selection-screen .character-selection h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3.6vh, 2.7rem);
    line-height: 1;
    letter-spacing: clamp(5px, 0.8vw, 10px);
    text-align: center;
    margin-bottom: clamp(6px, 0.8vh, 10px);
}

/* CONTENEDOR INLINE DEL BOTÓN PERSONALIZAR */
#character-selection-screen .character-selection > div[style] {
    margin: 0 !important;
}

/* BOTÓN PERSONALIZAR */
#character-selection-screen .action-btn.small {
    padding: clamp(10px, 1.3vh, 13px) clamp(28px, 3.2vw, 42px);
    font-size: clamp(0.72rem, 1.35vh, 0.92rem);
    letter-spacing: 3px;
}

/* SUBTÍTULO */
#character-selection-screen .step-label {
    margin: 0;
    margin-top: clamp(4px, 0.6vh, 8px);
    font-size: clamp(0.86rem, 1.7vh, 1.04rem);
    line-height: 1.2;
    letter-spacing: 2px;
    text-align: center;
}

/* ESTADO OTROS JUGADORES */
#character-selection-screen .other-players-status {
    width: min(800px, 78vw);
    min-height: clamp(44px, 5.5vh, 64px);
    max-height: clamp(48px, 6.5vh, 72px);

    margin: clamp(14px, 2vh, 18px) 0 clamp(8px, 1vh, 12px);
    padding: clamp(7px, 1vh, 10px) clamp(14px, 2vw, 22px);

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(168, 85, 247, 0.22);
    border-radius: 8px;

    overflow: hidden;
}

/* Mantiene visible la caja aunque no haya selección, pero sin recuadro interno */
#character-selection-screen .other-players-status:has(#otherPlayersContainer:empty) {
    display: flex;
    opacity: 1;
}

#character-selection-screen #otherPlayersContainer {
    margin: 0;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 1.4vw, 18px);
    flex-wrap: wrap;
}

#character-selection-screen .other-player-status {
    padding: clamp(7px, 1vh, 10px) clamp(12px, 1.8vw, 18px);
    gap: 4px;
    min-width: 96px;
}

#character-selection-screen .player-id,
#character-selection-screen .selected-character {
    font-size: clamp(0.68rem, 1.15vh, 0.84rem);
}

/* CARTAS */
#character-selection-screen .characters {
    width: 100%;
    margin: clamp(10px, 1.4vh, 16px) 0 0;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(44px, 5vw, 78px);

    overflow: visible;
}

#character-selection-screen .card {
    width: auto;
    height: clamp(360px, 51vh, 520px);
    aspect-ratio: 260 / 375;
    flex: 0 0 auto;
}

#character-selection-screen .card-inner,
#character-selection-screen .card-face {
    width: 100%;
    height: 100%;
}

#character-selection-screen .card-face {
    object-fit: cover;
}

/* BOTÓN LISTO */
#character-selection-screen .ready-btn {
    width: clamp(220px, 22vw, 320px);
    margin-top: clamp(34px, 5vh, 58px);
    padding: clamp(11px, 1.5vh, 15px) 20px;

    font-size: clamp(0.88rem, 1.45vh, 1rem);
    letter-spacing: 4px;
}

/* ===== FIX MODAL PERSONALIZAR FICHA - GLOW SIN CORTES ===== */

#customizeModal {
    overflow: visible;
    max-height: none;
}

#customizeModal .modal-content {
    overflow: visible;
    padding: 32px 38px 44px;
}

#customizeModal .modal-body {
    overflow: visible;
    max-height: none;
    padding: 0 8px 18px;
}

/* Caja de símbolos: damos aire para que el glow no choque con el borde */
#customizeModal .symbol-grid {
    margin: 22px 0 26px;
    padding: 10px 6px 16px;
    gap: 12px;
    overflow: visible;
}

#customizeModal .symbol-option {
    overflow: visible;
}

/* Símbolo seleccionado */
#customizeModal .symbol-option.selected {
    border-color: #00ffe1;
    background: rgba(0, 255, 225, 0.18);
    color: #00ffe1;
    box-shadow:
        0 0 14px rgba(0, 255, 225, 0.65),
        0 0 28px rgba(0, 255, 225, 0.28);
}

/* Display del símbolo seleccionado */
#customizeModal #selectedSymbolDisplay {
    margin: 12px 0 28px;
    overflow: visible;
}

/* Botón confirmar con espacio suficiente abajo */
#customizeModal #confirmSymbolBtn {
    margin-top: 18px;
    margin-bottom: 12px;
    box-shadow:
        0 0 26px rgba(168, 85, 247, 0.6),
        0 0 48px rgba(168, 85, 247, 0.28);
}

/* RESPONSIVE ALTURAS MEDIAS */
@media (max-height: 820px) {
    #character-selection-screen .character-selection {
        padding-top: clamp(32px, 4.8vh, 48px);
        gap: 8px;
    }

    #character-selection-screen .character-selection h2 {
        font-size: 1.75rem;
    }

    #character-selection-screen .other-players-status {
        margin-top: 12px;
        margin-bottom: 8px;
        min-height: 42px;
        max-height: 58px;
    }

    #character-selection-screen .characters {
        gap: clamp(34px, 4.2vw, 58px);
    }

    #character-selection-screen .card {
        height: clamp(320px, 47vh, 430px);
    }

    #character-selection-screen .ready-btn {
        margin-top: clamp(28px, 4vh, 42px);
    }
}

/* RESPONSIVE ALTURAS BAJAS */
@media (max-height: 700px) {
    #character-selection-screen .character-selection {
        padding-top: 24px;
        gap: 6px;
    }

    #character-selection-screen .character-selection h2 {
        font-size: 1.45rem;
    }

    #character-selection-screen .step-label {
        font-size: 0.78rem;
    }

    #character-selection-screen .other-players-status {
        min-height: 38px;
        max-height: 48px;
        margin-top: 10px;
        margin-bottom: 6px;
    }

    #character-selection-screen .card {
        height: clamp(270px, 43vh, 350px);
    }

    #character-selection-screen .ready-btn {
        margin-top: 24px;
    }
}