/* ================================================================
   stylesAlienJumps.css — Alien Jumps · Área 21
================================================================ */

@font-face {
    font-family: 'Flappy';
    src: url('../RecursosJuegos/font.ttf') format('truetype');
}

:root {
    --neon-pink:   #ff2d75;
    --neon-blue:   #00f0ff;
    --neon-purple: #9d00ff;
    --dark-bg:     #0a0a0a;
    --card-bg:     rgba(20, 20, 20, 0.88);
    --text-dim:    rgba(255, 255, 255, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--dark-bg);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 45, 117, .13) 0%, transparent 28%),
        radial-gradient(circle at 80% 70%, rgba(0, 240, 255, .13)  0%, transparent 28%),
        radial-gradient(ellipse 80% 55% at 10% 5%,  rgba(157, 0, 255, .04) 0%, transparent 65%),
        radial-gradient(ellipse 80% 55% at 90% 95%, rgba(0, 240, 255, .03) 0%, transparent 65%);
    overflow: hidden;
    color: #fff;
}

/* ── 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(--neon-blue);
    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(--neon-pink);
    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); }
}

/* ── Top bar ── */
#topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 45, 117, .25);
    box-shadow: 0 0 20px rgba(255, 45, 117, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.2rem;
    gap: 0.75rem;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Syne', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: .06em;
    text-shadow: 0 0 8px var(--neon-pink), 0 0 16px var(--neon-blue);
    color: #fff;
}

.topbar-brand .brand-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 0 0 8px var(--neon-pink);
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1.5px solid rgba(255, 45, 117, .4);
    color: rgba(255, 45, 117, .85);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.38rem 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, box-shadow .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-back:hover {
    background: rgba(255, 45, 117, .15);
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 45, 117, .3);
}

/* ── Game wrapper ── */
#game-wrap {
    position: fixed;
    inset: 0;
    top: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

/* ── Overlay base ── */
.overlay {
    position: fixed;
    inset: 0;
    top: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(6px);
    z-index: 100;
    padding: 1rem;
}
.overlay.hidden { display: none; }

/* ── Panel (glow-card estilo Área 21) ── */
.panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow:
        0 0 12px rgba(255, 45, 117, .2),
        0 0 28px rgba(0, 240, 255, .1),
        0 20px 60px rgba(0, 0, 0, .6);
    backdrop-filter: blur(14px);
    animation: panelIn .35s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes panelIn {
    from { opacity: 0; transform: scale(.9) translateY(18px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

/* ── Panel typography ── */
.panel-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.65rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 8px var(--neon-pink), 0 0 20px var(--neon-blue);
    margin-bottom: 0.2rem;
    letter-spacing: .04em;
}

.panel-sub {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    letter-spacing: .04em;
}

/* ── Divider ── */
.panel-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
    margin: 1.25rem 0;
}

/* ── Menu buttons ── */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.72rem 1rem;
    border-radius: 0.65rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    letter-spacing: .04em;
    margin-bottom: 0.6rem;
}
.menu-btn:last-child { margin-bottom: 0; }
.menu-btn:hover  { transform: translateY(-2px); }
.menu-btn:active { transform: translateY(0) scale(.97); }

.btn-start {
    background: transparent;
    color: #fff;
    border: 2px solid var(--neon-pink) !important;
    box-shadow: 0 0 10px rgba(255, 45, 117, .3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.btn-start::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 45, 117, .6), transparent);
    transform: translateX(-100%);
    transition: transform .45s ease;
    z-index: -1;
}
.btn-start:hover::before { transform: translateX(100%); }
.btn-start:hover {
    box-shadow: 0 0 18px rgba(255, 45, 117, .55), 0 0 36px rgba(255, 45, 117, .2);
}

.btn-secondary {
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .8);
    border: 1.5px solid rgba(255, 255, 255, .12) !important;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .25) !important;
}

.btn-mute {
    background: rgba(0, 240, 255, .07);
    color: var(--neon-blue);
    border: 1.5px solid rgba(0, 240, 255, .25) !important;
}
.btn-mute.muted {
    background: rgba(239, 68, 68, .08);
    color: #f87171;
    border-color: rgba(239, 68, 68, .25) !important;
}

/* ── Name input ── */
.name-input {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, .2);
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    margin-bottom: 1.25rem;
    transition: border-color .25s, box-shadow .25s;
}
.name-input::placeholder { color: rgba(255, 255, 255, .3); }
.name-input:focus {
    border-bottom-color: var(--neon-pink);
    box-shadow: 0 4px 16px rgba(255, 45, 117, .12);
}
.name-input-decoration {
    height: 2px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
    margin-top: -1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0 0 2px 2px;
}
.name-input:focus + .name-input-decoration { transform: scaleX(1); }

.name-error {
    font-size: 0.8rem;
    color: var(--neon-pink);
    text-align: center;
    margin: -0.25rem 0 0.5rem;
}
.name-error.hidden { display: none; }

/* ── Character selection ── */
.char-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.25rem 0 1.5rem;
}

.char-card {
    flex: 1;
    max-width: 130px;
    background: rgba(255, 255, 255, .04);
    border: 2px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    padding: 1rem 0.5rem 0.75rem;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    text-align: center;
}
.char-card:hover {
    border-color: rgba(255, 45, 117, .5);
    background: rgba(255, 45, 117, .06);
    transform: translateY(-3px);
}
.char-card.selected {
    border-color: var(--neon-pink);
    background: rgba(255, 45, 117, .12);
    box-shadow: 0 0 18px rgba(255, 45, 117, .3);
}
.char-card img {
    width: 52px;
    height: auto;
    image-rendering: pixelated;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 6px var(--neon-blue));
}
.char-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .65);
    line-height: 1.3;
}

/* ── Ranking list ── */
.ranking-list {
    list-style: none;
    margin: 0.75rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 45, 117, .3) transparent;
}
.ranking-list::-webkit-scrollbar       { width: 4px; }
.ranking-list::-webkit-scrollbar-track { background: transparent; }
.ranking-list::-webkit-scrollbar-thumb { background: rgba(255, 45, 117, .3); border-radius: 99px; }

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 0.6rem;
    padding: 0.55rem 0.9rem;
    transition: border-color .2s;
}
.ranking-item.is-me {
    border-color: rgba(255, 45, 117, .45);
    background: rgba(255, 45, 117, .07);
    box-shadow: 0 0 10px rgba(255, 45, 117, .12);
}
.ranking-item.top-1 { border-color: rgba(255, 215, 0, .4);  background: rgba(255, 215, 0, .05); }
.ranking-item.top-2 { border-color: rgba(192, 192, 192, .3); }
.ranking-item.top-3 { border-color: rgba(205, 127, 50, .3);  background: rgba(205, 127, 50, .04); }

.ranking-pos {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}
.ranking-pos-num {
    font-family: 'Syne', sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--text-dim);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.ranking-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-score {
    font-family: 'Syne', sans-serif;
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--neon-blue);
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0, 240, 255, .5);
}
.ranking-item.top-1 .ranking-score { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, .5); }
.ranking-item.is-me .ranking-score { color: var(--neon-pink); text-shadow: 0 0 8px rgba(255, 45, 117, .5); }

.ranking-empty {
    font-size: 0.82rem;
    color: var(--text-dim);
    padding: 0.75rem 0 1rem;
    text-align: center;
}
.ranking-loading {
    font-size: 0.82rem;
    color: var(--text-dim);
    padding: 0.75rem 0;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ── Game over score ── */
.go-score-box {
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0.85rem;
    padding: 1rem 1.5rem;
    margin: 0.75rem 0 0.5rem;
}
.go-score-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 0.2rem;
}
.go-score-val {
    font-family: 'Syne', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--neon-pink);
    text-shadow: 0 0 16px rgba(255, 45, 117, .6);
    line-height: 1;
}
.go-score-best {
    font-size: 0.76rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

/* ── Save score section ── */
.go-save-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
}

/* ── Responsive ── */
@media (max-width: 400px) {
    .panel { padding: 1.5rem 1.25rem; max-width: 100%; }
    .panel-title { font-size: 1.35rem; }
    .go-score-val { font-size: 2.2rem; }
    .char-card img { width: 42px; }
}
@media (max-height: 600px) {
    .panel { padding: 1.25rem 1.5rem; }
    .panel-sub { margin-bottom: 0.9rem; }
    .menu-btn { padding: 0.58rem 1rem; margin-bottom: 0.45rem; }
    .ranking-list { max-height: 180px; }
}
