:root {
    --primary-color: #ff8c00; /* Naranja Gotchivergas */
    --secondary-color: #f0e68c; /* Amarillo Pálido */
    --bar-full-color: #4caf50; /* Verde */
    --bar-medium-color: #ffeb3b; /* Amarillo */
    --bar-low-color: #f44336; /* Rojo */
    --text-color: #333;
    --border-radius: 8px;
    --fury-color: rgba(255, 0, 0, 0.3);
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; 
    -webkit-tap-highlight-color: transparent; 
}

#game-container {
    background-color: #d4d4d4;
    border-radius: var(--border-radius);
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    padding: 20px;
    width: 100%;
    max-width: 380px; 
    box-sizing: border-box;
    text-align: center;

    transition: background-color 0.5s ease; 
    margin-bottom: 10px;
}

#game-container.fury-mode {
    background-color: var(--fury-color);
    animation: screenShake 0.1s linear 10;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}


header {
    margin-bottom: 20px;
}

header h1 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 2.2em; 
}

.currency-display {
    font-size: 1.1em;
    font-weight: bold;
}

#install-pwa-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9em;
}
#install-pwa-button:hover {
    background-color: #e67e00;
}


#gotchivergas-area { /* Renombrado de gochivergas-area */
    position: relative;
    margin-bottom: 20px;
    min-height: 220px; 
    display: flex; 
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
}

#dialogue-bubble {
    background-color: #e0e0e0;
    border-radius: var(--border-radius);
    padding: 10px 15px;
    margin: 0 auto 15px auto;
    max-width: 90%;
    font-size: 0.95em;
    position: relative;
    word-wrap: break-word;
    min-height: 60px; 
    max-height: 60px; 
    overflow-y: auto;  
    display: flex;     
    align-items: center; 
    justify-content: center; 
    text-align: left; 
    box-sizing: border-box; 
}

#dialogue-bubble::after { 
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #e0e0e0;
}


#gotchivergas-character { /* Renombrado de gochivergas-character */
    cursor: pointer;
    display: inline-block; 
    position: relative; 
    width: 270px;  
    height: 270px; 
}

#gotchivergas-body { /* Renombrado de gochivergas-body */
    width: 100%; 
    height: 100%;
    background-color: var(--primary-color); 
    border-radius: 50%; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; 
    box-shadow: 0px 3px 8px rgba(0,0,0,0.3);
    z-index: 1; 
}

#game-over-text { /* NUEVO ESTILO */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em; /* Ajusta el tamaño según prefieras */
    font-weight: bold;
    color: var(--bar-low-color); /* Rojo para "GAME OVER" */
    text-shadow: 2px 2px 0 black, -2px -2px 0 black, 2px -2px 0 black, -2px 2px 0 black; /* Contorno negro */
    z-index: 20; /* Asegurar que esté por encima de otros elementos si es necesario */
    display: none; /* Inicialmente oculto */
    pointer-events: none; /* Para no interferir con clicks si algo estuviera debajo */
    user-select: none; /* Para que no se pueda seleccionar */
}


#gotchivergas-face { /* Renombrado de gochivergas-face */
    width: 95%;  
    height: 95%; 
    object-fit: contain; 
    position: relative; 
    z-index: 10; 
    pointer-events: auto; /* Asegurar que la cara sea clickeable */
}


#gotchivergas-accessories { /* Renombrado de gochivergas-accessories */
    position: absolute;
    top: 0;  
    left: 0; 
    width: 100%; 
    height: 100%;
    pointer-events: none; 
    z-index: 5; 
}

.accessory-item { 
    position: absolute; 
    font-size: 35px; 
    user-select: none;
}

#needs-bars {
    margin-bottom: 20px;
}

.need {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.need label {
    width: 80px; 
    text-align: right;
    margin-right: 10px;
    font-size: 0.9em;
}

.bar-container {
    flex-grow: 1;
    background-color: #e0e0e0;
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
    border: 1px solid #ccc;
}

.bar {
    height: 100%;
    width: 100%; 
    background-color: var(--bar-full-color);
    transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out;
    border-radius: 5px 0 0 5px; 
}

#actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16%, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

#actions button, 
#shop-button-container button,
#info-button-container button {
    color: white;
    border: none;
    padding: 12px 10px; 
    margin: 0; 
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95em; 
    transition: background-color 0.2s, opacity 0.2s;
    width: 100%; 
}
#actions button:disabled, 
#shop-button-container button:disabled,
#info-button-container button:disabled {
    background-color: #aaa !important; 
    cursor: not-allowed;
    opacity: 0.7;
}


#actions button {
    background-color: var(--primary-color); 
}
#actions button:not(:disabled):hover {
    background-color: #e67e00; 
}

#shop-button-container button {
    background-color: var(--primary-color); 
}
#shop-button-container button:not(:disabled):hover {
    background-color: #e67e00; 
}

#info-button-container button {
    background-color: #6c757d; 
}
#info-button-container button:not(:disabled):hover {
    background-color: #545b62; 
}


#shop-button-container,
#info-button-container {
    margin-top: 10px;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    padding-top: 30px; 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 90%; 
    max-width: 360px; 
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

#shop-items .shop-item {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-item span {
    font-size: 1.2em; 
}
.shop-item button {
    background-color: var(--bar-full-color);
    font-size: 0.9em;
    padding: 8px 12px;
    color: white; 
    border: none; 
    border-radius: var(--border-radius);
    cursor: pointer;
}
.shop-item button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#info-modal .modal-content {
    text-align: left;
}
#info-modal h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 15px;
}
#info-content ul {
    list-style-type: disc;
    margin-left: 20px;
    padding-left: 10px;
}
#info-content li {
    margin-bottom: 8px;
}
#info-content p {
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 0.95em;
}
#info-content strong {
    color: var(--primary-color);
}
#info-content em {
    font-size: 0.9em;
    color: #555;
}

#banana-catcher-area {
    height: 200px;
    border: 2px dashed var(--primary-color);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    background-color: var(--secondary-color);
}

.banana-game-item {
    position: absolute;
    font-size: 30px;
    cursor: pointer;
    user-select: none; 
}

#mamarracho-makeover-game {
    text-align: center;
}
#mamarracho-timer {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--bar-low-color);
}
#mamarracho-categories {
    display: flex;
    flex-direction: column; 
    gap: 10px;
    margin-top: 10px;
    max-height: 250px; 
    overflow-y: auto;
}
.mamarracho-category {
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: var(--border-radius);
}
.mamarracho-category h4 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: var(--primary-color);
}
.mamarracho-items-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 8px;
    justify-content: center;
    min-height: 40px; 
}
.mamarracho-item {
    font-size: 28px; 
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: transform 0.1s, background-color 0.2s;
}
.mamarracho-item:hover {
    transform: scale(1.2);
}
.mamarracho-item.selected {
    background-color: var(--secondary-color);
    box-shadow: 0 0 5px var(--primary-color);
}
#mamarracho-selection-preview {
    font-style: italic;
    color: #555;
    display: block;
    margin-top: 10px;
    min-height: 20px;
}

.gotchivergas-happy { /* Renombrado de gochivergas-happy */
    animation: happyBounce 0.5s ease-in-out;
}
@keyframes happyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

.gotchivergas-angry { /* Renombrado de gochivergas-angry */
    animation: angryShakeCharacter 0.3s linear 2;
}
@keyframes angryShakeCharacter {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px) rotate(-3deg); }
    75% { transform: translateX(8px) rotate(3deg); }
}

.gotchivergas-furious-idle { /* Renombrado de gochivergas-furious-idle */
     animation: furiousIdleWiggle 0.2s infinite linear;
}
@keyframes furiousIdleWiggle {
    0% { transform: translateX(-2px) rotate(-1deg); }
    50% { transform: translateX(2px) rotate(1deg); }
    100% { transform: translateX(-2px) rotate(-1deg); }
}

footer {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    font-size: 0.8em;
    color: #555;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
}

#game-container.all-needs-red-flash {
    animation: quickFlash 0.5s linear infinite;
}

#atrapa-zzz-game {
    text-align: center;
}
#zzz-catcher-area {
    height: 220px;
    border: 2px dashed #6a5acd; 
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    background-color: #e6e6fa; 
    border-radius: var(--border-radius);
}
.zzz-item {
    position: absolute;
    cursor: pointer;
    user-select: none;
    color: #483d8b; 
    opacity: 0.8; 
}

#sabiduria-gotchi-game { /* Renombrado de sabiduria-gochi-game */
    text-align: center;
}
#sabiduria-gotchi-game p { 
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-color);
    margin-bottom: 10px;
}
#sabiduria-question-area {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sabiduria-question {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
}
#sabiduria-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sabiduria-option-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}
.sabiduria-option-button:hover:not(:disabled) {
    background-color: #e67e00;
}
.sabiduria-option-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes quickFlash {
    0%, 100% { box-shadow: 0 0 20px rgba(0,0,0,0.2), 0 0 15px 10px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0,0,0,0.2), 0 0 15px 10px rgba(255, 0, 0, 0.6); }
}