:root {
    --rosa: rgb(237, 14, 143);
    --verde-claro: rgb(0, 236, 0);
    --verde: #4caf50;
    --verde-oscuro: rgba(5,56,45,.8);
    --amarillo: rgb(250, 254, 3);
    --azul-oscuro: rgb(35, 41, 228);
    --morado: rgb(97, 35, 246);
    --azul-claro: rgb(49, 206, 218);
    --naranja: rgb(227, 74, 0);
    --negro: rgb(0, 0, 0);
    --gris-mas-oscuro: rgb(27 31 29);
    --gris-oscuro: rgb(43, 45, 44);
    --gris-medio: rgb(66, 68, 67);
    --gris-claro: rgb(237, 237, 237); /* 10% */
    --blanco: #fff;
  }


/* Reset y configuración base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--gris-mas-oscuro);
    color: var(--blanco);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

header {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gris-claro);
}

header img {
    max-width: 100%;
}

/* Contenedor principal */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* intro */
.intro {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    margin: 0 0 20px 0;
    font-size: clamp(2rem, 5vw, 2.5rem);
    letter-spacing: 2px;
}

.large {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    font-weight: bold;
}

.desc {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Navegación de Escape Rooms */
.escape-rooms-nav {
    margin-bottom: 30px;
    text-align: center;
}

.escape-rooms-nav h3 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.room-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.room-card {
    background: var(--gris-oscuro);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: var(--verde-claro);
}

.room-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.room-card p {
    margin: 0;
    font-size: 0.9rem;
}

.room-card.completed {
    border: 2px solid var(--verde);
    box-shadow: 0 0 10px 0 var(--verde);
    position: relative;
}
.room-card.completed::after {
    content: '✔ Completado';
    color: var(--gris-claro);
    background: var(--verde);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 8px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.room-card.locked {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(0.7);
    position: relative;
}
.room-card.locked::after {
    content: '🔒 Bloqueada';
    color: var(--gris-claro);
    background: var(--gris-medio);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 8px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

/* Contenido principal con flexbox */
.main-content {
    display: flex;
    gap: 30px;
    flex: 1;
    align-items: flex-start;
}

/* Panel izquierdo */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Permite que el flex item se encoja */
}

/* Panel derecho */
.right-panel {
    flex: 0 0 350px;
    min-width: 0;
}

/* Chatbot */
.chatbot-container {
    background: var(--gris-claro);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.chatbot-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 15px 20px;
    background: var(--verde-oscuro);
    border-bottom: 1px solid var(--gris-medio);
    gap: 20px;
    flex-wrap: wrap;
}

.chatbot-container h3 {
    margin: 0;
    font-size: 1.1rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.chatbot-container iframe {
    border: none;
    width: 100%;
    height: 500px;
    min-height: 400px;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

/* Energía - Barra horizontal */
.energy-container {
    flex: 1;
    min-width: 0;
}

/* Batería horizontal */
.battery {
    width: 100%;
    height: 24px;
    border: 2px solid var(--gris-medio);
    border-radius: 12px;
    position: relative;
    background: var(--gris-claro);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.battery-level {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--verde), var(--verde));
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease, background 0.5s ease;
    border-radius: 10px;
}

#energyValue {
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    position: relative;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    margin-right: 5px;
}

#energyRays {
    font-size: 0.8rem;
    z-index: 10;
    position: relative;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    color: var(--verde-claro);
}

/* Cuando la energía es baja, cambiar color */
.battery-level.low {
    background: linear-gradient(90deg, var(--naranja), var(--naranja));
}

#energyValue.low {
    color: var(--gris-claro);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

#energyRays.low {
    color: var(--amarillo);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}



/* Estados del ordenador */
.lock-container.opened {
    background: linear-gradient(135deg, var(--verde), var(--verde));
}

.lock-container.opened h2 {
        color: var(--blanco);
}

.lock-container.opened .lockbox label {
    color: var(--blanco);
}

.lock-container.opened .lockbox input[type="password"] {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.lock-container.opened .lockbox button {
    background: linear-gradient(135deg, var(--gris-claro), var(--gris-claro));
    color: var(--verde);
    font-weight: bold;
}

.lock-container.opened .lockbox button:hover {
    background: linear-gradient(135deg, var(--gris-claro), var(--gris-claro));
}


/* Estado de error temporal */
.lock-container.error {
    background: linear-gradient(135deg, #ff5252, #d32f2f);
    transition: background 0.3s ease;
}

.lock-container.error h2 {
    color: var(--blanco);
}

.lock-container.error .lockbox label {
    color: var(--blanco);
}

.lock-container.error .lockbox input[type="password"] {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.lock-container.error .lockbox button {
    background: linear-gradient(135deg, var(--gris-claro), var(--gris-claro));
    color: var(--naranja);
    font-weight: bold;
}

/* Cofre */
.lock-container {
    background: var(--gris-claro);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.lock-container h2 {
    margin: 0 0 25px 0;
    text-align: center;
    font-size: 1.5rem;
}

.lockbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.lockbox label {
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.lockbox input[type="password"] {
    padding: 12px 16px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 2px solid var(--gris-medio);
    width: 100%;
    max-width: 250px;
    text-align: center;
    background: var(--gris-claro);
    color: var(--blanco);
    transition: border-color 0.3s ease;
}

.lockbox input[type="password"]:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    background-color: blue;
}

.lockbox button {
    background: var(--gris-medio);
    color: var(--verde-claro);
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    /* box-shadow: 0 2px 8px rgba(255, 180, 0, 0.3); */
}

.lockbox button:hover {
    background: var(--verde-claro);
    color: var(--negro);
}

.lockbox button:active {
    transform: translateY(0);
}

/* Mensajes */
#message {
    min-height: 20px;
    text-align: center;
    font-weight: 500;
    margin-top: 10px;
}

.success {
    font-weight: bold;
}

.error {
    font-weight: bold;
}

/* Cronómetro */
.timer-container {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-display {
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--blanco);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}

.timer-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Estados del cronómetro */
.warning {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 1s infinite;
}

.danger {
    color: var(--naranja);
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
    animation: pulse 0.5s infinite;
}


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


.lock-container {
    padding: 20px;
    border-radius: 12px;
    border-style: solid;
    border-width: 1px;
    background-color: var(--gris-oscuro);
    border-color: hsla(0,0%,100%,.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        gap: 20px;
    }
    
    .right-panel {
        flex: 0 0 320px;
    }
    
    .chatbot-container iframe {
        height: 450px;
    }
    
    .rooms-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .left-panel {
        order: 2;
        width: 100%;
    }
    
    .right-panel {
        flex: none;
        order: 1;
        width: 100%;
    }
    
    .lock-container {
        position: static;
    }
    
    .chatbot-container {
        width: 100%;
        margin: 0 auto;
        min-height: 500px;
    }
    
    .chatbot-container iframe {
        height: 500px;
        width: 100%;
        min-height: 450px;
    }
    
    .chatbot-intro {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px 15px 10px 15px;
    }
    
    .chatbot-container h3 {
        text-align: center;
        font-size: 1rem;
    }
    
    .energy-container {
        width: 100%;
    }
    
    .escape-rooms-nav {
        margin-bottom: 20px;
    }
    
    .escape-rooms-nav h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .rooms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .room-card {
        padding: 15px;
    }
    
    .room-card h4 {
        font-size: 1.1rem;
    }
    
    .timer-container {
        padding: 12px;
    }
    
    .timer-display {
        font-size: 1.5rem;
    }
    
    .timer-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .intro {
        margin-bottom: 20px;
    }
    
    .chatbot-container {
        border-radius: 12px;
        height: 80vh;
        min-height: 400px;
    }
    
    .chatbot-intro {
        padding: 12px 12px 8px 12px;
        gap: 10px;
    }
    
    .chatbot-container h3 {
        font-size: 0.95rem;
    }
    
    .chatbot-container iframe {
        height: calc(80vh - 60px);
        min-height: 350px;
        flex: 1;
    }
    
    .lockbox input[type="password"] {
        max-width: 200px;
        padding: 10px 12px;
    }
    
    .lockbox button {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .battery {
        height: 20px;
    }
    
    #energyValue {
        font-size: 0.8rem;
    }
    
    #energyRays {
        font-size: 0.7rem;
    }
    
    .escape-rooms-nav {
        margin-bottom: 15px;
    }
    
    .escape-rooms-nav h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .room-card {
        padding: 12px;
    }
    
    .room-card h4 {
        font-size: 1rem;
    }
    
    .room-card p {
        font-size: 0.8rem;
    }
    
    .timer-container {
        padding: 10px;
    }
    
    .timer-display {
        font-size: 1.3rem;
    }
    
    .timer-label {
        font-size: 0.75rem;
    }
}

#lockTitle, #timer {
    margin-bottom: 0;
}

.intro-desc {
  background: var(--gris-oscuro);
  border: 2px solid var(--gris-medio);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 24px;
  font-size: 1.08em;
  box-shadow: 0 2px 8px rgba(80,40,120,0.07);
  width: 100%;
  box-sizing: border-box;
}
.highlight {
  color: var(--verde-claro);
  font-weight: bold;
}
.suerte {
  color: var(--verde);
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  margin-top: 12px;
}

/* Footer */
.footer {
    background: var(--negro);
    padding: 30px 20px;
    border-top: 1px solid var(--gris-claro);
}

.footer-content {
    max-width: 1000px;
    margin: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}



.logos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.logos-container img {
    height: 60px;
    max-width: 150px;
}


/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .logos-container {
        gap: 20px;
    }
    
    .logos-container img {
        height: 50px;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .logos-container {
        flex-direction: column;
        gap: 15px;
    }
}

#iframeEscape {
    display: none;
}

a {
    color: var(--verde-claro);
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;

}

#already-completed-message {
    animation: blink 1s step-start 0s infinite;
}

@keyframes blink {
    0% {
        color: var(--verde-claro);
    }
    50% {
        color: white;
    }
    100% {
        color: var(--verde-claro);
    }
}

.fixed-center {
  position: fixed;       /* Fija el elemento en la pantalla */
  top: 50%;              /* Centrado vertical */
  left: 50%;             /* Centrado horizontal */
  transform: translate(-50%, -50%); /* Ajusta para centrar exactamente */
  z-index: 9999;         /* Se asegura que esté por encima de otros elementos */
  text-align: center;    /* Centrado del texto */
}

/* Consent Overlay */
#consentOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 1);
    z-index: 100000; /* por encima de todo */
    display: none; /* visible si no hay consentimiento */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.consent-box {
    background: var(--gris-oscuro);
    color: var(--blanco);
    border: 1px solid var(--gris-medio);
    border-radius: 12px;
    padding: 24px;
    max-width: 640px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.consent-box h2 {
    margin: 0 0 12px 0;
}

.consent-actions {
    margin-top: 16px;
}

.consent-actions button {
    background: var(--verde);
    color: var(--blanco);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.consent-actions button:hover {
    background: var(--verde-claro);
    color: var(--negro);
}

/* PISTAS */

.hints-balls-container {
        display: flex;
        gap: 12px;
        justify-content: center;
        margin: 0px 0 18px 0;
    }
.hint-ball {
    width: 60px;
    height: 60px;
    background: #e0e0e0;
    border-radius : 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.7em;
    color: #333;
    border: 2px solid #bdbdbd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    outline: none;
}
.hint-ball:hover {
    background: var(--verde-claro);
    border-color: var(--verde-oscuro);
}
.hint-ball-used {
    background: #4caf50 !important;
    border-color: #388e3c !important;
    color: white !important;
}
.hint-ball-disabled {
    background: #bdbdbd !important;
    border-color: #9e9e9e !important;
    color: #757575 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Modal de pista */
#modalPista {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#modalPista .modal-content {
    background: var(--gris-medio);
    color: var(--blanco);
    border-radius: 18px;
    padding: 36px 28px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#modalPistaTexto {
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 18px;
    display: block;
}

#modalPista .modal-close-btn {
    margin-top: 10px;
    padding: 8px 22px;
    border-radius: 8px;
    border: none;
    background: #4caf50;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
}
    
