/* ================================================================
   PC互換チェッカー - v2 2パネル設計
   ================================================================ */

:root {
  --bg-outer: #0a0f1a;
  --bg-main: #111827;
  --bg-active: #1e293b;
  --c-text: #f1f5f9;
  --c-sub: #94a3b8;
  --c-muted: #64748b;
  --c-border: #334155;
  --c-primary: #60a5fa;
  --c-ok: #78FFCB;
  --c-warn: #fbbf24;
  --c-ng: #ff9a8c;
}

:root[data-theme="light"] {
  --bg-outer: #f1f5f9;
  --bg-main: #ffffff;
  --bg-active: #e2e8f0;
  --c-text: #1e293b;
  --c-sub: #475569;
  --c-muted: #94a3b8;
  --c-border: #cbd5e1;
  --c-primary: #3b82f6;
  --c-ok: #059669;
  --c-warn: #d97706;
  --c-ng: #dc2626;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-outer);
  color: var(--c-text);
  line-height: 1.6;
}

/* ================================================================
   メインレイアウト
   ================================================================ */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.header-logo {
  font-size: 24px;
}

.header-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 4px 0;
}

.beta-badge {
  font-size: 10px;
  font-weight: 700;
  background: #ff6b35;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 1px;
  margin-left: 4px;
}

.header-title .subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--c-text-muted);
  margin: 0;
  opacity: 0.7;
}

.btn-menu, .btn-mode-switch {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-menu:hover, .btn-mode-switch:hover {
  background: var(--bg-active);
}

/* ── テーマ切り替えトグル ── */
.btn-theme-toggle {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: auto;
  transition: background 0.2s, border-color 0.2s;
}
.btn-theme-toggle:hover {
  background: var(--bg-active);
  border-color: var(--c-primary);
}

/* ── メインコンテナ: 左右2パネル ── */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── 左パネル: チャット ── */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--c-border);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  width: 100%;
  margin-right: auto;
}

.featured-games-links {
  padding: 12px 16px;
  background: var(--bg-active);
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-sub);
  flex-shrink: 0;
}

.featured-games-links a {
  color: var(--c-primary);
  text-decoration: none;
}

.featured-games-links a:hover {
  text-decoration: underline;
}

.chat-examples {
  display: flex;
  gap: 12px;
  padding: 0 0 8px 0;
  flex-wrap: wrap;
}

.chat-example {
  font-size: 12px;
  color: var(--c-text-muted);
  opacity: 0.6;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--c-bg-light);
  transition: all 0.2s;
  user-select: none;
}

.chat-example:hover {
  opacity: 1;
  background: var(--c-primary-light);
  color: var(--c-primary);
}

.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-main);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

.chat-reset-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

#btn-reset-all {
  background: none;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
#btn-reset-all:hover {
  color: var(--c-text);
  border-color: var(--c-primary);
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

#chat-input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-outer);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  font-size: 14px;
  resize: none;
  font-family: inherit;
  max-height: 120px;
}

#btn-send {
  background: var(--c-primary);
  border: none;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

#btn-send:hover {
  opacity: 0.9;
}

/* ── 右パネル: ダッシュボード ── */
.dashboard-panel {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bg-main);
  overflow-y: auto;
  flex-shrink: 0;
}

.dashboard-section {
  background: var(--bg-outer);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 16px;
}

.dashboard-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--c-ok);
}

/* ── パーツ一覧テーブル ── */
.parts-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.parts-row:last-child {
  border-bottom: none;
}

.parts-category {
  width: 60px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
}

.parts-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}

.build-name {
  font-weight: 700;
}

.parts-name--empty {
  color: var(--c-muted);
  font-style: italic;
}

.parts-price {
  width: 80px;
  text-align: right;
  font-size: 13px;
  color: var(--c-sub);
}

.parts-total-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  margin-top: 4px;
  border-top: 2px solid var(--c-border);
}

.parts-total-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}

.parts-total-price {
  width: 80px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-ok);
}

.parts-status {
  width: 30px;
  text-align: center;
  font-size: 16px;
}

.parts-buy {
  width: 48px;
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: flex-end;
}

.parts-buy-link {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  line-height: 20px;
}

.parts-buy-amz {
  background: #FF9900;
}

.parts-buy-rak {
  background: #BF0000;
}

.parts-change-link {
  width: 32px;
  font-size: 11px;
  color: var(--c-primary);
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
  opacity: 0.7;
}
.parts-change-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.parts-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--c-border);
  font-size: 14px;
  font-weight: 700;
}

.parts-progress {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-active);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-ok));
  transition: width 0.3s ease;
}

.budget-warn {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 145, 115, 0.15);
  color: var(--c-ng);
  border: 1px solid rgba(255, 145, 115, 0.3);
}

.budget-ok {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(120, 255, 203, 0.15);
  color: var(--c-ok);
  border: 1px solid rgba(120, 255, 203, 0.3);
}

/* ── CTAボタン ── */
.btn-generate-image, .btn-purchase-main {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-generate-image {
  background: linear-gradient(135deg, var(--c-primary), #8b5cf6);
  color: #fff;
}

.btn-purchase-main {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-generate-image:hover, .btn-purchase-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.btn-generate-image:disabled {
  cursor: not-allowed;
  opacity: 0.6 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ── ローディングアニメーション ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-generate-image:disabled {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── 画像エリア ── */
#generated-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.image-note {
  font-size: 11px;
  color: var(--c-muted);
  text-align: center;
}

/* ── 購入エリア ── */
.purchase-details {
  margin-top: 12px;
}

.purchase-details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--c-sub);
  padding: 8px;
}

.purchase-details summary:hover {
  color: var(--c-primary);
}

.individual-link-item {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-outer);
  border: 1px solid var(--c-border);
  border-radius: 6px;
}

.link-item-name {
  display: block;
  font-size: 13px;
  color: var(--c-text);
  margin-bottom: 8px;
  font-weight: 500;
}

.link-item-buttons {
  display: flex;
  gap: 8px;
}

.buy-btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.buy-btn-amazon {
  background: #ff9900;
  color: #fff;
}

.buy-btn-amazon:hover {
  background: #e88800;
}

.buy-btn-rakuten {
  background: #bf0000;
  color: #fff;
}

.buy-btn-rakuten:hover {
  background: #a00000;
}

/* ── チャットバブル（.msg / .msg-bubble） ── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

.msg.user {
  flex-direction: row-reverse;
}

.msg.ai {
  flex-direction: row;
}

.msg-avatar {
  font-size: 18px;
  flex-shrink: 0;
  padding-top: 3px;
  line-height: 1;
}

.msg-bubble {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.65;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 90%;
  word-break: break-word;
}

/* ユーザー: 右寄せ・薄い青 */
.msg.user .msg-bubble {
  background: rgba(96, 165, 250, 0.18);
  color: #c8e3ff;
  border-radius: 18px 4px 18px 18px;
  text-align: left;
}

/* AI（店員）: 左寄せ・薄いグレー */
.msg.ai .msg-bubble {
  background: #1e2d3d;
  color: var(--c-text);
  border-radius: 4px 18px 18px 18px;
}

/* ライトモード: バブル色上書き */
:root[data-theme="light"] .msg.user .msg-bubble {
  background: rgba(59, 130, 246, 0.12);
  color: #1e40af;
}
:root[data-theme="light"] .msg.ai .msg-bubble {
  background: #e2e8f0;
  color: var(--c-text);
}
:root[data-theme="light"] .bubble.user {
  background: rgba(59, 130, 246, 0.12);
  color: #1e40af;
}
:root[data-theme="light"] .bubble.ai {
  background: #e2e8f0;
  color: var(--c-text);
}

/* チャット内リンク */
.msg-bubble a {
  color: var(--c-primary);
  text-decoration: underline;
}
.msg-bubble a:hover {
  opacity: 0.8;
}

/* 型番・製品名を太字+アクセントカラー */
.msg.ai .msg-bubble strong {
  font-weight: 700;
  color: var(--c-ok);
}

/* 後方互換: 旧 .bubble クラス */
.bubble {
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  max-width: 85%;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
}

.bubble.user {
  background: rgba(96, 165, 250, 0.18);
  color: #c8e3ff;
  margin-left: auto;
}

.bubble.ai {
  background: #1e2d3d;
  color: var(--c-text);
}

.bubble.ai strong {
  font-weight: 700;
  color: var(--c-ok);
}



/* ── モバイル対応 ── */
@media (max-width: 1023px) {
  .dashboard-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  
  .dashboard-panel.open {
    transform: translateY(0);
  }
  
  .mobile-dashboard-toggle {
    display: block;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--c-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
}

@media (min-width: 1024px) {
  .mobile-dashboard-toggle {
    display: none;
  }
}

/* ── ドロワー（履歴） ── */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
}

.drawer-overlay.open {
  display: block;
}

.drawer {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-main);
  border-right: 1px solid var(--c-border);
  padding: 16px;
  overflow-y: auto;
  z-index: 1001;
}

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

.drawer-header h2 {
  font-size: 16px;
}

.btn-drawer-close {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-new-chat {
  width: 100%;
  padding: 12px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 16px;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-item {
  padding: 10px 12px;
  background: var(--bg-outer);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--c-sub);
}

.drawer-item:hover {
  background: var(--bg-active);
  color: var(--c-text);
}

/* ── レーダーチャート ── */
#radar-chart {
  max-width: 100%;
  height: auto;
}

/* ── ユーティリティ ── */
.text-muted {
  color: var(--c-muted);
}

.text-warn {
  color: var(--c-warn);
}

.text-ok {
  color: var(--c-ok);
}

.text-ng {
  color: var(--c-ng);
}

/* ── ヘッダー: ガイドリンク ── */
.btn-guide-link {
  color: var(--c-sub);
  font-size: 13px;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-guide-link:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
}

/* ── サイトフッター（メインページ） ── */
.site-footer-main {
  background: var(--bg-main);
  border-top: 1px solid var(--c-border);
  padding: 16px 20px;
  text-align: center;
}
.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.site-footer-links a {
  color: var(--c-muted);
  font-size: 12px;
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--c-primary);
}
.site-footer-copy {
  color: var(--c-muted);
  font-size: 11px;
}

/* ================================================================
   モード選択カード（起動時）
   ================================================================ */
.mode-cards {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.mode-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg-active);
  border: 1px solid var(--c-border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-sub);
  line-height: 1.5;
}
.mode-card:hover {
  background: var(--bg-active);
  border-left-color: var(--c-primary);
  transform: translateY(-2px);
}
.mode-card-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

/* ================================================================
   BTOモード: 松竹梅カード
   ================================================================ */

/* モード選択カード: BTO */
.mode-card--bto {
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  background: rgba(99, 102, 241, 0.08) !important;
}
.mode-card-sub {
  display: block;
  font-size: 10px;
  color: var(--c-muted);
  margin-top: 4px;
}

/* BTO サブパス選択カード */
.bto-sub-cards { margin-top: 12px; }
.bto-sub-card { border-left: 3px solid rgba(99, 102, 241, 0.3) !important; }
.bto-sub-card:hover { border-left-color: rgba(99, 102, 241, 0.8) !important; background: rgba(99, 102, 241, 0.08) !important; }

/* スペック要件サマリー */
.bto-spec-summary {
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--c-sub);
}

/* 松竹梅3カード並列 */
.bto-cards-container {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.bto-card {
  flex: 1;
  background: var(--bg-outer);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.bto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ゴルディロックス: 竹（おすすめ）を強調 */
.bto-card--highlight {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.06);
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.bto-card--highlight:hover {
  transform: scale(1.03) translateY(-2px);
}

.bto-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 12px;
  white-space: nowrap;
}

/* ティアラベル */
.bto-card-tier {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.bto-tier--value .bto-card-tier { color: #10b981; }
.bto-tier--recommended .bto-card-tier { color: #6366f1; }
.bto-tier--premium .bto-card-tier { color: #f59e0b; }

/* メーカー・モデル */
.bto-card-maker {
  font-size: 11px;
  color: var(--c-muted);
  margin-bottom: 2px;
}
.bto-card-model {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* 価格 */
.bto-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ok);
  margin-bottom: 12px;
}
.bto-card-tax {
  font-size: 11px;
  font-weight: 400;
  color: var(--c-muted);
}

/* スペック表 */
.bto-card-specs {
  flex: 1;
  margin-bottom: 10px;
}
.bto-spec-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.bto-spec-row:last-child {
  border-bottom: none;
}
.bto-spec-label {
  color: var(--c-muted);
  font-weight: 600;
  min-width: 36px;
}
.bto-spec-val {
  color: var(--c-text);
  text-align: right;
}

/* タグ */
.bto-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.bto-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.15);
  color: var(--c-primary);
}

/* マッチ度 */
.bto-card-score {
  font-size: 11px;
  color: var(--c-sub);
  text-align: center;
  margin-bottom: 8px;
}

/* 購入ボタン */
.bto-card-btn {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
  margin-bottom: 6px;
}
.bto-card-btn:hover {
  opacity: 0.85;
}
.bto-tier--value .bto-card-btn {
  background: linear-gradient(135deg, #10b981, #059669);
}
.bto-tier--premium .bto-card-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.bto-card-btn--disabled {
  background: var(--c-muted) !important;
  cursor: default;
  font-size: 11px;
  opacity: 0.7;
}

/* 保証 */
.bto-card-warranty {
  font-size: 10px;
  color: var(--c-muted);
  text-align: center;
}

/* フッター注意 */
.bto-footer-note {
  font-size: 10px;
  color: var(--c-muted);
  margin-top: 10px;
  text-align: center;
}

/* ライトモード: BTO カード調整 */
:root[data-theme="light"] .bto-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
:root[data-theme="light"] .bto-card--highlight {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.04);
}
:root[data-theme="light"] .bto-spec-row {
  border-bottom-color: #e2e8f0;
}
:root[data-theme="light"] .bto-tag {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}
:root[data-theme="light"] .bto-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ライトモード: 送信ボタン */
:root[data-theme="light"] #btn-send {
  color: #fff;
}

/* モバイル: 松竹梅カード縦積み */
@media (max-width: 768px) {
  .bto-cards-container {
    flex-direction: column;
  }
  .bto-card--highlight {
    transform: none;
    order: -1;
  }
  .bto-card--highlight:hover {
    transform: translateY(-2px);
  }
}

/* ================================================================
   レスポンシブ: 768px以下（タブレット縦・大型スマホ）
   ================================================================ */
@media (max-width: 768px) {
  header {
    gap: 8px;
    padding: 10px 12px;
  }
  .header-title h1 {
    font-size: 14px;
  }
  .header-title .subtitle {
    font-size: 10px;
  }
  .header-logo {
    font-size: 20px;
  }
  .mode-cards {
    flex-direction: column;
    gap: 8px;
  }
  .mode-card {
    min-width: unset;
    padding: 12px 10px;
  }
  .msg-bubble {
    max-width: 95%;
  }
}

/* ================================================================
   レスポンシブ: 480px以下（スマートフォン）
   ================================================================ */
@media (max-width: 480px) {
  .btn-guide-link {
    display: none;
  }
  .btn-menu, .btn-mode-switch {
    padding: 6px 8px;
    font-size: 12px;
  }
  .btn-theme-toggle {
    padding: 4px 8px;
    font-size: 14px;
  }
  .header-title h1 {
    font-size: 13px;
  }
  .header-title .subtitle {
    font-size: 9px;
  }
  .chat-input-area {
    padding: 8px 10px;
  }
  #chat-input {
    font-size: 13px;
    padding: 8px 10px;
  }
  #btn-send {
    padding: 8px 12px;
    font-size: 14px;
  }
  .mode-card {
    padding: 10px 8px;
    font-size: 12px;
  }
  .mode-card-icon {
    font-size: 22px;
  }
  .mobile-dashboard-toggle {
    bottom: 72px;
  }
  #btn-reset-all {
    font-size: 11px;
    padding: 3px 8px;
  }
  .site-footer-links {
    gap: 12px;
  }
  .site-footer-links a {
    font-size: 11px;
  }
}

/* ================================================================
   レスポンシブ: 375px以下（iPhone SE等の小型デバイス）
   ================================================================ */
@media (max-width: 375px) {
  header {
    gap: 6px;
    padding: 8px 10px;
  }
  .header-title h1 {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }
  .header-title .subtitle {
    display: none;
  }
  .header-logo {
    font-size: 18px;
  }
  .btn-mode-switch {
    display: none;
  }
}

/* ================================================================
   直帰率対策: Discovery Bar (サイドバー代替 - 横3カラム)
   ================================================================ */
.discovery-bar {
  background: var(--bg-main);
  border-top: 1px solid var(--c-border);
  padding: 32px 20px;
}
.discovery-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.discovery-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 12px 0;
}
.popular-games-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: popular;
}
.popular-games-list li {
  counter-increment: popular;
  margin-bottom: 6px;
  font-size: 13px;
}
.popular-games-list li::before {
  content: counter(popular) ". ";
  font-weight: 600;
  color: var(--c-primary);
  margin-right: 4px;
}
.popular-games-list a,
.new-games-list a,
.genre-list a {
  color: var(--c-sub);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.popular-games-list a:hover,
.new-games-list a:hover,
.genre-list a:hover {
  color: var(--c-primary);
  text-decoration: underline;
}
.new-games-list,
.genre-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.new-games-list li,
.genre-list li {
  margin-bottom: 6px;
  padding-left: 18px;
  position: relative;
  font-size: 13px;
}
.new-games-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--c-primary);
}
.genre-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--c-primary);
}
@media (max-width: 768px) {
  .discovery-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ================================================================
   直帰率対策: フッター強化 (4セクション版)
   ================================================================ */
.site-footer-enhanced {
  background: var(--bg-main);
  border-top: 1px solid var(--c-border);
  padding: 40px 20px 20px;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--c-primary);
}
.footer-section p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-sub);
  margin: 0;
}
.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-section ul li {
  margin-bottom: 6px;
}
.footer-section a {
  color: var(--c-sub);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-section a:hover {
  color: var(--c-primary);
}
.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
}
.footer-bottom p {
  font-size: 12px;
  color: var(--c-muted);
  margin: 0;
}
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}
@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   直帰率対策: Exit Intent Modal
   ================================================================ */
.exit-intent-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.exit-intent-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.exit-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}
.exit-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-main);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.exit-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--c-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.exit-modal-close:hover {
  color: var(--c-text);
}
.exit-modal-content h2 {
  font-size: 24px;
  margin: 0 0 12px 0;
  color: var(--c-text);
}
.exit-modal-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-sub);
  margin: 0 0 24px 0;
}
.exit-modal-cta {
  display: inline-block;
  background: var(--c-primary);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: opacity 0.2s;
}
.exit-modal-cta:hover {
  opacity: 0.85;
}
.exit-modal-games {
  margin-top: 16px;
  font-size: 12px;
  color: var(--c-muted);
}
.exit-modal-games a {
  color: var(--c-sub);
  text-decoration: none;
}
.exit-modal-games a:hover {
  color: var(--c-primary);
  text-decoration: underline;
}

/* ================================================================
   直帰率対策: Scroll 50% CTA
   ================================================================ */
.scroll-cta {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: bottom 0.3s ease-out;
}
.scroll-cta.show {
  bottom: 20px;
}
.scroll-cta-content {
  background: var(--c-primary);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.4);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 90vw;
}
.scroll-cta-text {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.scroll-cta-button {
  background: #ffffff;
  color: var(--c-primary);
  padding: 8px 18px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: transform 0.2s;
}
.scroll-cta-button:hover {
  transform: scale(1.05);
}
.scroll-cta-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}
.scroll-cta-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
@media (max-width: 768px) {
  .scroll-cta-content {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
  }
  .scroll-cta-text {
    font-size: 13px;
    text-align: center;
    white-space: normal;
  }
}
