:root {

    --bg-core: #0B0F14;

    --bg-solid: #111827;

    --bg-panel: rgba(17, 24, 39, 0.9);

    --text-main: #E5E7EB;

    --text-dim: #9CA3AF;

    --neon-cyan: #22D3EE;

    --neon-magenta: #ff00ccb4;

    --neon-green: #7fff00;

    --neon-yellow: #ffea00;

    --neon-orange: #ff8c00;

    --card-w: 9.5vh;

    --card-h: 12vh;

    --gap: 65px;

    --header-margin-top: 0px;

    --title-size: 3.25rem;

    --title-size-mob: 1.8rem;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.6);

    --focus-outline: 2px solid var(--neon-cyan);

}



* {

    box-sizing: border-box;

    touch-action: manipulation;

    margin: 0;

    padding: 0
}



body {

    background-color: var(--bg-core);

    font-family: 'Share Tech Mono', monospace;

    color: var(--text-main);

    overflow: hidden;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: flex-start;

    padding-top: var(--header-margin-top);

    height: 100vh;

    position: relative;

    background-image: linear-gradient(rgba(255, 255, 255, 0.187) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.186) 1px, transparent 1px);

    background-size: 52px 52px;

    background-position: center
}



body::after {

    content: " ";

    display: block;

    position: fixed;

    top: 0;

    left: 0;

    bottom: 0;

    right: 0;

    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 50%, rgba(255, 255, 255, 0.1) 50%), radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.7) 100%);

    background-size: 100% 4px, 100% 100%;

    z-index: 200;

    pointer-events: none;

    animation: tv-flicker .15s infinite
}



@keyframes tv-flicker {

    0% {
        opacity: .25
    }

    25% {
        opacity: .3
    }

    50% {
        opacity: .25
    }

    75% {
        opacity: .3
    }

    100% {
        opacity: .28
    }

}



body::-webkit-scrollbar {

    display: none
}



.hud-overlay {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    pointer-events: none;

    z-index: 10;

    box-shadow: inset 0 0 100px rgba(0, 0, 0, .6)
}



.hud-corner {

    position: absolute;

    width: 40px;

    height: 40px;

    border: 2px solid var(--neon-cyan);

    opacity: .5
}



.tl {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.tr {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none
}

.bl {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none
}

.br {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none
}



header {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 10px;

    width: 100%;

    padding-top: 5px;

    z-index: 10;

    position: relative;

    pointer-events: none
}



h1.logo-title {

    display: block;

    text-align: center;

    line-height: 1;

    margin-bottom: 20px;

    font-family: 'Orbitron', sans-serif;

    font-weight: 900;

    font-size: var(--title-size);

    color: var(--text-main);

    text-shadow: 2px 2px 0px var(--neon-cyan);

    text-transform: uppercase;

    cursor: pointer;

    position: relative;

    z-index: 9999;

    pointer-events: auto;

    user-select: none;

    transition: color .3s ease, text-shadow .3s ease
}



h1.logo-title:hover {

    text-shadow: 0 0 15px var(--neon-cyan)
}



#timer-box {

    transform: translateY(-8px) scale(1.4);

    background: var(--bg-solid);

    padding: 3px 15px;

    border: 1px solid var(--neon-cyan);

    color: var(--neon-cyan);

    font-size: 1.2rem;

    font-weight: bold;

    box-shadow: 2px 2px 0px rgba(34, 211, 238, .3);

    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%, 0 20%);

    pointer-events: auto;

    position: relative;

    z-index: 20;

    margin-left: 40px;

}



.main-stage {

    flex: 1;

    display: flex;

    justify-content: center;

    align-items: center;

    width: 100%;

    z-index: 10;

    padding: 0 0 5px 0;

    margin-bottom: 0;

    position: relative
}



#game-board {

    backdrop-filter: none;

    background: rgba(17, 24, 39, .8);

    flex: 0 0 auto;

    border: 2px solid rgba(229, 231, 235, .1);

    width: 95%;

    max-width: auto;

    border-radius: 8px;

    display: flex;

    flex-direction: column-reverse;

    justify-content: center;

    align-items: center;

    gap: 20px;

    position: relative;

    z-index: 10;

    overflow: hidden;

    min-height: auto;

    padding-bottom: 10px;

    padding-top: 10px;

    margin-bottom: 40px !important;

}



#game-board::before {

    content: " ";

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 50%, rgba(255, 255, 255, .02) 50%), radial-gradient(circle at center, transparent 60%, rgba(11, 15, 20, .4) 100%);

    background-size: 100% 4px, 100% 100%;

    pointer-events: none;

    animation: tv-flicker .2s infinite;

    z-index: 1
}



.side-img {

    position: absolute;

    height: auto;

    object-fit: contain;

    width: 350px;

    pointer-events: none;

    z-index: 10;

    transition: all .3s ease;

    opacity: .9
}



.logo-left {
    bottom: 10px;
    left: -10px
}

.logo-right {
    bottom: 10px;
    right: -10px
}



.level-row {

    display: flex;

    justify-content: center;

    z-index: 1
}



#lvl-1 {
    gap: var(--gap)
}

#lvl-2 {
    gap: calc(var(--card-w) + (var(--gap) * 2))
}

#lvl-3 {
    gap: var(--gap)
}



.slot {

    width: var(--card-w);

    height: var(--card-h);

    background: #0f151f;

    border: 2px dashed #4B5563;

    border-radius: 4px;

    box-shadow: inset 0 0 10px rgba(0, 0, 0, .5);

    position: relative;

    transition: all .2s;

    z-index: 10
}



.slot::after {

    content: '+';

    position: absolute;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    color: #4B5563;

    font-size: 20px;

    font-weight: bold;

    pointer-events: none
}



.slot.drag-over {

    border-color: var(--neon-cyan);

    background: rgba(34, 211, 238, .05);

    box-shadow: 0 0 15px rgba(34, 211, 238, .2);

    transform: scale(1.05)
}



.slot.drag-over::after {

    color: var(--neon-cyan)
}



.base-wrapper {

    display: flex;

    gap: var(--gap);

    z-index: 1
}



.base-container {

    width: var(--card-w);

    height: 10px;

    display: flex;

    border-radius: 2px;

    overflow: hidden;

    box-shadow: 0 2px 5px rgba(0, 0, 0, .3)
}



.base-block {
    width: 50%;
    height: 100%
}



.card {

    width: var(--card-w);

    height: var(--card-h);

    background: #F3F4F6;

    border: 1px solid #374151;

    box-shadow: 0 2px 4px rgba(0, 0, 0, .5);

    clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 0 100%);

    cursor: grab;

    display: flex;

    flex-direction: column;

    position: relative;

    transform: translateZ(0);

    transition: transform .2s ease;

    z-index: 10
}



.card:hover {

    transform: translateY(-5px);

    border-color: var(--neon-cyan);

    box-shadow: 0 5px 15px rgba(34, 211, 238, .2);

    z-index: 100;

    transition: transform 0.2s ease, box-shadow 0.2s ease;

}



.card:active {
    cursor: grabbing
}



.card.selected {

    border: none;

    transform: scale(1.1);

    z-index: 100;

    box-shadow: 0 0 20px var(--neon-cyan)
}



.card-top {

    display: flex;

    height: 50%;

    width: 100%;

    border-bottom: 1px solid rgba(0, 0, 0, .1)
}



.card-half {
    width: 50%;
    height: 100%
}

.card-half:first-child {
    border-right: 1px solid rgba(0, 0, 0, .1)
}

.card-bottom {
    width: 100%;
    height: 50%
}



.g {
    background-color: var(--neon-green)
}

.b {
    background-color: var(--neon-cyan)
}

.r {
    background-color: var(--neon-magenta)
}

.y {
    background-color: var(--neon-yellow)
}



.card-ghost {

    position: fixed;

    z-index: 9999;

    pointer-events: none;

    opacity: .9;

    transform: rotate(5deg) scale(1.1);

    box-shadow: 0 15px 30px rgba(0, 0, 0, .3)
}



.is-dragging {

    opacity: .8;

    pointer-events: none;

    z-index: 100;

    transform: scale(1.05);

    box-shadow: 0 0 15px var(--neon-cyan)
}



.inventory-panel {

    width: 100%;

    flex: 1;

    background: var(--bg-solid);

    border-top: 2px solid var(--neon-cyan);

    padding: 10px 20px;

    display: flex;

    flex-direction: column;

    z-index: 20;

    box-shadow: 0 -10px 30px rgba(0, 0, 0, .3);

    position: relative
}



.inv-header {

    display: flex;

    justify-content: space-between;

    border-bottom: 1px solid #374151;

    padding-bottom: 5px
}



.inv-title {

    font-size: .9rem;

    font-weight: 700;

    color: var(--text-dim)
}



.inventory-scroll {

    overflow-y: auto;

    flex: 1;

    padding: 10px;

    -ms-overflow-style: none;

    scrollbar-width: none;

    scrollbar-color: var(--neon-cyan) transparent;

}



.inventory-scroll::-webkit-scrollbar {
    display: none
}



#inventory {

    display: grid;

    grid-template-columns: repeat(8, 1fr);

    gap: 1vw;

    width: 95%;

    max-width: 1200px;

    margin: 0 auto;

    padding: 20px 0;

}



/* --- ESTA ES LA CLASE CLAVE DEL EFECTO BLUR --- */

.modal-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    z-index: 2000;

    display: flex;

    justify-content: center;

    align-items: center;


    /* EFECTO LIQUID APPLE */

    background-color: rgba(0, 0, 0, 0.4);

    backdrop-filter: blur(30px) saturate(180%);

    -webkit-backdrop-filter: blur(30px) saturate(180%);

}



.k1-login-wrapper {

    display: grid;

    grid-template-areas: "stack";

    place-items: center;

    position: relative;

    width: fit-content;

    height: auto;

    margin: 0 auto;

    z-index: 1000;

    transform: scale(1.2)
}



.k1-login-wrapper::before {

    content: "";

    position: absolute;

    top: -50%;

    left: -50%;

    width: 200%;

    height: 200%;

    background-color: var(--bg-core);

    background-image: linear-gradient(rgba(255, 255, 255, .15) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .15) 1px, transparent 1px), radial-gradient(circle at center, transparent 40%, #000 90%);

    background-size: 52px 52px, 52px 52px, 100% 100%;

    background-position: center;

    z-index: -1;

    pointer-events: none
}



.k1-login-wrapper::after {

    content: " ";

    grid-area: stack;

    width: 100%;

    height: 100%;

    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, .5) 50%), linear-gradient(90deg, rgba(255, 0, 0, .03), rgba(0, 255, 0, .03), rgba(0, 0, 255, .03));

    background-size: 100% 4px, 3px 100%;

    z-index: 5;

    pointer-events: none;

    opacity: .7;

    mix-blend-mode: overlay
}



.k1-login-img,

.k1-neon-snake,

.k1-screen-content,

.k1-big-title {
    grid-area: stack
}



.k1-big-title {

    z-index: 40;

    align-self: start;

    margin-top: 4%;

    font-size: 4rem;

    text-align: center;

    pointer-events: none;

    font-family: 'Orbitron', sans-serif;

    color: var(--text-main);

    text-transform: uppercase;

    text-shadow: 0 0 15px var(--neon-cyan);

    width: 100%;

    max-width: 800px
}



@keyframes snake-rotate {

    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }

}



.k1-neon-snake {

    width: 100%;

    height: 100%;

    z-index: 1;

    transform: scale(1.08);

    pointer-events: none;

    display: flex;

    justify-content: center;

    align-items: center;

    position: relative;

    overflow: hidden;

    -webkit-mask-image: url('k1login.svg');

    mask-image: url('k1login.svg');

    -webkit-mask-size: 100% 100%;

    mask-size: 100% 100%;

    -webkit-mask-repeat: no-repeat;

    mask-repeat: no-repeat;

    filter: drop-shadow(0 0 8px var(--neon-cyan))
}



.k1-neon-snake::before {

    content: '';

    position: absolute;

    top: -50%;

    left: -50%;

    width: 200%;

    height: 200%;

    background: conic-gradient(transparent 0deg, transparent 270deg, var(--neon-cyan) 360deg);

    animation: snake-rotate 3s linear infinite
}



.k1-login-img {

    height: 85vh;

    width: auto;

    max-height: 900px;

    display: block;

    filter: drop-shadow(0 0 20px rgba(34, 211, 238, .3));

    z-index: 2;

    position: relative
}



.k1-screen-content {

    z-index: 20;

    transform: translateY(-5%);

    width: 30%;

    display: flex;

    flex-direction: column;

    align-items: center
}



.k1-input {

    align-items: center;

    width: 38%;

    height: 40px;

    background: #F9FAFB;

    border: 1px solid var(--neon-cyan);

    font-size: 1.5vh;

    text-align: center;

    font-family: 'Share Tech Mono', monospace;

    font-weight: 700;

    color: #111827;

    outline: none;

    margin-bottom: 6%;

    border-radius: 5%
}



.k1-input:focus {

    box-shadow: 0 0 10px rgba(34, 211, 238, .5)
}



@keyframes arcade-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px #f7931a;
        opacity: 1
    }

    50% {
        box-shadow: 0 0 25px #f7931a;
        opacity: .85
    }

}



.k1-btn {

    width: 40%;

    height: 40px;

    background: #f7931a;

    color: #0B0F14;

    border: none;

    font-size: 1.6vh;

    font-family: 'Orbitron', sans-serif;

    font-weight: 800;

    cursor: pointer;

    margin-top: 2%;

    transition: all .2s ease;

    animation: arcade-pulse 1.2s infinite ease-in-out
}



.k1-btn:hover {

    animation: none;

    color: #fff;

    transform: scale(1.05)
}



.seed-control-area {

    position: absolute !important;

    bottom: 15%;

    left: 50%;

    transform: translateX(-50%);

    z-index: 2147483647 !important;

    pointer-events: auto !important;

    display: flex;

    flex-direction: column;

    align-items: center;

    width: auto;

    margin: 0 !important
}



.btn-personalizar {

    background: rgba(11, 15, 20, .9);

    color: var(--neon-cyan);

    border: 1px solid var(--neon-cyan);

    padding: 8px 15px;

    font-size: .75rem;

    border-radius: 5px;

    cursor: pointer;

    font-family: 'Share Tech Mono', monospace;

    transition: .2s;

    width: 160px;

    text-align: center;

    box-shadow: 0 0 10px rgba(34, 211, 238, .1);

    cursor: pointer !important;

    pointer-events: auto !important;

    position: relative;

    z-index: 2147483647;

    margin-bottom: 0;

}



.btn-personalizar:hover {

    background: var(--neon-cyan);

    color: #000;

    box-shadow: 0 0 15px var(--neon-cyan)
}



#input-seed {

    position: absolute;

    top: 100%;

    left: 50%;

    transform: translateX(-50%);

    width: 160px !important;

    height: 35px;

    line-height: 35px;

    background: #000;

    color: var(--neon-cyan);

    border: 1px solid var(--neon-cyan);

    font-size: .8rem;

    padding: 5px;

    text-align: center;

    border-radius: 5px;

    box-shadow: 0 0 10px rgba(34, 211, 238, .2);

    z-index: 2147483647;

    display: none;

    outline: none;

    transition: all .3s ease;

    margin-top: 5px;

}



#input-seed:focus {

    border-color: var(--neon-cyan);

    box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 10px rgba(34, 211, 238, .2)
}



#input-seed.mostrar-seed {
    display: block !important
}



input[type=number]::-webkit-inner-spin-button,

input[type=number]::-webkit-outer-spin-button {

    -webkit-appearance: none;

    margin: 0
}



.cyber-card {

    background: var(--bg-solid);

    padding: 40px;

    width: 90%;

    max-width: 400px;

    border: 1px solid var(--neon-cyan);

    box-shadow: 0 0 30px rgba(0, 0, 0, .5);

    text-align: center;

    position: relative;

    color: var(--text-main);

    z-index: 100;

    font-family: 'Share Tech Mono', monospace
}



.cyber-card::before,

.cyber-card::after {

    content: '';

    position: absolute;

    width: 10px;

    height: 10px;

    background: var(--neon-cyan)
}



.cyber-card::before {
    top: -1px;
    left: -1px
}

.cyber-card::after {
    bottom: -1px;
    right: -1px
}



.cyber-btn {

    margin-top: 20px;

    background: var(--neon-cyan);

    color: #0B0F14;

    border: none;

    padding: 15px 30px;

    font-family: 'Orbitron', sans-serif;

    font-size: 1rem;

    font-weight: 700;

    cursor: pointer;

    letter-spacing: 2px;

    transition: .2s;

    width: 100%
}



.cyber-btn:hover {

    background: #fff;

    color: #000;

    box-shadow: 0 0 15px var(--neon-cyan)
}



.hash-display {

    background: #000;

    color: var(--neon-cyan);

    padding: 10px;

    font-size: .8rem;

    word-break: break-all;

    margin-top: 15px;

    border-left: 4px solid var(--neon-cyan);

    text-align: left
}



#raw-data-display,

.cyber-card textarea,

.cyber-card input[type="text"].raw-data {

    background-color: #fff !important;

    color: #0B0F14 !important;

    border: 1px solid var(--text-dim);

    font-family: 'Share Tech Mono', monospace;

    font-size: .85rem;

    padding: 10px;

    width: 100%;

    margin-top: 5px;

    outline: none;

    box-shadow: inset 0 0 5px rgba(0, 0, 0, .2)
}



.cyber-card .label-raw {

    color: var(--neon-cyan);

    font-size: .8rem;

    text-align: left;

    display: block;

    margin-top: 15px;

    margin-bottom: 5px;

    text-transform: uppercase
}



#inventory .card {

    max-width: 120px;

    margin: 0 auto;

}



/* --- MEDIAS QUERIES --- */



@media (max-width: 1024px) {

    #game-board {

        width: 100%;

        transform: scale(0.80);

        margin-top: -120px !important;

        margin-bottom: -100px !important;

    }

    #inventory {

        grid-template-columns: repeat(8, 1fr);

        gap: 8px;

        width: 95%;

        margin: 0 auto;

        margin-top: 10px !important;

    }

    .inventory-panel .card,

    #inventory .card {

        width: 130% !important;

        max-width: 60px !important;

        height: auto;

        aspect-ratio: 9.5 / 12;

        margin: 0 auto;

    }

    .side-img {
        width: 250px;
        height: auto;
    }

    .k1-login-wrapper {
        transform: scale(0.96);
    }

}



@media (max-width: 768px) {

    :root {

        --card-w: 55px !important;

        --card-h: 70px !important;

        --gap: 30px !important;

    }

    #inventory .card {
        max-width: 50px !important;
        margin: 0 auto;
    }

    .side-img {
        width: 170px;
        height: auto;
    }

    .logo-left {
        left: 0 !important;
    }

    .logo-right {
        right: 0 !important;
    }

    .hud-corner {
        display: none !important;
    }

    header,

    .header-container {

        flex-direction: row !important;

        justify-content: center !important;

        align-items: center !important;

        padding-top: 15px !important;

        gap: 10px !important;

    }

    h1.logo-title {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        font-size: 1.7rem;
    }

    #timer-box {
        transform: scale(0.9) !important;
        margin: 0 !important;
        position: relative;
    }

    #game-board {

        width: 94% !important;

        transform: none !important;

        margin-left: 0 !important;

        margin-right: 0 !important;

        margin-top: -15px !important;

    }

    .inventory-panel {

        margin-top: 90px !important;

        border-top: 2px solid var(--neon-cyan);

    }

    .k1-big-title {

        z-index: 40;

        align-self: start;

        margin-top: 5%;

        font-size: 3rem;

        text-align: center;

        pointer-events: none;

        font-family: 'Orbitron', sans-serif;

        color: var(--text-main);

        text-transform: uppercase;

        text-shadow: 0 0 15px var(--neon-cyan);

        width: 100%;

        max-width: 800px
    }

    .k1-input {

        align-items: center;

        width: 38%;

        height: 35px;

        background: #F9FAFB;

        border: 1px solid var(--neon-cyan);

        font-size: 1.5vh;

        text-align: center;

        font-family: 'Share Tech Mono', monospace;

        font-weight: 700;

        color: #111827;

        outline: none;

        margin-bottom: 6%;

        margin-top: -3%;

        border-radius: 5%
    }


}



@media (max-width: 480px) {

    :root {

        --card-w: 15vw !important;

        --card-h: 18vw !important;

        --gap: 25px !important;

    }

    .inv-title {
        font-size: 0.6rem !important;
        line-height: 1.2 !important;
    }

    h1.logo-title {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        font-size: 1.7rem;
    }

    #timer-box {
        transform: scale(0.9) !important;
        margin: 0 !important;
        position: relative;
    }

    .side-img {
        width: 135px;
        height: auto;
    }

    #game-board {

        transform: none !important;

        width: 95% !important;

        margin-top: -6px !important;

        padding: 10px 0 !important;

    }

    #inventory {

        grid-template-columns: repeat(4, 1fr);

        gap: 3px;

        width: 99%;

        margin: 0;

        padding: 0;

    }

    header,

    .header-container {
        padding-top: 20px !important;
    }

}



@media (max-width: 350px) {

    .side-img {
        width: 100px;
        height: auto;
    }

}



/* Estilos para el brote ciberpunk */

.cyber-particle {

    position: absolute;

    pointer-events: none;

    border-radius: 2px;

    opacity: 0;

    z-index: 100;

    box-shadow: 0 0 8px currentColor;

    transform-origin: center center;

    scrollbar-width: none;

}



.p-square {
    width: 25px;
    height: 25px;
}

.p-triangle {

    width: 0;

    height: 0;

    border-left: 15px solid transparent;

    border-right: 15px solid transparent;

    border-bottom: 30px solid currentColor;

    background: none !important;

}

.p-line {
    width: 8px;
    height: 35px;
}



@keyframes particle-explode {

    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0) rotate(var(--rot));
        opacity: 0;
    }

}



.broken-glass-bg {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    z-index: 1;
    /* Detrás de la tarjeta, sobre el fondo */

    pointer-events: none;
    /* Importante para poder dar click */


    /* Imagen de vidrio roto */

    background-image: url('https://i.imgur.com/K3a2VpB.png');

    background-size: cover;

    background-position: center;

    opacity: 0.6;

    mix-blend-mode: screen;
    /* Mezcla las grietas con el blur */

}



/* Asegura que la tarjeta flote ENCIMA del vidrio */

#message .cyber-card {

    position: relative;

    z-index: 10;

}