/* --- Estilos Generales --- */
:root {
    --bg-body: #1a75d2;
    --bg-blue-container: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    --font-color-header: #fff;
    --font-color-general: #333;
    --font-color-white: #ffffff;
    --border-gold: #f1c40f;
    --btn-color-base: #9b59b6; 
    --btn-border-base: #8e44ad;
    --btn-color-correct: #2ecc71; 
    --btn-border-correct: #27ae60;
    --btn-color-incorrect: #e74c3c; 
    --btn-border-incorrect: #c0392b;
}

body {
    margin: 0;
    padding: 20px 0;
    font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 20px, transparent 20px, transparent 40px);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.mobile-container { width: 100%; max-width: 420px; background-color: transparent; display: flex; flex-direction: column; margin: 0 auto; position: relative; }

/* --- Título Principal --- */
.main-header { text-align: center; padding: 10px; }
.main-header h1 { 
    font-size: 32px; font-weight: 700; color: var(--border-gold); margin: 0; 
    text-shadow: -2px -2px 0 #8B4513, 2px -2px 0 #8B4513, -2px 2px 0 #8B4513, 2px 2px 0 #8B4513, 0px 4px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}
.main-header h2 { font-size: 16px; color: var(--font-color-white); margin: 5px 0 15px 0; font-weight: 600; letter-spacing: 1px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* --- Área de Juego --- */
.game-area { background: var(--bg-blue-container); border: 6px solid var(--border-gold); border-radius: 15px; padding: 10px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0px 10px 20px rgba(0,0,0,0.3); }

/* --- Barra Superior de Estado --- */
.top-status-bar { display: flex; justify-content: space-between; align-items: stretch; gap: 5px; height: 35px; }
.status-box { background-color: #8c7247; color: var(--font-color-white); border: 2px solid var(--border-gold); border-radius: 8px; display: flex; align-items: center; padding: 0 8px; font-size: 14px; font-weight: 600; box-shadow: inset 0 2px 5px rgba(0,0,0,0.3); }
.status-box svg { width: 20px; height: 20px; margin-right: 5px; }
.level-box { flex-direction: column; justify-content: center; padding: 2px 15px; background-color: var(--border-gold); color: #8B4513; }
.level-box .level-label { font-size: 11px; text-transform: uppercase; font-weight: 700;}
.level-box .level-number { font-size: 16px; font-weight: 700;}
.value { color: #ffd700; margin-left: 5px; font-size: 16px;}

/* --- Contenido del Juego --- */
.game-content { display: flex; gap: 10px; min-height: 250px; }
.character-col { flex: 0 0 110px; background: linear-gradient(180deg, #A8D8F8 0%, #E6F4FB 100%); border: 3px solid var(--border-gold); border-radius: 10px; display: flex; flex-direction: column; align-items: center; padding: 8px 5px 0 5px; position: relative; }

.player-name-container { width: 100%; display: flex; flex-direction: column; align-items: center; z-index: 2; margin-bottom: 5px; }
.player-name-label { font-size: 9px; color: #8B4513; font-weight: 700; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.player-name-input-box { background-color: #FFF8DC; border: 2px solid #8B4513; border-radius: 6px; display: flex; align-items: center; padding: 3px 5px; width: 95%; box-sizing: border-box; box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.2); }
.player-name-input-box svg { width: 14px; height: 14px; stroke: #8B4513; margin-right: 4px; flex-shrink: 0; }
.player-name-input { width: 100%; border: none; background: transparent; font-size: 11px; color: #5a3a22; font-family: 'Fredoka', sans-serif; font-weight: 600; text-align: center;}
.player-name-input:focus { outline: none; }
.player-name-input::placeholder { color: #a68a73; font-weight: 400; }

.speech-bubble { background: #fff; border: 2px solid #5a3a22; border-radius: 10px; padding: 8px 8px; font-size: 12px; font-weight: 600; color: #5a3a22; text-align: center; position: relative; z-index: 2; margin-bottom: 110px; box-shadow: 0 3px 5px rgba(0,0,0,0.1);}
.speech-bubble::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border-width: 8px 8px 0; border-style: solid; border-color: #5a3a22 transparent transparent transparent; }
.placeholder-image { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.placeholder-image img { width: 130px; max-width: none; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); z-index: 1; filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.3)); }

.question-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.question-container { background-color: #FFF8DC; border: 3px solid var(--border-gold); border-radius: 10px; padding: 10px; box-shadow: inset 0 0 10px rgba(139, 69, 19, 0.1); flex-grow: 1; }
.question-header { background-color: var(--border-gold); color: #8B4513; text-align: center; padding: 6px; border-radius: 5px; margin-bottom: 10px; }
.question-header span { font-size: 11px; display: block; font-weight: 700; text-transform: uppercase;}
.question-header h3 { margin: 2px 0 0 0; font-size: 14px; font-weight: 700;}
.question-text p { margin: 0; font-size: 15px; text-align: center; font-weight: 600; color: #4a4a4a; line-height: 1.3; }

.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.option-btn { background-color: var(--btn-color-base); border: 3px solid var(--btn-border-base); border-radius: 8px; padding: 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; font-family: 'Fredoka', sans-serif; font-weight: 600; color: #fff; text-align: left; transition: all 0.2s ease; line-height: 1.2;}
.option-btn:active { transform: scale(0.95); }
.option-btn:disabled { cursor: not-allowed; opacity: 0.9; }
.option-btn svg { width: 28px; height: 28px; flex-shrink: 0; }
.option-btn p { margin: 0; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); }
.option-btn.correcta { background-color: var(--btn-color-correct); border-color: var(--btn-border-correct); box-shadow: 0 0 10px rgba(46, 204, 113, 0.8); }
.option-btn.correcta svg circle { fill: var(--btn-color-correct); stroke: var(--btn-border-correct); }
.option-btn.incorrecta { background-color: var(--btn-color-incorrect); border-color: var(--btn-border-incorrect); box-shadow: 0 0 10px rgba(231, 76, 60, 0.8); }
.option-btn.incorrecta svg circle { fill: var(--btn-color-incorrect); stroke: var(--btn-border-incorrect); }

.next-btn-container { display: flex; justify-content: flex-end; margin-top: 2px; }
.next-btn { background: linear-gradient(180deg, #FFD700 0%, #FF8C00 100%); border: 3px solid #B8860B; border-radius: 20px; padding: 8px 16px; font-family: 'Fredoka', sans-serif; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.8); box-shadow: 0px 4px 6px rgba(0,0,0,0.3); transition: transform 0.1s; display: none; }
.next-btn:active { transform: scale(0.95); }

/* --- Menú Inferior --- */
.bottom-menu { display: flex; justify-content: center; gap: 15px; padding-top: 5px; border-top: 2px dashed rgba(255,255,255,0.3); }
.bottom-menu svg { width: 40px; height: 40px; cursor: pointer; transition: transform 0.2s; }
.bottom-menu svg:hover { transform: scale(1.1); }
.bottom-menu svg:active { transform: scale(0.9); }

/* --- Estilos Generales de los Modales --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; 
    justify-content: center; align-items: center;
    z-index: 1000; backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-body);
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 20px, transparent 20px, transparent 40px);
    border: 6px solid var(--border-gold);
    border-radius: 20px;
    padding: 25px 20px;
    width: 90%; max-width: 340px;
    text-align: center;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.modal-title {
    color: var(--border-gold); font-size: 32px; font-weight: 700;
    margin: 0 0 5px 0; text-transform: uppercase;
    text-shadow: -2px -2px 0 #8B4513, 2px -2px 0 #8B4513, -2px 2px 0 #8B4513, 2px 2px 0 #8B4513, 0px 4px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.modal-subtitle { color: #fff; font-size: 18px; font-weight: 600; margin: 0 0 20px 0; letter-spacing: 1px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

.modal-img-container {
    width: 130px; height: 130px; margin: 0 auto 20px auto;
    background: linear-gradient(180deg, #A8D8F8 0%, #E6F4FB 100%);
    border-radius: 50%; border: 4px solid var(--border-gold);
    overflow: hidden; display: flex; justify-content: center; align-items: flex-end;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3), inset 0px 0px 10px rgba(0,0,0,0.2);
}
.modal-img-container img { width: 100%; margin-bottom: -10px; }

/* Modal de Inicio Específico */
.input-group-inicio { margin-bottom: 20px; }
.input-group-inicio label { display: block; color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 8px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.input-inicio-box { background-color: #FFF8DC; border: 3px solid #8B4513; border-radius: 10px; display: flex; align-items: center; padding: 8px 12px; width: 85%; margin: 0 auto; box-shadow: inset 0 3px 6px rgba(139, 69, 19, 0.2); }
.input-inicio-box svg { width: 18px; height: 18px; stroke: #8B4513; margin-right: 8px; flex-shrink: 0; }
.input-inicio-box input { width: 100%; border: none; background: transparent; font-size: 16px; color: #5a3a22; font-family: 'Fredoka', sans-serif; font-weight: 600; text-align: center; }
.input-inicio-box input:focus { outline: none; }
.input-inicio-box input::placeholder { color: #a68a73; font-weight: 400; }

.btn-play-huge {
    background: linear-gradient(180deg, #2ECC71 0%, #27AE60 100%);
    border: 3px solid #1E8449; border-radius: 30px; padding: 12px 30px;
    color: #fff; font-weight: 700; font-size: 20px; cursor: pointer; font-family: 'Fredoka', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); box-shadow: 0px 5px 10px rgba(0,0,0,0.4);
    transition: transform 0.1s; display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 auto; width: 80%;
}
.btn-play-huge:active { transform: scale(0.95); }
.btn-play-huge svg { width: 24px; height: 24px; fill: #fff; }

/* Modal Fin de Juego Específico */
#capture-area {
    background-color: var(--bg-body);
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 20px, transparent 20px, transparent 40px);
    padding: 20px 10px; border-radius: 10px; margin-bottom: 15px;
}

.modal-text { color: #ffffff; font-size: 18px; margin: 5px 0; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.nombre-destacado { font-size: 24px; color: var(--border-gold); font-weight: 700; margin: 5px 0 15px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); letter-spacing: 1px; }
.modal-score { 
    font-size: 50px; color: var(--border-gold); font-weight: 700; margin: 10px 0; 
    text-shadow: -2px -2px 0 #8B4513, 2px -2px 0 #8B4513, -2px 2px 0 #8B4513, 2px 2px 0 #8B4513, 0px 4px 4px rgba(0,0,0,0.5);
}

.modal-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.modal-btn { font-family: 'Fredoka', sans-serif; padding: 10px 15px; border-radius: 25px; border: 3px solid; font-weight: 600; font-size: 15px; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.1s; }
.modal-btn:active { transform: scale(0.95); }

.btn-green { background: linear-gradient(180deg, #2ECC71 0%, #27AE60 100%); border-color: #1E8449; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4); }
.btn-orange { background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%); border-color: #d35400; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4); }
.btn-red { background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%); border-color: #922b21; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4); }

.modal-btn svg { width: 18px; height: 18px; fill: #fff; }

@media (max-width: 480px) { .mobile-container { max-width: 100%; } body { padding: 0; } .game-area { border-radius: 0; border-left: none; border-right: none; } }