:root {
    --primary-color: #FF9800; /* Orange for kids */
    --secondary-color: #4CAF50; /* Green */
    --bg-color: #f0f4f8;
    --text-color: #333;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

header {
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#question-display {
    margin-bottom: 15px;
}

#question-text {
    font-size: 2rem;
    font-weight: bold;
    color: #000;
}

.canvas-wrapper {
    border: 2px solid #ddd;
    border-radius: 10px;
    display: inline-block;
    cursor: crosshair;
    background-color: #fff;
    /* faint grid for writing guide */
    background-image: 
        linear-gradient(#eee 1px, transparent 1px),
        linear-gradient(90deg, #eee 1px, transparent 1px);
    background-size: 150px 150px;
    background-position: center;
}

canvas {
    touch-action: none; /* Prevent scrolling while drawing */
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.95);
}

.primary {
    background-color: var(--primary-color);
    color: white;
}

.secondary {
    background-color: #ccc;
    color: #333;
}

#result-message {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    height: 1.5em; /* preserve space */
}

.correct { color: var(--secondary-color); }
.incorrect { color: #f44336; }

.hidden { display: none; }
