/* スネークゲーム 固有の見た目（共通は ../common/base.css） */
.board-wrap { max-width: none; }
/* 盤は正方形。スマホでも向きのボタンまで1画面に入るよう、画面の高さに合わせて幅を決める */
#cv {
  display: block; margin: 0 auto; width: min(100%, 560px, calc(100svh - 340px)); min-width: min(100%, 250px);
  aspect-ratio: 1 / 1; height: auto; border-radius: var(--radius); background: #FBFAF6; /* 盤の地は紙の色（ダークでも明るいまま） */
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
/* パソコン: 向きのボタンは小さめ・下の1段まで1画面に入るように */
@media (pointer: fine) {
  #cv { width: min(100%, 560px, calc(100svh - 290px)); min-width: min(100%, 300px); }
}
/* パソコン幅: 向きのボタンと下のボタンを横に並べて、縦を短く */
@media (pointer: fine) and (min-width: 700px) {
  #play:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 10px; }
  #play .pad { margin: 0; }
  #play .sub-row { margin: 0; max-width: 300px; justify-content: flex-start; }
}
.board-wrap .callout { top: 40%; }

/* 向きのボタン（十字）。まん中に一時停止 */
.pad {
  display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 52px); gap: 6px;
  justify-content: center; margin: 10px auto 0; touch-action: none; user-select: none; -webkit-user-select: none;
}
.pad .btn { min-width: 0; min-height: 0; width: 100%; height: 100%; padding: 0; display: flex; align-items: center; justify-content: center; }
.pad svg { width: 22px; height: 22px; fill: currentColor; }
.pad .up { grid-column: 2; grid-row: 1; }
.pad .left { grid-column: 1; grid-row: 2; }
.pad .pausebtn { grid-column: 2; grid-row: 2; }
.pad .pausebtn svg { width: 18px; height: 18px; }
.pad .right { grid-column: 3; grid-row: 2; }
.pad .down { grid-column: 2; grid-row: 3; }
.pad .dir.hit { background: var(--accent-soft); }
@media (pointer: fine) {
  .pad { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 44px); gap: 4px; }
  .pad svg { width: 18px; height: 18px; }
  .pad .pausebtn svg { width: 15px; height: 15px; }
}
.sub-row { justify-content: center; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }

/* 手番のバー: 食べた数・長さ・記録 */
.hud { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; font-variant-numeric: tabular-nums; }
.hud b { font-size: 1.2rem; }
.hud .tag { color: var(--ink-sub); font-size: 15px; }

/* 一時停止 */
.pause-box {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 5;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 28px; text-align: center;
}
.pause-title { font-weight: 700; font-size: 1.2rem; margin: 0 0 10px; }

.result-box { z-index: 6; inset: 10% 8% auto; }
.result-box .big { margin: 0 0 8px; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-box dl { display: grid; grid-template-columns: auto auto; gap: 2px 16px; justify-content: center; margin: 0 0 8px; }
.result-box dt { color: var(--ink-sub); text-align: right; }
.result-box dd { margin: 0; text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-box .new { color: var(--ok); font-weight: 700; }
@media (max-width: 480px) {
  .stage { padding: 8px; }
  .result-box { inset: 5% 4% auto; padding: 14px; }
  .result-box h2 { font-size: 1.3rem; margin-bottom: 6px; }
  .hud { gap: 2px 12px; font-size: .95rem; }
  .turnbar { margin-bottom: 6px; }
  .sub-row { margin-top: 8px; }
  .pad { margin-top: 8px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
