/* 勘定科目 書きとり道場 — 記述式。スマホ縦持ち最優先。和・道場テーマ（藍×金×朱）。 */
:root {
  --bg: #10151f;
  --bg2: #19212e;
  --panel: #212c3d;
  --ink: #f0f4fb;
  --sub: #97a6c0;
  --gold: #e8b84b;
  --vermil: #e2553b;
  --good: #52c08a;
  --bad: #e2553b;
  --close: #e8b84b;
  --line: #344056;
  --shadow: 0 6px 0 rgba(0,0,0,.4);
  --radius: 16px;
  /* 要素カラー */
  --c-asset: #4aa3df;
  --c-liability: #e2553b;
  --c-equity: #9b6bd6;
  --c-revenue: #52c08a;
  --c-expense: #e8923b;
  --c-special: #8894aa;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% 0%, #1a2436 0%, var(--bg) 60%);
  color: var(--ink);
  min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center;
  -webkit-text-size-adjust: 100%;
}
#app {
  width: 100%; max-width: 460px; min-height: 100vh; min-height: 100dvh;
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}

/* 共通 */
.btn { appearance: none; border: none; border-radius: 14px; background: var(--gold); color: #2a2207;
  font-weight: 800; font-size: 17px; padding: 15px 16px; width: 100%; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .05s, filter .1s; letter-spacing: .02em; }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.4); }
.btn.sub { background: var(--panel); color: var(--ink); box-shadow: 0 5px 0 #121925; }
.btn.ghost { background: transparent; color: var(--sub); box-shadow: none; font-size: 14px; padding: 10px; font-weight: 700; }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
.card { background: linear-gradient(180deg, var(--bg2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.hide { display: none !important; }
.muted { color: var(--sub); font-size: 13px; line-height: 1.7; }
.center { text-align: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #344056; color: #dce6f7; }

/* タイトル */
.title-wrap { display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: center; }
.logo { text-align: center; }
.logo .em { font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.45)); }
.logo h1 { font-size: 27px; margin: 8px 0 2px; letter-spacing: .1em; }
.logo .by { color: var(--sub); font-size: 13px; font-weight: 700; }
.rankline { text-align: center; font-weight: 800; font-size: 15px; }
.rankline b { color: var(--gold); }

.stat-row { display: flex; gap: 8px; }
.stat-box { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat-box .n { font-size: 21px; font-weight: 900; color: var(--gold); }
.stat-box .l { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* 要素別の習得バー */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-row .nm { width: 52px; font-size: 12px; font-weight: 800; }
.cat-row .bar { flex: 1; height: 12px; border-radius: 999px; background: #11161f; overflow: hidden; border: 1px solid #0008; }
.cat-row .bar > i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.cat-row .num { width: 46px; text-align: right; font-size: 11px; color: var(--sub); }

/* モード選択 */
.mode { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--bg2);
  border: 1px solid var(--line); cursor: pointer; transition: transform .05s; }
.mode:active { transform: scale(.985); }
.mode.disabled { opacity: .4; cursor: default; }
.mode .ic { font-size: 26px; width: 34px; text-align: center; }
.mode .body .h { font-weight: 800; font-size: 15px; }
.mode .body .s { color: var(--sub); font-size: 12px; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex: 1 0 28%; text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--bg2);
  border: 1.5px solid var(--line); font-weight: 800; font-size: 14px; cursor: pointer; }
.chip:active { transform: scale(.97); }
.chip .c { font-size: 11px; color: var(--sub); font-weight: 700; display: block; margin-top: 3px; }

/* セッション上部 */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar .back { font-size: 22px; background: none; border: none; color: var(--sub); cursor: pointer; padding: 4px 6px; }
.topbar .who { font-weight: 800; font-size: 14px; }
.topbar .right { margin-left: auto; font-size: 12px; }
.progress { height: 8px; border-radius: 999px; background: #11161f; overflow: hidden; border: 1px solid #0008; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--vermil)); transition: width .3s; }

.combo { text-align: center; font-weight: 900; height: 22px; color: var(--gold); font-size: 16px; letter-spacing: .04em; }
.combo.pop { animation: pop .3s ease; }
@keyframes pop { 0%{transform:scale(.6)} 60%{transform:scale(1.3)} 100%{transform:scale(1)} }

/* 問題カード */
.q-card { text-align: center; }
.q-badges { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.badge2 { font-size: 11px; font-weight: 800; padding: 3px 11px; border-radius: 999px; }
.badge2.t { background: #344056; color: #dce6f7; }
.q-text { font-size: 19px; font-weight: 800; line-height: 1.55; margin: 6px 4px 4px; min-height: 56px; display: flex; align-items: center; justify-content: center; }
.ans-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ans-input {
  width: 100%; text-align: center; font-size: 22px; font-weight: 800; color: var(--ink);
  background: #0e131c; border: 2px solid var(--line); border-radius: 14px; padding: 15px 12px;
  outline: none; transition: border-color .15s, background .15s;
}
.ans-input::placeholder { color: #4a5a72; font-weight: 600; font-size: 16px; }
.ans-input:focus { border-color: var(--gold); }
.ans-input.ok { border-color: var(--good); background: rgba(82,192,138,.1); }
.ans-input.close { border-color: var(--close); background: rgba(232,184,75,.12); }
.ans-input.ng { border-color: var(--bad); background: rgba(226,85,59,.12); }

.feedback { border-radius: 12px; padding: 11px 13px; font-size: 14px; line-height: 1.6; text-align: left; }
.feedback.ok { background: rgba(82,192,138,.14); border: 1px solid #2f7d5a; color: #c8f3df; }
.feedback.close { background: rgba(232,184,75,.14); border: 1px solid #9b7e2e; color: #f6e6b8; }
.feedback.ng { background: rgba(226,85,59,.14); border: 1px solid #9b3c2c; color: #f6ccc2; }
.feedback b { color: #fff; }

.skip { color: var(--sub); font-size: 12px; text-align: center; padding: 4px; cursor: pointer; }

/* 結果 */
.result .big { font-size: 50px; text-align: center; }
.result h2 { text-align: center; margin: 6px 0 2px; font-size: 24px; }
.reward { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.reward-line { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.reward-line b { color: var(--gold); }
.pop-in { animation: popIn .35s cubic-bezier(.2,1.2,.4,1); }
@keyframes popIn { 0%{transform:scale(.8);opacity:0} 100%{transform:scale(1);opacity:1} }

.footer-note { text-align: center; color: var(--sub); font-size: 11px; padding: 6px 0 2px; line-height: 1.7; }
a.link { color: var(--gold); text-decoration: none; font-weight: 700; }
.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(3px)} }
