* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #02050a;
    color: #dffcff;
    font-family: 'Orbitron', Arial, sans-serif;
    user-select: none;
}
body {
    position: relative;
}
canvas {
    position: fixed;
    inset: 0;
    display: block;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0;
}

/* =================================================
   BOTÓN MENÚ
================================================= */

.menu-toggle {
    position: fixed;
    top: 16px;
    left: 18px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(0, 246, 255, 0.45);
    background: linear-gradient(
        135deg,
        rgba(9, 24, 32, 0.96),
        rgba(2, 8, 13, 0.96)
    );
    color: #00f6ff;
    font: 700 22px/1 'Orbitron', sans-serif;
    cursor: pointer;
    z-index: 120;
    box-shadow:
        0 0 22px rgba(0, 246, 255, 0.17),
        inset 0 0 14px rgba(0, 246, 255, 0.04);
    backdrop-filter: blur(12px);
}
.menu-toggle:hover {
    border-color: #00f6ff;
    box-shadow: 0 0 26px rgba(0, 246, 255, 0.30);
}

/* =================================================
   PANEL PRINCIPAL
================================================= */

.control-panel {
    position: fixed;
    top: 74px;
    left: 18px;
    width: 310px;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
    z-index: 110;
    background: linear-gradient(
        145deg,
        rgba(8, 20, 28, 0.95),
        rgba(2, 8, 13, 0.93)
    );
    border: 1px solid rgba(0, 246, 255, 0.25);
    box-shadow:
        0 0 38px rgba(0, 0, 0, 0.60),
        inset 0 0 28px rgba(0, 246, 255, 0.025);
    backdrop-filter: blur(18px);
    clip-path: polygon(
        0 12px,
        12px 0,
        100% 0,
        100% calc(100% - 12px),
        calc(100% - 12px) 100%,
        0 100%
    );
    transition:
        transform 0.32s ease,
        opacity 0.28s ease;
}
.control-panel.panel-hidden {
    transform: translateX(calc(-100% - 50px));
    opacity: 0;
    pointer-events: none;
}
.control-panel::-webkit-scrollbar {
    width: 4px;
}
.control-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 246, 255, 0.30);
}

/* =================================================
   MARCA UV/3D
================================================= */

.menu-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 246, 255, 0.12);
}
.brand-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.brand-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #00f6ff;
    box-shadow:
        0 0 8px #00f6ff,
        0 0 20px #00f6ff;
    animation: pulse 1.5s infinite;
}
.brand-text strong {
    display: block;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 2px;
    white-space: nowrap;
}
.brand-text strong span {
    color: #00f6ff;
}
.brand-text small {
    display: block;
    margin-top: 4px;
    color: #52777c;
    font-size: 6px;
    letter-spacing: 1.7px;
    white-space: nowrap;
}
.home-link {
    flex: 0 0 auto;
    color: #00f6ff;
    text-decoration: none;
    font-size: 8px;
    letter-spacing: 1px;
}
.home-link:hover {
    text-shadow: 0 0 10px #00f6ff;
}

/* =================================================
   CABECERA
================================================= */

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.panel-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    letter-spacing: 2px;
}
.status {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #40ff9c;
    font-size: 6px;
    letter-spacing: 1px;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #40ff9c;
    box-shadow: 0 0 10px #40ff9c;
}

/* =================================================
   SECCIONES
================================================= */

.section-title {
    margin: 14px 0 7px;
    color: #5f858a;
    font-size: 7px;
    letter-spacing: 2px;
}
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

/* =================================================
   BOTONES
================================================= */

.menu-button {
    min-height: 56px;
    padding: 9px 8px;
    border: 1px solid rgba(0, 246, 255, 0.16);
    background: linear-gradient(
        135deg,
        rgba(13, 31, 39, 0.82),
        rgba(4, 12, 17, 0.94)
    );
    color: #dffcff;
    font: 600 8px/1.25 'Orbitron', sans-serif;
    letter-spacing: 0.7px;
    cursor: pointer;
    text-align: left;
    transition: 0.18s ease;
}
.menu-button span {
    display: block;
    margin-bottom: 4px;
    color: #00f6ff;
    font-size: 16px;
}
.menu-button small {
    display: block;
    margin-top: 4px;
    color: #52777c;
    font-size: 6px;
    letter-spacing: 0.7px;
}
.menu-button:hover {
    border-color: #00f6ff;
    background: linear-gradient(
        135deg,
        rgba(0, 246, 255, 0.13),
        rgba(4, 12, 17, 0.96)
    );
    box-shadow: 0 0 18px rgba(0, 246, 255, 0.12);
}
.menu-button.active {
    border-color: rgba(64, 255, 156, 0.35);
}
.menu-button.active span,
.menu-button.active small {
    color: #40ff9c;
}
.menu-button.danger span {
    color: #ff526d;
}

/* =================================================
   DATOS
================================================= */

.data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    margin-bottom: 6px;
    border: 1px solid rgba(0, 246, 255, 0.09);
    background: rgba(255, 255, 255, 0.015);
}
.data-row span {
    color: #5f858a;
    font-size: 7px;
    letter-spacing: 1px;
}
.data-row strong {
    color: #00f6ff;
    font-size: 10px;
}

/* =================================================
   COORDENADAS
================================================= */

.coords-box {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    padding: 8px 11px;
    border: 1px solid rgba(0, 246, 255, 0.25);
    background: rgba(2, 8, 13, 0.74);
    color: #00f6ff;
    font-size: 9px;
    letter-spacing: 1px;
    text-shadow: 0 0 7px rgba(0, 246, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* =================================================
   MIRA CENTRAL
================================================= */

.crosshair {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    z-index: 40;
    opacity: 0.55;
    pointer-events: none;
}
.crosshair::before,
.crosshair::after {
    content: "";
    position: absolute;
    background: #00f6ff;
    box-shadow: 0 0 8px #00f6ff;
}
.crosshair::before {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
}
.crosshair::after {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

/* =================================================
   INSTRUCCIONES
================================================= */

.instructions-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}
.instructions-modal.hidden {
    display: none;
}
.instructions-box {
    width: min(680px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    background: linear-gradient(
        145deg,
        rgba(8, 20, 28, 0.96),
        rgba(2, 8, 13, 0.96)
    );
    border: 1px solid rgba(0, 246, 255, 0.28);
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.65),
        0 0 24px rgba(0, 246, 255, 0.08),
        inset 0 0 24px rgba(0, 246, 255, 0.03);
    clip-path: polygon(
        0 14px,
        14px 0,
        100% 0,
        100% calc(100% - 14px),
        calc(100% - 14px) 100%,
        0 100%
    );
}
.instructions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 246, 255, 0.14);
}
.instructions-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    letter-spacing: 2px;
}
.close-instructions {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(0, 246, 255, 0.26);
    background: rgba(0, 246, 255, 0.06);
    color: #00f6ff;
    font: 700 16px/1 'Orbitron', sans-serif;
    cursor: pointer;
}
.close-instructions:hover {
    border-color: #00f6ff;
    box-shadow: 0 0 14px rgba(0, 246, 255, 0.18);
}
.instructions-content {
    color: #b7d7db;
    font-size: 12px;
    line-height: 1.8;
}
.instructions-intro {
    margin-top: 0;
    margin-bottom: 18px;
    color: #dffcff;
}
.instructions-section {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(0, 246, 255, 0.10);
    background: rgba(255, 255, 255, 0.02);
}
.instructions-section h4 {
    margin: 0 0 10px 0;
    color: #00f6ff;
    font-size: 11px;
    letter-spacing: 2px;
}
.instructions-section ul {
    margin: 0;
    padding-left: 18px;
}
.instructions-section li {
    margin-bottom: 6px;
}
.instructions-section strong {
    color: #ffffff;
}

/* =================================================
   ANIMACIÓN
================================================= */

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.38;
    }
}

/* =================================================
   CELULARES
================================================= */

@media (max-width: 700px) {
    .menu-toggle {
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
    }
    .control-panel {
        top: 64px;
        left: 12px;
        width: min(330px, calc(100vw - 24px));
        max-height: calc(100dvh - 76px);
        padding: 15px;
    }
    .coords-box {
        right: 12px;
        bottom: 12px;
        font-size: 8px;
    }
    .instructions-box {
        padding: 16px;
    }
    .instructions-header h3 {
        font-size: 15px;
    }
    .instructions-content {
        font-size: 11px;
    }
}