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

body {
    font-family: 'Hiragino Maru Gothic ProN', 'Rounded M+ 1c', sans-serif;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    color: var(--text);
}

.app-container {
    background: var(--card);
    padding: 25px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
    max-width: 650px;
}

.question-box {
    background: #e0f2fe; padding: 15px; border-radius: 12px; margin-bottom: 20px;
    font-size: 18px; font-weight: bold; border-left: 6px solid var(--primary); text-align: left;
}

/* ステップカード */
.step-card {
    background: white; border: 2px solid var(--primary); border-radius: 12px;
    padding: 15px; margin-bottom: 15px; transition: all 0.3s;
}
.step-card.disabled-card {
    border-color: #e2e8f0; background: #f8fafc; opacity: 0.5; pointer-events: none;
}
.step-title { font-weight: bold; color: var(--primary-dark); text-align: left; margin-bottom: 10px; font-size: 16px; border-bottom: 2px solid #e2e8f0; padding-bottom: 5px; }
.hint-text { font-size: 14px; color: var(--accent); margin-bottom: 15px; font-weight: bold; }

.calc-row { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 16px; font-weight: bold; margin-bottom: 10px; }
.hidden { display: none !important; }

.highlight-box {
    background: #fffbeb; padding: 10px 20px; border-radius: 10px; border: 2px dashed #fcd34d;
    font-size: 18px;
}

/* 入力欄 */
.num-input { width: 50px; padding: 6px; border: 2px solid #cbd5e1; border-radius: 8px; text-align: center; font-size: 18px; font-weight: bold; }
.text-input { width: 80px; padding: 6px; border: 2px solid #cbd5e1; border-radius: 8px; text-align: center; font-size: 16px; font-weight: bold; }
.num-input:focus, .text-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: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 14px; }
.btn-check:hover:not(:disabled) { background: var(--primary-dark); }
.btn-check:disabled { background: #cbd5e1; }

.btn-action { padding: 8px 15px; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; color: white; }
.btn-action.start { background: #3b82f6; }
.btn-action.stop { background: #ef4444; }
.btn-action.reset { background: #64748b; }

.btn-reset-all { background: #94a3b8; margin-top: 10px; font-size: 13px; color: white; border: none; padding: 8px 20px; border-radius: 5px; cursor: pointer; }

/* ストップウォッチのレイアウト */
.stopwatch-container { display: flex; justify-content: space-around; align-items: center; gap: 20px; }
.sw-wrapper { display: flex; flex-direction: column; align-items: center; }
.sw-label { font-weight: bold; margin-bottom: 10px; color: #475569; }
.ans-row { margin-top: 15px; display: flex; align-items: center; gap: 5px; font-weight: bold; }

/* アナログストップウォッチ */
.analog-sw {
    width: 120px; height: 120px; border: 8px solid #334155; border-radius: 50%;
    background: #f8fafc; position: relative; box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}
.sw-center-dot {
    position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
    background: #ef4444; border-radius: 50%; transform: translate(-50%, -50%); z-index: 10;
}
.sw-hand {
    position: absolute; bottom: 50%; left: 50%; width: 4px; height: 50px;
    background: #ef4444; transform-origin: bottom center; margin-left: -2px;
    border-radius: 4px; transition: transform 0.1s linear; z-index: 5;
}
.sw-number { position: absolute; font-size: 12px; font-weight: bold; color: #64748b; }
.sw-number.top { top: 5px; left: 50%; transform: translateX(-50%); }
.sw-number.right { top: 50%; right: 5px; transform: translateY(-50%); }
.sw-number.bottom { bottom: 5px; left: 50%; transform: translateX(-50%); }
.sw-number.left { top: 50%; left: 5px; transform: translateY(-50%); }

/* デジタルストップウォッチ */
.digital-sw {
    width: 140px; height: 100px; background: #eab308; border-radius: 15px;
    display: flex; justify-content: center; align-items: center; border: 4px solid #ca8a04;
    position: relative; box-shadow: 0 4px 0 #a16207;
}
.digital-display {
    background: #c2c9ad; border: 2px solid #8e967a; padding: 10px; border-radius: 5px;
    font-family: 'Courier New', Courier, monospace; font-size: 18px; font-weight: bold;
    color: #1a1c14; box-shadow: inset 0 0 5px rgba(0,0,0,0.2); width: 100px; text-align: center;
}

/* メッセージボックス */
.message-box {
    min-height: 24px; color: var(--primary-dark); font-weight: bold; margin-bottom: 10px;
    font-size: 15px; background: #e0f2fe; padding: 10px; border-radius: 8px; border: 2px dashed #7dd3fc;
}