:root {
    --primary: #0ea5e9; --primary-dark: #0284c7;
    --success: #22c55e; --warning: #f59e0b;
    --bg: #f8fafc; --card: #ffffff; --text: #334155;
}

body { font-family: 'Hiragino Maru Gothic ProN', sans-serif; background: var(--bg); display: flex; justify-content: center; padding: 20px 0; color: var(--text); }
.app-container { background: var(--card); padding: 20px 25px; border-radius: 20px; box-shadow: 0 8px 20px rgba(0,0,0,0.05); width: 100%; max-width: 600px; }
.header-title { font-size: 20px; font-weight: bold; color: #854d0e; text-align: center; margin-bottom: 20px; background: #fef08a; padding: 10px; border-radius: 10px;}

/* タブ */
.tabs { display: flex; gap: 5px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px 5px; font-size: 13px; font-weight: bold; border: 2px solid #cbd5e1; border-radius: 8px; background: white; color: #64748b; cursor: pointer; transition: 0.2s; }
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active-content { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* 共通パーツ */
.question-box { background: #f0fdf4; padding: 15px; border-radius: 10px; margin-bottom: 15px; font-size: 15px; font-weight: bold; border-left: 6px solid var(--success); line-height: 1.4; }
.step-card { border: 2px solid #e2e8f0; border-radius: 12px; padding: 15px; margin-bottom: 15px; background: #fff; }
.step-title { font-weight: bold; color: var(--primary-dark); margin-bottom: 10px; border-bottom: 2px solid #e2e8f0; padding-bottom: 5px; }
.calc-row { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: bold; margin-bottom: 8px; flex-wrap: wrap; }
.final-ans { background: #fffbeb; padding: 10px; border-radius: 8px; border: 2px dashed var(--warning); }
.hidden { display: none !important; }
.message-box { font-size: 13px; font-weight: bold; color: #475569; background: #f1f5f9; padding: 8px; border-radius: 6px; margin-top: 5px; }

/* 入力・ボタン */
.num-input { width: 45px; padding: 5px; border: 2px solid #cbd5e1; border-radius: 6px; text-align: center; font-size: 16px; font-weight: bold; }
.num-input:focus { border-color: var(--primary); outline: none; }
.correct { background: #dcfce7 !important; border-color: var(--success) !important; color: var(--success) !important; }
.btn-check { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 6px; font-weight: bold; cursor: pointer; margin-left: auto; }
.btn-check:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-reset-all { background: #94a3b8; display: block; width: 100%; margin-top: 20px; font-size: 14px; color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: bold; }

/* 時計 */
.clock-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 15px; }
.clock { width: 120px; height: 120px; border: 4px solid var(--primary); border-radius: 50%; position: relative; background: #fff; }
.center-dot { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; background: #fff; border: 2px solid #e91e63; border-radius: 50%; transform: translate(-50%, -50%); z-index: 10; }
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom center; transition: transform 0.5s ease-in-out; border-radius: 4px; }
.hour { width: 5px; height: 30px; background: var(--primary); margin-left: -2.5px; z-index: 5; }
.minute { width: 3px; height: 50px; background: #e91e63; margin-left: -1.5px; z-index: 6; }
.digital-time { font-size: 20px; font-weight: bold; color: var(--primary-dark); margin-top: 5px; }

/* 単位選び */
.unit-q-container { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.unit-q-text { font-size: 15px; font-weight: bold; margin-bottom: 10px; }
.ans-blank { display: inline-block; width: 40px; text-align: center; border-bottom: 2px solid #94a3b8; color: #8b5cf6; }
.unit-btns { display: flex; gap: 5px; justify-content: center; }
.unit-btns button { flex: 1; padding: 6px; font-size: 14px; font-weight: bold; background: white; border: 2px solid #8b5cf6; color: #8b5cf6; border-radius: 6px; cursor: pointer; }
.unit-btns button:hover { background: #f3e8ff; }