html { scroll-behavior: smooth; }
:root {
    --primary-accent: #e56b55;
    --primary-accent-hover: #c44933;
    --text-dark: #f4ecd8;
    --text-light: #f4ecd8;
    --border-color: rgba(255, 255, 255, 0.2);
    --correct-color: #008000;
    --incorrect-color: #d13b3b;

    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);}

/* --- Global Setup & ANON STUDIOS Canvas --- */
#ukiyo-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.3; pointer-events: none; }

body {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    margin: 0;
    padding: 0 0 150px 0; /* Add padding to bottom to avoid footer overlap */
    background: url('assets/bg_image.jpeg') no-repeat center center fixed;
    background-size: cover;
    color: #ffffff;
    overflow-x: hidden;
}

/* --- Reusable Components & Styles --- */

/* General Animation */
.animated-component {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.8s ease-out forwards;
}

@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism + Neobrutalism Card Style */
.glass-brutalist-card {
    background-color: rgba(255, 255, 255, 0.45); /* Increased opacity for better readability */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
}

/* 3D Skeuomorphic/Brutalist Buttons */
.btn-3d {
    background-color: var(--primary-accent);
    color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'IBM Plex Mono', monospace;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s linear, box-shadow 0.1s linear, background-color 0.2s;
}
.btn-3d:hover {
    background-color: var(--primary-accent-hover);
    color: var(--text-light);
}
.btn-3d:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.btn-3d:disabled {
    background-color: #ccc;
    color: #888;
    box-shadow: 4px 4px 0px #888;
    cursor: not-allowed;
}

/* --- Header & Drawer --- */
.header {
    color: var(--text-light);
    text-align: center;
    padding: 20px;
    margin: 100px 20px 0 20px;
    position: relative;
    z-index: 1;
    background-color: rgba(58, 58, 58, 0.2);
    border-bottom: 8px solid var(--text-light);
}
.drawer {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 3px solid var(--border-color);
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    overflow-x: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding-top: 60px;
    z-index: 10;
}
.drawer.is-open {
    transform: translateX(0);
}
.drawer a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.1em;
    color: var(--text-light);
    display: block;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: bold;
}
.drawer a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}
.drawer-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.drawer-close:hover {
    transform: rotate(90deg);
}
.drawer-toggle {
    font-size: 24px;
    color: #ffffff;
    background-color: var(--primary-accent);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 11;
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s linear, box-shadow 0.1s linear;
}

.drawer-toggle:hover {
    background-color: var(--primary-accent-hover);
    color: var(--text-light);
}
.drawer-toggle:active {
     transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- Quiz Specific Styles --- */
.quiz-container {
    text-align: center;
}
.question {
    text-align: left;
    margin-bottom: 40px;
    padding: 20px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 10px;
    background: rgba(10, 10, 10, 0.85);
    opacity: 0;
    animation: flipInX 0.7s ease-out forwards;
}

.question:nth-child(1) { animation-delay: 0.2s; }
.question:nth-child(2) { animation-delay: 0.3s; }
.question:nth-child(3) { animation-delay: 0.4s; }
.question:nth-child(4) { animation-delay: 0.5s; }
.question:nth-child(5) { animation-delay: 0.6s; }
.question:nth-child(6) { animation-delay: 0.7s; }
.question:nth-child(7) { animation-delay: 0.8s; }
.question:nth-child(8) { animation-delay: 0.9s; }
.question:nth-child(9) { animation-delay: 1.0s; }
.question:nth-child(10){ animation-delay: 1.1s; }

@keyframes flipInX {
    from {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotate3d(1, 0, 0, 0);
        opacity: 1;
    }
}

.question h3 {
    margin: 0 0 20px;
    font-size: 1.4em;
}
.options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.options-list li {
    margin-bottom: 10px;
}
.options-list input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}
.options-list label {
    display: inline-block;
    background-color: rgba(20, 20, 20, 0.95);
    color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 95%;
    position: relative;
}
.options-list input[type="radio"]:checked + label {
    background-color: var(--primary-accent);
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}
.options-list input[type="radio"]:focus + label {
     outline: 2px dashed var(--primary-accent-hover);
}

/* Result styling */
.quiz-submitted .options-list label {
    cursor: not-allowed;
}
.quiz-submitted .correct-answer {
    background-color: #004d00 !important;
    color: #ffffff !important; /* Light green */
    border-color: var(--correct-color);
    font-weight: bold;
}
.quiz-submitted .user-incorrect {
    background-color: #4d0000 !important;
    color: #ffffff !important; /* Light red */
    border: 3px solid var(--incorrect-color);
    text-decoration: line-through;
}

#result-display {
    margin-top: 40px;
    font-size: 1.5em;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.5s;
}
#result-display.visible {
    opacity: 1;
    animation: resultShake 0.6s ease-in-out; /* New animation! */
}

/* New animation for result */
@keyframes resultShake {
    0% { transform: scale(1) translateX(0); }
    10%, 30% { transform: scale(1.05) translateX(-5px); }
    20%, 40% { transform: scale(1.05) translateX(5px); }
    50% { transform: scale(1) translateX(0); }
    100% { transform: scale(1) translateX(0); }
}

/* --- Footer & Audio --- */
.footer {
    text-align: center;
}
.footer p { margin-bottom: 15px; }

@keyframes pulse-btn {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.02); box-shadow: 0 4px 15px rgba(229, 107, 85, 0.4); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
}

#submit-btn:not(:disabled):hover {
    animation: pulse-btn 1s infinite;
}

/* --- Enhancements --- */
.progress-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    height: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e56b55, #f4ecd8);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.pop-anim {
    animation: pop 0.3s ease;
}

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

.chart-container {
    max-width: 400px;
    margin: 30px auto;
    background: rgba(10, 10, 10, 0.7);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    animation: fadeInScale 0.8s ease forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.options-list label:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}
