/* drill.css — ドリル画面（drill.html）の見た目。牌そのものの描画は style.css の .tile を使う */
.topbar h1 .sub { font-size: 13px; font-weight: 400; opacity: .8; margin-left: 4px; }
.drill {
  --dw: 44px;   /* 手牌の牌の幅 */
  --rw2: 24px;  /* 河の牌の幅 */
  max-width: 820px; margin: 0 auto; padding: 12px 16px 40px; display: flex; flex-direction: column; gap: 10px;
  color: var(--ink);
}
.d-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.d-card, .d-panel { background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.d-card h2, .d-panel h2 { margin: 0 0 6px; font-size: 18px; }
.d-card p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: #444; }
.d-primary, .d-secondary {
  font: inherit; font-weight: 700; border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; color: #fff; background: #1f6a4a;
}
.d-secondary { background: #607d8b; }
.d-primary:disabled { background: #9db3a8; cursor: not-allowed; }
.d-panel h3 { font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* 記録 */
.d-hist { display: flex; flex-direction: column; gap: 3px; }
.d-hist-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 44px 52px; gap: 6px; align-items: center; font-size: 13px; }
.d-hist-row.now { font-weight: 700; }
.d-hist-row .bar, .d-dir .bar { height: 10px; background: #e3e0d6; border-radius: 5px; overflow: hidden; display: block; }
.d-hist-row .fill, .d-dir .fill { display: block; height: 100%; background: #1f6a4a; }
.d-hist-row .pct, .d-hist-row .sec { text-align: right; }
.d-hist-row .date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend { font-size: 13px; margin: 4px 0 0; }

/* 出題 */
.d-head { display: flex; justify-content: space-between; align-items: center; color: #f3f3f3; font-size: 14px; }
.d-head .progress { font-weight: 800; font-size: 16px; }
.d-head .clock { font-variant-numeric: tabular-nums; background: rgba(0,0,0,.3); border-radius: 6px; padding: 2px 8px; }
.d-context { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: #eee; font-size: 13px; }
.d-context .dora { display: inline-flex; align-items: center; gap: 4px; }
.d-context .tile { --w: 20px; }

.d-rivers {
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
  border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; color: #fff;
}
.d-river-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px; align-items: start; }
.d-river-row .who { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; font-size: 12px; padding-top: 2px; }
.d-river-row .wind { color: #ffe58a; font-weight: 700; }
.d-river-row .badge { background: #d6332a; color: #fff; border-radius: 4px; padding: 0 4px; font-size: 11px; font-weight: 700; }
.d-river-row.riichi { background: rgba(214, 51, 42, .18); border-radius: 8px; padding: 3px; }
.d-river { display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-end; min-height: calc(var(--rw2) * 1.36); }
.d-river .tile { --w: var(--rw2); }
.d-river .tile.riichi-tile { margin: 0 calc(var(--w) * .2); }

.d-handbox { background: #2a3a33; border-radius: 12px; padding: 8px 6px 10px; }
.d-prompt { color: #ffe58a; font-weight: 700; font-size: 14px; text-align: center; margin-bottom: 14px; }
.d-hand { display: flex; justify-content: center; align-items: flex-end; gap: 3px; flex-wrap: nowrap; padding-top: 4px; }
.d-hand .tile { --w: var(--dw); }
.d-hand .tile.clickable { cursor: pointer; transition: transform .08s; }
.d-hand .tile.clickable:hover, .d-hand .tile.clickable:focus-visible { transform: translateY(-6px); outline: none; }
.d-hand .gap { width: calc(var(--dw) * .35); flex: none; }
.d-hand .tile.recommended { box-shadow: 0 2px 0 var(--tile-edge), 0 0 0 3px var(--accent); transform: translateY(-6px); }
.d-hand .tile.picked { box-shadow: 0 2px 0 var(--tile-edge), 0 0 0 3px #d6332a; transform: translateY(-6px); }
.d-hand .tile .dot {
  position: absolute; bottom: 2px; right: 2px; width: calc(var(--dw) * .22); height: calc(var(--dw) * .22);
  border-radius: 50%; border: 1px solid rgba(0,0,0,.25);
}

.d-choices { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.d-choices .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip {
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 999px; border: 1px solid #4d7a65;
  background: #2c4a3d; color: #fff; cursor: pointer; min-height: 40px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #222; font-weight: 700; }
.chip.answer { outline: 3px solid #2e9e5b; outline-offset: 1px; }
.chip.accept { outline: 2px dashed #8bbf3a; outline-offset: 1px; }
.chip:disabled { cursor: default; }
.d-choices .submit { min-width: 160px; }

/* 解説 */
.d-feedback:empty { display: none; }
.d-feedback { background: var(--panel); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6; display: flex; flex-direction: column; gap: 8px; }
.d-feedback .verdict { border-radius: 10px; padding: 8px 10px; font-weight: 800; font-size: 17px; }
.verdict.ok { background: #e3f6e9; color: #17643a; }
.verdict.near { background: #eef6e0; color: #4a6b12; }
.verdict.ng { background: #fdecea; color: #a22a20; }
.d-answer { margin: 0; }
.d-dirs { display: flex; flex-direction: column; gap: 6px; }
.d-dir { border: 1px solid #e3e0d6; border-radius: 8px; padding: 6px 10px; background: #fff; }
.d-dir.top { border: 2px solid #2e9e5b; }
.d-dir .h { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; gap: 8px; align-items: center; }
.d-dir .you { font-size: 11px; background: var(--accent); border-radius: 4px; padding: 0 5px; font-weight: 700; }
.d-dir .reason { font-size: 13px; }
.d-dir .kc { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.d-compare { display: flex; flex-direction: column; gap: 6px; }
.d-compare .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.d-compare .tile { --w: 26px; }
.d-compare .lbl { font-weight: 700; min-width: 3em; }
.d-compare .lv { color: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 700; }
.d-compare .why { font-size: 12px; color: var(--muted); flex-basis: 100%; padding-left: 3.4em; }
.d-reason { margin: 0; font-weight: 700; }
.d-sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.d-opts { margin: 0; padding-left: 1.2em; font-size: 13px; }
.d-feedback .next { align-self: center; min-width: 180px; }

/* 結果 */
.d-big { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 26px; font-weight: 800; }
.d-list { padding-left: 1.6em; margin: 8px 0; font-size: 14px; }
.d-list li { margin: 2px 0; }
.d-list li > span { margin-right: 6px; }
.d-list .mk { font-weight: 800; }
.d-list li.ok .mk { color: #17643a; }
.d-list li.near .mk { color: #6b8a12; }
.d-list li.ng .mk { color: #a22a20; }
.d-list .sec { color: var(--muted); font-size: 12px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 600px) {
  .drill { --dw: min(44px, calc((100vw - 40px) / 14.8)); --rw2: 18px; padding: 8px 8px 32px; }
  .d-hand { gap: 1px; }
  .d-river-row { grid-template-columns: 52px minmax(0, 1fr); }
  .d-hist-row { grid-template-columns: 76px minmax(0, 1fr) 38px 46px; font-size: 12px; }
  .d-big { font-size: 22px; }
}
