/* 結算の面（ui/result-panel.js が読み込む）。設計稿 2026-11-10 定稿の A1・A2・M3。
   色・枠・角は tokens.css の値だけを使う。新しい部品は札（.result-info）と判子の見た目だけ —— 站長承認済み */

/* 登録欄は名前と小さな「登録」を 1 行に（主ボタンの座を「もう一度」「挑戦状を送る」に譲る）*/
.game-overlay .score-form { flex-direction: row; align-items: stretch; gap: 6px; max-width: 260px; }
.game-overlay .score-form input { flex: 1; min-width: 0; }
.game-overlay .score-form button { flex: none; padding: 6px 14px; font-size: 12.5px; }

/* 送る前に名前を聞く窓（ui/ask-name.js・設計稿 A4）。窓は既存の dialog.modal、ここは中の並べ方だけ */
.ask-name { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: min(300px, 80vw); text-align: center; }
.ask-name p { margin: 0; font-size: 13px; color: var(--sub); }
.ask-name input { font: inherit; font-size: 15px; padding: 9px 12px; border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius); background: var(--surface); color: var(--ink); }

/* この局の意味の札 */
.result-info {
  box-sizing: border-box; width: 100%; max-width: 260px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: var(--stroke-w) solid var(--line); border-radius: var(--radius-inner);
  padding: 8px 12px; text-align: left; line-height: 1.5;
  transition: opacity .25s ease-out, transform .25s ease-out;
}
.result-info[hidden] { display: none; }
/* 値の入らない行は出さない。どの行にも値が無ければ札ごと出さない（行は頁が並べ、値は JS が入れる・盤面チャレンジ／ステージ／作品頁）*/
.result-info-row:is([hidden], :has(> b:is(:empty, [hidden]))) { display: none; }
.result-info:not(:has(> .result-info-row:not([hidden]) > b:not(:empty):not([hidden]))) { display: none; }
.result-info-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.result-info-row span { color: var(--sub); }
.result-info-row b { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.result-info-bar { height: 6px; background: var(--soft); border-radius: var(--radius-pill); overflow: hidden; }
.result-info-bar i { display: block; height: 100%; background: var(--cta); border-radius: var(--radius-pill); transition: width .5s ease-out; }

/* 自己ベスト更新は判子（設計稿 A2 の金の札）*/
.game-overlay .new-best {
  display: inline-block; background: var(--gold); color: var(--ink);
  border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
  padding: 2px 12px; font-size: 12.5px; font-weight: 900; letter-spacing: .04em; rotate: -4deg;
}
.game-overlay .new-best[hidden] { display: none; }

/* 主と次の釦は同じ幅・同じ高さで縦に並べ、色だけで主従を分ける（開始画面の .start-cta と同じ。result-panel.js が start-cta を付ける）*/
.game-overlay .share-row { flex-direction: column; align-items: center; gap: 10px; width: 100%; }

/* 初めての局（前のベストが無い）は「更新」と言わない。主ボタン・札と同じ判断（result-panel.js の moment）*/
.game-overlay[data-result-moment="plain"] [data-new-best] { display: none !important; }

/* 演出の段（data-result-step）。count → stamp → info → done */
.game-overlay[data-result-step="count"] .new-best { visibility: hidden; }
.game-overlay[data-result-step="stamp"] .new-best { animation: result-stamp .25s ease-out; }
.game-overlay:is([data-result-step="count"], [data-result-step="stamp"]) .result-info { opacity: 0; transform: translateY(4px); }
.game-overlay:is([data-result-step="count"], [data-result-step="stamp"]) .result-info-bar i { width: 0 !important; }
.game-overlay[data-result-step="done"] .share-row .primary-button { animation: result-bounce .4s ease-out; }
@keyframes result-stamp { 0% { scale: 1.5; opacity: 0; } 70% { scale: .95; opacity: 1; } 100% { scale: 1; } }
@keyframes result-bounce { 0%, 100% { translate: 0 0; } 40% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) {
  .game-overlay .new-best, .game-overlay .share-row .primary-button { animation: none !important; }
  .result-info, .result-info-bar i { transition: none; }
}

/* 手機（console 皮膚）は膜が小さい。札は 1 行ぶん詰める */
@media (max-width: 560px) {
  .result-info { padding: 5px 9px; gap: 4px; max-width: 100%; }
  .result-info-row { font-size: 11px; }
  .game-overlay .score-form { max-width: 100%; }
}
