body,
html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #010102;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#swarm-container {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#ui {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 11px;
    padding: 14px 36px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4),
                inset 0 0 12px rgba(255, 255, 255, 0.05);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#ui:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5),
                inset 0 0 16px rgba(255, 255, 255, 0.1);
    transform: translateX(-50%) translateY(-2px);
    color: rgba(255, 255, 255, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

#ui:active {
    transform: translateX(-50%) translateY(1px);
}

/* ==========================================
   TRAUMA-XP — GLOBAL INTERACTION GUIDE
   Reusable component
========================================== */
#xp-interaction-guide {
    position: fixed;
    left: 40px;
    bottom: 40px;
    z-index: 999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Poppins', sans-serif;
}

/* TYPOGRAPHY */
#xp-interaction-guide .xp-guide-words {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.06em;
}

#xp-interaction-guide .xp-guide-words span {
    display: block;
    font-weight: 900;
    color: #fff;
}

#xp-interaction-guide .xp-guide-words span:first-child {
    color: #0062ff;
}

/* DESCRIPTION */
#xp-interaction-guide p {
    margin: 18px 0 0;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
}

/* RESPONSIVE POSITIONING */
@media (max-width: 600px) {
    #xp-interaction-guide {
        left: 20px;
        bottom: 24px;
    }
}

/* VIEWPORT SAFETY */
html,
body {
    overscroll-behavior: none;
}

/* ESTILOS GENERICOS */
html {
    -webkit-text-size-adjust: 100%;

    /* evita que iOS agrande el texto al rotar */
}

body {
    overscroll-behavior: none;

    /* evita pull-to-refresh accidental */
}

* {
    -webkit-tap-highlight-color: transparent;

    /* quita el flash azul al tocar en iOS */
}

/* ==========================================
   TRAUMA-XP — SHAPE LABEL
   RESPONSIVE: MOBILE / TABLET / DESKTOP
========================================== */
#shape-label-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
    padding-top: 80px;
}

#shape-label {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 700;
    letter-spacing: clamp(2px, 0.45vw, 5px);
    text-transform: uppercase;
    text-align: right;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 15px rgba(0, 200, 255, 0.6);
}

/* TABLETS — INCLUDING IPAD */
@media (min-width: 601px) and (max-width: 1024px) {
    #shape-label-container {
        padding: 40px 32px 0 20px;
    }

    #shape-label {
        font-size: clamp(30px, 4vw, 38px);
        letter-spacing: 3px;
    }
}

/* MOBILE */
@media (max-width: 600px) {
    #shape-label-container {
        padding: 32px 20px 0;
    }

    #shape-label {
        font-size: clamp(25px, 6vw, 34px);
        letter-spacing: clamp(1px, 0.5vw, 3px);
    }
}

:root {
    --xp-blue: #0062ff;
    --xp-white: rgba(255,255,255,.88);
    --xp-muted: rgba(255,255,255,.42);
    --xp-line: rgba(255,255,255,.16);
    --xp-live: #36df9a;
}

/* ==========================================
   HUD NAV
========================================== */
.xp-hud-nav {
    position: fixed;
    top: 38px;
    left: 52px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
    user-select: none;
    font-family: 'Poppins', sans-serif;
}

.nav-logo {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .12em;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--xp-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .16em;
}

.dot-live {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #6aff00;
    box-shadow: 0 0 9px rgba(55, 255, 0, 0.75);
    animation: trauma-live-pulse 1.6s ease-in-out infinite;
}

@keyframes trauma-live-pulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 9px rgba(67, 251, 6, 0.836);
    }

    50% {
        opacity: 0.35;
        box-shadow: 0 0 3px rgba(55, 255, 0, 0.831);
    }
}

/* ==========================================
   HUD CORNERS
========================================== */
.hud-corner {
    position: fixed;
    z-index: 15;
    width: 40px;
    height: 40px;
    pointer-events: none;
}

.hud-tl {
    top: 20px;
    left: 20px;
}

.hud-br {
    position: fixed;
    right: 40px;
    bottom: 38px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    width: auto;
    height: auto;
    z-index: 20;
    pointer-events: none;
}

/* ==========================================
   CAMERA READOUT
========================================== */
.hud-readout {
    display: block;
    color: var(--xp-muted);
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: .12em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transform: translate(-30px, 20px);
}

/* ==========================================
   EXPERIENCE METADATA
========================================== */
.xp-hud-meta {
    position: fixed;
    top: 130px;
    left: 52px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
    user-select: none;
    font-family: 'Poppins', sans-serif;
}

.xp-hud-meta .tag {
    color: var(--xp-blue);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
}

.hud-engine {
    color: var(--xp-muted);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: .14em;
}

/* ==========================================
   HUD FOOTER
========================================== */
.xp-hud-footer {
    position: fixed;
    right: 40px;
    bottom: 130px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    color: var(--xp-muted);
    font-family: 'Poppins', sans-serif;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: .14em;
    line-height: 1.5;
    white-space: nowrap;
    text-align: right;
    pointer-events: none;
    user-select: none;
}

/* ==========================================
   TABLETS
========================================== */
@media (min-width: 601px) and (max-width: 1024px) {
    .xp-hud-nav {
        top: 26px;
        left: 32px;
    }

    .xp-hud-meta {
        left: 32px;
        top: 108px;
    }

    .hud-br {
        right: 32px;
        bottom: 28px;
    }

    .hud-readout {
        transform: translate(-30px, 20px);
    }

    .xp-hud-footer {
        right: 32px;
        bottom: 34px;
        font-size: 8px;
        letter-spacing: .12em;
    }
}

/* ==========================================
   MOBILE
========================================== */
@media (max-width: 600px) {
    .xp-hud-nav {
        top: 28px;
        left: 38px;
        gap: 6px;
    }

    .nav-logo {
        font-size: 12px;
    }

    .nav-status {
        font-size: 8px;
        letter-spacing: .12em;
    }

    .hud-tl {
        top: 12px;
        left: 12px;
    }

    .hud-br {
        right: 20px;
        bottom: 24px;
    }

    .hud-readout {
        font-size: 8px;
        transform: translate(-30px, 20px);
    }

    .xp-hud-meta {
        top: 96px;
        left: 38px;
    }

    .xp-hud-footer {
        right: 20px;
        bottom: 115px;
        font-size: 7px;
        letter-spacing: .10em;
        gap: 4px;
    }
}





/* ==========================================
   MOBILE LANDSCAPE — HUD ADJUSTMENTS
========================================== */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 950px) {

    /* 1. CLICK. MOVE. EVOLVE. -> Fijo abajo a la izquierda */
    #xp-interaction-guide {
        left: 20px;       /* Anclado a la izquierda */
        right: auto;      /* Anulamos la derecha */
        bottom: 20px;     /* Fijo al fondo */
        top: auto;        /* Anulamos cualquier top que lo suba */
        align-items: flex-start;
    }

    /* 2. GENERATIVE 3D / PARTICLE MORPHING -> Arriba a la derecha */
    .xp-hud-meta {
        top: 38px;
        left: auto;
        right: 20px;
        align-items: flex-end;
        text-align: right;
    }

    /* 3. INTERACTIVE EXPERIENCE / 100,000 PARTICLES -> Derecha, arriba de XYZ */
    .xp-hud-footer {
        top: auto;
        bottom: 110px;
        left: auto;
        right: 20px;
        align-items: flex-end;
        text-align: right;
    }

}


/* ==========================================
   AJUSTE PARA FORMATO VERTICAL
========================================== */
@media (orientation: portrait) {
    #shape-label-container {
        padding-top: 200px; 
    }
    #shape-label {
        font-size: 15px; 
        letter-spacing: 2px; 
    }
}

/* Ajuste extra para móviles verticales muy pequeños (iPhone SE, etc.) */
@media (orientation: portrait) and (max-width: 400px) {
    #shape-label-container {
        padding-top: 180px; 
    }
    #shape-label {
        font-size: 17px; 
        letter-spacing: 2px;
    }
}


/* ==========================================
   AJUSTE PARA FORMATO HORIZONTAL
========================================== */
/* Landscape general (laptop, iPad acostado, desktop) */
@media (orientation: landscape) {
    #shape-label-container {
        padding-top: 80px; 
    }
}

/* Landscape móvil (pantallas pequeñas acostadas) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 950px) {
    #shape-label-container {
        padding-top: 40px; 
    }
    #shape-label {
        font-size: 17px; 
        letter-spacing: 2px;
    }
}




/* ==========================================
   AJUSTE PARA DESKTOP (pantallas grandes)
========================================== */
@media (orientation: landscape) and (min-width: 1025px) {
    #shape-label {
        font-size: 30px;
        letter-spacing: 3px; /* Reducimos un poco el espaciado para que combine */
    }
}