/* ============================================================
   ふよふよ UI v2
   ・骨格／デザイントークンは reversi/assets/css/style.css 準拠（五目並べと同じ方針）
   ・盤面のみふよふよの identity（木枠＋生成りのフィールド、4色のふよ）
   ・画面状態は .stage[data-state] = ready / playing / paused / over で切替
   ・盤面サイズは JS（ui.js の layout）が画面の幅・高さから決める
   ============================================================ */

:root {
  --bg: #f5efe4;
  --bg-soft: #ebe3d2;
  --bg-deep: #e0d4ba;

  /* 盤面（木枠＋生成りのフィールド） */
  --frame: #4a3220;
  --frame-light: #6b4828;
  --field: #fbf7ee;

  /* ふよの色（game.js の COLORS と対応） */
  --fuyo-r: #d9442f;
  --fuyo-g: #3fb38a;
  --fuyo-b: #3557b8;
  --fuyo-y: #f6d24a;

  --ink: #2a2218;
  --ink-soft: #5a4e3a;
  --ink-mute: #8a7d65;

  --accent: #d96f57;
  --accent-deep: #c45a44;
  --ok: #5b9b76;

  --line: rgba(42, 34, 24, 0.12);
  --header-bg: #2c3e50;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(91, 143, 217, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(217, 111, 87, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

button { font-family: inherit; }
.emoji { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

/* ============ サイトヘッダー（あそぶねっと枠） ============ */
.site-header {
  position: relative;
  z-index: 3;
  background-color: var(--header-bg);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-link {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.back-link:hover, .back-link:focus-visible {
  background: rgba(255,255,255,0.12);
  outline: none;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.site-name-mark {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
}

/* ============ メインステージ ============ */
.stage {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.title .dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset -2px -2px 3px rgba(0,0,0,0.15);
}
.title .dot-r { background: var(--fuyo-r); }
.title .dot-g { background: var(--fuyo-g); margin-right: 4px; }
.title .dot-b { background: var(--fuyo-b); margin-left: 4px; }
.title .dot-y { background: var(--fuyo-y); }

/* ============ 盤面＋サイドパネル ============ */
.play-area {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.board-wrap {
  position: relative;
  flex: none;
  /* 実寸は ui.js が --cell から決める。JS 前のちらつき防止に仮の大きさを置く */
  width: calc(var(--cell, 36px) * 6);
  height: calc(var(--cell, 36px) * 12.5);
  margin: 10px;
}

.board-frame {
  position: absolute;
  inset: -10px;
  background: linear-gradient(135deg, var(--frame-light) 0%, var(--frame) 50%, var(--frame-light) 100%);
  border-radius: 14px;
  box-shadow:
    0 8px 24px rgba(42, 34, 24, 0.25),
    0 2px 6px rgba(42, 34, 24, 0.15);
}

.board {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: var(--field);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.board-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(251, 247, 238, 0.72);
  backdrop-filter: blur(2px);
  border-radius: 6px;
  z-index: 2;
  animation: fadeIn 0.2s ease-out;
}

.board-overlay[hidden] { display: none; }

.overlay-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.overlay-emoji { font-size: 40px; line-height: 1; }

/* はじめる画面の飾り：盤面の一部（4 列 × 5 段）だけを切り出して見せる。大きさは ui.js が --cell で決める */
.intro-demo {
  position: relative;
  width: calc(var(--cell, 26px) * 4);
  height: calc(var(--cell, 26px) * 5);
  overflow: hidden;
  pointer-events: none;
  /* 上から入ってくる組が切り口で ぷつっと見えないように上端をぼかす */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}

.intro-demo canvas { position: absolute; left: 0; top: 0; }

.overlay-lead {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.5;
}

.overlay-btn {
  padding: 14px 26px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(217, 111, 87, 0.35);
  transition: all 0.2s;
}

.overlay-btn:hover { background: var(--accent-deep); transform: translateY(-2px); }
.overlay-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.overlay-sub-btn {
  padding: 8px 16px;
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.overlay-hint:empty { display: none; }

.overlay-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-mute);
}

/* サイドパネル */
.side {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.side-card {
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
}

.side-cap {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}

.next-card .side-cap { font-family: 'Fraunces', serif; letter-spacing: 0.12em; }

.next {
  display: block;
  margin: 4px auto 0;
}

.side-num {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.side-num.bump { animation: bump 0.25s ease-out; }

@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); color: var(--accent-deep); }
  100% { transform: scale(1); }
}

.side-card-sub { padding: 6px 10px; }

/* CPU の盤面（VS CPU のときだけ） */
.cpu-card { display: none; padding: 6px; }
.cpu-board {
  display: block;
  margin: 4px auto 0;
  background: var(--field);
  border: 3px solid var(--frame);
  border-radius: 5px;
  box-sizing: content-box;
}
.stage[data-mode="cpu"] .cpu-card { display: block; }
.stage[data-mode="cpu"] .score-card,
.stage[data-mode="cpu"] .side-card-sub { display: none; }
.stage[data-mode="cpu"] .side { flex-basis: 156px; }

/* れんしゅう：つぎ・スコアの代わりに「もくひょう」と成績 */
.practice-only { display: none; }
.stage[data-mode="practice"] .practice-only { display: block; }
.stage[data-mode="practice"] .next-card,
.stage[data-mode="practice"] .score-card,
.stage[data-mode="practice"] .side-card-sub:not(.practice-only) { display: none; }
.side-num small { font-family: 'Zen Maru Gothic', sans-serif; font-size: 0.5em; font-weight: 700; margin-left: 2px; }

/* 広い画面の VS CPU：自分｜サイド｜CPU（フルサイズ）の 3 列。サイドの CPU カードは見出しだけ残す */
.cpu-wrap { display: none; }
.stage[data-wide] { max-width: 920px; }
.stage[data-wide] .cpu-wrap { display: block; }
.stage[data-wide] .side { flex-basis: 132px; }
.stage[data-wide] .cpu-card { padding: 8px 6px; }
.stage[data-wide] .actions,
.stage[data-wide] .game-info { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
.cpu-wrap .cpu-board {
  position: relative;
  margin: 0;
  border: 0;
  border-radius: 6px;
}

.side-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  font-size: 12px;
}

.side-row + .side-row { border-top: 1px solid var(--bg-soft); }

.side-k { color: var(--ink-mute); font-weight: 700; white-space: nowrap; }
.side-v { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }

.side-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.side-btn:hover:not(:disabled) {
  background: var(--bg-soft);
  transform: translateY(-1px);
}

.side-btn:disabled { opacity: 0.45; cursor: default; }

.key-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  margin-top: 6px;
  font-size: 11px;
  text-align: left;
}

.key-list dt {
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.key-list dd { color: var(--ink-soft); white-space: nowrap; }

/* ============ タッチ操作パッド ============ */
.pad {
  display: none;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.pad-group {
  display: flex;
  gap: 8px;
}

.pad-btn {
  width: 58px;
  height: 58px;
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 16px;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 0 var(--bg-deep);
  transition: transform 0.06s, box-shadow 0.06s, background 0.06s;
}

.pad-btn.rot {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: white;
  font-size: 26px;
  box-shadow: 0 3px 0 var(--accent-deep);
}

.pad-btn.pressed {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--bg-deep);
  background: var(--bg-soft);
}

.pad-btn.rot.pressed { background: var(--accent-deep); }

/* ============ アクションボタン ============ */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.action-btn {
  padding: 14px 8px;
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 34, 24, 0.1);
}

.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.action-btn .emoji { font-size: 24px; }

/* ============ ゲーム説明・攻略記事（SEO・読み物） ============ */
.game-info {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section {
  background: white;
  border-radius: 16px;
  padding: 18px;
  border: 2px solid var(--bg-deep);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.section h2 { font-size: 17px; font-weight: 900; color: var(--ink); margin-bottom: 8px; }
.section h3 { font-size: 16px; font-weight: 900; color: var(--ink); margin: 14px 0 8px; }
.section > h3:first-child { margin-top: 0; }
.section h4 {
  font-size: 14px; font-weight: 900; color: var(--ink);
  margin: 16px 0 6px; border-left: 4px solid var(--accent); padding-left: 8px;
}
.section p { margin: 8px 0; }
.section ul { padding-left: 20px; margin: 8px 0; }
.section li { margin-bottom: 5px; }
.section strong { color: var(--accent-deep); }

.related-list { list-style: none; padding-left: 0; }
.section .related-list { padding-left: 0; }
.related-list li { padding: 9px 0; border-bottom: 1px solid var(--bg-soft); }
.related-list a { color: var(--accent-deep); font-weight: 700; text-decoration: none; }
.related-list a:hover { text-decoration: underline; }

/* ============ モーダル ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 34, 24, 0.55);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}

.modal-panel {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 24px 22px;
  max-width: 360px;
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3);
  animation: popIn 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
  text-align: center;
}

.modal-panel-wide { max-width: 440px; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 14px;
}

.modal-list {
  text-align: left;
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 22px;
  margin-bottom: 18px;
  line-height: 1.7;
}

.modal-list li { margin-bottom: 4px; }
.modal-list strong { color: var(--accent-deep); }

/* 入力手段で出し分け（タッチ端末かどうか） */
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .only-touch { display: list-item; }
  .only-mouse { display: none; }
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal-btn {
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 2px solid var(--bg-deep);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn:hover:not(:disabled) { background: var(--bg-deep); }
.modal-btn:disabled { opacity: 0.5; cursor: default; }

.modal-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.modal-btn.primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.start-step[hidden] { display: none; }

/* はじめるモーダル：モード → 強さ／問題 の順に えらぶ */
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.pick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  background: white;
  border: 2px solid var(--bg-deep);
  border-radius: 14px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.pick-btn:hover { background: var(--bg); border-color: var(--accent); }
.pick-btn:active { transform: scale(0.98); }
.pick-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 前回えらんだもの */
.pick-btn.is-last { border-color: var(--accent); }

.pick-emoji { font-size: 26px; line-height: 1; flex: none; }
.pick-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pick-name { font-size: 16px; font-weight: 900; }
.pick-desc { font-size: 12px; font-weight: 700; color: var(--ink-mute); }
.pick-rec:not(:empty)::before { content: '・'; }
.pick-rec { color: var(--accent-deep); }
.pick-arrow { font-size: 22px; font-weight: 900; color: var(--ink-mute); flex: none; }

.start-step .modal-btn { width: 100%; }

/* 結果 */
.result-emoji {
  font-size: 48px;
  line-height: 1;
  margin: 0 0 6px;
}

.result-score {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 10px 6px;
  margin-bottom: 12px;
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rs-k { font-size: 11px; font-weight: 700; color: var(--ink-mute); }
.rs-v { font-size: 16px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }

.result-note {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent-deep);
  margin-bottom: 12px;
}

.result-note[hidden] { display: none; }

.rank-form {
  text-align: left;
  border: 2px dashed var(--bg-deep);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.rank-form[hidden] { display: none; }

.rank-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.rank-row {
  display: flex;
  gap: 6px;
}

.rank-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--bg-deep);
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px; /* iOS のフォーカス時ズームを防ぐため 16px 以上 */
  color: var(--ink);
  background: var(--bg);
}

.rank-input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.rank-submit { flex: none; padding: 10px 14px; }

.rank-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
  margin-top: 6px;
  min-height: 1.5em;
}

.rank-status.ok { color: var(--ok); }
.rank-status.err { color: var(--accent-deep); }

/* ランキング */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 5px;
}

.mode-tab {
  padding: 10px 2px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.mode-tab:hover:not(.active) { color: var(--ink-soft); }

.mode-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(42, 34, 24, 0.08);
}

.ranking-body {
  min-height: 220px;
  max-height: 46dvh;
  overflow-y: auto;
  margin-bottom: 14px;
}

.ranking-msg {
  padding: 60px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-mute);
}

.ranking-list {
  list-style: none;
  text-align: left;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--bg-soft);
  font-size: 14px;
}

.ranking-list li.me { background: #fdf0e8; border-radius: 8px; }

.rk-no {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--ink-mute);
  text-align: center;
}

.rk-no.top1 { color: #c9961a; }
.rk-no.top2 { color: #8b8f99; }
.rk-no.top3 { color: #b0703a; }

.rk-name {
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-score {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ============ サイトフッター ============ */
.site-footer {
  position: relative;
  z-index: 3;
  background-color: var(--header-bg);
  color: white;
  text-align: center;
  padding: 14px 0;
  margin-top: 12px;
  font-size: 0.8rem;
}

/* ============ 画面状態 ============ */
.stage[data-state="ready"] #btn-pause,
.stage[data-state="over"] #btn-pause { opacity: 0.45; pointer-events: none; }

/* ============ タッチ端末 ============ */
@media (hover: none) and (pointer: coarse) {
  .pad { display: flex; }
  .key-card { display: none; }
}

/* ============ レスポンシブ ============ */
@media (max-width: 480px) {
  .stage { padding: 10px 12px 24px; }
  .title-row { margin-bottom: 8px; }
  .title { font-size: 22px; }
  .title .dot { width: 10px; height: 10px; }
  .play-area { gap: 12px; margin-bottom: 12px; }
  .board-wrap { margin: 7px; }
  .board-frame { inset: -7px; border-radius: 11px; }
  .side { flex-basis: 92px; gap: 8px; }
  .stage[data-mode="cpu"] .side { flex-basis: 108px; }
  .cpu-card { padding: 5px 4px; }
  .cpu-board { border-width: 2px; }
  .overlay-card { gap: 8px; }
  .side-card { padding: 6px 6px; border-radius: 12px; }
  .side-num { font-size: 20px; }
  .side-row { font-size: 11px; flex-direction: column; align-items: center; gap: 0; }
  .side-btn { padding: 8px 4px; font-size: 12px; border-radius: 12px; }
  .key-list { font-size: 10px; gap: 2px 4px; }
  .pad-btn { width: 54px; height: 54px; }
  .action-btn { font-size: 13px; padding: 12px 6px; }
  .action-btn .emoji { font-size: 22px; }
  .back-link { font-size: 0.85rem; }
  .site-name { font-size: 1rem; }
  .modal-panel { padding: 20px 16px; }
}

@media (max-width: 360px) {
  .pad-btn { width: 48px; height: 48px; font-size: 20px; }
  .pad-btn.rot { font-size: 22px; }
  .pad-group { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .side-num.bump { animation: none; }
  .modal-panel, .modal-backdrop, .board-overlay { animation: none; }
}
