:root {
    --primary-color: #8B4513;    /* Earthy brown */
    --secondary-color: #D4AF37;  /* Ancient gold */
    --accent-color: #800000;     /* Deep maroon */
    --background-color: #F5E6D3; /* Parchment */
    --text-color: #2C1810;      /* Dark brown */
    --error-color: #8B0000;     /* Dark red */
    --success-color: #2F4F4F;   /* Dark slate */
}

body {
    font-family: 'Outfit', 'Cinzel Decorative', serif;
    background: linear-gradient(135deg, #F5E6D3 0%, #E6D5C3 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    padding: 2.5rem;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0) 5%, 
        rgba(0, 0, 0, 0) 95%, 
        rgba(0, 0, 0, 0.1) 100%);
    border-radius: 0;
    margin: 1rem auto;
    position: relative;
}

.quest-title {
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Cinzel Decorative', serif;
}

.question-container {
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E"),
        linear-gradient(to right, #F5E6D3, #E8D5B9);
    border: 2px solid #8B4513;
    border-radius: 0;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.question-container::before,
.question-container::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 100%;
    top: 0;
}

.question-container::before {
    left: -15px;
    background: linear-gradient(to right,
        rgba(139, 69, 19, 0.2),
        rgba(139, 69, 19, 0.1) 40%,
        transparent 100%);
}

.question-container::after {
    right: -15px;
    background: linear-gradient(to left,
        rgba(139, 69, 19, 0.2),
        rgba(139, 69, 19, 0.1) 40%,
        transparent 100%);
}

#question {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-family: 'Cormorant Garamond', serif;
    text-align: center;
    padding: 0 2rem;
}

#options button {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--primary-color);
    padding: 1.5rem;
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
    font-family: 'Cormorant Garamond', serif;
    position: relative;
    cursor: pointer;
}

#options button:hover {
    transform: translateX(0.5rem);
    background: rgba(139, 69, 19, 0.1);
}

.correct-answer {
    background: rgba(47, 79, 79, 0.2) !important;
    border-color: var(--success-color) !important;
    animation: treasure-found 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.wrong-answer {
    background: rgba(139, 0, 0, 0.2) !important;
    border-color: var(--error-color) !important;
    animation: quest-failed 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: center;
}

.stat-item {
    text-align: center;
    padding: 1.2rem;
    background: rgba(245, 230, 211, 0.9);
    border: 1px solid var(--primary-color);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes treasure-found {
    0% { transform: scale(1); }
    50% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1); }
}

@keyframes quest-failed {
    0% { transform: translateX(0); }
    25% { transform: translateX(-0.5rem); }
    75% { transform: translateX(0.5rem); }
    100% { transform: translateX(0); }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    .container {
        margin: 0;
        padding: 1.5rem;
    }
    .quest-title {
        font-size: 2.8rem;
    }
    #question {
        font-size: 1.8rem;
        padding: 0 1rem;
    }
    #options button {
        font-size: 1.3rem;
        padding: 1.3rem;
    }
    .back-button {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
}

.btn-quest {
    background: linear-gradient(135deg, var(--primary-color), #818CF8);
    border: 2px solid var(--secondary-color);
    border-radius: 1rem;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    margin: 0.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-quest:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(212, 175, 55, 0.4);
    border-color: var(--secondary-color);
}

.btn-quest.active {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
    transform: scale(1.05);
    color: white;
}

/* Update hover effect for non-active buttons */
.btn-quest:not(.active):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(212, 175, 55, 0.4);
    border-color: var(--secondary-color);
}

.btn-check:checked + .btn-quest {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
    transform: scale(1.05);
}

.testament-select, .age-group-select {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1.2rem;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.08);
}

.character-decoration {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    animation: float 8s ease-in-out infinite;
    z-index: 0;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes sparkle {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1) rotate(180deg); opacity: 0.7; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

@keyframes sparkle-burst {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    100% { box-shadow: 0 0 0 20px rgba(245, 158, 11, 0); }
}

.xp-animation {
    position: absolute;
    font-family: 'Cinzel Decorative', serif;
    color: var(--secondary-color);
    font-size: 1.2rem;
    pointer-events: none;
    animation: float-up 1.5s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    font-family: 'Cinzel Decorative', serif;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.feedback-message {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    color: var(--text-color);
    padding: 15px 30px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-family: 'Cinzel Decorative', serif;
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1000;
}

@keyframes pop-in {
    0% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Add to the existing style.css file */

.minigame-container {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 0.5rem;
    border: 2px solid var(--secondary-color);
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    color: var(--text-color);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.victory-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

@media (max-width: 768px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .card-front, .card-back {
        font-size: 1.5rem;
    }
}

/*Leaderboard styles*/
.leaderboard-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.champion-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-family: 'Cinzel Decorative', serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-players {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1rem;
}

.top-player-card {
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.top-player-card:hover {
    transform: translateY(-10px);
}

.position-1 {
    order: 2;
    transform: scale(1.2);
    z-index: 3;
}

.position-2 {
    order: 1;
    transform: scale(0.9);
    z-index: 2;
}

.position-3 {
    order: 3;
    transform: scale(0.9);
    z-index: 1;
}

.medal {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: shine 2s ease-in-out infinite;
}

.player-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0.5rem 0;
    font-family: 'Cinzel Decorative', serif;
}

.player-score {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
}

.other-players {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    padding: 1rem;
}

.player-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
}

.player-row:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 1);
}

.position {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    width: 2.5rem;
}

.name {
    flex-grow: 1;
    font-size: 1.2rem;
    color: var(--text-color);
    padding: 0 1rem;
}

.score {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.bonus-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.9);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    animation: fadeInOut 2s ease-in-out;
    white-space: pre-line;
    font-weight: bold;
    z-index: 100;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

@keyframes shine {
    0% { opacity: 1; }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; }
}

@media (max-width: 768px) {
    .top-players {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .top-player-card {
        width: 100%;
        max-width: 300px;
    }

    .position-1, .position-2, .position-3 {
        order: initial;
        transform: scale(1);
    }
}

.initials-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;
}

.initials-content {
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.initials-input-container {
    margin: 2rem 0;
}

.initials-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.initial-box {
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    text-align: center;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.initial-box:focus {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    outline: none;
}

.initial-box.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: var(--error-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Add to existing CSS file */

.timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: #28a745;
    transition: color 0.3s ease;
    font-family: 'Cinzel Decorative', serif;
    margin-top: 1rem;
    animation: pulse 2s infinite;
}

.multiplier-text {
    font-size: 1.2rem;
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
    display: block;
    margin-top: 0.4rem;
    animation: glow 1s ease-in-out infinite alternate;
}

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

@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ff6b6b;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #ff6b6b;
    }
}