:root {
    --nc-base:   #10b981;
    --nc-accent: #06b6d4;
}

* { font-family: 'Space Grotesk', sans-serif; }
.f-display { font-family: 'Rajdhani', sans-serif; }

/* ── Screens ── */
.screen { display: none; }
.screen.activo { display: flex; flex-direction: column; }
#resultadoRonda { display: none; }
#resultadoRonda.visible {
    display: block;
    animation: slideUp .38s cubic-bezier(.16,1,.3,1) both;
}

/* ── Background ── */
body {
    background-color: #0a0a0a;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(16,185,129,.14) 0%, transparent 28%),
        radial-gradient(circle at 80% 70%, rgba(6,182,212,.14) 0%, transparent 28%),
        radial-gradient(ellipse 80% 55% at 10% 5%,  rgba(16,185,129,.04) 0%, transparent 60%),
        radial-gradient(ellipse 80% 55% at 90% 95%, rgba(124,58,237,.03) 0%, transparent 60%);
}
.z-up { position: relative; z-index: 2; }

/* ── Particles canvas ── */
#particlesCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ── Neon cursor ── */
.neon-cursor {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--nc-base);
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    filter: blur(1px);
    opacity: .7;
    transition: transform .15s ease, background .15s ease;
}
.neon-cursor::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--nc-accent);
    mix-blend-mode: screen;
    animation: cursorPulse 2s ease-in-out infinite;
}
@keyframes cursorPulse {
    0%,100% { opacity: .6; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.4); }
}

/* ── Glow card ── */
.glow-card {
    box-shadow:
        0 0 12px rgba(16,185,129,.18),
        0 0 28px rgba(6,182,212,.1),
        0 0 0 1px rgba(255,255,255,.06),
        0 20px 60px rgba(0,0,0,.55) !important;
    backdrop-filter: blur(14px);
}

/* ── Player grid ── */
#jugadoresContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: .625rem;
    margin-bottom: 1rem;
}

/* ── Player card ── */
.jugador-card {
    background: rgba(255,255,255,.025);
    border: 1.5px solid rgba(16,185,129,.15);
    border-radius: .875rem;
    padding: .75rem .5rem .6rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .375rem;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.jugador-card:hover {
    border-color: rgba(16,185,129,.28);
}
.jugador-card.card-winner {
    border-color: rgba(251,191,36,.45);
    background: rgba(251,191,36,.04);
    box-shadow: 0 0 22px rgba(251,191,36,.1);
}
.jugador-card.card-winner .jugador-nombre {
    color: #fbbf24;
}

.jugador-nombre {
    color: rgba(110,231,183,.8);
    font-weight: 600;
    font-size: .75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    transition: color .25s;
}

.jugador-puntos {
    color: rgba(255,255,255,.38);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
}

/* ── Card display area ── */
.carta-display {
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 500px;
}

/* ── Playing card ── */
.carta {
    width: 70px;
    height: 98px;
    border-radius: .5rem;
    background: #f9fafb;
    position: relative;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    box-shadow:
        0 6px 20px rgba(0,0,0,.6),
        0 0 0 .5px rgba(0,0,0,.25),
        inset 0 1px 0 rgba(255,255,255,.9);
    animation: cardReveal .42s cubic-bezier(.16,1,.3,1) both;
    overflow: hidden;
}

.carta::before {
    content: attr(data-valor) " " attr(data-palo);
    position: absolute;
    top: 4px;
    left: 5px;
    font-size: .55rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
}

.carta::after {
    content: attr(data-valor) " " attr(data-palo);
    position: absolute;
    bottom: 4px;
    right: 5px;
    font-size: .55rem;
    font-weight: 800;
    line-height: 1;
    color: inherit;
    transform: rotate(180deg);
}

.carta-center {
    font-size: 1.65rem;
    line-height: 1;
    user-select: none;
}

.carta[data-palo="♥"],
.carta[data-palo="♦"] {
    color: #dc2626;
}

.carta-vacia {
    background: rgba(5,10,7,.7);
    border: 1.5px dashed rgba(16,185,129,.18);
    box-shadow: none;
    animation: none;
    color: transparent;
}
.carta-vacia::before,
.carta-vacia::after { content: none !important; }
.carta-vacia .carta-center { display: none; }

@keyframes cardReveal {
    0%   { opacity: 0; transform: rotateY(90deg) scale(.94); }
    100% { opacity: 1; transform: rotateY(0deg)  scale(1); }
}

/* ── Dynamic inputs ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.form-group label {
    color: rgba(52,211,153,.8);
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-family: 'Space Grotesk', sans-serif;
}
.form-group input {
    background: rgba(8, 25, 18, 0.85) !important;
    border: 1.5px solid rgba(16,185,129,.45) !important;
    border-radius: .75rem;
    padding: .62rem 1rem;
    color: #e2fff4 !important;
    font-family: 'Space Grotesk', sans-serif;
    font-size: .9rem;
    width: 100%;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 0 rgba(16,185,129,0);
    transition: border-color .2s, box-shadow .2s;
}
.form-group input::placeholder { color: rgba(110,231,183,.35) !important; }

select {
    background-color: rgba(8, 25, 18, 0.9) !important;
    color: #e2fff4 !important;
}
select option {
    background-color: #0a1f14;
    color: #e2fff4;
}
.form-group input:focus {
    border-color: rgba(52,211,153,.75) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.5), 0 0 0 3px rgba(16,185,129,.18), 0 0 12px rgba(16,185,129,.12) !important;
}

/* ── Score leaderboard ── */
.leaderboard-title {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: rgba(255,255,255,.22);
    text-align: center;
    margin-bottom: .625rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
}
.puntaje-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: .625rem;
    padding: .45rem .875rem;
    margin-bottom: .3rem;
}
.puntaje-item:first-of-type {
    background: rgba(251,191,36,.05);
    border-color: rgba(251,191,36,.18);
}
.puntaje-item:first-of-type .puntaje-nombre { color: #fbbf24; }
.puntaje-item:first-of-type .puntaje-valor  { color: #fbbf24; }
.puntaje-nombre {
    color: rgba(255,255,255,.55);
    font-weight: 600;
    font-size: .82rem;
    font-family: 'Space Grotesk', sans-serif;
}
.puntaje-valor {
    color: #34d399;
    font-weight: 700;
    font-size: .95rem;
    font-family: 'Rajdhani', sans-serif;
}

/* ── Deal button ── */
.btn-repartir {
    background: linear-gradient(155deg, #065f46 0%, #064e3b 100%);
    border: 1.5px solid rgba(16,185,129,.35);
    box-shadow: 0 8px 28px rgba(6,78,59,.45), inset 0 1px 0 rgba(255,255,255,.1);
    color: #6ee7b7;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: .08em;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    position: relative;
    overflow: hidden;
}
.btn-repartir::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,.08), transparent);
    pointer-events: none;
}
.btn-repartir:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(6,78,59,.6), 0 0 0 1.5px rgba(52,211,153,.45);
}
.btn-repartir:not(:disabled):active {
    transform: translateY(0) scale(.97);
}
.btn-repartir:disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Animations ── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes winReveal {
    0%  { opacity: 0; transform: scale(.85) translateY(18px); }
    70% { transform: scale(1.025) translateY(-2px); }
    100%{ opacity: 1; transform: scale(1) translateY(0); }
}
.anim-win { animation: winReveal .5s cubic-bezier(.16,1,.3,1) both; }

@keyframes pulseGreen {
    0%,100% { box-shadow: 0 0 22px rgba(16,185,129,.08), 0 0 0 1px rgba(16,185,129,.1); }
    50%      { box-shadow: 0 0 40px rgba(16,185,129,.18), 0 0 0 1px rgba(16,185,129,.22); }
}
.pulse-green { animation: pulseGreen 3s ease-in-out infinite; }

/* ── Helpers ── */
.hr-dim {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
}

::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(16,185,129,.25); border-radius: 99px; }
