:root {
    --bg-color: #fdf2f8; /* Soft pink background */
    --primary-color: #db2777; /* Pink 600 */
    --secondary-color: #9d174d; /* Pink 800 */
    --accent-color: #fce7f3; /* Pink 100 */
    --text-color: #374151; /* Gray 700 */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #fdf2f8;
    overflow: hidden; /* Mantener oculto el desbordamiento general */
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    background: transparent;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 10;
}

/* --- MAP VIEW (SCROLLABLE) --- */
#map-view {
    /* Permitir scroll horizontal si el mapa es más ancho */
    display: block; /* Cambiar de flex a block para permitir scroll */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Suavizar scroll en iOS */
    
    /* El contenedor interno del mapa */
    background: none; /* Quitamos el background de aquí */
}

/* Wrapper para la imagen del mapa y los pines */
.map-wrapper {
    position: relative;
    height: 100%;
    /* Aspect ratio aproximado de un mapa mundial (ej. 16:9 o más ancho) */
    /* Aseguramos que sea lo suficientemente ancho para verse bien en móvil */
    min-width: 150vh; /* Forzamos que sea ancho (basado en la altura) */
    background-image: url('map-bg.png');
    background-size: cover;
    background-position: center;
}

/* Floating Cards/Pins */
.card {
    position: absolute;
    width: 70px; /* Mas grandes */
    height: 55px; /* Mas grandes */
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 2rem; /* Icono mas grande */
    animation: float 3s ease-in-out infinite;
    z-index: 100; /* Asegurar que este por encima */
    transition: transform 0.2s;
}

.card:hover {
    transform: scale(1.1) rotate(5deg);
}

.card:nth-child(even) {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Safe Trigger on Map */
.safe-trigger-container {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 25;
    animation: pulse-safe 2s infinite;
}

.safe-trigger-img {
    width: 100%;
    height: auto;
    /* Intentar eliminar fondo blanco con mezcla */
    mix-blend-mode: multiply; 
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.safe-trigger-container:hover .safe-trigger-img {
    transform: scale(1.1);
}

@keyframes pulse-safe {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Locked View Safe Image */
.safe-image-locked {
    width: 200px; 
    height: auto;
    margin-bottom: 1rem;
    border-radius: 20px;
    /* Si la imagen tiene fondo blanco, esto ayuda a integrarla en el modo bloqueado también */
    mix-blend-mode: multiply; 
}

/* Removed old .safe-image and .vault-trigger styles */


/* Removed generic SVG lock-icon styles */

.hint-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.code-display {
    display: flex;
    gap: 0.5rem; /* Reduced gap for 5 digits */
    margin-bottom: 2rem;
}

.digit-box {
    width: 45px; /* Slightly smaller */
    height: 55px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.digit-box.filled {
    border-color: var(--primary-color);
    background: #fff;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 320px;
}

.key {
    background: rgba(255, 255, 255, 0.4);
    border: none;
    border-radius: 50%;
    height: 65px;
    width: 65px;
    margin: 0 auto;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.key:active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0.95);
}

.action-key {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
    color: #ef4444; /* Red for error */
    border-color: #ef4444;
}

/* Unlocked View Styles */
#unlocked-view {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.heart-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.message-body {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-color);
    padding: 0 1rem;
}
/* Reset Button */
.reset-btn {
    margin-top: 2rem;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.reset-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Instructions Button */
.info-btn {
    position: fixed; /* Changed to fixed so it doesn't scroll with the map */
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 50;
    transition: all 0.2s;
}

.info-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-50%) scale(1.05);
}
/* --- MODAL STYLES --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; /* High z-index to be on top of everything */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
    /* Ensure it overlays correctly even if inside transformed parent */
    backdrop-filter: blur(5px);
}

.modal.open {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s ease;
    border: 2px solid var(--primary-color);
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--primary-color);
}

#clue-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

#clue-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.clue-decoration {
    font-size: 3rem;
}
