@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Anton&family=Oswald:wght@400;600;700&display=swap');

:root { 
    --background: #6a1b9a; 
    --text: #ffffff; 
    --accent: #ab47bc; 
    --acid: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Oswald', 'Bebas Neue', sans-serif;
    color: var(--text);
    background-color: var(--background);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Fondo que cubre toda la pantalla */
.top-section {
    background-color: var(--accent);
    padding: 0;
    margin: 0;
    padding-top: env(safe-area-inset-top);
}

/* Fondo morado hasta abajo de la imagen footer */
.bottom-section { 
    background-color: var(--background); 
    padding: 30px 0 0; 
    text-align: center; 
}

.footer {
    margin: 0;
    padding: 0;
}

.footer img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1600px;
    margin: 10px auto;
    border: 4px solid black;
    border-radius: 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--accent);
}

.models-row {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    grid-template-columns: 1fr;
    position: relative;
    width: 100%;
    padding: 20px 0;
    gap: 0px;
    aspect-ratio: 1 / 1;
    max-height: 95vh;
}

/* Los modelos 3D ahora son MAS GRANDES pero detrás de los logos */
.left-model, .right-model {
    position: absolute;
    width: 38%;
    max-width: 380px;
    height: 55%;
    max-height: 500px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Zona sensible al arrastre centrada sobre el modelo */
.left-model .touch-zone,
.right-model .touch-zone {
    position: absolute;
    left: 50%;
    top: 85%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    touch-action: none;
    z-index: 4;
    display: block;
    transition: opacity 200ms ease;
    pointer-events: auto;
    opacity: 0;
}

/* Ocultar cuando está arrastrando */
.touch-zone.dragging {
    opacity: 0 !important;
}

/* Parpadeo de la caja touch-zone cada 8 segundos (2 parpadeos) */
.touch-zone.idle-blink {
    animation: blink-touchzone 640ms ease-in-out;
    opacity: 1;
}

@keyframes blink-touchzone {
    0% { 
        background: rgba(255,255,255,0.06); 
        border-color: rgba(255,255,255,0.12); 
        box-shadow: none;
    }
    25% { 
        background: rgba(255,255,255,0.25); 
        border-color: rgba(255,255,255,0.4); 
        box-shadow: 0 0 12px rgba(255,255,255,0.3);
    }
    50% { 
        background: rgba(255,255,255,0.06); 
        border-color: rgba(255,255,255,0.12); 
        box-shadow: none;
    }
    75% { 
        background: rgba(255,255,255,0.25); 
        border-color: rgba(255,255,255,0.4); 
        box-shadow: 0 0 12px rgba(255,255,255,0.3);
    }
    100% { 
        background: transparent; 
        border-color: transparent; 
        box-shadow: none;
    }
}

/* Hover para escritorio */
.left-model .touch-zone:hover,
.right-model .touch-zone:hover {
    background: rgba(255,255,255,0.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    cursor: grab;
    opacity: 1;
}

.left-model .touch-zone:active,
.right-model .touch-zone:active {
    cursor: grabbing;
    opacity: 0;
}

.left-model {
    left: -2%;
}

.right-model {
    right: -2%;
}

model-viewer {
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

/* Logo Katchi arriba */
.center-logos {
    display: contents;
}

.katchi-logo {
    grid-row: 1;
    width: 100%;
    max-width: clamp(280px, 65vw, 500px);
    height: auto;
    margin: 0 auto;
    padding: 0 20px;
    cursor: pointer;
    z-index: 3;
    position: relative;
    align-self: end;
}

/* X en el centro */
.crossover {
    grid-row: 2;
    font-family: 'Anton', 'Bebas Neue', sans-serif;
    font-size: clamp(100px, 28vw, 200px);
    line-height: 1;
    text-shadow: 0 0 30px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    position: relative;
    margin: 0;
    font-weight: 400;
}

/* Logo Palida abajo */
.palida-logo {
    grid-row: 3;
    width: 100%;
    max-width: clamp(300px, 68vw, 520px);
    height: auto;
    margin: 0 auto;
    padding: 0 20px;
    cursor: pointer;
    z-index: 3;
    position: relative;
    align-self: start;
}

.palida-logo-container {
    display: none;
}

/* AJUSTES PARA TABLETS (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        margin: 8px;
    }

    .models-row {
        padding: 18px 0;
        gap: 0px;
        aspect-ratio: 1 / 1;
        grid-template-rows: 1fr auto 1fr;
    }

    .left-model, .right-model {
        width: 36%;
        max-width: 340px;
        height: 52%;
        max-height: 460px;
    }

    .left-model {
        left: -1%;
    }

    .right-model {
        right: -1%;
    }

    .katchi-logo {
        max-width: clamp(260px, 62vw, 460px);
    }

    .crossover {
        font-size: clamp(90px, 26vw, 180px);
        margin: 0;
    }

    .palida-logo {
        max-width: clamp(280px, 65vw, 480px);
    }
}

/* AJUSTES PARA CELULAR HORIZONTAL Y TABLETS CHICAS (481px - 768px) */
@media (max-width: 768px) {
    .container {
        margin: 6px;
        border-radius: 12px;
        border-width: 3px;
    }

    .models-row {
        padding: 16px 0;
        gap: 0px;
        aspect-ratio: 1 / 1.05;
        grid-template-rows: 1fr auto 1fr;
    }

    .left-model, .right-model {
        width: 34%;
        max-width: 300px;
        height: 50%;
        max-height: 420px;
    }

    .left-model {
        left: -1%;
    }

    .right-model {
        right: -1%;
    }

    .katchi-logo {
        max-width: clamp(240px, 60vw, 420px);
        padding: 0 16px;
    }

    .crossover {
        font-size: clamp(80px, 24vw, 150px);
        margin: 0;
    }

    .palida-logo {
        max-width: clamp(260px, 63vw, 440px);
        padding: 0 16px;
    }
}

/* AJUSTES PARA CELULAR VERTICAL (hasta 480px) */
@media (max-width: 480px) {
    .container {
        margin: 4px;
        border-radius: 10px;
        border-width: 2px;
    }

    .models-row {
        padding: 14px 0;
        gap: 0px;
        aspect-ratio: 1 / 1.08;
        grid-template-rows: 1fr auto 1fr;
    }

    .left-model, .right-model {
        width: 32%;
        max-width: 260px;
        height: 48%;
        max-height: 380px;
    }

    .left-model {
        left: -2%;
    }

    .right-model {
        right: -2%;
    }

    .katchi-logo {
        max-width: clamp(220px, 58vw, 380px);
        padding: 0 12px;
    }

    .crossover {
        font-size: clamp(70px, 22vw, 130px);
        margin: 0;
    }

    .palida-logo {
        max-width: clamp(240px, 60vw, 400px);
        padding: 0 12px;
    }
}

/* AJUSTES PARA CELULARES MUY PEQUEÑOS (hasta 360px) */
@media (max-width: 360px) {
    .container {
        margin: 3px;
    }

    .models-row {
        padding: 12px 0;
        gap: 0px;
        aspect-ratio: 1 / 1.1;
        grid-template-rows: 1fr auto 1fr;
    }

    .left-model, .right-model {
        width: 30%;
        max-width: 220px;
        height: 46%;
        max-height: 340px;
    }

    .left-model {
        left: -2%;
    }

    .right-model {
        right: -2%;
    }

    .katchi-logo {
        max-width: clamp(200px, 56vw, 340px);
        padding: 0 10px;
    }

    .crossover {
        font-size: clamp(60px, 20vw, 110px);
        margin: 0;
    }

    .palida-logo {
        max-width: clamp(220px, 58vw, 360px);
        padding: 0 10px;
    }
}

/* Sección inferior */
.form-container { 
    max-width: 700px; 
    margin: 0 auto; 
    padding: 0 16px; 
}

.registration-box { 
    background: transparent; 
    color: var(--text); 
    padding: 24px; 
    border: 4px solid var(--accent); 
    border-radius: 12px; 
}

.user-info {
    background: transparent;
    color: var(--acid);
    padding: 16px;
    margin-bottom: 20px;
    border: 2px solid var(--acid);
    border-radius: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1rem, 4vw, 1.3rem);
    letter-spacing: 1.5px;
}

h2 { 
    font-family: 'Bebas Neue', 'Anton', sans-serif; 
    font-size: clamp(1.8rem, 6vw, 2.3rem); 
    margin: 0 0 20px;
    font-weight: 400;
    letter-spacing: 2px;
}

input { 
    background: transparent; 
    border: none; 
    border-bottom: 3px solid var(--text); 
    color: var(--text); 
    font-size: 1.3rem; 
    margin: 12px 0; 
    padding: 10px; 
    width: 100%; 
    outline: none; 
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

button { 
    background: var(--accent); 
    color: white; 
    border: none; 
    padding: 14px 40px; 
    font-family: 'Bebas Neue', 'Anton', sans-serif; 
    font-size: 1.15rem; 
    cursor: pointer; 
    margin-top: 20px; 
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 400;
    letter-spacing: 2px;
}

button:hover {
    background: var(--text);
    color: var(--background);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Estilos para el panel admin */
.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--acid);
}

@media (max-width: 480px) {
    .bottom-section {
        padding: 20px 0 0;
    }

    .registration-box {
        padding: 20px 16px;
        border-width: 3px;
    }

    input {
        font-size: 1.1rem;
        padding: 8px;
    }

    button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .admin-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .admin-item button {
        width: 100%;
        margin-top: 8px;
    }
}