@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Press+Start+2P&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');

/* ==================== Global Styles ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    touch-action: none; /* Prevent touch-based movements */
    height: 100%;
    margin: 0;
    padding: 0;
}


body {
    background-image: url(../images/background-image.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
}

/* ==================== Menu Container ==================== */
.menu-container {
    text-align: center;
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.6); 
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

.game-title {
    font-size: 55px; 
    color: #fbc531; 
    text-shadow: 0px 0px 15px rgba(108, 92, 231, 0.9);
    margin-bottom: 30px;
    font-weight: 800;
    letter-spacing: 3px;
}

.game-instructions {
    font-size: 1.7rem;
    color: #dfe6e9;
    margin: 15px 0;
    line-height: 1.8;
}

.highlighted {
    color: #00cec9; 
    font-weight: bold; 
    text-shadow: 0px 0px 20px rgba(0, 206, 201, 0.8);
}

.messy {
    color: #e17055;
    text-shadow: 0px 0px 10px rgba(225, 112, 85, 0.8);
}

.button-container {
    margin-top: 30px;
}

/* ==================== Buttons General Rules ==================== */
.menu-button {
    padding: 14px 40px;
    margin: 12px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background: linear-gradient(145deg, #fbc531, #e1b12c); 
    color: #1e2229;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s;
    box-shadow: 0 6px 15px rgba(251, 197, 49, 0.4); 
}

.menu-button:hover {
    background: linear-gradient(145deg, #ffd32a, #fbc531);
    transform: scale(1.07);
    box-shadow: 0px 0px 15px rgba(108, 92, 231, 0.9); 
}

.menu-button:active {
    transform: scale(0.95); 
}

/* ==================== Hidden Utility ==================== */
.hidden {
    display: none !important;
}

/* ==================== Options Menu ==================== */
#options-menu {
    text-align: center;
    margin-top: 40px;
    background: linear-gradient(135deg, #1a1a2e, #16213e); /* Gradient for depth */
    padding: 30px;
    border-radius: 20px; /* Smooth rounded corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8); /* Enhanced shadow for emphasis */
    border: 3px solid rgba(108, 92, 231, 0.9); /* Neon border effect */
    animation: pulseGlow 3s infinite alternate; /* Subtle glowing animation */
}

.menu-title {
    font-size: 42px;
    color: #fbc531; /* Bright yellow for visibility */
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0px 0px 15px rgba(108, 92, 231, 0.9);
    font-weight: 700;
    letter-spacing: 2px; /* Slight spacing for elegance */
    font-family: 'Poppins', sans-serif;
}

.options-content {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    color: #ffffff; /* White text for clarity */
}

.option-group {
    display: flex;
    flex-direction: column;
    font-size: 22px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5); /* Transparent background for grouping */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); /* Shadow for depth */
    transition: transform 0.2s, background 0.2s; /* Smooth hover effects */
}

.option-group:hover {
    background: linear-gradient(135deg, #6c5ce7, #8e44ad); /* Gradient on hover */
    transform: scale(1.05); /* Subtle zoom on hover */
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.8); /* Enhanced glow effect */
}

.option-group label {
    margin-bottom: 12px;
    color: #dcdde1;
    font-weight: bold;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.option-group input[type="checkbox"],
.option-group input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2); /* Slightly larger inputs for better visibility */
    accent-color: #6c5ce7; /* Custom color for radio buttons and checkboxes */
}

fieldset.option-group {
    border: 2px solid rgba(108, 92, 231, 0.8); /* Subtle border for grouping */
    border-radius: 15px;
    padding: 20px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5); /* Transparent background */
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    transition: transform 0.2s, background 0.2s; /* Smooth hover effects */
}

fieldset.option-group legend {
    font-size: 1.5rem;
    color: #fbc531; /* Bright yellow for the legend */
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

fieldset.option-group:hover {
    background: linear-gradient(135deg, #6c5ce7, #8e44ad); /* Gradient on hover */
    transform: scale(1.03); /* Subtle hover effect */
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.8); /* Glow effect */
}
/* ==================== High Scores Menu ==================== */
#high-scores-menu {
    text-align: center;
    margin-top: 40px;
    background: linear-gradient(135deg, #1a1a2e, #16213e); /* Dark gradient for depth */
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8); /* Enhanced shadow for depth */
    border: 3px solid rgba(108, 92, 231, 0.9); /* Neon border for high scores */
    animation: pulseGlow 3s infinite alternate; /* Subtle glowing effect */
}

#high-scores-menu ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0; /* Add spacing from the heading */
}

#high-scores-menu ul li {
    font-size: 24px; /* Slightly larger font for readability */
    margin: 10px 0;
    padding: 10px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5); /* Transparent background for contrast */
    border-radius: 10px; /* Rounded list items */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); /* Add shadow for depth */
    text-shadow: 0px 0px 5px rgba(255, 255, 255, 0.5); /* Glow effect on text */
    transition: transform 0.2s, background 0.2s; /* Smooth hover effects */
}

#high-scores-menu ul li:hover {
    background: linear-gradient(135deg, #6c5ce7, #8e44ad); /* Neon purple gradient on hover */
    transform: scale(1.05); /* Slight zoom effect */
    color: #fff; /* Ensure text remains visible */
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.8), 0 0 30px rgba(108, 92, 231, 0.6); /* Glow shadow on hover */
}

#high-scores-menu h2 {
    
    color: #ffd32a; /* Bright yellow for heading */
    margin-bottom: 20px;
    text-shadow: 0px 0px 15px rgba(108, 92, 231, 0.9);
    font-family: 'Poppins', sans-serif;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
    100% {
        box-shadow: 0 0 25px rgba(108, 92, 231, 1);
    }
}




/* ==================== Typography ==================== */
h1, h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

h1 {
    font-size: 45px;
}

h2 {
    font-size: 35px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* ==================== Game Board ==================== */
#game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(20, 20, 60, 0.95); 
    border: 5px solid #6c5ce7;
    box-shadow: 0 0 10px #6c5ce7, 0 0 40px #8e44ad;
    padding: 10px;
    margin: 0 auto;
    border-radius: 20px;
    position: relative;
}

/* Game Board Glow Animation */
#game-board-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 25px; 
    background: linear-gradient(135deg, #6c5ce7, #8e44ad, #9b59b6); 
    filter: blur(12px);
    opacity: 0.8;
    z-index: -1;
    animation: trivia-glow 3s infinite alternate;
}

@keyframes trivia-glow {
    0% { opacity: 0.6; filter: blur(8px); }
    100% { opacity: 1; filter: blur(12px); }
}

/* Background Canvas */
#backgroundCanvas {
    background: linear-gradient(135deg, #202a34, #34495e);
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

/* Game Canvas */
#gameCanvas {
    background: #202a34; 
    border: 5px solid #6c5ce7; 
    display: block;
    position: relative;
    border-radius: 15px;
   
   
    
}

/* ==================== Game board with walls ==================== */
#gameCanvas.walls-enabled {
    border: 4px solid #f9ca24;
    box-shadow: 0 0 10px #f9ca24; 
}

/* ==================== Align form elements ==================== */
input[type="radio"], input[type="checkbox"] {
    margin-right: 10px; 
    width: 20px; 
    height: 20px; 
    display: flex;
}

/* Align labels to be on the same line as the radio button/checkbox */
label {
    display: flex;
    margin-bottom: 10px; 
    vertical-align: middle;
}

/* Create a better structure for the radio buttons and checkboxes */
.form-group {
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    margin-right: 10px;
}

.radio-group, .checkbox-group {
    margin-bottom: 10px;
}

/* Fieldset for Game Speed */
fieldset.option-group {
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

fieldset legend {
    font-size: 1.3rem;
    color: #fbc531;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

/* ==================== Overlays ==================== */
#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #e4e4eb;
    z-index: 10;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.5);
    font-size: 48px;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.6);
}

#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: none;
}

#game-over-overlay h2 {
    font-size: 55px;
    margin-bottom: 20px;
    text-shadow: 0px 0px 12px rgba(255, 255, 255, 0.8);
}

#game-over-overlay:not(.hidden) {
    display: flex; 
}

#game-over-overlay #final-score {
    font-size: 30px;
    margin-bottom: 30px;
    color: #fbc531;
    text-shadow: 0px 0px 12px rgba(255, 255, 255, 0.8);
}



/* ==================== Trivia Game Styles ==================== */

#trivia-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(20, 20, 60, 0.95); /* Semi-transparent dark blue */
    border: 5px solid #6c5ce7; /* Neon purple border to differentiate trivia */
    box-shadow: 0 0 20px #6c5ce7, 0 0 40px #8e44ad; /* Glowing effect similar to snake game */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.5s ease-in-out;
    position: relative;
    backdrop-filter: blur(6px); /* Blurs the area behind the container */
}

/* Trivia Container Glow Animation */
#trivia-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 25px; /* Match trivia container border radius */
    background: rgba(20, 20, 60, 0.95);
    filter: blur(10px);
    opacity: 0.8;
    z-index: -1;
    animation: trivia-glow 3s infinite alternate;
}

@keyframes trivia-glow {
    0% { opacity: 0.6; filter: blur(8px); }
    100% { opacity: 1; filter: blur(12px); }
}

/* Question Text */
/* Question Text */
#trivia-question {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: center;
}

/* Trivia Answers */
#trivia-answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%; /* Full width for uniform alignment */
    max-width: 600px;
}

/* Trivia Answer Buttons */
#trivia-answers button {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    background: linear-gradient(135deg, #202a34, #3a3e44); /* Neutral gradient */
    border: 4px solid #6c5ce7; /* Neon purple border for consistency */
    padding: 14px 18px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

/* Hover Effect for Trivia Answer Buttons */
#trivia-answers button:hover {
    background: linear-gradient(135deg, #3a3e44, #4e4376); /* Slightly lighter gradient on hover */
    transform: scale(1.05); /* Slight zoom effect */
    box-shadow: 0 0 15px #8e44ad, 0 0 30px #9b59b6; /* Enhanced glow on hover */
}


/* Feedback Message */
#feedback {
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    color: #FFC107; /* Yellow feedback color */
    font-weight: 600;
    text-shadow: 0px 0px 8px rgba(255, 193, 7, 0.8); /* Glow effect for feedback */
}

/* Navigation Buttons */
.trivia-button {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #8e44ad, #9b59b6); /* Purple gradient */
    border: none;
    padding: 12px 24px;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 20px;
    margin-right: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
    text-shadow: 0px 0px 8px rgba(0, 0, 0, 0.4);
}

/* Hover Effect for Navigation Buttons */
.trivia-button:hover {
    background: linear-gradient(135deg, #9b59b6, #6c5ce7); /* Slightly lighter purple on hover */
    transform: scale(1.07); /* Slight zoom on hover */
    box-shadow: 0 0 15px #9b59b6, 0 0 30px #8e44ad; /* Enhanced glow */
}

/* Active Effect (Click) */
.trivia-button:active {
    transform: scale(0.95); /* Shrink effect */
    background: linear-gradient(135deg, #6c5ce7, #8e44ad); /* Reverse gradient */
    box-shadow: 0 0 10px #6c5ce7, 0 0 20px #8e44ad; /* Subtle glow when active */
}

.fa-lightbulb {
    padding-right: 5px;
}


/* Trivia Button Animation (subtle pulse) */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(138, 43, 226, 0.8), 0 0 30px rgba(211, 84, 212, 0.8);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(138, 43, 226, 1), 0 0 40px rgba(211, 84, 212, 1);
    }
}

/*Animations*/

/* Keyframe Animation for Button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(108, 92, 231, 1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
}

/* Apply Animation to Trivia Button */
.bonus-button {
    animation: pulse 2s infinite; /* Pulse animation runs indefinitely */
}

/* Keyframe Animation for Container */
@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply Animation to Trivia Container */
.bonus-container {
    animation: slideIn 1s ease-out; /* Smooth slide-in effect */
}

/* Keyframe Animation for Gradient Flow */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Apply Gradient Flow Effect on Hover */
.bonus-button:hover {
    background: linear-gradient(270deg, #6c5ce7, #9b59b6, #8e44ad);
    background-size: 300% 300%;
    animation: gradient-flow 2s infinite;
}





/* Align Navigation Buttons */
#navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#feedback {
    animation: fadeInFeedback 0.5s ease;
}

@keyframes fadeInFeedback {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==================== Animations ==================== */
@keyframes trivia-glow {
    0% { opacity: 0.6; filter: blur(8px); }
    100% { opacity: 1; filter: blur(12px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(108, 92, 231, 0.8); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(108, 92, 231, 1); }
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(142, 68, 173, 0.7); }
    50% { box-shadow: 0 0 20px rgba(142, 68, 173, 0.9), 0 0 30px rgba(155, 89, 182, 0.7); }
    100% { box-shadow: 0 0 10px rgba(142, 68, 173, 0.7); }
}


/* ==================== Trivia Game: Mobile Styles ==================== */

/* Trivia Container */
@media (max-width: 768px) {
    #trivia-container {
        width: 90%; 
        padding: 15px;
        border-radius: 15px; 
        box-shadow: 0 0 10px #6c5ce7, 0 0 20px #8e44ad; 
    }

    #trivia-container::before {
        border-radius: 20px; 
        filter: blur(8px); 
    }

    /* Trivia Question */
    #trivia-question {
        font-size: 18px; 
        line-height: 1.5; 
        margin-bottom: 15px;
    }

    /* Trivia Answers - Buttons */
    #trivia-answers {
        gap: 10px; 
    }

    #trivia-answers button {
        font-size: 16px; 
        padding: 12px; 
        border-radius: 12px; 
    }

    #trivia-answers button:hover {
        box-shadow: 0 0 10px #8e44ad, 0 0 20px #9b59b6; 
    }

    /* Feedback Message */
    #feedback {
        font-size: 16px; 
    }

    /* Navigation Buttons */
    .trivia-button {
        font-size: 16px; 
        padding: 10px 20px; 
        margin-top: 15px; 
        width: 100%; 
        border-radius: 10px;
    }

    .trivia-button:hover {
        box-shadow: 0 0 12px #9b59b6, 0 0 20px #8e44ad;
    }

    /* High Scores - Mobile Layout */
    #high-scores-container {
        flex-direction: column;
        gap: 15px; 
    }

    #snake-highscore-box,
    #trivia-highscore-box {
        width: 100%; 
        padding: 10px;
        box-shadow: 0 0 10px #6c5ce7, 0 0 20px #8e44ad; 
        border-radius: 12px; 
    }

    #snake-highscore-box h3,
    #trivia-highscore-box h3 {
        font-size: 18px; 
        margin-bottom: 10px;
    }

    #snake-score-list li,
    #trivia-score-list li {
        font-size: 16px; 
        margin: 5px 0;
    }

    /* Adjust Back Button */
    #back-scores-button {
        margin-top: 20px;
        font-size: 16px;
        padding: 12px 20px;
        width: 100%; 
        border-radius: 10px;
    }
}

/* Extra Small Screens (Phones below 576px) */
@media (max-width: 576px) {
    #trivia-container {
        width: 95%; 
        padding: 10px;
    }

    #trivia-question {
        font-size: 16px;
        margin-bottom: 10px;
    }

    #trivia-answers button {
        font-size: 14px; 
        padding: 10px; 
        border-radius: 10px;
    }

    .trivia-button {
        font-size: 14px;
        padding: 8px 16px;
    }

    #high-scores-container {
        gap: 10px; 
    }

    #snake-highscore-box,
    #trivia-highscore-box {
        padding: 8px; 
    }

    #snake-highscore-box h3,
    #trivia-highscore-box h3 {
        font-size: 16px; 
    }

    #snake-score-list li,
    #trivia-score-list li {
        font-size: 14px; 
    }

    #back-scores-button {
        font-size: 14px;
        padding: 10px;
    }
}

  /* Apply Animation to Trivia Button */
.bonus-button {
    animation: pulse 2s infinite; 
}

/* Keyframe Animation for Container */
@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply Animation to Trivia Container */
.bonus-container {
    animation: slideIn 1s ease-out; 
}

/* Keyframe Animation for Gradient Flow */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Apply Gradient Flow Effect on Hover */
.bonus-button:hover {
    background: linear-gradient(270deg, #6c5ce7, #9b59b6, #8e44ad);
    background-size: 300% 300%;
    animation: gradient-flow 2s infinite;
}

/* Trivia Bonus Section Container */
.bonus-container {
    margin-top: 30px;
    padding: 15px 20px;
    background: rgba(20, 20, 60, 0.9); 
    border: 2px solid #6c5ce7; 
    border-radius: 20px; 
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.8), 0 0 40px rgba(155, 89, 182, 0.6); 
    text-align: center; 
    max-width: 600px; 
    margin-left: auto;
    margin-right: auto;
}

/* Bonus Trivia Button */
.bonus-button {
    font-family: 'Roboto Mono', monospace;
    padding: 12px 40px;
    font-size: 18px; 
    font-weight: 700;
    background: linear-gradient(135deg, #6c5ce7, #9b59b6); /* Purple gradient */
    color: white;
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    margin-top: 10px; /* Add spacing above button */
}

/* Hover Effect for Bonus Button */
.bonus-button:hover {
    transform: scale(1.1); /* Slightly larger on hover */
    box-shadow: 0 0 20px rgba(108, 92, 231, 1), 0 0 30px rgba(155, 89, 182, 0.9); /* Stronger glow */
}

/* Bonus Subtext */
.bonus-subtext {
    margin-top: 10px;
    margin-bottom: 15px; /* Increase spacing */
    font-size: 16px;
    color: #dfe6e9; /* Soft neutral color */
    font-weight: 500;
    text-shadow: 0px 0px 8px rgba(108, 92, 231, 0.7); /* Subtle glow */
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(142, 68, 173, 0.7);
    }
    50% {
        box-shadow: 0 0 20px rgba(142, 68, 173, 0.9), 0 0 30px rgba(155, 89, 182, 0.7);
    }
    100% {
        box-shadow: 0 0 10px rgba(142, 68, 173, 0.7);
    }
}

.bonus-button {
    animation: pulseGlow 2s infinite;
}

/* Keyframe Animation for Button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(108, 92, 231, 1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.8);
    }
}

/* Apply Animation to Trivia Button */
.bonus-button {
    animation: pulse 2s infinite; /* Pulse animation runs indefinitely */
}

#instructions-container {
    display: none;
}







/* ==================== Mobile Styles ==================== */
@media (max-width: 768px) {
    .button-container {
        display: flex;
        flex-direction: column;
        align-items: center; 
        margin-top: 20px;
    }

    .menu-button {
        margin: 12px 0; /* Adjust margin for vertical layout */
        width: 80%; /* Adjust button width for smaller screens */
    }

    /* Remove box shadow on mobile */
    .menu-container {
        box-shadow: none; /* Remove shadow */
        padding: 15px; /* Reduce padding */
        margin-bottom: 100px;
    }

    #game-board-container {
       
        width: 100%;
        
    }

    #gameCanvas {
        box-shadow: none; /* Remove shadow */
        width: 100%;
    }
    
    /* Adjust game title for better readability on small screens */
    .game-title {
        font-size: 40px;
        margin-bottom: 20px;
    }

    /* Adjust other text for mobile */
    .game-instructions {
        font-size: 20px;
        margin-top: 70px;
    }
}

/* ==================== Pause Overlay for Mobile ==================== */
@media (max-width: 768px) {
    #pause-overlay {
        font-size: 32px; /* Reduce font size for mobile */
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    #pause-overlay h1 {
        font-size: 40px; /* Slightly larger title for mobile */
        margin-bottom: 15px;
    }

    #pause-overlay p {
        font-size: 20px; /* Smaller text for instructions */
        margin-bottom: 20px;
        line-height: 1.4;
    }

    .menu-button {
        width: 80%; /* Make buttons full width for mobile */
        padding: 16px;
        font-size: 18px; /* Slightly smaller text for buttons */
        margin: 8px 0;
    }

    .menu-button:hover{
        transform: scale(1.05); /* Slight hover effect */
    }

    .menu-button:active{
        transform: scale(0.95);
    }
    
    #game-over-overlay {
        font-size: 20px; /* Reduce font size for smaller screens */
        padding: 15px;
    }
    
    #game-over-overlay h2 {
        font-size: 30px; /* Smaller text */
        margin-bottom: 10px;
    }
    
    #game-over-overlay #final-score {
        font-size: 18px; /* Final score text adjustment */
    }
}

@media (max-width: 768px) {
    body {
        background-image: url(../images/background-image.jpg);
        background-size: cover; /* Ensure the image covers the entire screen */
        background-repeat: no-repeat; /* Prevent tiling */
        background-position: 10% center; /* Focus on the left side of the image */
    }
}

/* Modal for instructions */
#instructions-container {
    display: none; /* Hidden by default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: rgba(20, 20, 60, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    z-index: 9999;
}

#instructions-container h2 {
    font-size: 24px;
    color: #fbc531;
    margin-bottom: 20px;
}

#instructions-container p {
    font-size: 16px;
    color: #dfe6e9;
    line-height: 1.5;
}
#close-instructions {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 10px;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

#close-instructions:hover {
    background: linear-gradient(145deg, #c0392b, #e74c3c);
    transform: scale(1.05);
}

#close-instructionsl:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    /* Hide the game instructions text */
    .game-instructions {
        display: none;
    }
}


/* ==================== Desktop Styles ==================== */
@media (min-width: 769px) {
    /* Hide instructions button on larger screens */
    #instructions-button {
        display: none !important; /* Ensure it does not show */
    }

    /* Ensure modal is hidden by default */
    #instructions-container {
        display: none !important;
    }
}

/* ==================== Speaker icon style ==================== */
#speaker-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(108, 92, 231, 0.8); 
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #6c5ce7;
    transition: background 0.3s, box-shadow 0.3s;
}

#speaker-icon:hover {
    background-color: #8e44ad; 
    box-shadow: 0 0 15px #8e44ad;
}

/* Adjust icon state */
.speaker-off {
    background-color: #dc3545; 
    box-shadow: 0 0 10px #dc3545;
}

/* ==================== Footer Styles ==================== */
#game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.footer-left {
    margin-left: 15px;
}

.footer-right {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-right: 15px;
}

.footer-right a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.footer-right a:hover {
    color: #f5cb5c; /* Accent color */
}

/* Style for the social media icons */
.footer-right i {
    font-size: 20px;
}

@media screen and (max-width: 430px) {
    .footer-right a {
        display: none; /* Hides social media icons on small screens */
    }
}