:root {
    --primary-color: #BF2A2A;
    --primary-hover: #a12323;
    --correct-color: #28a745;
    --incorrect-color: #dc3545;
    --timer-color: #2196f3;
}

body { background-color: #f0f2f5; font-family: 'Helvetica Neue', 'Hiragino Sans', 'Meiryo', sans-serif; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; margin: 0; padding: 20px; box-sizing: border-box; }
#app-wrapper { width: 100%; max-width: 600px; }
.container { background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); padding: 30px 40px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); text-align: center; position: relative; border: 1px solid rgba(255, 255, 255, 0.2); }
.app-version { position: absolute; top: 10px; right: 15px; font-size: 0.8rem; color: #b0b0b0; margin: 0; }
h1 { color: #333; margin-top: 0; }
p.description { color: #666; margin-bottom: 30px; }

/* --- Sakura Animation --- */
#sakura-fall { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; overflow: hidden; display: none; }
.petal { position: absolute; top: -20px; background-color: #ffc0cb; width: 15px; height: 15px; border-radius: 1px 50%; opacity: 0.9; animation-name: fall; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes fall { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

/* --- Screen Transitions --- */
.screen { display: none; animation: fadeIn 0.5s ease-in-out; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Start Screen --- */
#level-selection-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.level-card { background-color: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 20px; cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; }
.level-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); }
.level-card h2 { margin: 0 0 5px 0; font-size: 2rem; color: #333; }
.level-card p { margin: 0; font-size: 0.9rem; color: #777; }
.level-card[data-level="N5"] { border-left: 5px solid #4caf50; }
.level-card[data-level="N4"] { border-left: 5px solid #2196f3; }
.level-card[data-level="N3"] { border-left: 5px solid #ff9800; }
.level-card[data-level="N2"] { border-left: 5px solid var(--primary-color); }

/* --- Quiz Screen --- */
#quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: #888; font-size: 1.1rem; }
#progress-container { width: 100%; background-color: #e0e0e0; border-radius: 5px; height: 10px; margin-bottom: 5px; }
#progress-bar { width: 0%; height: 100%; background-color: var(--correct-color); border-radius: 5px; transition: width 0.3s ease; }
#timer-container { width: 100%; background-color: #e0e0e0; border-radius: 5px; height: 5px; margin-bottom: 20px; }
#timer-bar { width: 100%; height: 100%; background-color: var(--timer-color); border-radius: 5px; }
#kanji-question-display { font-size: 8rem; font-weight: bold; color: #333; background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 30px; line-height: 1; display: flex; justify-content: center; align-items: center; min-height: 150px; box-sizing: border-box; white-space: nowrap; overflow: hidden; }
#options-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.option-btn {
    background-color: #fff;
    color: #555;
    border: 2px solid #ddd;
    padding: 15px;
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    /* transition နှင့် hover effect အားလုံးကို ဖြုတ်ထားပါသည် */
}
.option-btn:disabled { cursor: not-allowed; opacity: 0.8; }
.option-btn.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: white; animation: glow 0.5s ease; }
.option-btn.incorrect { background-color: var(--incorrect-color); border-color: var(--incorrect-color); color: white; animation: shake 0.5s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 5px var(--correct-color); } 50% { box-shadow: 0 0 20px var(--correct-color); } }

/* --- Results Screen --- */
#score-display { font-size: 2rem; font-weight: bold; margin-bottom: 20px; }
#score-display .percent { font-size: 3rem; color: var(--primary-color); }

/* Sakura Rating Style (ပြင်ဆင်ထား) */
#sakura-rating { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; }
.sakura-blossom {
    font-size: 2.5rem;
    color: #ff85a2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    visibility: hidden; /* မူလက ဖျောက်ထား (နေရာယူထား) */
}
.sakura-blossom.earned {
    visibility: visible; /* ရမှတ်ရှိမှ ပြန်ပေါ် */
    transform: scale(0);
    animation: popIn 0.5s ease-out forwards;
}
.sakura-blossom.earned:nth-child(2) { animation-delay: 0.2s; }
.sakura-blossom.earned:nth-child(3) { animation-delay: 0.4s; }

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

#results-summary { max-height: 250px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; padding: 10px; text-align: left; }
.result-item { padding: 15px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 15px; }
.result-item:last-child { border-bottom: none; }
.result-item.correct { color: var(--correct-color); }
.result-item.incorrect { color: var(--incorrect-color); }
.result-item .result-icon { font-size: 1.5rem; font-weight: bold; }
.result-item .result-text .kanji { font-weight: bold; font-size: 1.2rem; }

#restart-btn { background-color: var(--primary-color); color: white; border: none; padding: 15px 30px; font-size: 1.2rem; border-radius: 8px; cursor: pointer; margin-top: 30px; transition: background-color 0.2s; }
#restart-btn:hover { background-color: var(--primary-hover); }

footer { margin-top: 30px; text-align: center; color: #888; }