.endless-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #fffbe6;
    background: #4b2e05;
    border-radius: 16px;
    padding: 18px 0 14px 0;
    margin-bottom: 18px;
    box-shadow: 0 2px 12px #0004;
    letter-spacing: 2px;
    text-shadow: 1px 2px 8px #000a;
}
.questions-left {
    margin: 18px 0 0 0;
    font-size: 1.4em;
    font-weight: bold;
    color: #2e3d1f;
    background: #ffeebc;
    border-radius: 10px;
    padding: 10px 0;
    box-shadow: 0 2px 8px #0002;
    display: block;
}
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #2e3d1f 0%, #1a2312 100%);
    color: #f3eac2; /* Updated text color for better contrast */
    text-align: center;
    margin: 0;
    padding: 0;
}


.container {
    width: 60%;
    margin: auto;
    margin-top: 50px;
    padding: 20px;
    background: #f3eac2;
    border: 6px solid #4b2e05;
    border-radius: 24px;
    box-shadow: 0 0 24px #0008;
    color: #4b2e05;
}

.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background: #4b2e05;
    color: #f3eac2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.btn:hover {
    background: #6d4106;
}

.status {
    margin: 20px 0;
    font-size: 18px;
}

.question {
    margin: 24px 0;
    font-size: 2em;
    font-weight: bold;
    color: #2e3d1f;
    background: #ffeebc;
    border-radius: 12px;
    padding: 18px 12px;
    box-shadow: 0 2px 8px #0002;
    display: block;
}

.feedback {
    background: #333;
    color: #ffd369;
    padding: 10px;
    border-radius: 10px;
}

#timer {
    font-size: 1.2em;
    font-weight: bold;
    color: #b22222; /* Keep timer in red for visibility */
}

/* Game layout avatar styles */
.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.avatar-column {
    width: 140px; /* fixed left column for avatar */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.enemy-column {
    width: 140px; /* fixed right column for enemy */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.player-avatar {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: contain;
    border: 3px solid #fff3;
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.player-avatar.placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #fff2;
    color: #1e1e2f;
    border-radius: 12px;
}
.avatar-label {
    margin-top: 8px;
    color: #f5deb3;
}
.game-column {
    flex: 1;
}

/* Additional HP Bar Styles for compatibility */
.hp-bar {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #4b2e05;
    margin: 5px 0;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.enemy-hp-fill {
    background: linear-gradient(90deg, #f44336, #ff9800) !important;
}

/* Animation Speed Classes */
.animation-slow {
    --animation-duration: 1.5s;
}

.animation-normal {
    --animation-duration: 0.5s;
}

.animation-fast {
    --animation-duration: 0.2s;
}

/* Base animations using CSS variables */
.animated-element {
    transition-duration: var(--animation-duration, 0.5s);
}

.fade-in {
    animation: fadeIn var(--animation-duration, 0.5s) ease-in-out;
}

.slide-in {
    animation: slideIn var(--animation-duration, 0.5s) ease-out;
}

.bounce-in {
    animation: bounceIn var(--animation-duration, 0.5s) ease-out;
}

.pulse {
    animation: pulse var(--animation-duration, 0.5s) infinite alternate;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Login Modal Styles */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.login-modal-content {
    background: #f3eac2;
    border: 6px solid #4b2e05;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.4s ease-out;
}

.login-modal-content h3 {
    color: #4b2e05;
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: none;
}

.login-modal-content p {
    color: #4b2e05;
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.4;
}

.name-input-section {
    margin: 20px 0;
    text-align: center;
}

.name-input-section input {
    font-family: 'Times New Roman', Times, serif;
    color: #4b2e05;
    background: #f8f5e8;
    outline: none;
    transition: border-color 0.3s;
}

.name-input-section input:focus {
    border-color: #2d5016 !important;
    box-shadow: 0 0 8px rgba(45, 80, 22, 0.3);
}

.login-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.login-modal-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.login-btn {
    background: #4b2e05;
    color: #f3eac2;
}

.login-btn:hover {
    background: #2e3d1f;
    transform: translateY(-2px);
}

.guest-btn {
    background: #8b6914;
    color: #f3eac2;
}

.guest-btn:hover {
    background: #6b5010;
    transform: translateY(-2px);
}

.close-btn {
    background: #c74545;
    color: white;
}

.close-btn:hover {
    background: #a03535;
    transform: translateY(-2px);
}

/* Progress bar colors */
.progress-good {
    background: #4a7c59 !important;
}

.progress-poor {
    background: #e74c3c !important;
}

/* Responsive design for modal */
@media (max-width: 600px) {
    .login-modal-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .login-modal-buttons button {
        width: 200px;
        margin: 5px 0;
    }
}
