
/* =========================================================
   KRAFEX SPEED PARKOUR
   FULL NEON CSS
   ========================================================= */

:root {
    --bg: #030006;
    --bg2: #08000f;
    --panel: rgba(8, 0, 18, 0.94);

    --cyan: #00f6ff;
    --blue: #008cff;
    --purple: #9b00ff;
    --pink: #ff00d9;
    --green: #00ff88;
    --yellow: #ffe600;
    --red: #ff1744;
    --white: #f4fbff;

    --neon-cyan:
        0 0 5px #00f6ff,
        0 0 15px #00f6ff,
        0 0 35px #00f6ff;

    --neon-purple:
        0 0 5px #9b00ff,
        0 0 15px #9b00ff,
        0 0 35px #9b00ff;

    --neon-pink:
        0 0 5px #ff00d9,
        0 0 15px #ff00d9,
        0 0 35px #ff00d9;

    --neon-green:
        0 0 5px #00ff88,
        0 0 15px #00ff88,
        0 0 35px #00ff88;

    --font:
        "Orbitron",
        Arial,
        sans-serif;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

body {
    font-family: var(--font);
    color: var(--white);
    user-select: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* =========================================================
   APP
========================================================= */

#app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}


/* =========================================================
   SCREENS
========================================================= */

.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}


/* =========================================================
   LOADING SCREEN
========================================================= */

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(0, 246, 255, 0.13),
            transparent 28%
        ),
        radial-gradient(
            circle at 25% 70%,
            rgba(155, 0, 255, 0.14),
            transparent 30%
        ),
        #030006;
    z-index: 9999;
}

.loading-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.loading-grid {
    position: absolute;
    width: 160%;
    height: 100%;
    left: -30%;
    bottom: -25%;
    background-image:
        linear-gradient(
            rgba(0,246,255,.18) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(0,246,255,.18) 1px,
            transparent 1px
        );
    background-size: 55px 55px;
    transform:
        perspective(500px)
        rotateX(62deg);
    transform-origin: bottom;
    opacity: .45;
}

.loading-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .35;
}

.glow-one {
    background: var(--cyan);
    top: 5%;
    left: 10%;
}

.glow-two {
    background: var(--purple);
    right: 5%;
    bottom: 10%;
}

.glow-three {
    background: var(--pink);
    left: 45%;
    bottom: -10%;
}

.loading-content {
    position: relative;
    z-index: 2;
    width: min(620px, 90%);
    text-align: center;
}

.loading-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--cyan);
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 10px;
    text-shadow: var(--neon-cyan);
}

.brand-k {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    border: 2px solid var(--cyan);
    transform: skew(-10deg);
    box-shadow: var(--neon-cyan);
}

.loading-game-name {
    margin-top: 30px;
    color: white;
    font-size: clamp(30px, 5vw, 64px);
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow:
        0 0 10px white,
        0 0 30px var(--purple),
        0 0 60px var(--purple);
}

.loading-slogan {
    margin-top: 12px;
    color: var(--cyan);
    font-size: 13px;
    letter-spacing: 5px;
}

.loading-runner {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 45px auto 20px;
}

.runner-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 25px;
    height: 1px;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.runner-dot {
    position: absolute;
    top: 18px;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--neon-cyan);
    animation: loadingRun 1.5s linear infinite;
}

@keyframes loadingRun {
    from {
        left: 0;
    }
    to {
        left: calc(100% - 15px);
    }
}

.loading-text {
    min-height: 24px;
    color: white;
    font-size: 13px;
    letter-spacing: 2px;
}

.loading-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
}

.loading-bar {
    flex: 1;
    height: 7px;
    border: 1px solid rgba(0,246,255,.6);
    background: rgba(0,246,255,.06);
    box-shadow:
        inset 0 0 10px rgba(0,246,255,.2),
        0 0 15px rgba(0,246,255,.25);
}

.loading-progress {
    width: 0;
    height: 100%;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
    transition: width .15s linear;
}

.loading-percent {
    min-width: 55px;
    color: var(--cyan);
    font-weight: 800;
}

.loading-tips {
    margin-top: 30px;
    padding: 15px;
    border: 1px solid rgba(155,0,255,.4);
    background: rgba(155,0,255,.05);
}

.loading-tips span {
    color: var(--purple);
    font-size: 10px;
    letter-spacing: 3px;
}

.loading-tips p {
    margin-top: 8px;
    color: #c8d9e5;
    font-size: 11px;
}

.loading-version {
    position: absolute;
    bottom: 20px;
    color: rgba(255,255,255,.35);
    font-size: 9px;
    letter-spacing: 3px;
}


/* =========================================================
   MAIN MENU
========================================================= */

.main-menu {
    background:
        radial-gradient(
            ellipse at center bottom,
            rgba(0,246,255,.08),
            transparent 45%
        ),
        #030006;
}

.menu-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.menu-background::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            rgba(0,246,255,.04) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(0,246,255,.04) 1px,
            transparent 1px
        );
    background-size: 45px 45px;
    transform:
        perspective(600px)
        rotateX(55deg)
        translateY(25%);
}

.city-layer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 45%;
    opacity: .5;
}

.city-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 40px,
            rgba(0,246,255,.12) 41px 43px
        );
}

.city-back {
    transform: scaleY(.7);
    bottom: 15%;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 80px,
            rgba(155,0,255,.1) 81px 145px
        );
}

.city-middle {
    bottom: 5%;
    background:
        linear-gradient(
            transparent,
            rgba(0,246,255,.08)
        );
}

.city-front {
    height: 25%;
    background:
        linear-gradient(
            to top,
            #05000c,
            transparent
        );
}

.neon-line {
    position: absolute;
    height: 1px;
    width: 70%;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
    opacity: .4;
    transform: rotate(-8deg);
}

.line-one {
    top: 25%;
    left: -10%;
}

.line-two {
    top: 45%;
    right: -10%;
    background: var(--purple);
    box-shadow: var(--neon-purple);
}

.line-three {
    bottom: 20%;
    left: 20%;
    background: var(--pink);
    box-shadow: var(--neon-pink);
}

.main-topbar {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 35px;
    border-bottom: 1px solid rgba(0,246,255,.25);
    background: rgba(3,0,6,.7);
    backdrop-filter: blur(15px);
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cyan);
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: var(--neon-cyan);
}

.logo-symbol {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--cyan);
    box-shadow: var(--neon-cyan);
}

.top-game {
    color: white;
    font-size: 14px;
    letter-spacing: 4px;
}

.top-game strong {
    color: var(--pink);
    text-shadow: var(--neon-pink);
}

.top-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-info span {
    color: #71818b;
    font-size: 8px;
    letter-spacing: 2px;
}

.profile-info strong {
    color: white;
    font-size: 11px;
}

.main-menu-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100% - 80px);
    padding-top: 5vh;
}

.hero-title {
    text-align: center;
}

.hero-small {
    color: var(--cyan);
    font-size: 10px;
    letter-spacing: 7px;
}

.hero-title h1 {
    margin-top: 10px;
    font-size: clamp(40px, 6vw, 80px);
    line-height: .9;
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow:
        0 0 10px white,
        0 0 30px var(--cyan);
}

.hero-title h1 span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 1px var(--pink);
    text-shadow: var(--neon-pink);
}

.hero-title p {
    margin-top: 15px;
    color: #9aaab3;
    font-size: 10px;
    letter-spacing: 6px;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 350px));
    gap: 12px;
    width: min(720px, 90%);
    margin-top: 35px;
}

.menu-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 68px;
    padding: 12px 20px;
    border: 1px solid rgba(0,246,255,.35);
    background:
        linear-gradient(
            90deg,
            rgba(0,246,255,.08),
            rgba(155,0,255,.04)
        );
    color: white;
    text-align: left;
    transition:
        transform .2s,
        border-color .2s,
        box-shadow .2s,
        background .2s;
}

.menu-button::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
    transition: width .25s;
}

.menu-button:hover {
    transform: translateY(-3px);
    border-color: var(--cyan);
    box-shadow:
        0 0 15px rgba(0,246,255,.2),
        inset 0 0 20px rgba(0,246,255,.04);
}

.menu-button:hover::after {
    width: 100%;
}

.menu-button .material-symbols-rounded {
    color: var(--cyan);
    font-size: 28px;
    text-shadow: var(--neon-cyan);
}

.menu-button strong {
    display: block;
    font-size: 13px;
    letter-spacing: 2px;
}

.menu-button small {
    display: block;
    margin-top: 5px;
    color: #778993;
    font-size: 8px;
    letter-spacing: 1px;
}

.primary-button {
    border-color: var(--cyan);
    background:
        linear-gradient(
            90deg,
            rgba(0,246,255,.16),
            rgba(155,0,255,.1)
        );
    box-shadow:
        0 0 20px rgba(0,246,255,.12),
        inset 0 0 20px rgba(0,246,255,.04);
}

.menu-stat-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(720px, 90%);
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid rgba(0,246,255,.18);
    border-bottom: 1px solid rgba(0,246,255,.18);
    background: rgba(0,0,0,.2);
}

.menu-stat {
    flex: 1;
    text-align: center;
}

.menu-stat span {
    display: block;
    color: #62727c;
    font-size: 7px;
    letter-spacing: 2px;
}

.menu-stat strong {
    display: block;
    margin-top: 5px;
    color: var(--cyan);
    font-size: 15px;
    text-shadow: var(--neon-cyan);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(0,246,255,.2);
}

.main-footer {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    color: #3d4c55;
    font-size: 7px;
    letter-spacing: 2px;
}


/* =========================================================
   MODALES
========================================================= */

.modal-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(12px);
}

.modal-window {
    position: relative;
    width: min(950px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    border: 1px solid var(--cyan);
    background:
        radial-gradient(
            circle at top right,
            rgba(155,0,255,.1),
            transparent 35%
        ),
        var(--panel);
    box-shadow:
        0 0 20px rgba(0,246,255,.15),
        0 0 80px rgba(155,0,255,.1),
        inset 0 0 30px rgba(0,246,255,.03);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.2);
    background: transparent;
    color: white;
}

.modal-close:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.modal-header span {
    color: var(--cyan);
    font-size: 9px;
    letter-spacing: 4px;
}

.modal-header h2 {
    margin-top: 5px;
    color: white;
    font-size: 28px;
    letter-spacing: 3px;
    text-shadow: var(--neon-cyan);
}


/* =========================================================
   CHARACTER
========================================================= */

.character-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.character-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-platform {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 330px;
    background:
        radial-gradient(
            ellipse,
            rgba(0,246,255,.12),
            transparent 60%
        );
}

.preview-platform::after {
    content: "";
    position: absolute;
    bottom: 25px;
    width: 180px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid var(--cyan);
    box-shadow: var(--neon-cyan);
    transform: rotateX(65deg);
}

.runner-preview {
    position: relative;
    width: 80px;
    height: 190px;
    z-index: 2;
    filter:
        drop-shadow(0 0 12px var(--cyan));
    animation: previewFloat 2s ease-in-out infinite;
}

@keyframes previewFloat {
    50% {
        transform: translateY(-12px);
    }
}

.preview-head {
    position: absolute;
    left: 20px;
    top: 0;
    width: 40px;
    height: 40px;
    border: 2px solid var(--cyan);
    background: #08151c;
    border-radius: 12px 12px 8px 8px;
    box-shadow: var(--neon-cyan);
}

.preview-visor {
    position: absolute;
    left: 25px;
    top: 13px;
    width: 30px;
    height: 9px;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.preview-body {
    position: absolute;
    left: 14px;
    top: 48px;
    width: 52px;
    height: 75px;
    border: 2px solid var(--purple);
    background: linear-gradient(
        135deg,
        #171327,
        #050509
    );
    box-shadow: var(--neon-purple);
    border-radius: 10px;
}

.preview-leg {
    position: absolute;
    top: 118px;
    width: 20px;
    height: 70px;
    border: 2px solid var(--cyan);
    background: #080c12;
    box-shadow: var(--neon-cyan);
}

.preview-leg.left {
    left: 14px;
    transform: rotate(5deg);
}

.preview-leg.right {
    right: 14px;
    transform: rotate(-5deg);
}

.preview-name {
    text-align: center;
}

.preview-name span {
    display: block;
    color: #61717a;
    font-size: 8px;
    letter-spacing: 3px;
}

.preview-name strong {
    display: block;
    margin-top: 5px;
    color: var(--cyan);
    font-size: 14px;
    text-shadow: var(--neon-cyan);
}

.character-options {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #71838d;
    font-size: 8px;
    letter-spacing: 3px;
}

.form-group input[type="text"],
.form-group select,
.settings-list select {
    width: 100%;
    height: 45px;
    padding: 0 12px;
    border: 1px solid rgba(0,246,255,.3);
    outline: none;
    background: #05070b;
    color: white;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.settings-list select:focus {
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.color-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-control input {
    width: 55px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--cyan);
    background: transparent;
}

.color-control span {
    color: #71838d;
    font-size: 8px;
}

.style-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.style-option {
    height: 40px;
    border: 1px solid rgba(155,0,255,.3);
    background: rgba(155,0,255,.05);
    color: #8896a0;
    font-size: 9px;
}

.style-option:hover,
.style-option.active {
    color: var(--purple);
    border-color: var(--purple);
    box-shadow: var(--neon-purple);
}


/* =========================================================
   ACTION BUTTON
========================================================= */

.action-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--cyan);
    background:
        linear-gradient(
            90deg,
            rgba(0,246,255,.12),
            rgba(155,0,255,.12)
        );
    color: white;
    box-shadow:
        0 0 15px rgba(0,246,255,.1);
    font-size: 10px;
    letter-spacing: 2px;
}

.action-button:hover {
    background: rgba(0,246,255,.15);
    box-shadow: var(--neon-cyan);
}


/* =========================================================
   LEVELS
========================================================= */

.levels-window {
    width: min(1100px, 95vw);
}

.level-progress-header {
    margin-top: 25px;
}

.level-progress-header > div:first-child {
    display: flex;
    justify-content: space-between;
    color: #71838d;
    font-size: 9px;
}

.level-progress-header strong {
    color: var(--cyan);
}

.level-progress-bar {
    width: 100%;
    height: 4px;
    margin-top: 8px;
    background: rgba(255,255,255,.08);
}

.level-progress-fill {
    width: 16%;
    height: 100%;
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.level-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.level-card {
    position: relative;
    min-height: 150px;
    padding: 20px;
    border: 1px solid rgba(0,246,255,.25);
    background:
        linear-gradient(
            135deg,
            rgba(0,246,255,.05),
            rgba(155,0,255,.05)
        );
    transition: .2s;
}

.level-card:hover:not(.locked) {
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
    transform: translateY(-3px);
}

.level-card.locked {
    opacity: .4;
    filter: grayscale(.7);
}

.level-number {
    color: var(--cyan);
    font-size: 9px;
    letter-spacing: 2px;
}

.level-card h3 {
    margin-top: 8px;
    font-size: 15px;
}

.level-card p {
    margin-top: 7px;
    color: #71838d;
    font-size: 8px;
    line-height: 1.5;
}

.level-stars {
    margin-top: 15px;
    color: var(--yellow);
}


/* =========================================================
   PRACTICE
========================================================= */

.practice-content {
    margin-top: 25px;
}

.practice-intro {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(0,246,255,.2);
    background: rgba(0,246,255,.03);
}

.practice-icon {
    font-size: 35px;
    color: var(--cyan);
    text-shadow: var(--neon-cyan);
}

.practice-intro h3 {
    color: var(--cyan);
    font-size: 13px;
}

.practice-intro p {
    margin-top: 6px;
    color: #74858f;
    font-size: 9px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.control-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid rgba(155,0,255,.22);
    background: rgba(155,0,255,.03);
}

.control-card.wide {
    grid-column: span 1;
}

.control-card kbd {
    display: grid;
    place-items: center;
    min-width: 70px;
    height: 35px;
    padding: 0 7px;
    border: 1px solid var(--purple);
    color: var(--purple);
    box-shadow: var(--neon-purple);
    font-size: 8px;
}

.control-card strong {
    display: block;
    font-size: 9px;
}

.control-card span {
    display: block;
    margin-top: 4px;
    color: #687984;
    font-size: 7px;
}


/* =========================================================
   SETTINGS
========================================================= */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 30px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,246,255,.1);
}

.setting-info strong {
    display: block;
    color: white;
    font-size: 10px;
    letter-spacing: 1px;
}

.setting-info span {
    display: block;
    margin-top: 5px;
    color: #687984;
    font-size: 8px;
}

.setting-item input[type="range"] {
    width: 220px;
    accent-color: var(--cyan);
}

.setting-item select {
    width: 180px;
}

.switch {
    position: relative;
    width: 48px;
    height: 25px;
}

.switch input {
    display: none;
}

.switch-slider {
    position: absolute;
    inset: 0;
    border: 1px solid #45515a;
    background: #090c10;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 17px;
    height: 17px;
    left: 3px;
    top: 3px;
    background: #687984;
    transition: .2s;
}

.switch input:checked + .switch-slider {
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(23px);
    background: var(--cyan);
}


/* =========================================================
   GAME
========================================================= */

.game-screen {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #020206;
}

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}


/* =========================================================
   NEON VIGNETTE
========================================================= */

.game-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    box-shadow:
        inset 0 0 120px rgba(0,0,0,.75),
        inset 0 0 20px rgba(0,246,255,.08);
}


/* =========================================================
   GAME HUD
========================================================= */

.game-hud {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.hud-left {
    top: 22px;
    left: 22px;
}

.hud-right {
    top: 22px;
    right: 22px;
}

.hud-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.hud-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--cyan);
    background: rgba(0,0,0,.6);
    color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.hud-player span {
    display: block;
    color: #63737d;
    font-size: 7px;
    letter-spacing: 2px;
}

.hud-player strong {
    display: block;
    margin-top: 3px;
    color: white;
    font-size: 9px;
}

.stat-bars {
    width: 220px;
    margin-top: 15px;
}

.bar-stat {
    margin-top: 8px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #76858e;
    font-size: 7px;
}

.bar-label strong {
    color: white;
}

.hud-bar {
    width: 100%;
    height: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(0,0,0,.5);
}

.hud-fill {
    width: 100%;
    height: 100%;
    transition: width .15s;
}

.hud-fill.health {
    background: var(--green);
    box-shadow: var(--neon-green);
}

.hud-fill.energy {
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.hud-fill.flow {
    background: var(--purple);
    box-shadow: var(--neon-purple);
}

.level-indicator span,
.checkpoint-indicator span {
    display: block;
    color: #63737d;
    font-size: 7px;
    letter-spacing: 3px;
}

.level-indicator strong {
    display: block;
    margin-top: 4px;
    color: var(--cyan);
    font-size: 11px;
    letter-spacing: 2px;
    text-shadow: var(--neon-cyan);
}

.game-timer {
    margin-top: 8px;
    color: white;
    font-size: 25px;
    font-weight: 800;
    text-shadow:
        0 0 10px white,
        0 0 20px var(--pink);
}

.checkpoint-indicator {
    margin-top: 7px;
}

.checkpoint-indicator strong {
    color: var(--yellow);
    font-size: 12px;
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(0,246,255,.2);
    background: rgba(0,0,0,.45);
}

.resource-icon {
    font-size: 17px;
}

.resource-card span:not(.resource-icon) {
    display: block;
    color: #63737d;
    font-size: 6px;
    letter-spacing: 1px;
}

.resource-card strong {
    display: block;
    margin-top: 2px;
    color: white;
    font-size: 10px;
}


/* =========================================================
   SPEEDOMETER
========================================================= */

.speedometer {
    position: absolute;
    z-index: 10;
    left: 25px;
    bottom: 75px;
    pointer-events: none;
}

.speed-number {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.speed-number strong {
    color: white;
    font-size: 48px;
    font-weight: 900;
    text-shadow:
        0 0 10px white,
        0 0 30px var(--cyan);
}

.speed-number span {
    color: var(--cyan);
    font-size: 8px;
}

.speed-label {
    color: #566770;
    font-size: 7px;
    letter-spacing: 4px;
}


/* =========================================================
   COMBO
========================================================= */

.combo-display {
    position: absolute;
    z-index: 10;
    right: 25px;
    bottom: 80px;
    text-align: right;
    pointer-events: none;
}

.combo-display span {
    display: block;
    color: #687984;
    font-size: 7px;
    letter-spacing: 3px;
}

.combo-display strong {
    color: var(--pink);
    font-size: 28px;
    text-shadow: var(--neon-pink);
}


/* =========================================================
   ABILITIES
========================================================= */

.abilities {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 25px;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.ability {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 115px;
    padding: 6px;
    border: 1px solid rgba(0,246,255,.22);
    background: rgba(0,0,0,.55);
}

.ability-key {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 28px;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 7px;
    box-shadow: 0 0 8px rgba(0,246,255,.3);
}

.ability-info strong {
    display: block;
    color: white;
    font-size: 7px;
}

.ability-info span {
    display: block;
    margin-top: 3px;
    color: #687984;
    font-size: 6px;
}


/* =========================================================
   CONTROLS HINT
========================================================= */

.controls-hint {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 5px;
    display: flex;
    gap: 15px;
    transform: translateX(-50%);
    color: #64747d;
    font-size: 6px;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
}

.controls-hint kbd {
    color: var(--cyan);
    text-shadow: var(--neon-cyan);
}


/* =========================================================
   CROSSHAIR
========================================================= */

.crosshair {
    position: absolute;
    z-index: 12;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.crosshair span {
    position: absolute;
    background: rgba(255,255,255,.9);
    box-shadow: 0 0 7px var(--cyan);
}

.crosshair span:nth-child(1),
.crosshair span:nth-child(3) {
    width: 2px;
    height: 7px;
    left: 10px;
}

.crosshair span:nth-child(1) {
    top: 0;
}

.crosshair span:nth-child(3) {
    bottom: 0;
}

.crosshair span:nth-child(2),
.crosshair span:nth-child(4) {
    width: 7px;
    height: 2px;
    top: 10px;
}

.crosshair span:nth-child(2) {
    left: 0;
}

.crosshair span:nth-child(4) {
    right: 0;
}


/* =========================================================
   SPEED EFFECTS
========================================================= */

.speed-lines {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0 50px,
            rgba(0,246,255,.13) 51px 52px
        );
    transition: opacity .2s;
}

.speed-lines.active {
    opacity: .35;
    animation: speedMove .15s linear infinite;
}

@keyframes speedMove {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-80px);
    }
}

.damage-flash,
.flow-flash {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
}

.damage-flash {
    background:
        radial-gradient(
            circle,
            transparent 30%,
            rgba(255,23,68,.55)
        );
}

.damage-flash.active {
    animation: damageFlash .3s;
}

@keyframes damageFlash {
    0% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.flow-flash {
    background:
        radial-gradient(
            circle,
            transparent 35%,
            rgba(155,0,255,.3)
        );
}

.flow-flash.active {
    animation: flowFlash .5s;
}

@keyframes flowFlash {
    0% {
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


/* =========================================================
   GAME MESSAGE
========================================================= */

.game-message {
    position: absolute;
    z-index: 20;
    left: 50%;
    top: 65%;
    transform: translate(-50%, -50%);
    color: var(--cyan);
    font-size: 25px;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: var(--neon-cyan);
    opacity: 0;
    pointer-events: none;
}

.game-message.show {
    animation: messagePop .8s ease-out;
}

@keyframes messagePop {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(.7);
    }

    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(1);
    }
}


/* =========================================================
   PAUSE / RESULT OVERLAY
========================================================= */

.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(10px);
}

.pause-window,
.result-window {
    width: min(600px, 92vw);
    padding: 40px;
    text-align: center;
    border: 1px solid var(--cyan);
    background:
        radial-gradient(
            circle at top,
            rgba(0,246,255,.08),
            transparent 50%
        ),
        rgba(3,0,8,.97);
    box-shadow:
        var(--neon-cyan),
        inset 0 0 50px rgba(0,246,255,.04);
}

.overlay-logo {
    color: var(--cyan);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 6px;
    text-shadow: var(--neon-cyan);
}

.overlay-small {
    display: block;
    margin-top: 8px;
    color: #586972;
    font-size: 7px;
    letter-spacing: 4px;
}

.pause-window h2,
.result-window h2 {
    margin-top: 25px;
    color: white;
    font-size: 32px;
    text-shadow:
        0 0 10px white,
        0 0 30px var(--purple);
}

.pause-time {
    margin: 20px 0;
    color: #62727c;
    font-size: 8px;
}

.pause-time strong {
    display: block;
    margin-top: 5px;
    color: var(--cyan);
    font-size: 22px;
}

.overlay-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    margin-top: 10px;
    border: 1px solid rgba(0,246,255,.3);
    background: rgba(0,246,255,.04);
    color: white;
    font-size: 9px;
    letter-spacing: 2px;
}

.overlay-button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.result-top > span {
    color: var(--cyan);
    font-size: 8px;
    letter-spacing: 4px;
}

.medal {
    margin-top: 15px;
    font-size: 55px;
    filter:
        drop-shadow(0 0 15px var(--yellow));
}

.result-level {
    margin-top: 8px;
    color: var(--pink);
    font-size: 10px;
    letter-spacing: 3px;
    text-shadow: var(--neon-pink);
}

.rank-display {
    margin: 20px auto;
}

.rank-display span {
    display: block;
    color: #64747d;
    font-size: 7px;
    letter-spacing: 3px;
}

.rank-display strong {
    display: block;
    margin-top: 3px;
    color: var(--yellow);
    font-size: 55px;
    text-shadow:
        0 0 10px var(--yellow),
        0 0 30px var(--yellow);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(0,246,255,.15);
    border-bottom: 1px solid rgba(0,246,255,.15);
    padding: 18px 0;
}

.result-stat {
    border-right: 1px solid rgba(0,246,255,.1);
}

.result-stat:last-child {
    border-right: none;
}

.result-stat span {
    display: block;
    color: #64747d;
    font-size: 6px;
    letter-spacing: 2px;
}

.result-stat strong {
    display: block;
    margin-top: 5px;
    color: white;
    font-size: 13px;
}

.result-actions {
    margin-top: 15px;
}


/* =========================================================
   COUNTDOWN
========================================================= */

.countdown {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0,0,0,.15);
}

.countdown-label {
    color: var(--cyan);
    font-size: 10px;
    letter-spacing: 7px;
    text-shadow: var(--neon-cyan);
}

.countdown-number {
    margin-top: 5px;
    color: white;
    font-size: 120px;
    font-weight: 900;
    text-shadow:
        0 0 10px white,
        0 0 30px var(--cyan),
        0 0 70px var(--purple);
    animation: countdownPulse .8s ease-out;
}

@keyframes countdownPulse {
    0% {
        opacity: 0;
        transform: scale(1.7);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: .9;
        transform: scale(.9);
    }
}

.countdown-tip {
    margin-top: 10px;
    color: #697984;
    font-size: 7px;
    letter-spacing: 4px;
}


/* =========================================================
   PAUSE BUTTON
========================================================= */

.pause-button {
    position: absolute;
    z-index: 30;
    top: 25px;
    right: 50%;
    margin-right: -22px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(0,246,255,.3);
    background: rgba(0,0,0,.45);
    color: var(--cyan);
}

.pause-button:hover {
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
}


/* =========================================================
   NOTIFICATIONS
========================================================= */

.notification-container {
    position: fixed;
    z-index: 9000;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification {
    min-width: 250px;
    padding: 12px 15px;
    border-left: 2px solid var(--cyan);
    background: rgba(3,0,8,.95);
    color: white;
    box-shadow: 0 0 20px rgba(0,246,255,.15);
    animation: notificationIn .3s ease-out;
}

@keyframes notificationIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* =========================================================
   TOOLTIP
========================================================= */

.tooltip {
    position: fixed;
    z-index: 99999;
    padding: 8px 12px;
    border: 1px solid var(--cyan);
    background: rgba(3,0,8,.95);
    color: var(--cyan);
    font-size: 8px;
    box-shadow: var(--neon-cyan);
    pointer-events: none;
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #030006;
}

::-webkit-scrollbar-thumb {
    background: var(--cyan);
    box-shadow: var(--neon-cyan);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 850px) {

    .main-actions {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .main-menu-content {
        padding-top: 3vh;
        overflow-y: auto;
    }

    .menu-stat-panel {
        margin-bottom: 40px;
    }

    .character-editor {
        grid-template-columns: 1fr;
    }

    .character-preview-section {
        min-height: 300px;
    }

    .level-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .controls-hint {
        display: none;
    }

    .top-game {
        display: none;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-stat:nth-child(2) {
        border-right: none;
    }

}


@media (max-width: 600px) {

    .main-topbar {
        padding: 0 15px;
    }

    .profile-info {
        display: none;
    }

    .loading-brand {
        font-size: 28px;
    }

    .loading-game-name {
        font-size: 34px;
    }

    .loading-slogan {
        font-size: 8px;
        letter-spacing: 3px;
    }

    .modal-screen {
        padding: 10px;
    }

    .modal-window {
        padding: 25px 18px;
    }

    .level-list {
        grid-template-columns: 1fr;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .setting-item input[type="range"],
    .setting-item select {
        width: 100%;
    }

    .hud-left {
        top: 12px;
        left: 12px;
    }

    .hud-right {
        top: 12px;
        right: 12px;
    }

    .hud-center {
        top: 12px;
    }

    .stat-bars {
        width: 150px;
    }

    .game-timer {
        font-size: 17px;
    }

    .speedometer {
        left: 15px;
        bottom: 45px;
    }

    .speed-number strong {
        font-size: 35px;
    }

    .abilities {
        bottom: 8px;
        gap: 3px;
    }

    .ability {
        min-width: auto;
        padding: 4px;
    }

    .ability-info {
        display: none;
    }

    .pause-button {
        top: 12px;
        right: 15px;
        margin: 0;
    }

}


/* =========================================================
   EXTRA NEON ANIMATIONS
========================================================= */

@keyframes neonBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .65;
    }

}

@keyframes neonPulse {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.4);
    }

}

.neon-pulse {
    animation: neonPulse 1.2s ease-in-out infinite;
}

.neon-blink {
    animation: neonBlink 1s ease-in-out infinite;
}


/* =========================================================
   PARKOUR VISUAL CLASSES
   Para elementos generados dinámicamente por JS
========================================================= */

.parkour-platform {
    border: 1px solid var(--cyan);
    box-shadow:
        0 0 8px var(--cyan),
        0 0 20px var(--cyan);
}

.parkour-platform.purple {
    border-color: var(--purple);
    box-shadow: var(--neon-purple);
}

.parkour-platform.pink {
    border-color: var(--pink);
    box-shadow: var(--neon-pink);
}

.parkour-platform.green {
    border-color: var(--green);
    box-shadow: var(--neon-green);
}

.checkpoint {
    border-color: var(--yellow);
    box-shadow:
        0 0 10px var(--yellow),
        0 0 30px var(--yellow);
}

.finish {
    border-color: var(--pink);
    box-shadow: var(--neon-pink);
    animation: neonPulse .8s infinite;
}

.speed-pad {
    border-color: var(--cyan);
    box-shadow: var(--neon-cyan);
}

.jump-pad {
    border-color: var(--purple);
    box-shadow: var(--neon-purple);
}


/* =========================================================
   FIN
========================================================= */

