/* 西洋棋頁（2026-10-05）：與 css/xiangqi.css 同一個骨架（沿用 css/style.css 的按鈕、對話框與字型），
   色調換成黑底＋金色（參考 Steam Chess 707140 的大理石棋盤與鑲金木框）。 */
/* 字級倍率：象棋頁同一個坑——這一頁沒有 css/themes.css，少了它 calc(… * var(--fs)) 全部失效 */
:root { --fs: 1; }
body.ch { background: #0b0b0d; }
#ch-gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.ch-loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center;
  background: #0b0b0d; color: #e9dfc8; z-index: 30; transition: opacity .4s ease; }
.ch-loading.done { opacity: 0; pointer-events: none; }

.ch-top { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 14px; z-index: 5; pointer-events: none; }
.ch-top > * { pointer-events: auto; }
.ch-top > .btn { display: inline-flex; align-items: center; flex: 0 0 auto; width: auto; }
.ch-title { white-space: nowrap; display: flex; align-items: baseline; gap: 12px; margin-right: auto; color: #f1e7cf; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.ch-title h1 { margin: 0; font-family: var(--serif); font-weight: 900; font-size: calc(26px * var(--fs)); letter-spacing: .14em; }
.ch-title p { margin: 0; font-size: calc(13px * var(--fs)); color: #cdbb93; letter-spacing: .06em; }

.ch-panel { position: fixed; top: 70px; right: 12px; width: min(240px, 34vw); max-height: calc(100% - 150px);
  display: flex; flex-direction: column; padding: 14px 16px; border-radius: 14px; z-index: 4;
  background: rgba(16, 15, 18, .8); border: 1px solid rgba(214, 178, 106, .25); color: #eee6d4; backdrop-filter: blur(4px); }
.ch-panel h2 { margin: 14px 0 6px; font-size: calc(13px * var(--fs)); font-weight: 500; color: #c9ad72; letter-spacing: .12em; }
.ch-turn { display: flex; align-items: center; gap: 10px; font-size: calc(16px * var(--fs)); letter-spacing: .08em; }
.ch-dot { width: 14px; height: 14px; border-radius: 50%; background: #f2f0ea; box-shadow: 0 0 0 3px rgba(242, 240, 234, .25); transition: background .3s, box-shadow .3s; }
.ch-turn.black .ch-dot { background: #151515; box-shadow: 0 0 0 3px rgba(214, 178, 106, .45); }
.ch-status { min-height: 1.4em; margin: 8px 0 0; font-size: calc(14px * var(--fs)); color: #ffb199; font-weight: 700; letter-spacing: .1em; }
.ch-moves { margin: 0; padding: 0 0 0 2.4em; overflow-y: auto; font-size: calc(15px * var(--fs)); line-height: 1.75;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; font-variant-numeric: tabular-nums; }
.ch-moves li { white-space: nowrap; }
.ch-moves li.black { list-style: none; color: #d8c9a4; }
.ch-moves li.last { text-decoration: underline; text-underline-offset: 4px; }

.ch-actions { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 10px; z-index: 5;
  padding: 8px; border-radius: 999px; background: rgba(16, 15, 18, .65); backdrop-filter: blur(4px); }
.ch-actions .btn[disabled] { opacity: .45; pointer-events: none; }

.ch-result { text-align: center; }
.ch-result .big { font-family: var(--serif); font-size: calc(32px * var(--fs)); font-weight: 900; letter-spacing: .14em; margin: 6px 0 4px; }
.ch-result .why { color: var(--muted); margin: 0 0 6px; }

/* 升變：四個大按鈕，棋子用 Unicode 符號（字型一定有，不用載圖） */
.ch-promo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.ch-promo button { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(214, 178, 106, .35); color: var(--text); font: inherit; }
.ch-promo button:hover, .ch-promo button:focus-visible { background: rgba(214, 178, 106, .15); outline: none; }
.ch-promo .glyph { font-size: calc(40px * var(--fs)); line-height: 1; }
.ch-promo small { font-size: calc(12px * var(--fs)); color: var(--muted); }

@media (max-width: 720px) {
  .ch-title p { display: none; }
  .ch-title h1 { letter-spacing: .06em; }
  .ch-panel { top: auto; bottom: 74px; right: 12px; left: 12px; width: auto; max-height: 128px; padding: 10px 12px; }
  .ch-panel h2 { display: none; }
  .ch-moves { max-height: 52px; }
  .ch-actions { left: 12px; right: 12px; transform: none; justify-content: center; border-radius: 16px; }
}
