/* TOEICロード - モバイルファースト / フラット / アイコン・絵文字なし */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2330;
  --sub: #5b6472;
  --line: #dde1e7;
  --accent: #1e4fa3;      /* 青 */
  --accent-ink: #ffffff;
  --ok: #1e7d46;          /* 緑 */
  --ng: #b3362e;          /* 赤 */
  --warn: #8a6d1a;
  --soft: #eef1f6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.app { max-width: 520px; margin: 0 auto; padding: 12px 14px 40px; }

h1 { font-size: 1.25rem; margin: 8px 0 2px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 6px 0; }
.small { font-size: 0.85rem; color: var(--sub); }
.center { text-align: center; }

.topbar {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px; gap: 8px;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar .right { font-size: 0.85rem; color: var(--sub); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* ボタン: タップ目標44px以上 */
button {
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 10px 14px;
  width: 100%;
  text-align: center;
  cursor: pointer;
}
button:active { background: var(--soft); }
button:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn-primary:active { background: #173c7d; }
.btn-ghost { background: transparent; }
.btn-row { display: flex; gap: 8px; }
.btn-row button { flex: 1; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stack > * + * { margin-top: 8px; }

/* 入力: 16px以上でiOSズーム防止 */
input, select {
  font: inherit; font-size: 1rem;
  width: 100%; min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
}
label { display: block; font-size: 0.9rem; color: var(--sub); margin-bottom: 4px; }
.field { margin-bottom: 14px; }

/* ホーム: スコアカード */
.score-big { font-size: 2.4rem; font-weight: 700; line-height: 1.2; }
.score-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.score-line .goal { text-align: right; font-size: 0.9rem; color: var(--sub); }
.bar { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; margin: 8px 0 4px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar.ok > span { background: var(--ok); }
.stat-row { display: flex; gap: 8px; }
.stat-box {
  flex: 1; background: var(--soft); border-radius: 10px;
  padding: 8px 10px; text-align: center;
}
.stat-box .v { font-size: 1.15rem; font-weight: 700; }
.stat-box .k { font-size: 0.75rem; color: var(--sub); }

/* ミッション */
.quest { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quest:last-child { border-bottom: 0; }
.quest .name { flex: 1; }
.quest .prog { font-size: 0.9rem; color: var(--sub); white-space: nowrap; }
.quest.done .name, .quest.done .prog { color: var(--ok); }
.quest button { width: auto; min-width: 88px; min-height: 44px; padding: 6px 10px; font-size: 0.9rem; }
.quest .done-label { min-width: 88px; text-align: center; color: var(--ok); font-weight: 700; font-size: 0.9rem; }

/* クイズ */
.quiz-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--sub); margin-bottom: 8px; gap: 8px; }
.quiz-head .combo { color: var(--accent); font-weight: 700; }
.quiz-head .timer { font-weight: 700; color: var(--ink); }
.quiz-head .timer.low { color: var(--ng); }
.passage {
  background: var(--soft); border-radius: 10px; padding: 12px;
  font-size: 0.95rem; margin-bottom: 12px;
  max-height: 40vh; overflow-y: auto; white-space: pre-wrap;
}
.passage .en { font-family: Georgia, "Times New Roman", serif; }
.prompt { font-size: 1.05rem; margin: 10px 0 14px; white-space: pre-wrap; }
.prompt .en { font-family: Georgia, "Times New Roman", serif; }
.choices .choice {
  display: block; width: 100%; text-align: left;
  margin-bottom: 8px; min-height: 48px;
}
.choice .letter { font-weight: 700; margin-right: 8px; color: var(--sub); }
.choice.sel-ok { border-color: var(--ok); background: #e8f4ec; }
.choice.sel-ng { border-color: var(--ng); background: #f9ebea; }
.choice.reveal-ok { border-color: var(--ok); }
.feedback { border-radius: 10px; padding: 12px; margin-top: 12px; }
.feedback.ok { background: #e8f4ec; border: 1px solid var(--ok); }
.feedback.ng { background: #f9ebea; border: 1px solid var(--ng); }
.feedback .head { font-weight: 700; margin-bottom: 4px; }
.feedback .ex { font-size: 0.92rem; }
.feedback .tr { font-size: 0.88rem; color: var(--sub); margin-top: 6px; }
.xp-gain { font-size: 0.85rem; color: var(--accent); font-weight: 700; margin-top: 6px; }

/* リスニング */
.audio-box { text-align: center; padding: 8px 0 4px; }
.audio-box .note { font-size: 0.85rem; color: var(--sub); margin-top: 6px; }

/* 成績 */
.acc-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.acc-row .nm { width: 40%; font-size: 0.9rem; }
.acc-row .bar { flex: 1; margin: 0; }
.acc-row .pct { width: 3.2em; text-align: right; font-size: 0.85rem; color: var(--sub); }
.prio-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.prio-item:last-child { border-bottom: 0; }
.prio-item .why { font-size: 0.82rem; color: var(--sub); }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 6px 12px; font-size: 0.85rem;
}
.badge.locked { border-color: var(--line); color: var(--sub); background: var(--soft); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; white-space: nowrap; }
th { color: var(--sub); font-weight: 600; font-size: 0.82rem; }

/* 結果 */
.result-big { font-size: 1.8rem; font-weight: 700; text-align: center; margin: 8px 0; }
.result-note { text-align: center; color: var(--sub); font-size: 0.9rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 0.9rem; z-index: 50;
  max-width: 90vw; text-align: center;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }

.onboard-step { font-size: 0.8rem; color: var(--sub); letter-spacing: 0.1em; }
.target-opt { text-align: left; }
.target-opt .d { display: block; font-size: 0.82rem; color: var(--sub); font-weight: 400; }
.back-link { background: none; border: none; color: var(--sub); width: auto; min-height: 44px; padding: 8px 4px; font-size: 0.9rem; }
