:root {
    /* Theme Colors */
    --fuwa-blue: #add8e6;
    --moco-pink: #ffb6c1;
    --dark-blue: #4c93ba;
    --menu-btn-hover: #87ceeb;
    --menu-btn-active: #f18d9c;
    --quiz-btn-hover: #5aace0;
    --quit-btn-hover: #E25858;

    /* General Colors */
    --white: #ffffff;
    --off-white: #fafafa;
    --light-gray: #f0f8ff;
    --black: #000;
    --black-opacity-90: rgba(0,0,0,0.9);
    --white-opacity-90: rgba(255, 255, 255, 0.9);
    
    /* Text & Borders */
    --text-primary: #000;
    --text-secondary: #555;
    --border-light: #ddd;
    --border-dark: #333;

    /* Quiz Status Colors */
    --correct-bg: #d8ffc4;
    --correct-border: #60a03f;
    --incorrect-bg: #ffe8e8;
    --incorrect-border: #c78181;

    /* Disabled Buttons */
    --disabled-bg: #999;
    --disabled-text: #eee;
}

#quizWrap {
    max-width: 900px;
    margin: 0 auto;
}

#quizQn {
    background: linear-gradient(to bottom, var(--white), var(--light-gray));
    border: 3px solid var(--dark-blue);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 10px;
}

#quizAns {
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
}

#quizAns input[type=radio] {
    display: none;
}

#quizAns label {
    background: var(--white);
    border: 1px solid var(--moco-pink);
    border-radius: 10px;
    padding: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    white-space: normal;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#quizAns label:hover {
    background: #fff5f8;
}

#quizAns label.correct {
    background: var(--correct-bg);
    border: 1px solid var(--correct-border);
    font-size: 1.2rem;
}

#quizAns label.wrong {
    background: var(--incorrect-bg);
    border: 1px solid var(--incorrect-border);
    font-size: 1.2rem;  
}

#quizAns.results {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

#quizAns.results ol {
    width: 100%;
    padding-left: 20px;
    margin: 0;
}

#quizAns.results li {
    width: 100%;
    display: block;
}

* {
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

body {
    display: block;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    background: none;

    background-image: url("images/Background 5.png");
    background-repeat: repeat;
    background-size: auto;
    background-position: top left;
    background-size: 500px auto;
}

.widget-wrap {
    background: var(--white-opacity-90);
    padding: 15px;
    max-width: 600px;
    width: 90%;
    margin: 20px auto;
    border-radius: 10px;

    border-left: 10px solid var(--fuwa-blue);
    border-top: 10px solid var(--fuwa-blue);
    border-right: 10px solid var(--moco-pink);
    border-bottom: 10px solid var(--moco-pink);
}

#introWrap {
    text-align: center;
}

#startBtn {
    padding: 10px 20px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--dark-blue);
    color: var(--white);
}

.page-title {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--black-opacity-90);
    padding: 15px 20px;
    z-index: 1000;
    font-family: Impact, fantasy;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

.title-icons {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    height: 32px;
}

.page-title .fuwa {
    color: var(--fuwa-blue);
}

.page-title .moco {
    color: var(--moco-pink);
}

.page-title .quiz {
    color: var(--white);
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    min-height: calc(100vh - 80px);
    padding-top: 100px;
    padding-bottom: 100px;
}

@media (max-width: 1200px) {
    .main-content {
        padding-top: 200px;
    }
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto;
}

#difficultyWrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    width: fit-content;
}

#difficultyWrap .diffBtn {
    display: block;
    width: 200px;
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: var(--dark-blue);
    color: var(--white);
    text-align: center;
    margin-bottom: 15px;
}

#difficultyWrap .diffBtn:last-child {
    margin-bottom: 0;
}

#quizStatus {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    color: var(--black);
}

#quizButtons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 999;
    gap: 200px;
}

#quizButtons button:disabled {
    background: var(--disabled-bg);
    color: var(--disabled-text);
    cursor: not-allowed;
    opacity: 0.6;
}

#quizButtons button:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

#quizSourceList {
    margin-top: 10px;
    text-align: center;
}

#quizSource {
    min-height: 24px;
    margin-top: 10px;
    text-align: left;
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.7;
}

#quizSection {
    position: relative;
}

.side-img {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    height: auto;
    display: none;
}

.left-img {
    left: calc(50% - 620px);
}

.right-img {
    right: calc(50% - 620px);
}

.mobile-chars {
    position: fixed;
    top: 67px;
    left: 0;
    right: 0;
    z-index: 998;
    display: none;
    text-align: center;
    padding: 5px 0;
    background: var(--black-opacity-90);
}

.mobile-img {
    width: 80px;
    height: auto;
    margin: 0 5px;
}

@media (min-width: 1201px) {
    .side-img.show {
        display: block;
    }
}

@media (max-width: 1200px) {
    .mobile-chars.show {
        display: block;
    }
}

@keyframes bounce {
    0%   { transform: translateY(-50%) scale(1); }
    30%  { transform: translateY(-55%) scale(1.08); }
    60%  { transform: translateY(-45%) scale(0.95); }
    100% { transform: translateY(-50%) scale(1); }
}

.side-img.bounce {
    animation: bounce 0.7s;
}

@keyframes shake {
    0% { transform: translateY(-50%) translateX(0); }
    20% { transform: translateY(-50%) translateX(-25px); }
    40% { transform: translateY(-50%) translateX(25px); }
    60% { transform: translateY(-50%) translateX(-15px); }
    80% { transform: translateY(-50%) translateX(15px); }
    100% { transform: translateY(-50%) translateX(0); }
}

.side-img.shake {
    animation: shake 0.5s;
}

@keyframes mobile-bounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.08); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.mobile-img.bounce {
    animation: mobile-bounce 0.7s;
}

@keyframes mobile-shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-15px); }
    40% { transform: translateX(15px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

.mobile-img.shake {
    animation: mobile-shake 0.5s;
}

.icon-white {
    filter: invert(100%);
}

.link-icon {
    width: 24px;
    height: auto;
    vertical-align: middle;
    margin-right: 5px;
}

.youtube-icon, .reddit-icon {
    filter: invert(10%) sepia(100%) saturate(7000%) hue-rotate(350deg);
}

.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--black-opacity-90);
    padding: 1px 1px;
    z-index: 1000;
    font-family: Arial, sans-serif;
    font-size: 10px;
    color: var(--white);
    text-align: center;
    box-sizing: border-box;
}

.page-footer p {
    margin: 0;
    line-height: 1.2;
}

.quiz-image {
    max-width: 100%;
    max-height: 250px;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--border-light);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quiz-image-container {
    display: flex;
    justify-content: center; /* centers the image horizontally */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: var(--border-dark);
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--black);
    text-decoration: none;
    cursor: pointer;
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--white);
    background-color: var(--black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
}

.fab-btn:hover {
    transform: scale(1.1);
}

#nextBtn:hover,
.fab-btn.restart-btn:hover {
    background-color: var(--quiz-btn-hover);
}

#quitBtn:hover {
    background-color: var(--quit-btn-hover);
}

.fab-btn img {
    width: 30px;
    height: 30px;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--black);
    background-color: var(--black-opacity-90);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.menu-content {
    position: relative;
    max-width: 1000px;
    width: 80%;
    padding: 30px;
}

.menu-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.menu-btn {
    padding: 10px 20px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--fuwa-blue);
    color: var(--border-dark);
    transition: all 0.2s ease;
}

.menu-btn.active {
    background-color: var(--menu-btn-active);
    color: var(--black);
    pointer-events: none;
}

.menu-btn:not(.active):hover {
    background-color: var(--menu-btn-hover);
}

.menu-section {
    text-align: left;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.menu-section h3 {
    margin-top: 0;
    color: var(--dark-blue);
}

.channel-link-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    margin-bottom: 100px;
}

.channel-link {
    display: inline-block;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 10px;
    background: #1b1b1b;
    color: var(--white);
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.channel-link:hover {
    background-color: var(--black);
}

#sourceContent ul {
    list-style-type: none;
    padding: 0;
}

#sourceContent li {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.5;
}

#sourceContent a {
    color: var(--dark-blue);
    text-decoration: none;
    font-weight: bold;
}

#sourceContent a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    h1, h2, h3, h4, h5 {
        font-size: 1.2em;
    }
    
    p {
        font-size: 0.9em;
        line-height: 1.4;
    }

    button {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    #quizQn {
        font-size: 1em;
        padding: 8px;
    }

    #quizAns label {
        font-size: 0.9em;
        padding: 8px;
    }
    
    #quizAns label.correct,
    #quizAns label.wrong {
        font-size: 0.9em;
    }

    .page-footer p {
        font-size: 0.8em;
    }

    #quizWrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    #difficultyWrap {
        flex-direction: column;
        width: 100%;
    }

    #difficultyWrap .diffBtn {
        width: 100%;
        margin-bottom: 10px;
    }

    .modal-content {
        max-width: 80%;
        max-height: 80%;
    }

    .menu-content {
        width: 90%;
        padding: 20px;
    }

    .menu-nav {
        flex-direction: column;
        gap: 10px;
    }

    .menu-btn {
        width: 100%;
    }

    .quiz-image {
        max-width: 100%;
        max-height: 150px;
    }

    .modal-content {
        max-width: 90%;
        max-height: 90%;
    }

    .mobile-img {
        width: 60px;
    }

    .page-footer {
        padding: 5px;
    }

    .widget-wrap {
        padding: 10px;
        margin: 10px;
    }

    #quizStatus {
        font-size: 1.2em;   
        margin-bottom: 10px;
        padding: 5px;
    }

    #quizAns {
        grid-template-columns: 1fr;
        grid-gap: 5px;
    }

    #menuOverlay {
        padding: 10px;
    }

    .menu-content {
        width: 90%;
        padding: 15px;
    }

    .menu-btn {
        font-size: 0.9em;
        padding: 8px 12px;
    }

    .menu-section {
        padding: 10px;
    }

    .title-icons {
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .title-icons img {
        width: 20px;
        height: 20px;
    }
}