:root {
    --primary-color: #4CAF50;
    --bg-color: #E0F7FA;
    --card-bg: #FFFFFF;
    --text-color: #333;
    --shadow: #90A4AE;
}

* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0; padding: 0;
    font-family: "Hiragino Kaku Gothic ProN", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 100%; max-width: 800px; height: 100%;
    position: relative;
    background: var(--card-bg);
}

.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto; /* Allow scrolling for list view */
}
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; }}

h1 { font-size: 3rem; margin-bottom: 30px; line-height: 1.2; text-align: center; color: #00796B; }

.primary-btn {
    background-color: var(--primary-color); color: white;
    font-size: 2rem; padding: 15px 40px;
    border: none; border-radius: 50px;
    box-shadow: 0 4px #2E7D32;
    cursor: pointer; margin: 20px 0;
    width: 80%; max-width: 400px;
}
.primary-btn:active { box-shadow: 0 0 #2E7D32; transform: translateY(4px); }

/* Start Screen */
.menu-container { display: flex; flex-direction: column; gap: 20px; width: 100%; align-items: center; }
.sub-links { margin-top: 30px; display: flex; gap: 20px; }
.secondary-btn {
    background: #607D8B; color: white; border: none; padding: 10px 20px;
    border-radius: 20px; font-size: 1.2rem; cursor: pointer;
    text-decoration: none;
}

/* Quiz Screen */
.quiz-container { display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; }
.quiz-header { 
    display: flex; justify-content: space-between; width: 100%; 
    padding: 10px 20px; align-items: center; font-size: 1.5rem; color: #555;
}
.big-letter {
    font-size: 8rem; font-weight: bold; color: #00796B;
    background: #E0F2F1; border-radius: 20px;
    width: 200px; height: 200px; display: flex; align-items: center; justify-content: center;
    margin: 20px 0;
}
.question-text { font-size: 1.5rem; margin-bottom: 20px; }

.choices {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    width: 100%; max-width: 500px;
}
.choice-btn {
    background: white; border: 2px solid #EEE; border-radius: 15px;
    font-size: 3rem; padding: 20px;
    box-shadow: 0 4px var(--shadow); cursor: pointer;
}
.choice-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0; }

.back-link {
    font-size: 1rem; color: white; background: #90A4AE;
    padding: 8px 12px; border-radius: 20px; text-decoration: none;
    box-shadow: 0 2px #546E7A;
}

/* List Screen */
.list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Responsive Grid */
    gap: 15px; width: 100%; padding: 20px;
    justify-items: center;
    overflow-y: auto;
}
.letter-card {
    background: white; border-radius: 10px; padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; align-items: center;
    width: 100%;
}
.u { font-size: 3rem; color: #333; }
.l { font-size: 2.5rem; color: #666; }
.screen-header { 
    width: 100%; display: flex; justify-content: flex-start; padding: 10px;
    position: sticky; top: 0; background: var(--card-bg); z-index: 10;
}

/* Feedback Overlay */
.feedback-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 15rem; font-weight: bold;
    opacity: 0; transition: opacity 0.2s;
    z-index: 100;
}
.feedback-overlay.correct::after { content: "⭕"; color: #E91E63; } 
.feedback-overlay.incorrect::after { content: "❌"; color: #3F51B5; }
.feedback-overlay.show { opacity: 0.8; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}
