/* ============================
   スマートフォンモード専用CSS
   横向き（Landscape）前提の1画面レイアウト
   ============================ */

/* --- CSS Variables はtheme.css(共有)で定義 --- */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #2a1811;
  color: var(--text-primary);
  height: calc(var(--vh, 1vh) * 100);
  height: calc(var(--vh, 1vh) * 100);
  width: 100vw;
  overflow: hidden;
  line-height: 1.4;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================
   全体レイアウト（CSS Grid）
   ┌─────────────────────┬──────┐
   │      ヘッダー        │      │
   ├─────────────────────┤ 右   │
   │      場エリア        │ パネ │
   │                     │ ル   │
   ├─────────────────────┴──────┤
   │         手札バー            │
   └────────────────────────────┘
   ============================ */
.mobile-layout {
  display: grid;
  grid-template-columns: 1fr 52px;
  grid-template-rows: 28px 1fr 54px;
  height: calc(var(--vh, 1vh) * 100);
  height: calc(var(--vh, 1vh) * 100);
  width: 100vw;
  overflow: hidden;
}

/* ============================
   ヘッダー
   ============================ */
.mobile-header {
  grid-column: 1 / 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.mobile-header .btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.mobile-header .badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mobile-header .badge.joker-on {
  background: rgba(255, 138, 101, 0.15);
  color: var(--accent-secondary);
  border: 1px solid rgba(255, 138, 101, 0.3);
}

.mobile-header .stock-badge {
  background: rgba(255, 255, 255, 0.8);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

/* ============================
   右パネル（ボタン集約）
   ============================ */
.right-panel {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 1px 2px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  gap: 0;
  overflow: hidden;
}

.btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 0;
  width: 100%;
}

.btn-group + .btn-group {
  border-top: 1px solid var(--border-subtle);
}

.btn-group-label {
  font-size: 0.45rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- 丸型アイコンボタン --- */
.circle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.circle-btn:active {
  transform: scale(0.92);
}

/* サイズバリエーション */
.circle-btn.btn-sm {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
}

.circle-btn.btn-md {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

/* ドローボタン（緑色） */
.circle-btn.draw-btn {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  border-color: #2e7d32;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(56, 142, 60, 0.4);
}

.circle-btn.draw-btn:active {
  box-shadow: 0 1px 3px rgba(56, 142, 60, 0.3);
}

/* ドローボタンのバッジ（+1, +3, +5） */
.draw-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  background: #fff;
  color: #2e7d32;
  font-size: 0.45rem;
  font-weight: 800;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2e7d32;
  line-height: 1;
}

/* ソートボタン（数字表示） */
.circle-btn.sort-btn {
  font-size: 0.55rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ユーティリティボタン（アイコン表示） */
.circle-btn.util-btn {
  font-size: 0.9rem;
}

/* ============================
   場エリア
   ============================ */
.mobile-field {
  grid-column: 1;
  grid-row: 2;
  padding: 6px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.mobile-field-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
  align-content: flex-start;
}

/* --- セット --- */
.field-set {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  background: var(--surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 5px;
  min-height: 42px;
}

.field-set.invalid {
  border-color: rgba(239, 83, 80, 0.6);
  background: rgba(239, 83, 80, 0.08);
}

.field-set-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  margin-right: 2px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.7;
}

.field-set-type {
  font-size: 0.45rem;
  color: var(--text-muted);
  margin-left: 3px;
  flex-shrink: 0;
  opacity: 0.5;
}

/* ============================
   タイル（共通）
   ============================ */
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 38px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #333;
  user-select: none;
  position: relative;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 40%, rgba(0,0,0,0.08) 100%),
    #e8d5b5;
  border: 1px solid #c9bda8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: outline var(--transition-fast);
}

/* タイルカラー */
.tile.tile-red { color: #d32f2f; }
.tile.tile-blue { color: #1976d2; }
.tile.tile-black { color: #212121; }
.tile.tile-orange { color: #f57c00; }
.tile.tile-joker { color: #7b1fa2; font-size: 1rem; }

/* タイル選択状態 (引いた直後の緑よりも優先するため !important を付与) */
.tile.selected {
  outline: 3px solid #fdd835 !important;
  outline-offset: 1px;
  box-shadow: 0 0 10px rgba(253, 216, 53, 0.6) !important;
  z-index: 50;
}

/* タイル引いた直後のハイライト (選択中と区別するためグリーンに変更) */
.tile.just-drawn {
  border-color: #4caf50 !important;
  outline: 2px solid #4caf50;
  outline-offset: 1px;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

/* --- Compact タイル --- */
.compact-tiles .tile {
  width: 24px;
  height: 32px;
  font-size: 0.72rem;
  border-radius: 3px;
}

.compact-tiles .field-set {
  gap: 1px;
  padding: 2px 3px;
  min-height: 36px;
}

/* --- Tiny タイル --- */
.tiny-tiles .tile {
  width: 20px;
  height: 28px;
  font-size: 0.62rem;
  border-radius: 3px;
}

.tiny-tiles .field-set {
  gap: 1px;
  padding: 2px 2px;
  min-height: 32px;
}

/* ============================
   手札バー
   ============================ */
.hand-bar {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #442410, #5c351b);
  border-top: 3px solid #3c200c;
  overflow-x: auto;
  overflow-y: hidden;
}

.hand-tiles {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
}

.hand-tiles::-webkit-scrollbar {
  height: 3px;
}
.hand-tiles::-webkit-scrollbar-track {
  background: transparent;
}
.hand-tiles::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.hand-count {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 35px;
  text-align: right;
}

/* 縦向き設定: オーバーレイを消し、レイアウトを許可 */
@media (orientation: portrait) {
  .mobile-layout {
    grid-template-columns: 1fr 48px; /* パネルを少し狭く */
  }
}

/* ============================
   モーダル（設定・通知・クリア）
   ============================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}

.modal-heading {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #039be5);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* 設定行 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
}

.setting-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* トグルスイッチ */
.toggle-switch { position: relative; flex-shrink: 0; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block; width: 44px; height: 24px;
  background: #a5d6a7; border-radius: 20px;
  position: relative; cursor: pointer;
  transition: background-color var(--transition-fast);
}
.toggle-thumb {
  display: block; width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-input:checked + .toggle-track {
  background: var(--accent-primary);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* セット数ボタン */
.set-count-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
}

.set-count-btn {
  flex: 1;
  min-width: 36px;
  padding: 0.3rem 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.set-count-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* ============================
   新規セット追加ゾーン（タップ操作用）
   ============================ */
.new-set-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 42px;
  border: 2px dashed rgba(79, 195, 247, 0.4);
  border-radius: 5px;
  color: var(--accent-primary);
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

/* タイル選択中のみ表示 */
.has-selection .new-set-zone {
  opacity: 1;
}

/* ============================
   設定画面
   ============================ */
.mobile-settings-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--vh, 1vh) * 100);
  height: calc(var(--vh, 1vh) * 100);
  width: 100vw;
  background: var(--bg-primary);
  padding: 1rem;
}

.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
}

.modal-headline {
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

/* 言語ボタン */
.lang-btn {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.lang-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* ジョーカーオフバッジ */
.badge.joker-off {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* 通知ダイアログ */
.notify-dialog {
  text-align: center;
  max-width: 300px;
}

.notify-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.notify-message {
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-primary);
}

/* 場エリアの背景色 */
.mobile-field {
  background: var(--bg-primary);
}

/* ============================
   Clear Modal Result Area
   ============================ */
#clear-score-area {
  margin: 1rem 0;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#clear-score-area.show-result {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.result-rank {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.05em;
  text-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.rank-s { color: #fdd835; text-shadow: 0 0 20px rgba(253, 216, 53, 0.6), 0 0 40px rgba(253, 216, 53, 0.3); animation: rankPulse 2s infinite alternate; }
.rank-a { color: #ff8a65; text-shadow: 0 0 15px rgba(255, 138, 101, 0.5); }
.rank-b { color: #4fc3f7; text-shadow: 0 0 15px rgba(79, 195, 247, 0.5); }
.rank-c { color: #81c784; }
.rank-d { color: #a1887f; }
.rank-e { color: #9e9e9e; }

@keyframes rankPulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.score-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.score-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
}

.result-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   スコアパッドテーマ 造形上書き (案B + B-3濃紺バンド)
   紙とインクの様式をスマホ版へ移植。JS/レイアウトは変えず色と形のみ。
   ============================================================ */

body {
  background: var(--bg-primary);
}

/* --- タイル: フラット+インク輪郭+オフセット影 --- */
.tile {
  background: #fffef9;
  border: 1.5px solid var(--ink-line);
  box-shadow: 1.5px 1.5px 0 rgba(42, 49, 64, 0.2);
  color: var(--ink);
}

.tile.tile-red { color: var(--tile-red); }
.tile.tile-blue { color: var(--tile-blue); }
.tile.tile-black { color: var(--tile-black); }
.tile.tile-orange { color: var(--tile-orange); }
.tile.tile-joker { color: var(--accent-secondary); }

.tile.selected {
  outline: 2.5px solid var(--tile-red) !important;
  outline-offset: 1px;
  box-shadow: 1.5px 1.5px 0 rgba(42, 49, 64, 0.2) !important;
  z-index: 50;
}

.tile.just-drawn {
  border-color: var(--accent-primary) !important;
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
  box-shadow: 1.5px 1.5px 0 rgba(31, 78, 121, 0.35) !important;
}

/* --- 場: セットは濃紺アンダーライン(枠カード廃止) --- */
.mobile-field {
  background: var(--bg-primary);
}

.field-set {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid var(--accent-primary);
  border-radius: 0;
  padding: 2px 3px 4px;
}

.field-set.invalid {
  background: rgba(214, 67, 57, 0.07);
  border-bottom-color: var(--tile-red);
}

.new-set-zone {
  border: 2px dashed rgba(31, 78, 121, 0.5);
  color: var(--accent-primary);
}

/* --- ヘッダー: 紙+インクの太罫、バッジは枠線/濃紺 --- */
.mobile-header {
  border-bottom: 2px solid var(--ink);
}

.mobile-header .btn-back {
  border: 1.5px solid var(--accent-primary);
  border-radius: 3px;
  color: var(--accent-primary);
}

.mobile-header .badge.joker-on {
  background: transparent;
  color: var(--accent-secondary);
  border: 1.5px solid var(--accent-secondary);
}

.mobile-header .stock-badge {
  background: var(--accent-primary);
  color: #fffef9;
  border: 1.5px solid var(--accent-primary);
}

/* --- 右パネル: 丸ボタンをインク様式に --- */
.right-panel {
  border-left: 2px solid var(--ink);
}

.circle-btn {
  border: 1.5px solid var(--accent-primary);
  color: var(--accent-primary);
}

.circle-btn.sort-btn {
  color: var(--accent-primary);
}

.circle-btn.util-btn {
  color: var(--accent-primary);
}

/* ドローボタン: 濃紺ベタ(主要操作) */
.circle-btn.draw-btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fffef9;
  box-shadow: none;
}

.circle-btn.draw-btn:active {
  box-shadow: none;
  background: var(--accent-primary-hover);
}

.draw-badge {
  background: #fffef9;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

/* --- 手札バー: B-3 濃紺バンド --- */
.hand-bar {
  background: linear-gradient(180deg, #24567f, #1f4e79);
  border-top: 3px solid #16385a;
}

.hand-bar .tile {
  border-color: #16385a;
  box-shadow: 1.5px 1.5px 0 rgba(10, 26, 42, 0.5);
}

.hand-count {
  color: rgba(255, 254, 249, 0.85);
}

.hand-tiles::-webkit-scrollbar-thumb {
  background: rgba(255, 254, 249, 0.4);
}

/* --- ボタン(モーダル): スタンプ様式 --- */
.btn-primary {
  background: var(--accent-primary);
  color: #fffef9;
  border: 2px solid var(--accent-primary);
  border-radius: 3px;
  font-weight: 800;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid #7a8290;
  border-radius: 3px;
  font-weight: 800;
}

/* --- 設定画面の言語ボタン・セット数ボタン --- */
.lang-btn {
  background: transparent;
  border: 1.5px solid #7a8290;
  border-radius: 3px;
  color: var(--text-secondary);
  backdrop-filter: none;
}

.lang-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fffef9;
}

.set-count-btn {
  border-radius: 3px;
}

.set-count-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fffef9;
}

/* ============================================================
   スコアパッドテーマ 造形上書き (mobile。PC版 style.css と統一)
   紙とインク: 白地インク輪郭タイル / 罫線+濃紺下線の場 / 濃紺バンドの手札 / スタンプ丸ボタン
   ============================================================ */
body { background: var(--bg-primary); }

/* タイル: 白地+インク輪郭+オフセット影 */
.tile {
  background: #fffef9;
  border: 1.5px solid var(--ink-line);
  box-shadow: 1.5px 1.5px 0 rgba(42, 49, 64, 0.18);
}
.tile.selected {
  outline: 2.5px solid var(--tile-red) !important;
  outline-offset: 1px;
  box-shadow: 1.5px 1.5px 0 rgba(42, 49, 64, 0.18) !important;
}
.tile.just-drawn {
  border-color: var(--accent-secondary) !important;
  outline: 2px solid var(--accent-secondary);
  box-shadow: 1.5px 1.5px 0 rgba(42, 49, 64, 0.18);
}

/* 場: 罫線紙 + セットは濃紺アンダーライン */
.mobile-field {
  background: repeating-linear-gradient(180deg, transparent 0 33px, rgba(31, 78, 121, 0.07) 33px 34px);
}
.field-set {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid var(--accent-primary);
  border-radius: 0;
  padding: 2px 3px 3px;
}
.field-set.invalid {
  background: rgba(214, 67, 57, 0.07);
  border-bottom-color: var(--tile-red);
}

/* ヘッダー / 右パネル: インクの罫 */
.mobile-header { border-bottom: 2px solid var(--ink); }
.mobile-header .btn-back {
  background: transparent;
  border: 1.5px solid #7a8290;
  color: var(--text-secondary);
}
.mobile-header .badge.joker-on {
  background: transparent;
  color: var(--accent-secondary);
  border: 1.5px solid var(--accent-secondary);
}
.mobile-header .stock-badge {
  background: var(--accent-primary);
  color: #fffef9;
  border: 1.5px solid var(--accent-primary);
}
.right-panel { border-left: 2px solid var(--ink); }

/* 丸ボタン: 引く=濃紺ベタ / その他=スタンプ(濃紺枠) */
.circle-btn {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
}
.circle-btn.draw-btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fffef9;
  box-shadow: none;
}
.circle-btn.draw-btn:active { box-shadow: none; }
.draw-badge {
  background: #fffef9;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}
.circle-btn.sort-btn,
.circle-btn.util-btn { color: var(--accent-primary); }

/* 手札バー: B-3 濃紺バンド */
.hand-bar {
  background: linear-gradient(180deg, #24567f, #1f4e79);
  border-top: none;
}
.hand-bar .tile {
  border-color: #16385a;
  box-shadow: 1.5px 1.5px 0 rgba(10, 26, 42, 0.5);
}
.hand-count { color: rgba(255, 254, 249, 0.85); }
.hand-tiles::-webkit-scrollbar-thumb { background: rgba(255, 254, 249, 0.4); }

/* 新規セットゾーン / トグル / 設定カード */
.new-set-zone {
  border: 2px dashed rgba(31, 78, 121, 0.5);
  color: var(--accent-primary);
}
.toggle-track { background: #c8cfd8; }
.mobile-settings-screen { background: var(--bg-primary); }
.settings-card { background: var(--bg-card); }

/* クリア画面のランク色(水色/緑の旧アクセントを廃し統一) */
.rank-s { color: #c99a2e; text-shadow: none; animation: none; }
.rank-a { color: var(--accent-secondary); text-shadow: none; }
.rank-b { color: var(--accent-primary); text-shadow: none; }
.rank-c { color: var(--text-secondary); text-shadow: none; }
