:root {
    --primary-color: #d32f2f;
    --primary-hover: #b71c1c;
    --secondary-color: #424242;
    --border-color: #e0e0e0;
    --background-color: #f5f5f5;
    --favorite-color: #ffc107;
    --correct-color: #28a745;
    --incorrect-color: #dc3545;
}

body {
    background-color: var(--background-color);
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ပြင်ဆင်ချက်- content တွေကို အပေါ်ကပ်ရန် */
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 4px 20px 20px 20px; /* ပြင်ဆင်ချက်- အပေါ်ဘက် padding ကို ချိန်ညှိရန် */
    box-sizing: border-box;
    transition: background-image 0.5s ease-in-out;
}

body.selection-view {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.4)), url('images/background2.JPG');
    background-size: cover;
    background-position: center;
}

.container {
    background-color: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.5s ease-in-out;
}
body.selection-view .container { background-color: transparent; box-shadow: none; padding: 30px 10px; }

/* --- Top Bar, Level Indicator, Developer Credit (Style အသစ်) --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px 10px 5px; /* အောက်ဘက် နေရာအနည်းငယ်ခြားရန် */
    width: 100%;
    box-sizing: border-box;
}

.app-level-indicator, .developer-credit {
    font-size: 0.8rem;
    font-weight: 500;
    color: #aaa;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    margin: 0;
}

body.selection-view .app-level-indicator,
body.selection-view .developer-credit { 
    color: white; 
    background-color: rgba(0, 0, 0, 0.2); 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2); 
}


#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; } }

h1, h2 { text-align: center; color: #333; }
body.selection-view h1, body.selection-view h2 { color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
p.description { text-align: center; color: #777; margin-bottom: 30px; }
body.selection-view p.description { color: #f0f0f0; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.screen { display: none; width: 100%; animation: fadeIn 0.4s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

button { font-family: 'Noto Sans JP', sans-serif; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
button.primary { background-color: var(--primary-color); color: white; }
button.primary:hover { background-color: var(--primary-hover); }

.screen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.back-btn { background-color: #f0f0f0; border: 1px solid #ddd; color: #555; font-size: 0.9rem; padding: 8px 15px; border-radius: 20px; }
.back-btn:hover { background-color: #e0e0e0; }
body.selection-view .back-btn { background-color: rgba(255,255,255,0.7); color: #333; }

#chapter-grid { display: grid; grid-template-columns: 1fr; gap: 15px; max-height: 400px; overflow-y: auto; padding: 5px; }
.chapter-btn { background-color: rgba(255, 255, 255, 0.7); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 15px; text-align: left; cursor: pointer; transition: all 0.2s ease; position: relative; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.chapter-btn:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); border-color: rgba(255, 255, 255, 0.4); }
.chapter-btn h3 { margin: 0; font-size: 1.1rem; color: #333; }
.chapter-btn p { margin: 5px 0 10px 0; font-size: 0.8rem; color: #555; }
.progress-bar-container { background-color: rgba(0,0,0,0.1); border-radius: 10px; height: 8px; overflow: hidden; }
.progress-bar { background-color: var(--primary-color); height: 100%; width: 0%; border-radius: 10px; transition: width 0.5s ease; }
.chapter-btn.favorites { border-color: var(--favorite-color); }
.chapter-btn.favorites h3 { color: var(--favorite-color); }

.chapter-result { margin-top: 10px; font-size: 0.9rem; font-weight: 500; color: #444; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.1); }
.chapter-result .sakura-rating { font-size: 1rem; margin-right: 5px; }
.chapter-result .percentage { color: var(--primary-color); font-weight: bold; }

.chapter-btn.review-chapter { background-color: var(--secondary-color); border-color: #212121; }
body.selection-view .chapter-btn.review-chapter { background-color: rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.3); }
.chapter-btn.review-chapter h3, .chapter-btn.review-chapter p { color: white; }

.marquee-container { width: 100%; overflow: hidden; white-space: nowrap; box-sizing: border-box; margin-top: 20px; padding: 10px 0; background-color: rgba(0,0,0,0.2); border-radius: 5px; }
.marquee-text { display: inline-block; padding-left: 100%; animation: scroll-left 15s linear infinite; margin: 0; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
@keyframes scroll-left { 0% { transform: translateX(0%); } 100% { transform: translateX(-100%); } }

.mode-buttons { display: grid; grid-template-columns: 1fr; gap: 15px; }
.mode-btn { background-color: rgba(255, 255, 255, 0.7); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 20px; transition: all 0.2s ease; text-align: left; display: flex; align-items: center; gap: 20px; cursor: pointer; }
.mode-btn:hover { border-color: rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.8); }
.mode-icon { font-size: 2.5rem; }
.mode-btn h3 { margin: 0 0 5px 0; color: var(--primary-color); font-size: 1.2rem; }
.mode-btn p { margin: 0; color: #666; font-size: 0.9rem;}
#study-card, .card-face, #input-prompt-meaning { background-color: #fff; border: 1px solid var(--border-color); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.study-header { display: flex; justify-content: space-between; align-items: flex-start; }
#study-card { border-radius: 8px; padding: 30px; min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
#study-card hr { border: none; border-top: 1px solid #eee; width: 100%; margin: 0 auto 15px auto; }
#study-meaning { font-size: 1.5rem; color: #555; text-align: center; }
#study-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
#study-nav button { background-color: var(--secondary-color); color: white; padding: 10px 20px; }
#study-nav button:disabled { background-color: #ccc; cursor: not-allowed; }
#study-counter { font-size: 1.1rem; color: #888; }
.favorite-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: #ccc; transition: color 0.2s, transform 0.2s; padding: 0; }
.favorite-btn:hover { transform: scale(1.2); }
.favorite-btn.favorited { color: var(--favorite-color); }
#toggle-kanji-only-btn { background-color: #f0f0f0; border: 1px solid #ddd; color: #555; font-size: 0.9rem; padding: 8px 15px; border-radius: 20px; }
#toggle-kanji-only-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.flashcard-container { perspective: 1000px; min-height: 300px; margin-bottom: 30px; }
#flashcard { width: 100%; height: 300px; position: relative; transition: transform 0.6s; transform-style: preserve-3d; }
#flashcard.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 12px; box-sizing: border-box; padding: 20px; }
.card-back { transform: rotateY(180deg); background-color: #fdf8f8; }
.card-front #favorite-btn-practice { position: absolute; top: 15px; right: 15px; }
#practice-meaning { font-size: 2rem; color: var(--primary-color); }
.button-group { display: flex; justify-content: center; gap: 15px; }
.button-group button { background-color: var(--secondary-color); color: white; padding: 15px 30px; font-size: 1.2rem; }
#input-prompt-meaning { border-radius: 8px; padding: 40px 20px; min-height: 150px; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; color: #333; margin-bottom: 20px; }
.input-area { display: flex; gap: 10px; }
#user-input-field { flex-grow: 1; border: 2px solid #ddd; border-radius: 8px; padding: 15px; font-size: 1.2rem; }
#user-input-field:focus { border-color: var(--primary-color); outline: none; }
#submit-answer-btn { padding: 15px 25px; font-size: 1.1rem; }
#feedback-container { min-height: 80px; margin-top: 20px; font-size: 1.2rem; font-weight: bold; }
#feedback-container.correct { color: var(--correct-color); }
#feedback-container.incorrect { color: var(--incorrect-color); }
#study-word, #practice-word { font-weight: bold; color: #333; line-height: 1.2; flex-grow: 1; display: flex; justify-content: center; align-items: center; }
#study-word { font-size: 3.5rem; margin-bottom: 15px; }
#practice-word { font-size: 4rem; }
#study-word ruby, #practice-word ruby { display: inline-flex; flex-direction: column-reverse; align-items: center; text-align: center; }
#study-word rt, #practice-word rt { font-weight: normal; color: #555; opacity: 0.9; margin-top: 5px; }
#study-word rt { font-size: 1.2rem; }
#practice-word rt { font-size: 1.5rem; }
#score-display { text-align: center; font-size: 1.5rem; font-weight: bold; margin-bottom: 15px; }
#score-display .percent { font-size: 2.5rem; color: var(--primary-color); }
#sakura-rating { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; min-height: 40px; }
.sakura-blossom { font-size: 2.5rem; color: #ff85a2; text-shadow: 1px 1px 3px rgba(0,0,0,0.1); transform: scale(0); animation: popIn 0.5s ease-out forwards; }
.sakura-blossom:nth-child(2) { animation-delay: 0.2s; }
.sakura-blossom:nth-child(3) { animation-delay: 0.4s; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
#results-summary { max-height: 200px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; padding: 10px; text-align: left; }
.result-item { padding: 10px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.result-item:last-child { border-bottom: none; }
.result-item.correct { color: var(--correct-color); }
.result-item.incorrect { color: var(--incorrect-color); }
.result-item .word { font-weight: bold; font-size: 1rem; }
#restart-input-test-btn { width: 100%; padding: 15px; margin-top: 20px; margin-bottom: 10px; font-size: 1.1rem; }
