/* ============================================================
   BitSize Japanese Vocabulary — app-specific styles (.vc, vc- prefix).
   Builds on the shared Japanese-track tokens in japanese_kanji/kanji.css
   (.kj root: --paper, --c, --good, buttons, stepper, options, ring).
   ============================================================ */
.vc .vc-jp, .vc-resume__jp { font-family:var(--jp); }
.vc-resume__jp { font-size:26px; }

/* ---------- index hero card ---------- */
.vc-hero::after { content:"語"; }
.vc-hcard { width:240px; min-height:200px; border-radius:22px; background:rgba(255,255,255,.1); border:1.5px solid rgba(255,255,255,.3);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:22px; cursor:pointer; transition:transform .25s ease, opacity .25s ease; }
.vc-hcard:hover { transform:translateY(-3px); }
.vc-hcard.is-out { opacity:0; transform:translateY(8px) scale(.97); }
.vc-hcard__jp { font-family:var(--jp); font-size:54px; font-weight:600; line-height:1.1; text-align:center; }
.vc-hcard__r { font-family:var(--jp); font-size:17px; color:#FBD9D3; }
.vc-hcard__m { font-size:14px; color:#FCE9E6; text-align:center; max-width:22ch; }
.vc-lvl__sample { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:14px; }
.vc-lvl__sample span { font-family:var(--jp); font-size:13.5px; padding:3px 9px; border-radius:8px; background:var(--cream); color:var(--ink-soft); }
.vc-credit { font-size:12px; color:var(--ink-muted); margin:22px 0 0; }
.vc-credit a { text-decoration:underline; }

/* ---------- level page ---------- */
.vc-lvstats { margin:4px 0 22px; }
.vc-lvstats p { font-size:13px; color:var(--ink-muted); margin:8px 0 0; }
.vc-lvstats b { color:var(--ink); }
.vc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.vc-tile { display:flex; flex-direction:column; gap:8px; background:var(--panel); border:1.5px solid var(--line); border-radius:16px; padding:12px 14px; transition:transform .14s, border-color .15s; }
.vc-tile:hover { transform:translateY(-2px); border-color:var(--acc,var(--c)); }
.vc-tile.is-next { border-color:var(--acc,var(--c)); box-shadow:0 0 0 4px var(--c-tint); }
.vc-tile.is-done { background:var(--good-tint); border-color:transparent; }
.vc-tile__top { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:22px; }
.vc-tile__n { font-family:var(--mono); font-size:12px; font-weight:800; color:var(--ink-muted); }
.vc-tile__t { font-family:var(--serif); font-size:15.5px; font-weight:600; line-height:1.25; color:var(--ink); }
.vc-tile__w { display:flex; flex-wrap:wrap; gap:4px 8px; font-family:var(--jp); font-size:13.5px; font-weight:600; color:var(--ink-muted); line-height:1.35; }
.vc-tile.is-done .vc-tile__w { color:var(--good); }
.vc-tile.is-locked { opacity:.55; cursor:not-allowed; }
.vc-tile.is-locked:hover { transform:none; border-color:var(--line); }

/* ---------- 1 · words ---------- */
.vc-tools { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.vc-tools .kj-chip.is-on { background:var(--c); border-color:var(--c); color:#fff; }
.vc-words { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.vc-w { display:grid; grid-template-columns:28px minmax(96px,auto) minmax(0,1fr) 34px; grid-template-areas:"n jp m say" "n r m say"; align-items:center; column-gap:14px;
  background:var(--panel); border:1.5px solid var(--line); border-radius:16px; padding:10px 14px; cursor:pointer; transition:border-color .15s, transform .12s, background .15s; animation:kjIn .35s ease both; }
.vc-w:nth-child(2){animation-delay:.03s}.vc-w:nth-child(3){animation-delay:.06s}.vc-w:nth-child(4){animation-delay:.09s}.vc-w:nth-child(5){animation-delay:.12s}
.vc-w:nth-child(6){animation-delay:.15s}.vc-w:nth-child(7){animation-delay:.18s}.vc-w:nth-child(8){animation-delay:.21s}.vc-w:nth-child(9){animation-delay:.24s}.vc-w:nth-child(10){animation-delay:.27s}
.vc-w:hover { border-color:var(--c); }
.vc-w:focus-visible { outline:3px solid var(--c-tint); border-color:var(--c); }
.vc-w.is-on { border-color:var(--c); background:var(--c-tint); transform:translateX(3px); }
.vc-w__n { grid-area:n; font-family:var(--mono); font-size:12px; font-weight:800; color:var(--ink-muted); }
.vc-w__jp { grid-area:jp; font-family:var(--jp); font-size:24px; font-weight:600; line-height:1.2; }
.vc-w__r { grid-area:r; font-family:var(--jp); font-size:14px; color:var(--kun); min-height:1em; }
.vc-w__m { grid-area:m; font-size:14.5px; color:var(--ink-soft); line-height:1.4; }
.vc-w .kj-say { grid-area:say; }
.vc-hide-reading .vc-w__r, .vc-hide-meaning .vc-w__m { color:transparent; background:var(--cream); border-radius:6px; transition:color .15s; }
.vc-hide-reading .vc-w:hover .vc-w__r, .vc-hide-meaning .vc-w:hover .vc-w__m { color:inherit; background:none; }
.vc-hide-reading .vc-w:hover .vc-w__r { color:var(--kun); }

/* ---------- 2/3 · matching boards ---------- */
.vc-mhead { text-align:center; margin:0 0 14px; }
.vc-mhead__t { font-family:var(--serif); font-size:clamp(20px,3vw,24px); font-weight:600; margin:0; }
.vc-mhead__s { font-size:13px; color:var(--ink-muted); margin:4px 0 0; }
.vc-board { max-width:780px; margin:0 auto; position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(46px,.55fr) minmax(0,1fr); gap:0; background:var(--panel); border:1.5px solid var(--line); border-radius:22px; padding:16px; box-shadow:var(--shadow); touch-action:none; user-select:none; -webkit-user-select:none; }
.vc-board.is-empty { display:block; text-align:center; color:var(--ink-soft); padding:30px 20px; touch-action:auto; }
.vc-col { display:flex; flex-direction:column; gap:8px; justify-content:space-around; position:relative; z-index:2; }
.vc-col--l { grid-column:1; }
.vc-col--r { grid-column:3; }
.vc-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; overflow:visible; }
.vc-line { stroke-width:4; stroke-linecap:round; fill:none; }
.vc-line--temp { stroke:var(--c); stroke-dasharray:2 9; opacity:.8; }
.vc-line--bad { stroke:var(--bad); animation:vcFade .5s ease forwards; }
.vc-line--ok { animation:vcDraw .35s ease-out both; }
.vc-node { position:relative; display:flex; align-items:center; gap:10px; min-height:48px; padding:8px 12px; border-radius:14px; border:1.5px solid var(--line); border-bottom-width:3px; background:var(--panel);
  font-family:inherit; color:var(--ink); cursor:grab; text-align:left; transition:border-color .12s, background .12s, transform .12s, opacity .2s; }
.vc-node--l { justify-content:space-between; }
.vc-node--r { justify-content:flex-start; }
.vc-node:hover:not(.is-done) { border-color:var(--c); }
.vc-node.is-active { border-color:var(--c); background:var(--c-tint); transform:scale(1.02); }
.vc-node.is-hover { border-color:var(--c); background:var(--c-tint); }
.vc-node.is-wrong { border-color:var(--bad); background:var(--bad-tint); animation:kjShake .35s; }
.vc-node.is-done { cursor:default; border-color:var(--pair); background:color-mix(in srgb,var(--pair) 10%,var(--panel)); }
.vc-node.is-done .vc-dot { background:var(--pair); border-color:var(--pair); }
.vc-node__t { min-width:0; overflow-wrap:anywhere; }
.vc-node--l .vc-node__t { font-family:var(--jp); font-size:21px; font-weight:600; line-height:1.2; }
.vc-node--r[data-kind="reading"] .vc-node__t { font-family:var(--jp); font-size:17px; font-weight:600; color:var(--kun); }
.vc-node--r[data-kind="meaning"] .vc-node__t { font-size:13.5px; font-weight:600; line-height:1.3; color:var(--ink-soft); }
.vc-dot { flex-shrink:0; width:14px; height:14px; border-radius:50%; border:2.5px solid var(--line-2); background:var(--panel); transition:all .15s; }
.vc-node--l .vc-dot { margin-right:-19px; }
.vc-node--r .vc-dot { margin-left:-19px; }
.vc-node.is-active .vc-dot, .vc-node.is-hover .vc-dot { border-color:var(--c); background:var(--c); }
.vc-mstat { text-align:center; min-height:22px; margin:14px 0 0; font-size:14px; font-weight:650; color:var(--ink-soft); }
.vc-mstat.is-win { color:var(--good); font-size:16px; animation:kjPop .45s; }

/* ---------- 4 · quiz ---------- */
.vc-furi { font-family:var(--jp); font-size:14px; padding:0 11px; }
.vc-nofuri .vc-sent rt, .vc-nofuri .vc-rv__sent rt { visibility:hidden; }
.vc-q__kind { display:inline-flex; align-items:center; gap:6px; }
.vc-sent { font-family:var(--jp); font-size:clamp(21px,3.8vw,28px); line-height:2.1; text-align:center; }
.vc-sent rt { font-size:.45em; color:var(--ink-muted); font-weight:500; }
.vc-gap { display:inline-block; min-width:3.2em; padding:0 .35em; margin:0 .15em; border-bottom:3px solid var(--c); color:var(--c); font-weight:700; line-height:1.25; vertical-align:baseline; }
.vc-gap.is-right { color:var(--good); border-color:var(--good); background:var(--good-tint); border-radius:8px 8px 0 0; animation:kjPop .35s; }
.vc-gap.is-wrong { color:var(--bad); border-color:var(--bad); background:var(--bad-tint); border-radius:8px 8px 0 0; }
.vc-listen { display:flex; flex-direction:column; align-items:center; gap:10px; }
.vc-listen__row { display:flex; gap:8px; }
.vc-reveal { margin-top:10px; font-size:15px; color:var(--ink-soft); animation:kjIn .25s ease; }
.vc-reveal b { font-family:var(--jp); font-size:22px; color:var(--ink); margin-right:6px; }
.vc-reveal span { font-family:var(--jp); color:var(--kun); margin-right:8px; }
.vc .kj-opt__t { font-size:20px; }
.vc .kj-opts .kj-opt { min-height:58px; }

/* ---------- results review ---------- */
.vc-rhead { font-family:var(--serif); font-size:21px; font-weight:600; text-align:left; margin:26px 0 12px; }
.vc-review { display:flex; flex-direction:column; gap:10px; margin-bottom:18px; text-align:left; }
.vc-rv { display:grid; grid-template-columns:30px 1fr; gap:12px; background:var(--panel); border:1.5px solid var(--line); border-left:5px solid var(--good); border-radius:16px; padding:14px 16px; animation:kjIn .35s ease both; }
.vc-rv.is-miss { border-left-color:var(--bad); }
.vc-rv__ic { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:14px; background:var(--good-tint); color:var(--good); }
.vc-rv.is-miss .vc-rv__ic { background:var(--bad-tint); color:var(--bad); }
.vc-rv__top { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.vc-rv__jp { font-family:var(--jp); font-size:22px; font-weight:600; }
.vc-rv__r { font-family:var(--jp); font-size:14px; color:var(--kun); }
.vc-rv__m { font-size:14px; color:var(--ink-soft); }
.vc-rv__kind { margin-left:auto; font-family:var(--mono); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-muted); }
.vc-rv__sent { display:flex; gap:10px; align-items:flex-start; margin-top:8px; }
.vc-rv__sent .vc-sent { font-size:18px; line-height:2; text-align:left; flex:1; }
.vc-rv__sent mark { background:var(--gold-tint); color:inherit; border-radius:4px; padding:0 2px; }
.vc-rv__en { font-size:14px; color:var(--ink-soft); margin:2px 0 0; }
.vc-rv__you { font-size:13px; color:var(--bad); margin:4px 0 0; }
.vc-rv__you b { font-family:var(--jp); }

@keyframes vcFade { 0% { opacity:1; } 60% { opacity:1; } 100% { opacity:0; } }
@keyframes vcDraw { from { stroke-dasharray:0 1000; } to { stroke-dasharray:1000 0; } }

@media (max-width:640px) {
  .vc-w { grid-template-columns:22px minmax(0,1fr) 34px; grid-template-areas:"n jp say" "n r say" "n m say"; column-gap:10px; padding:10px 12px; }
  .vc-w__jp { font-size:22px; }
  .vc-board { padding:12px 8px; grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr); }
  .vc-node { min-height:44px; padding:7px 9px; gap:6px; border-radius:12px; }
  .vc-node--l .vc-node__t { font-size:18px; }
  .vc-node--r[data-kind="reading"] .vc-node__t { font-size:15px; }
  .vc-node--r[data-kind="meaning"] .vc-node__t { font-size:12px; }
  .vc-node--l .vc-dot { margin-right:-15px; }
  .vc-node--r .vc-dot { margin-left:-15px; }
  .vc-dot { width:12px; height:12px; }
  .vc-grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
  .vc-hcard { width:210px; min-height:170px; }
  .vc-hcard__jp { font-size:44px; }
  .vc-rv { grid-template-columns:1fr; }
  .vc-rv__ic { display:none; }
}

/* ---------- Lesson flow (Listening/Reading-style): sticky "where am I", step heads, pass target ---------- */
.vc-lhead { position:sticky; top:var(--nav-h,76px); z-index:30; margin:0 -4px; padding:0 4px;
  background:color-mix(in srgb,var(--paper) 94%,transparent); backdrop-filter:blur(8px); }
.vc-lhead .kjl-head { padding-bottom:2px; }
.vc-lhead .kj-stepper { margin:6px 0 0; padding-bottom:10px; }
.vc-pos { margin:0 0 2px; font-family:var(--mono); font-size:11px; letter-spacing:.06em; color:var(--ink-muted); }
.vc-pos__ok { color:var(--good); font-weight:700; }
.vc-step__n { display:inline-grid; place-items:center; width:17px; height:17px; margin-right:3px; border-radius:50%;
  background:var(--line); color:var(--ink-soft); font-family:var(--mono); font-size:10px; font-weight:800; vertical-align:1px; }
.kj-step.is-on .vc-step__n, .kj-step.is-done .vc-step__n { background:var(--c); color:#fff; }
.vc-stephead { display:flex; align-items:center; gap:10px; margin:16px 0 8px; }
.vc-stephead__t { font-family:var(--mono); font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-muted); }
.vc-passpill { margin-left:auto; font-family:var(--mono); font-size:10.5px; font-weight:700; letter-spacing:.04em;
  padding:3px 9px; border-radius:999px; background:var(--c-tint); color:var(--c); }
.vc-help { margin-left:auto; width:26px; height:26px; border-radius:50%; border:1.5px solid var(--line-2); background:var(--panel);
  color:var(--ink-soft); font-weight:700; font-size:13px; cursor:pointer; flex-shrink:0; display:grid; place-items:center; }
.vc-passpill + .vc-help { margin-left:0; }
.vc-help[aria-expanded="true"] { background:var(--c); border-color:var(--c); color:#fff; }
.vc-helpbox { margin:0 0 12px; padding:11px 14px; border-radius:12px; background:var(--cream); border:1.5px solid var(--line);
  font-size:13.5px; line-height:1.55; color:var(--ink-soft); }
.vc-helpbox b { color:var(--ink); }
/* results: the engine's verdict, then what's next, then every answer */
.vc-res .vc-check { margin:6px auto 0; max-width:560px; text-align:left; }
.vc-nextcard { max-width:560px; margin:14px auto 0; padding:16px 18px; border-radius:16px; border:1.5px solid var(--c);
  background:var(--c-tint); text-align:left; }
.vc-nextcard__k { font-family:var(--mono); font-size:10.5px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--c); margin:0 0 4px; }
.vc-nextcard__t { font-family:var(--serif); font-size:20px; font-weight:600; color:var(--c-deep); margin:0; }
.vc-nextcard__w { display:flex; flex-wrap:wrap; gap:6px 10px; margin:6px 0 0; font-family:var(--jp,inherit); font-size:15px; color:var(--ink-soft); }
.vc-nextcard__s { font-size:13.5px; color:var(--ink-soft); margin:6px 0 0; line-height:1.5; }
.vc-nextcard__s a { color:var(--c); font-weight:600; }
/* level page: why a tile is locked, said on the tile */
.vc-tile__hint { margin-top:auto; font-size:11.5px; font-weight:600; color:var(--ink-muted); }
.vc-tile.is-locked .vc-tile__hint { color:var(--ink-soft); }
.vc-lvdone { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; margin:0 0 16px; padding:14px 18px; border-radius:16px;
  background:var(--good-tint); }
.vc-lvdone p { margin:0; font-weight:600; color:var(--good); }
@media (max-width:640px) {
  .vc-lhead .kjl-head { padding-top:10px; }
  .kj-step__l { font-size:11px; }
  .vc-step__n { display:none; }
  .vc-stephead { margin-top:10px; }
}
/* Nov 2026 flow pass: one Match step (readings 1/2 → meanings 2/2), folded right answers, compact rows on a phone */
.vc-mtag { font-family:var(--mono); font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--c-tint); color:var(--c); }
.vc-rhead { font-size:17px; margin:20px 0 10px; }
.vc-rvmore { margin:14px 0 18px; text-align:left; }
.vc-rvmore > summary { cursor:pointer; list-style:none; padding:12px 16px; border-radius:14px; border:1.5px solid var(--line);
  background:var(--panel); font-weight:700; color:var(--good); }
.vc-rvmore > summary::-webkit-details-marker { display:none; }
.vc-rvmore > summary span { font-weight:500; color:var(--ink-muted); }
.vc-rvmore > summary::after { content:'▾'; float:right; color:var(--ink-muted); transition:transform .15s; }
.vc-rvmore[open] > summary::after { transform:rotate(180deg); }
.vc-rvmore > .vc-review { margin-top:10px; }
.kj-q .kj-opt:disabled { cursor:pointer; }
@media (max-width:640px) {
  .vc-tools { flex-wrap:nowrap; gap:6px; }
  .vc-tools .kj-chip { padding-left:10px; padding-right:10px; white-space:nowrap; }
  .vc-words { gap:6px; }
  .vc-w { grid-template-columns:minmax(64px,auto) minmax(0,1fr) 34px; grid-template-areas:"jp r say" "jp m say"; column-gap:12px; row-gap:0; padding:8px 10px 8px 14px; }
  .vc-w__n { display:none; }
  .vc-pass-long { display:none; }              /* the fail bar: a short line between two buttons on a phone */
  .vc-w__jp { font-size:21px; }
  .vc-w__r { font-size:13px; }
  .vc-w__m { font-size:13.5px; line-height:1.3; }
  .vc-rvmore > summary span { display:block; font-size:12.5px; }
}
.vc-pass-short { display:none; }
@media (max-width:640px) { .vc-pass-short { display:inline; white-space:nowrap; } }
