body {
    font-fambody {
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 700px;
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
}

h1 { font-size: 24px; color: #00796b; text-align: center; }
h2 { font-size: 20px; color: #fff; background: #4caf50; padding: 10px; border-radius: 8px; margin-top: 0;}
.instruction { text-align: center; font-weight: bold; color: #555; margin-bottom: 20px; }

/* タブ */
.tabs { display: flex; justify-content: center; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
    font-size: 16px; font-weight: bold; padding: 10px 15px;
    background: #e0e0e0; border: none; border-radius: 8px 8px 0 0;
    cursor: pointer; transition: 0.2s; border-bottom: 3px solid #ccc;
    color: #333;
}
.tab-btn:hover { background: #d5d5d5; }
.tab-btn.active-tab { background: #e8f5e9; color: #2e7d32; border-bottom: 3px solid #4caf50; }
.tab-btn.cleared { background: #ffeb3b; border-bottom-color: #fbc02d; color: #f57f17; } /* クリア時のタブ色 */

.mission-panel { background: #fafafa; border: 3px solid #4caf50; border-radius: 10px; padding: 20px; animation: fadeIn 0.3s; }
.hidden { display: none !important; }

/* ヒント */
.hint-btn { background: #ffca28; border: none; font-weight: bold; padding: 8px 15px; border-radius: 20px; cursor: pointer; margin-bottom: 10px; color: #333; }
.hint-btn:hover { background: #ffb300; }
.hint-box { background: #fff8e1; border: 2px dashed #f57f17; padding: 15px; border-radius: 10px; font-size: 15px; font-weight: bold; color: #d84315; margin-bottom: 15px; }

/* 入力エリア */
.answer-area { text-align: center; font-size: 20px; font-weight: bold; }
.list-area p { font-size: 18px; font-weight: bold; text-align: left; padding-left: 20px; }
.math-box { background: #fff; border: 2px solid #ccc; padding: 15px; border-radius: 10px; display: inline-block; width: 100%; box-sizing: border-box; }

input[type="number"], .select-box {
    text-align: center; font-weight: bold; font-size: 20px;
    border: 2px solid #999; border-radius: 5px; padding: 5px;
    color: #d32f2f; outline: none;
}
input[type="number"]:focus, .select-box:focus { border-color: #2196f3; background: #e3f2fd; }
.input-sm { width: 60px; }
.input-md { width: 90px; }
.select-box { width: 100px; cursor: pointer; }

/* きょりと道のりグラフィック */
.map-area { text-align: center; margin: 20px 0; }

/* ボタンとフィードバック */
.check-btn { background: #2196f3; color: white; font-size: 18px; font-weight: bold; border: none; padding: 10px 30px; border-radius: 30px; cursor: pointer; margin-top: 15px; box-shadow: 0 4px 0 #1565c0; transition: 0.1s; }
.check-btn:active { transform: translateY(4px); box-shadow: none; }
.check-btn:hover { background: #1e88e5; }
.feedback { font-size: 20px; font-weight: bold; margin-top: 15px; min-height: 25px; }
.correct { color: #e91e63; }
.incorrect { color: #757575; }

/* 全クリ画面 */
#all-clear-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px; z-index: 100;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.clear-content { text-align: center; background: #fffde7; padding: 40px; border-radius: 20px; border: 5px solid #ffca28; box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.clear-title { font-size: 48px; color: #f57f17; margin: 0 0 20px 0; text-shadow: 2px 2px 0px #fff; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }ily: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 700px;
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

h1 { font-size: 24px; color: #00796b; text-align: center; }
h2 { font-size: 20px; color: #fff; background: #4caf50; padding: 10px; border-radius: 8px; }
.instruction { text-align: center; font-weight: bold; color: #555; margin-bottom: 20px; }

/* タブ */
.tabs { display: flex; justify-content: center; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
    font-size: 16px; font-weight: bold; padding: 10px 15px;
    background: #e0e0e0; border: none; border-radius: 8px 8px 0 0;
    cursor: pointer; transition: 0.2s; border-bottom: 3px solid #ccc;
}
.tab-btn.active-tab { background: #e8f5e9; color: #2e7d32; border-bottom: 3px solid #4caf50; }

.mission-panel { background: #fafafa; border: 3px solid #4caf50; border-radius: 10px; padding: 20px; animation: fadeIn 0.3s; }
.hidden { display: none !important; }

/* ヒント */
.hint-btn { background: #ffca28; border: none; font-weight: bold; padding: 8px 15px; border-radius: 20px; cursor: pointer; margin-bottom: 10px; }
.hint-box { background: #fff8e1; border: 2px dashed #f57f17; padding: 15px; border-radius: 10px; font-size: 15px; font-weight: bold; color: #d84315; margin-bottom: 15px; }

/* 入力エリア */
.answer-area { text-align: center; font-size: 20px; font-weight: bold; }
.list-area p { font-size: 18px; font-weight: bold; text-align: left; padding-left: 20px; }
.math-box { background: #fff; border: 2px solid #ccc; padding: 15px; border-radius: 10px; display: inline-block; width: 100%; box-sizing: border-box; }

input[type="number"], .select-box {
    text-align: center; font-weight: bold; font-size: 20px;
    border: 2px solid #999; border-radius: 5px; padding: 5px;
    color: #d32f2f; outline: none;
}
input[type="number"]:focus, .select-box:focus { border-color: #2196f3; background: #e3f2fd; }
.input-sm { width: 60px; }
.input-md { width: 90px; }
.select-box { width: 100px; cursor: pointer; }

/* まきじゃくグラフィック */
.ruler-container { position: relative; width: 100%; height: 120px; margin: 20px 0; background: #fff; border: 1px solid #ccc; border-radius: 5px; overflow: hidden; padding-top: 40px; box-sizing: border-box; }
.arrow-box { position: absolute; top: 0; left: 0; width: 100%; height: 40px; }
.arrow { position: absolute; font-size: 16px; font-weight: bold; color: #f44336; text-align: center; transform: translateX(-50%); }
.ruler-track { position: relative; width: 100%; height: 60px; background: #fff3e0; border-top: 1px solid #000; display: flex; flex-direction: column; }
.ruler-marks { width: 100%; height: 20px; background: repeating-linear-gradient(90deg, #000 0, #000 1px, transparent 1px, transparent 10%), repeating-linear-gradient(90deg, #666 0, #666 1px, transparent 1px, transparent 2%); }
.ruler-numbers { display: flex; justify-content: space-between; padding: 5px 10px; font-weight: bold; font-size: 14px; }
.red-text { color: #f44336; }

/* きょりと道のりグラフィック */
.map-area { text-align: center; margin: 20px 0; }

/* ボタンとフィードバック */
.check-btn { background: #2196f3; color: white; font-size: 18px; font-weight: bold; border: none; padding: 10px 30px; border-radius: 30px; cursor: pointer; margin-top: 15px; box-shadow: 0 4px 0 #1565c0; transition: 0.1s; }
.check-btn:active { transform: translateY(4px); box-shadow: none; }
.feedback { font-size: 20px; font-weight: bold; margin-top: 15px; min-height: 25px; }
.correct { color: #e91e63; }
.incorrect { color: #757575; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }