/* ==========================================================================
   LOGIC SWEEPER - モダン・モバイル最適化スタイルシート
   ========================================================================== */

:root {
  --bg-top: #f8fafc;
  --bg-bottom: #e2e8f0;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border-light: #e2e8f0;
  --border-mid: #cbd5e1;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --emerald: #10b981;
  --emerald-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --rose: #ef4444;
  --rose-soft: #fee2e2;

  --cell-size: 36px;
  --cell-gap: 3px;
  --cell-radius: 7px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 18px 42px rgba(15, 23, 42, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   アプリ全体シェル (100dvh 固定レイアウト)
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 980px;
  height: 100dvh;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
}

/* ヘッダー */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-main);
  line-height: 1.15;
}

.logic-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: #047857;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn:hover {
  background: #f8fafc;
}

.primary-icon-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.primary-icon-btn:hover {
  background: var(--primary-dark);
}

/* ==========================================================================
   難易度＆エンドレス選択タブ
   ========================================================================== */
.difficulty-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px 14px 6px;
  flex-shrink: 0;
}

.diff-tab {
  border: 1.5px solid var(--border-light);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 11px;
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.diff-tab:active {
  transform: scale(0.96);
}

.diff-name {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.diff-meta {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.diff-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.26);
}

.diff-tab.active .diff-name,
.diff-tab.active .diff-meta {
  color: #ffffff;
}

.endless-tab.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

/* ==========================================================================
   HUD ステータスバー & ズームコントロール
   ========================================================================== */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 14px 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hud-counters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.hud-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.streak-pill {
  font-size: 11.5px;
  color: var(--text-sub);
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-sep {
  color: var(--border-mid);
  margin: 0 2px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}

.zoom-btn {
  border: none;
  background: var(--surface-soft);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease;
}

.zoom-btn:hover {
  background: #e2e8f0;
}

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

.fit-btn {
  padding: 0 7px;
  font-size: 10.5px;
  color: var(--primary);
  background: var(--primary-soft);
}

.zoom-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ヒント・ソルバー解説バナー
   ========================================================================== */
.hint-banner {
  margin: 2px 14px 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 1.5px solid #6ee7b7;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  animation: slideFadeIn 0.2s ease-out;
}

.hint-banner.failsafe-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fcd34d;
}

.hint-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hint-rule-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.hint-banner.failsafe-banner .hint-rule-tag {
  background: #d97706;
}

.hint-message {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.hint-close-btn {
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-sub);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   盤面ビューポート・スクロール＆ズームエリア
   ========================================================================== */
.board-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  display: flex;
  padding: 8px 14px 12px;
  position: relative;
}

.board-stage {
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.board-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow-md);
}

.board-grid {
  display: grid;
  gap: var(--cell-gap);
  background: #cbd5e1;
  padding: var(--cell-gap);
  border-radius: 10px;
  touch-action: pan-x pan-y;
}

/* ==========================================================================
   セル（タイル）デザインとアニメーション
   ========================================================================== */
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border: none;
  padding: 0;
  border-radius: var(--cell-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 800;
  font-size: calc(var(--cell-size) * 0.52);
  line-height: 1;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.08s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

/* 未開封セル（明るく押し心地のある立体タイル） */
.cell.unrevealed {
  background: linear-gradient(180deg, #ffffff 0%, #e8f1fb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -3px 0 #b6cbe3,
    0 1px 2px rgba(15, 23, 42, 0.08);
  color: var(--text-main);
}

@media (hover: hover) {
  .cell.unrevealed:hover {
    background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
  }
}

.cell.unrevealed:active,
.cell.unrevealed.pressing {
  transform: scale(0.93);
  box-shadow:
    inset 0 2px 4px rgba(15, 23, 42, 0.15),
    inset 0 -1px 0 #b6cbe3;
}

/* 旗が立ったセル */
.cell.flagged {
  background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 #fb923c;
  font-size: calc(var(--cell-size) * 0.56);
  animation: flagPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes flagPop {
  0% { transform: scale(0.72); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 開封済みセル */
.cell.revealed {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.6);
  cursor: default;
}

.cell.revealed.is-zero {
  background: #f1f5f9;
}

.cell.revealed.has-number {
  cursor: pointer;
}

.cell.revealed.has-number:active {
  background: #e0f2fe;
}

/* 空白連鎖のウェーブアニメーション */
.cell.wave-animate {
  animation: tileRevealWave 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--wave-delay, 0ms);
}

@keyframes tileRevealWave {
  0% {
    transform: scale(0.68);
    background-color: #bfdbfe;
    opacity: 0.65;
  }
  65% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 数字カラーリング（視認性重視の高コントラスト配色） */
.num-1 { color: #2563eb; }
.num-2 { color: #16a34a; }
.num-3 { color: #dc2626; }
.num-4 { color: #7c3aed; }
.num-5 { color: #b91c1c; }
.num-6 { color: #0d9488; }
.num-7 { color: #1e293b; }
.num-8 { color: #475569; }

/* 地雷・爆発・誤フラグ */
.cell.mine-revealed {
  background: #fee2e2;
  font-size: calc(var(--cell-size) * 0.58);
}

.cell.mine-exploded {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 0 2px #b91c1c;
  animation: mineShake 0.4s ease-in-out;
}

.cell.wrong-flag {
  background: #fecaca;
  color: #991b1b;
  font-size: calc(var(--cell-size) * 0.54);
}

@keyframes mineShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-4deg); }
  40% { transform: translateX(4px) rotate(4deg); }
  60% { transform: translateX(-3px) rotate(-2deg); }
  80% { transform: translateX(3px) rotate(2deg); }
}

/* 論理ヒントハイライト */
.cell.hint-safe {
  z-index: 3;
  box-shadow: 0 0 0 3px #10b981, 0 0 14px rgba(16, 185, 129, 0.55) !important;
  background: linear-gradient(180deg, #ecfdf5 0%, #a7f3d0 100%) !important;
  animation: hintPulseSafe 1.15s infinite ease-in-out;
}

.cell.hint-mine {
  z-index: 3;
  box-shadow: 0 0 0 3px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.6) !important;
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%) !important;
  animation: hintPulseMine 1.15s infinite ease-in-out;
}

.cell.hint-origin {
  z-index: 2;
  box-shadow: inset 0 0 0 2.5px #3b82f6 !important;
  background: #dbeafe !important;
}

@keyframes hintPulseSafe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes hintPulseMine {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

/* ==========================================================================
   下部ワンタップ操作ドック (スマホ最優先)
   ========================================================================== */
.control-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}

.mode-btn {
  border: none;
  background: transparent;
  border-radius: 11px;
  padding: 11px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.16s ease;
}

.mode-btn:active {
  transform: scale(0.96);
}

.mode-btn.active[data-mode="dig"] {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mode-btn.active[data-mode="flag"] {
  background: #f97316;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.32);
}

.mode-icon {
  font-size: 17px;
  line-height: 1;
}

.hint-action-btn {
  border: 1.5px solid #fcd34d;
  background: linear-gradient(180deg, #fefce8 0%, #fef08a 100%);
  color: #854d0e;
  border-radius: 14px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(234, 179, 8, 0.22);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.hint-action-btn:active {
  transform: scale(0.95);
}

.hint-action-btn:hover {
  box-shadow: 0 5px 14px rgba(234, 179, 8, 0.32);
}

.hint-icon {
  font-size: 17px;
  line-height: 1;
}

/* ==========================================================================
   モーダル群（リザルト・戦績・ガイド）
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 80;
  animation: fadeIn 0.18s ease-out;
}

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

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: modalPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.result-card {
  text-align: center;
}

.result-badge {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
}

.result-subtitle {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.45;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.metric-box {
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.endless-next-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #c2410c;
  font-size: 12.5px;
  font-weight: 700;
}

.endless-next-bar strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ea580c;
  color: #ffffff;
  font-size: 13px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary,
.btn-secondary,
.btn-danger-outline {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex: 1;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger-outline:active {
  transform: scale(0.97);
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

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

.btn-danger-outline {
  border: 1.5px solid #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-close-x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* 統計モーダル */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-diff-card {
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px;
}

.stat-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-diff-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-diff-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-diff-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-mini {
  background: var(--surface);
  border-radius: 9px;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.stat-mini-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-mini-val {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.stats-footer {
  display: flex;
  gap: 8px;
}

/* ガイドモーダル */
.guide-card {
  max-width: 500px;
}

.guide-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.guide-section {
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
}

.guide-section h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.guide-section ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-section li {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sub);
}

.guide-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  margin-right: 4px;
}

.tag-a {
  background: var(--rose-soft);
  color: #b91c1c;
}

.tag-b {
  background: var(--emerald-soft);
  color: #047857;
}

.tag-c {
  background: var(--primary-soft);
  color: #1d4ed8;
}

/* ==========================================================================
   レスポンシブ調整（スマホ幅・PC幅）
   ========================================================================== */
@media (max-width: 480px) {
  .app-header {
    padding: 8px 10px 4px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .brand-title {
    font-size: 14.5px;
  }

  .brand-sub {
    font-size: 10px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 10px;
  }

  .difficulty-tabs {
    padding: 3px 10px 4px;
    gap: 5px;
  }

  .hud-bar {
    padding: 3px 10px 4px;
    gap: 6px;
  }

  .hud-pill {
    padding: 4px 8px;
    font-size: 12px;
  }

  .streak-pill {
    font-size: 10.5px;
  }

  .board-viewport {
    padding: 6px 8px 10px;
  }

  .board-card {
    padding: 7px;
    border-radius: 14px;
  }

  .control-dock {
    padding: 7px 10px 10px;
    gap: 8px;
  }

  .mode-btn {
    padding: 10px 6px;
    font-size: 12.5px;
  }

  .hint-action-btn {
    padding: 10px 12px;
    font-size: 12.5px;
  }
}
