@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;500;700;800&display=swap');

:root {
    --bg-pure: #ffffff;
    --text-main: #111111;
    --border-light: #e5e5e5;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-pure);
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    user-select: none;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: auto;
}

.brand {
    font-size: 28px; 
    letter-spacing: 2px;
    line-height: 1.1;
    font-weight: 800;
}

/* Letra mucho más oscura y sólida */
#level-display {
    font-size: 16px;
    font-weight: 800;
    color: #111111; 
    letter-spacing: 2px;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 40px; 
}

button {
    background: var(--bg-pure);
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 12px 24px;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    pointer-events: auto;
}

button:hover {
    background: var(--text-main);
    color: var(--bg-pure);
}

#btn-volver {
    position: absolute;
    bottom: 40px;
    left: 40px;
    padding: 8px 16px;
    font-size: 9px;
}

.target-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-pure);
    padding: 12px 24px;
    border: 1px solid var(--border-light);
    pointer-events: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

.label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #111111; 
}

#color-target {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid rgba(0,0,0,0.15);
    transition: background-color 0.3s ease;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--text-main);
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
    padding: 0;
}

.btn-rot-lateral {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 64px; 
    font-weight: 300;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.3;
    padding: 20px;
}
.btn-rot-lateral:hover {
    background: transparent;
    color: var(--text-main);
    opacity: 1;
}
#btn-left { left: 2vw; }
#btn-left:hover { transform: translateY(-50%) translateX(-5px); }
#btn-right { right: 2vw; }
#btn-right:hover { transform: translateY(-50%) translateX(5px); }

.full-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    transition: opacity 0.4s ease;
    opacity: 1;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

.full-panel.hidden-fade {
    opacity: 0 !important;
    pointer-events: none !important;
}

.full-panel .close-btn {
    position: absolute;
    top: 40px;
    right: 40px;
}

.full-panel-content {
    max-width: 900px;
    width: 100%;
}

.full-panel h2 {
    font-size: 36px;
    letter-spacing: 6px;
    margin-bottom: 24px;
    font-weight: 800;
}

.intro-reglas {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 500;
    color: #444;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.reglas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px 40px;
    text-align: left;
}

.reglas-item h3 {
    font-size: 14px;
    color: var(--text-main);
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 800;
}

.reglas-item p {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    font-weight: 500;
    margin: 0;
}

/* --- DESVANECIMIENTO LIMPIO DEL HUD --- */
.fade-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease;
}

#eclipse-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #050505;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
    text-align: center;
    opacity: 1;
    transition: opacity 1s ease;
}

#eclipse-title {
    font-size: 80px;
    letter-spacing: 24px;
    margin-bottom: 20px;
    font-weight: 800;
    margin-left: 24px;
}

#eclipse-overlay p {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 1.5px;
    margin-bottom: 50px;
    max-width: 500px;
    color: #aaaaaa;
}

#btn-eclipse-start {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

#btn-eclipse-start:hover {
    background: #ffffff;
    color: #000000;
}

.hidden-fade {
    opacity: 0 !important;
    pointer-events: none !important;
}

.hidden-fade * {
    pointer-events: none !important;
}

.hidden {
    display: none !important;
}

#tension-ui {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    width: 100%;
}

.tension-warning {
    font-size: 32px;
    font-weight: 800;
    color: #DA251D;
    letter-spacing: 4px;
    animation: flashAlert 0.15s infinite alternate;
    text-shadow: 0px 4px 15px rgba(218, 37, 29, 0.5);
}

.tension-sub {
    font-size: 14px;
    color: var(--text-main);
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: 2px;
}

.tension-bar-container {
    width: 300px;
    height: 12px;
    border: 2px solid var(--text-main);
    margin: 20px auto;
    background: var(--bg-pure);
    position: relative;
}

#tension-progress {
    width: 0%;
    height: 100%;
    background: #DA251D;
    transition: width 0.1s linear;
}

@keyframes flashAlert {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.5; transform: scale(1.05); }
}

#torbellino-ui {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    width: 100%;
    color: #ffffff;
}

.torbellino-progress-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.torbellino-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid rgba(40, 40, 40, 0.55);
    background: rgba(255,255,255,0.08);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.torbellino-dot.found {
    background-color: #9D4EDD;
    border-color: #9D4EDD;
    box-shadow: 0px 0px 12px rgba(157, 78, 221, 0.9);
}

#gravedad-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-pure); 
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none; 
    text-align: center;
    opacity: 1;
    transition: opacity 1s ease;
}

#gravedad-alerta-titulo {
    font-size: 56px;
    letter-spacing: 10px;
    margin-bottom: 24px;
    font-weight: 800;
    animation: balizaRoja 1.5s infinite ease-in-out; 
}

@keyframes balizaRoja {
    0%, 100% { color: var(--text-main); } 
    50% { color: #DA251D; } 
}

#gravedad-overlay p {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 1px;
    margin-bottom: 48px;
    max-width: 600px;
    color: #444444; 
}

#btn-gravedad-start {
    background: var(--text-main);
    color: var(--bg-pure);
    border: 2px solid var(--text-main);
    font-size: 13px;
    padding: 16px 32px;
    font-weight: 700;
}

#btn-gravedad-start:hover {
    background: #DA251D;
    border-color: #DA251D;
    color: var(--bg-pure);
}

#torbellino-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-pure);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    text-align: center;
    opacity: 1;
    transition: opacity 1s ease;
}

#torbellino-alerta-titulo {
    font-size: 56px;
    letter-spacing: 10px;
    margin-bottom: 24px;
    font-weight: 800;
    animation: balizaMorada 1.5s infinite ease-in-out; 
}

@keyframes balizaMorada {
    0%, 100% { color: var(--text-main); }
    50% { color: #9D4EDD; } 
}

#torbellino-overlay p {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 1px;
    margin-bottom: 48px;
    max-width: 600px;
    color: #444444;
}

#btn-torbellino-start {
    background: var(--text-main);
    color: var(--bg-pure);
    border: 2px solid var(--text-main);
    font-size: 13px;
    padding: 16px 32px;
    font-weight: 700;
}

#btn-torbellino-start:hover {
    background: #9D4EDD;
    border-color: #9D4EDD;
    color: var(--bg-pure);
}

/* --- BARRA DE TIEMPO GRAVEDAD --- */
#gravedad-timer-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 200;
    pointer-events: none;
}

#gravedad-timer-bar {
    height: 100%;
    width: 0%;
    background-color: #111111;
    transition: width 0.12s linear, background-color 0.6s ease;
    transform-origin: left center;
}

/* --- PUNTOS DE ERROR TORBELLINO --- */
.torbellino-error-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.torbellino-error-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.torbellino-error-dot.burned {
    background-color: #DA251D;
    border-color: #DA251D;
    box-shadow: 0px 0px 10px rgba(218, 37, 29, 0.9);
}
#win-title {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-main);
    z-index: 100;
    pointer-events: none;
    transition: opacity 1s ease;
    text-align: center;
}

#btn-restart {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 100;
    transition: opacity 1s ease;
}

@media (max-width: 768px) {
    .reglas-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .full-panel h2 {
        font-size: 24px;
    }
    #win-title {
        font-size: 28px;
    }
}

/* --- INVERSIÓN DE COLORES DURANTE ECLIPSE --- */
.eclipse-ui .brand,
.eclipse-ui #level-display,
.eclipse-ui .label {
    color: #ffffff !important;
}

.eclipse-ui button {
    background: transparent !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

.eclipse-ui button:hover {
    background: #ffffff !important;
    color: #000000 !important;
}

.eclipse-ui .btn-rot-lateral {
    color: #ffffff !important;
    background: transparent !important;
}

.eclipse-ui .btn-rot-lateral:hover {
    opacity: 1 !important;
    color: #ffffff !important;
    background: transparent !important;
}

/* CORRECCION ED CAJA RULETA */
.eclipse-ui .target-container {
    background-color: #050505 !important;
    border-color: #ffffff !important;
}

.eclipse-ui #color-target {
    border-color: rgba(255, 255, 255, 0.5) !important;
}