body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: #f4f9f4;
    text-align: center;
    margin: 0;
    padding: 20px;
    color: #333;
}
h1 { color: #2e8b57; font-size: 24px; margin-bottom: 10px; }
.instruction { font-size: 16px; margin-bottom: 15px; font-weight: bold;}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.controls {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

button {
    font-size: 16px;
    padding: 10px 20px;
    margin: 5px;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    background-color: #fff;
    font-weight: bold;
    transition: 0.2s;
}
button:hover { background-color: #f0f0f0; }
button.active-kyori { background-color: #ffebee; border-color: #f44336; color: #d32f2f; }
button.active-michinori { background-color: #e3f2fd; border-color: #2196f3; color: #1976d2; }

.map-container {
    position: relative;
    width: 800px;
    height: 480px;
    background-color: #fffaf0;
    border: 2px solid #a8d08d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
canvas { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; }

.point {
    position: absolute;
    width: 28px;
    height: 28px;
    background-color: #ff9800;
    border: 3px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}
.point:hover { transform: translate(-50%, -50%) scale(1.2); }
.point.selected { background-color: #4caf50; border-color: #2e7d32; }

.label {
    position: absolute;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    z-index: 2;
    pointer-events: none;
    background: rgba(255,255,255,0.9);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.equation-box {
    margin-top: 25px;
    padding: 20px 30px;
    background-color: #fff;
    border: 3px dashed #2196f3;
    border-radius: 15px;
    font-size: 26px;
    min-width: 400px;
    min-height: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.eq-input {
    width: 70px;
    font-size: 26px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 5px;
    color: #d32f2f;
    margin: 0 5px;
    padding: 5px;
}
.eq-input:focus { border-color: #2196f3; outline: none; }

.check-btn { background-color: #ffc107; border-color: #ffb300; color: #333; margin-top:15px; }
.check-btn:hover { background-color: #ffb300; }
.reset-btn { background-color: #eceff1; border-color: #cfd8dc; font-size: 14px;}

#feedback { font-size: 20px; font-weight: bold; margin-left: 15px; vertical-align: middle; }
.correct { color: #e91e63; }
.incorrect { color: #9e9e9e; }