/* 九九（かけ算）ゲーム固有の見た目（共通は ../common/base.css） */
[hidden] { display: none !important; }

.board-wrap { min-height: 240px; container-type: inline-size; }

/* ---------- 問題のカード ---------- */
.card {
  background: var(--board); color: #1F2328; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 16px; text-align: center; min-height: 260px; display: flex; flex-direction: column; align-items: center;
}
.prog { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 18px; margin-bottom: 4px; }
.prog i {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #C9C4B8; background: #FFFFFF; font-style: normal;
  font-size: 14px; line-height: 1; font-weight: 700; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
}
.prog i.now { border-color: #2F5D8A; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #2F5D8A; }
.prog i.ok { background: #2E7D4F; border-color: #2E7D4F; }
.prog i.ng { background: #B23A3A; border-color: #B23A3A; }
.prog i.ok::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #FFFFFF; }
.prog i.ng::after { content: '×'; }

.q {
  display: flex; align-items: center; justify-content: center; gap: .18em; margin: 8px 0 4px;
  font-size: clamp(48px, 15cqw, 88px); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.q .op { color: #5B616B; font-size: .8em; }
.ans {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.2em; padding: 0 .12em;
  border: 3px solid #2F5D8A; border-radius: 10px; background: #FFFFFF; color: #2F5D8A;
}
.ans.caret::after { content: ''; width: 3px; height: .8em; background: #2F5D8A; animation: blink 1s steps(1) infinite; }
.ans.ok { background: #E6F3EA; border-color: #2E7D4F; color: #2E7D4F; }
.ans.ng { background: #FBE9E7; border-color: #B23A3A; color: #B23A3A; }
.ans.shake { animation: shake .35s ease-out; }
.card.pop .q { animation: pop-in .22s ease-out; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-8px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }
@keyframes pop-in { from { transform: scale(.85); opacity: .3; } to { transform: none; opacity: 1; } }

.yomi { min-height: 1.6em; margin: 4px 0 0; font-size: clamp(20px, 5.4cqw, 28px); font-weight: 700; color: #1F2328; letter-spacing: .04em; }
.yomi .ga { color: #2F5D8A; }
.yomi .rest { color: #8A8F97; }
.yomi .alt { display: block; font-size: 15px; font-weight: 400; color: #5B616B; letter-spacing: 0; }

.fb {
  margin: 10px auto 0; max-width: 520px; width: 100%; border-radius: var(--radius); padding: 8px 14px; text-align: left;
  background: #FFFFFF; border: 2px solid #B23A3A; color: #1F2328; font-size: 17px;
}
.fb b.big { font-size: 1.4em; color: #B23A3A; }
.fb p { margin: 0; }
.fb .clue { color: #5B616B; font-size: 16px; margin-top: 2px; }
.fb.ok { border-color: #2E7D4F; }

.dots { margin-top: 10px; max-width: 520px; width: 100%; background: #FFFFFF; border: 2px dashed #B7791F; border-radius: var(--radius); padding: 8px 12px; color: #1F2328; }
.dots p { margin: 0 0 4px; font-weight: 700; }
.dots svg { display: block; margin: 0 auto; width: auto; max-width: 100%; height: auto; max-height: 190px; }

/* ---------- 九九のひょう ---------- */
.tbl-wrap { background: var(--board); color: #1F2328; border: 2px solid var(--line); border-radius: var(--radius); padding: 8px; }
.tbl {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: min(100%, 500px); margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
.tbl .h, .tbl .c {
  appearance: none; font: inherit; aspect-ratio: 1; min-width: 0; padding: 0; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: min(4.6cqw, 24px); line-height: 1;
}
.tbl .h { background: #E3ECF5; color: #2F5D8A; }
.tbl .h.corner { background: transparent; color: #5B616B; }
.tbl .h.now { background: #2F5D8A; color: #FFFFFF; }
.tbl .c { border: 2px solid #D9D6CE; background: #FFFFFF; color: #1F2328; cursor: pointer; position: relative; }
.tbl .c.empty { background: #F3F1EA; }
.tbl .c.rel { background: #EEF3F8; }
.tbl .c.empty.rel { background: #E6EDF4; }
.tbl .c.sel { border: 3px solid #2F5D8A; background: #FFFFFF; color: #2F5D8A; }
.tbl .c.miss::after { content: ''; position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: #B23A3A; }
.tbl .c.ng { background: #FBE9E7; border-color: #B23A3A; color: #B23A3A; }
.tbl .c.pop { animation: pop-in .2s ease-out; }
.tbl .c.win { background: #E6F3EA; border-color: #2E7D4F; animation: jump .5s ease-out; animation-delay: calc(var(--i, 0) * 12ms); }
.tbl .c:focus-visible { outline: 3px solid var(--warn); outline-offset: 1px; }
@keyframes jump { 0%, 100% { transform: none; } 40% { transform: translateY(-5px); } }
.tq { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tq .ans.small { min-width: 1.8em; height: 1.3em; border-width: 2px; }
.tbl-wrap .fb { margin-top: 6px; font-size: 16px; }

/* ---------- 数字ボタン ---------- */
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 480px; margin: 12px auto 0; }
.key {
  appearance: none; font: inherit; font-size: 30px; font-weight: 700; min-height: 58px; padding: 0; font-variant-numeric: tabular-nums;
  border-radius: var(--radius); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  touch-action: manipulation;
}
.key.erase { grid-column: span 2; font-size: 19px; color: var(--accent); }
.key.enter { grid-column: span 3; font-size: 21px; background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.key:active:not(:disabled) { transform: translateY(1px); }
.key:disabled { opacity: .4; cursor: not-allowed; }
.key:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; min-width: 64px; text-align: right; margin-left: auto; }
.tag { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1.5px solid currentColor; margin-left: 6px; vertical-align: middle; color: var(--accent); }
.tag.retry { color: var(--ng); }

/* ---------- 設定（だんのボタン） ---------- */
.dans .choice span { min-width: 56px; justify-content: center; font-size: 20px; font-weight: 700; padding: 0 10px; position: relative; }
.dans .choice span small { font-size: 14px; font-weight: 700; margin-left: 2px; }
.dans .choice span .star { position: absolute; right: 3px; top: -1px; font-size: 14px; color: #B7791F; }

/* ---------- 結果 ---------- */
.result-box { position: static; margin: 0 auto; max-width: 560px; }
.result-box .big { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.result-box .weak { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 10px; }
.result-box .weak span { border: 2px solid var(--ng); color: var(--ng); border-radius: 6px; padding: 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-box .best { display: inline-block; margin-left: 6px; font-size: 14px; color: var(--ok); border: 1.5px solid var(--ok); border-radius: 999px; padding: 0 8px; vertical-align: middle; }
.callout { z-index: 5; top: 40%; }

@media (max-width: 420px) {
  .stage { padding: 8px; }
  .card { min-height: 230px; padding: 8px 8px 12px; }
  .key { min-height: 52px; font-size: 27px; }
  .pad { gap: 5px; }
  .tbl { gap: 2px; }
  .tbl-wrap { padding: 5px; }
  .tq { font-size: 26px; margin-top: 6px; }
  .controls .btn.icon { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .ans.caret::after, .ans.shake, .card.pop .q, .tbl .c.pop, .tbl .c.win { animation: none; }
}
.howto img.narrow { max-width: 560px; }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 11px; --tb-st-rt: 11px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
