@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Noto+Sans+JP:wght@400;700&display=swap');

:root {
    --bg-color: #eef2f3;
    --main-color: #ffffff;
    --accent-blue: #005a9e; /* Deeper Blue */
    --accent-yellow: #ffc900; /* Rich Yellow */
    --text-color: #2c3e50;
    --wood-color: #c8b7a6;
    --correct-color: #27ae60;
    --incorrect-color: #e74c3c;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans JP', 'Montserrat', sans-serif;
    background: linear-gradient(-45deg, #eef2f3, #d7e1e4, #eef2f3, #d7e1e4);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

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

#quiz-container {
    background-color: var(--main-color);
    border-radius: 25px;
    box-shadow: 0 15px 40px var(--shadow-color);
    width: 100%;
    max-width: 650px;
    overflow: hidden;
    position: relative;
}

.screen {
    padding: 30px 40px 40px;
    text-align: center;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    position: relative;
}

.dalahast-icon {
    font-size: 3.5rem;
    color: var(--accent-blue);
    animation: swing 3s ease-in-out infinite;
}

@keyframes swing {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(5deg); }
}

h1, h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-blue);
}

#start-screen h1 {
    font-size: 2.2rem;
    margin: 15px 0;
}

#start-screen p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn {
    background: linear-gradient(45deg, var(--accent-yellow), #ffd54f);
    color: var(--accent-blue);
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 5px 15px rgba(255, 201, 0, 0.4);
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 201, 0, 0.5);
}

#progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#progress-bar-container {
    flex-grow: 1;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-yellow), #fdd835);
    border-radius: 6px;
    transition: width 0.4s ease;
}

#question-counter {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-blue);
    flex-shrink: 0;
}

#question-text {
    font-size: 1.4rem;
    min-height: 110px;
    margin-bottom: 30px;
}

#options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.option-btn {
    background-color: var(--main-color);
    color: var(--text-color);
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 18px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--accent-yellow);
    background-color: #fffbeb;
}

.option-btn.correct {
    background-color: var(--correct-color);
    color: white;
    border-color: var(--correct-color);
    animation: pulse 0.5s;
}

.option-btn.incorrect {
    background-color: var(--incorrect-color);
    color: white;
    border-color: var(--incorrect-color);
    animation: shake 0.5s;
}

.option-btn:disabled {
    cursor: not-allowed;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#result-chart {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 20px auto;
}

#result-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

#result-chart .chart-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 15;
}

#result-chart .chart-bar {
    fill: none;
    stroke: var(--accent-yellow);
    stroke-width: 15;
    stroke-linecap: round;
    stroke-dasharray: 471.24; /* 2 * PI * 75 */
    stroke-dashoffset: 471.24;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

#score-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

#score-text {
    font-size: 1.3rem;
    font-weight: bold;
}

#result-message {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 15px 0 30px;
}