:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #10b981;
  --accent-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --border: #e2e8f0;
  --cbt-header-bg: #1e293b;
  --cbt-accent: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* アプリ全体ラッパー（モバイル時は最大480px、PC時は1240pxのワイド画面へ拡大） */
#app-container {
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  min-height: 100vh;
  box-shadow: 0 0 25px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: max-width 0.3s ease;
}

/* ヘッダー */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-to-blog {
  font-size: 0.8rem;
  color: var(--text-sub);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  transition: color 0.15s;
}
.back-to-blog:hover {
  color: var(--primary);
}

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}
.app-badge-cbt {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-light);
  color: #b45309;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* メインコンテンツ */
.app-content {
  flex: 1;
  padding: 16px 16px 85px 16px;
  overflow-y: auto;
}

/* タブパネル表示切替 */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}
.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* カウントダウンカード */
.countdown-card {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.countdown-card::after {
  content: "FE CBT";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 4.5rem;
  font-weight: 900;
  opacity: 0.08;
  pointer-events: none;
}
.countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 12px;
}
.countdown-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.days-number {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fbbf24;
}
.days-label {
  font-size: 0.95rem;
  font-weight: 600;
}
.countdown-tip {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  backdrop-filter: blur(4px);
}

/* クイックスタートボタン */
.quick-start-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 6px 15px -2px rgba(16, 185, 129, 0.35);
  margin-bottom: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.quick-start-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
}
.quick-start-btn:active {
  transform: scale(0.98);
}
.btn-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn-icon {
  font-size: 2rem;
}
.btn-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: left;
}
.btn-sub {
  font-size: 0.8rem;
  opacity: 0.9;
  text-align: left;
}
.btn-arrow {
  font-size: 1.2rem;
  font-weight: 700;
}

/* CBT本番模試モードボタン（PCでさらに映える） */
.cbt-mode-btn {
  width: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  transition: transform 0.15s, border-color 0.15s;
}
.cbt-mode-btn:hover {
  border-color: #38bdf8;
}
.cbt-mode-btn:active {
  transform: scale(0.98);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* カテゴリ別カードグリッド */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.cat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cat-card:active {
  transform: scale(0.98);
}
.cat-icon {
  font-size: 1.5rem;
}
.cat-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.cat-progress {
  font-size: 0.72rem;
  color: var(--text-sub);
}

/* 応援カード */
.encourage-card {
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.encourage-avatar {
  font-size: 2.2rem;
}
.encourage-text {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.45;
}
.encourage-text strong {
  color: var(--primary-dark);
}

/* --- クイズ画面 --- */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.quiz-timer-box {
  display: none; /* CBTモード時に表示 */
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}
.field-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.quiz-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* PC/CBT用パレット（問題一覧ナビゲーター：1〜20問マス目） */
.cbt-palette-container {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.cbt-palette-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.cbt-palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cbt-palette-item {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}
.cbt-palette-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cbt-palette-item.current {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}
.cbt-palette-item.answered-correct {
  background: var(--accent-light);
  border-color: var(--accent);
  color: #065f46;
}
.cbt-palette-item.answered-wrong {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991b1b;
}
.cbt-palette-item.has-wrong-history {
  position: relative;
}
.cbt-palette-item.has-wrong-history::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 2px rgba(239, 68, 68, 0.8);
}

.question-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.question-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 12px;
}
.question-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--text-main);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.option-btn {
  width: 100%;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}
.option-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.option-btn:active {
  transform: scale(0.99);
}
.option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-sub);
  flex-shrink: 0;
}
.option-key-hint {
  margin-left: auto;
  font-size: 0.7rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  display: none; /* PC版で表示 */
}
.option-btn.correct {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
  color: #065f46 !important;
}
.option-btn.correct .option-label {
  background: var(--accent);
  color: white;
}
.option-btn.wrong {
  background: var(--danger-light) !important;
  border-color: var(--danger) !important;
  color: #991b1b !important;
}
.option-btn.wrong .option-label {
  background: var(--danger);
  color: white;
}
.option-btn.disabled {
  pointer-events: none;
}

/* 解説ボックス */
.explanation-card {
  display: none;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  animation: slideUp 0.25s ease;
}
.explanation-card.active {
  display: block;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.result-header.correct {
  color: var(--accent);
}
.result-header.wrong {
  color: var(--danger);
}
.explanation-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-main);
  white-space: pre-wrap;
}

/* 詳細解説トグルボタン＆ボックス */
.btn-toggle-detail {
  width: 100%;
  background: white;
  border: 1.5px dashed var(--primary);
  color: var(--primary-dark);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  transition: all 0.2s ease;
}
.btn-toggle-detail:hover {
  background: var(--primary-light);
}
.btn-toggle-detail i.toggle-arrow {
  transition: transform 0.2s ease;
}
.btn-toggle-detail.expanded i.toggle-arrow {
  transform: rotate(180deg);
}

.detailed-explanation-box {
  display: none;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}
.detailed-explanation-box.active {
  display: block;
}

.detail-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.detail-sec-title {
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.detail-sec-step { color: #2563eb; }
.detail-sec-diagram { color: #7c3aed; }
.detail-sec-wrong { color: #dc2626; }
.detail-sec-tips { color: #d97706; }

.detail-diagram-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-top: 6px;
}

.detail-diagram-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.detail-sec-content {
  font-size: 0.85rem;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.next-action-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: none;
  transition: background 0.15s;
}
.next-action-btn:hover {
  background: var(--primary-dark);
}
.next-action-btn.active {
  display: block;
}

/* --- 結果サマリー --- */
.result-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.result-score-circle {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}
.score-number {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1;
}
.score-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}
.result-message {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}
.result-subtext {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* --- ダッシュボード --- */
.pass-rate-card {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.pass-rate-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 8px;
}
.pass-rate-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pass-rate-number {
  font-size: 3rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: -0.02em;
}
.pass-rate-grade {
  background: #38bdf8;
  color: #0f172a;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
}
.pass-rate-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  margin: 12px 0 8px 0;
  overflow: hidden;
}
.pass-rate-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  width: 0%;
  transition: width 0.8s ease;
}
.pass-rate-desc {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* 統計カード */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}
.stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 2px;
}

/* 分野別進捗 */
.field-progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.field-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.field-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.field-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.field-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.field-tech { background: #3b82f6; }
.field-manage { background: #10b981; }
.field-strategy { background: #f59e0b; }

/* マネタイズバナー */
.recommend-banner {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-badge {
  align-self: flex-start;
  background: #10b981;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.rec-title {
  font-size: 1rem;
  font-weight: 800;
  color: #065f46;
}
.rec-desc {
  font-size: 0.82rem;
  color: #047857;
  line-height: 1.45;
}
.rec-link-btn {
  align-self: flex-end;
  background: #059669;
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
  transition: background 0.15s;
}
.rec-link-btn:hover {
  background: #047857;
}

.recommend-banner.career {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(37, 99, 235, 0.3);
}
.recommend-banner.career .rec-badge { background: #2563eb; }
.recommend-banner.career .rec-title { color: #1e3a8a; }
.recommend-banner.career .rec-desc { color: #1d4ed8; }
.recommend-banner.career .rec-link-btn { background: #1d4ed8; }
.recommend-banner.career .rec-link-btn:hover { background: #1e40af; }

/* 設定 */
.setting-group {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-label {
  font-size: 0.92rem;
  font-weight: 600;
}
.setting-sub {
  font-size: 0.75rem;
  color: var(--text-sub);
}
.setting-input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

/* ボトムナビ（モバイル） */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px 10px 4px;
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex: 1;
  text-align: center;
}
.nav-item i {
  font-size: 1.15rem;
}
.nav-item.active {
  color: var(--primary);
  font-weight: 800;
}
.nav-item:active {
  transform: scale(0.92);
}

/* =================================================================
   💻 PC版 実践的レイアウト＆本番CBTモード（min-width: 768px）
   ================================================================= */
@media (min-width: 768px) {
  body {
    background-color: #0f172a; /* 本番CBTを意識した集中できるダーク背景 */
    padding: 20px 0;
  }

  #app-container {
    max-width: 1180px; /* PC時は1180pxの本格ワイドへ拡大 */
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
  }

  /* ヘッダーのPC拡張 */
  .app-header {
    padding: 14px 28px;
    background: #ffffff;
  }
  .app-title {
    font-size: 1.2rem;
  }
  .option-key-hint {
    display: inline-block; /* PCでは [1] [2] [3] [4] キーのショートカット案内を表示 */
  }

  /* PC時のメインレイアウト：2カラム（左：コンテンツ、右：ステータス＆分析） */
  .app-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    padding: 24px 28px 30px 28px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* タブパネルは左側メインエリアに配置（横幅の突き抜けを完全防止） */
  .tab-panel {
    grid-column: 1 / 2;
    min-width: 0;
    max-width: 100%;
  }

  /* PCサイドバー（右カラム常設ウィジェット：画面内に必ず収まる保護） */
  .pc-sidebar {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 340px;
  }

  /* ボトムナビをPC時は「ヘッダー直下」または「サイドバー」に統合 */
  .bottom-nav {
    position: static;
    max-width: 100%;
    background: #f8fafc;
    border-top: none;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    gap: 20px;
    padding: 10px 28px;
  }
  .nav-item {
    flex-direction: row;
    gap: 8px;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
  }
  .nav-item i {
    font-size: 1rem;
  }
  .nav-item.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
  }

  /* PC版 CBT演習画面の最適化 */
  .question-card {
    padding: 28px;
  }
  .question-text {
    font-size: 1.2rem;
    line-height: 1.75;
  }
  .option-btn {
    padding: 16px 20px;
    font-size: 1.05rem;
  }
  .quiz-timer-box {
    display: flex; /* PC時は本番用経過時間タイマーを常時表示 */
  }

  /* カテゴリグリッドをPC時は3列に展開 */
  .category-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  /* 統計カードをPC時は見やすく配置 */
  .stats-row {
    gap: 14px;
  }
  .stat-box {
    padding: 18px 12px;
  }
  .stat-val {
    font-size: 1.8rem;
  }
}

/* =================================================================
   🏆 科目A＆科目B 2大試験カード＆合格ボーダーライン スタイル
   ================================================================= */
.dual-exam-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .dual-exam-container {
    grid-template-columns: 1fr 1fr;
  }
}

.exam-track-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.exam-track-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.exam-track-card.track-a {
  border-top: 4px solid #2563eb;
}
.exam-track-card.track-b {
  border-top: 4px solid #10b981;
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.track-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.track-tag-a { background: #eff6ff; color: #1d4ed8; }
.track-tag-b { background: #ecfdf5; color: #047857; }

.track-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 4px;
}
.track-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 12px;
}
.track-border-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  background: #fffbeb;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 14px;
}

.track-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-btn-mock {
  width: 100%;
  background: var(--text-main);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.track-btn-mock:hover {
  background: #1e293b;
}
.track-btn-daily {
  width: 100%;
  background: var(--bg);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.track-btn-daily:hover {
  background: #e2e8f0;
}

/* ボーダーライン付きプログレスバー */
.border-progress-wrap {
  position: relative;
  width: 100%;
  height: 10px;
  background: var(--bg);
  border-radius: var(--radius-full);
  margin: 14px 0 10px 0;
  overflow: visible;
}
.border-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.border-progress-marker {
  position: absolute;
  top: -10px;
  bottom: -6px;
  width: 2px;
  background: #ef4444;
  z-index: 2;
}
.border-progress-flag {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ========================================================
   午後問題（科目B）言語切り替えセレクター＆コードブロック (v4.0)
   ======================================================== */
.quiz-lang-selector-box {
  margin-top: 16px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lang-selector-header {
  background: #1e293b;
  padding: 10px 14px;
  border-bottom: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .lang-selector-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.lang-tabs-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lang-tab-btn {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.lang-tab-btn:hover {
  background: #475569;
  color: white;
}

.lang-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: #60a5fa;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.lang-tab-btn[data-lang="pseudo"].active {
  background: #059669;
  border-color: #34d399;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.lang-tab-btn[data-lang="python"].active {
  background: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.lang-tab-btn[data-lang="javascript"].active {
  background: #d97706;
  border-color: #fbbf24;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

.lang-tab-btn[data-lang="java"].active {
  background: #dc2626;
  border-color: #f87171;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.lang-code-container {
  position: relative;
}

.lang-code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid #1e293b;
  font-size: 0.72rem;
  color: #94a3b8;
}

.lang-current-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-code {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-copy-code:hover {
  background: #334155;
  color: white;
}

.btn-copy-code.copied {
  background: #059669;
  color: white;
  border-color: #10b981;
}

.lang-code-pre {
  margin: 0;
  padding: 14px;
  background: #090d16;
  color: #e2e8f0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.lang-code-pre code {
  font-family: inherit;
  color: inherit;
}

.lang-info-guide {
  background: #1e293b;
  border-top: 1px solid #334155;
  padding: 9px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.lang-info-guide i {
  color: #fbbf24;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ========================================================
   学習日記＆解答ログ機能 (v4.0)
   ======================================================== */
.diary-header-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid #4338ca;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(49, 46, 129, 0.2);
}

.diary-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #c7d2fe;
}

.diary-header-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e0e7ff;
  margin-top: 6px;
}

.diary-today-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.diary-today-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.diary-today-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #a7f3d0;
}

.diary-today-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .diary-today-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-sub);
  font-weight: 600;
}

.metric-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
}

.metric-val.text-success { color: #059669; }
.metric-val.text-danger { color: #dc2626; }
.metric-val.text-primary { color: var(--primary); }

/* 日記メモ入力エリア */
.diary-memo-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.diary-memo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.diary-memo-textarea {
  width: 100%;
  min-height: 85px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  background: var(--bg);
  color: var(--text-main);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.diary-memo-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.diary-memo-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.diary-memo-status {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.btn-save-diary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

/* フィルタータブ */
.diary-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.diary-filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-sub);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.diary-filter-btn:hover {
  background: var(--bg);
  color: var(--text-main);
}

.diary-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 解答履歴タイムライン */
.diary-logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diary-log-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.diary-log-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.diary-log-item.is-wrong {
  border-left: 4px solid #ef4444;
}

.diary-log-item.is-correct {
  border-left: 4px solid #10b981;
}

.log-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-session-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-session-badge.badge-a {
  background: #eff6ff;
  color: #1d4ed8;
}

.log-session-badge.badge-b {
  background: #ecfdf5;
  color: #047857;
}

.log-timestamp {
  font-size: 0.7rem;
  color: #94a3b8;
}

.log-body-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-q-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-outcome-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.log-outcome-badge.correct {
  background: #ecfdf5;
  color: #059669;
}

.log-outcome-badge.wrong {
  background: #fef2f2;
  color: #dc2626;
}

.log-detail-row {
  font-size: 0.78rem;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.btn-review-q {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-review-q:hover {
  background: var(--primary-light);
  text-decoration: underline;
}

.diary-empty-state {
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-sub);
}

.diary-empty-state i {
  font-size: 2rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

/* ========================================================
   弱点傾向分析レポート＆リベンジ特訓 (v4.0)
   ======================================================== */
.weakness-analysis-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.weakness-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.weakness-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: #fef2f2;
  color: #b91c1c;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #fecaca;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.weakness-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weakness-item {
  background: #fff;
  border: 1px solid #fee2e2;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  border-left: 5px solid #ef4444;
}

.weakness-item.rank-1 {
  background: #fffdfd;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.weakness-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weakness-rank {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ef4444;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 3px;
}

.weakness-theme-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
}

.weakness-rate-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: #dc2626;
}

.weakness-advice {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #475569;
}

.btn-drill-weakness {
  align-self: flex-start;
  margin-top: 4px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-drill-weakness:hover {
  background: #ef4444;
  color: white;
}

.weakness-loading-box {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-sub);
}

.weakness-loading-box i {
  font-size: 1.8rem;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.weakness-action-box {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.btn-weakness-revenge {
  width: 100%;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-weakness-revenge:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-weakness-revenge:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #94a3b8;
  box-shadow: none;
}

/* 分野別マトリクス */
.category-matrix-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-matrix-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-matrix-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.cat-matrix-bar-bg {
  height: 8px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cat-matrix-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ========================================================
   問題復習モーダル
   ======================================================== */
.review-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.review-modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalScale 0.25s ease;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.modal-exam-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-sub);
  cursor: pointer;
  line-height: 1;
}

.review-modal-body {
  padding: 18px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-main);
}

.modal-question-text {
  font-weight: 700;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.modal-user-ans-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.modal-sec-heading {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-exp-text {
  font-size: 0.82rem;
  color: #334155;
  white-space: pre-wrap;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px;
}

.review-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.btn-modal-action {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-modal-cancel {
  background: white;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

/* ========================================================
   🎮 RPG風ゲーミフィケーション＆冒険マップ (v6.0)
   ======================================================== */

/* ヘッダー内ミニステータス */
.player-mini-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 2px 8px 2px 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-mini-status:hover {
  background: #e2e8f0;
}

.avatar-frame {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.header-lvl-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-lvl-text {
  font-size: 0.68rem;
  font-weight: 900;
  color: #1e293b;
  line-height: 1;
}

.header-exp-mini-bar {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  overflow: hidden;
}

.header-exp-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 2px;
  transition: width 0.3s;
}

/* プレイヤーステータスカード（冒険マップ上部） */
.player-hero-card {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border: 2px solid #6366f1;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
}

.player-hero-card::before {
  content: "★ RPG QUEST ★";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 0.65rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 2px;
}

.player-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 豪華進化アバターフレーム（Rank 1 〜 6） */
.avatar-stage-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-big-frame {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-big-icon {
  font-size: 2.2rem;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.avatar-rank-ribbon {
  position: absolute;
  bottom: -6px;
  background: #334155;
  color: white;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid #64748b;
  white-space: nowrap;
  z-index: 3;
}

/* Rank 1: ブロンズ木枠（見習い） */
.avatar-frame.rank-1, .avatar-big-frame.rank-1 {
  background: #78350f;
  border: 2.5px solid #d97706;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.3);
}

/* Rank 2: シルバー鉄兜（修業者） */
.avatar-frame.rank-2, .avatar-big-frame.rank-2 {
  background: #334155;
  border: 3px solid #cbd5e1;
  box-shadow: 0 0 12px rgba(203, 213, 225, 0.5);
}

/* Rank 3: ゴールド＆サファイア魔導書（覚醒者） */
.avatar-frame.rank-3, .avatar-big-frame.rank-3 {
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  border: 3px solid #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
}

/* Rank 4: プラチナ＆エメラルド聖騎士（防壁守護者） */
.avatar-frame.rank-4, .avatar-big-frame.rank-4 {
  background: linear-gradient(135deg, #065f46, #059669);
  border: 3px solid #34d399;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.7);
  animation: pulseGreen 3s infinite alternate;
}

/* Rank 5: ダイヤモンド＆ルビー王冠（覇王） */
.avatar-frame.rank-5, .avatar-big-frame.rank-5 {
  background: linear-gradient(135deg, #831843, #dc2626);
  border: 3.5px solid #f43f5e;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.8);
  animation: pulseRed 2.5s infinite alternate;
}

/* Rank 6: レインボー神話ドラゴン（FE制覇マスター） */
.avatar-frame.rank-6, .avatar-big-frame.rank-6 {
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  border: 4px solid #facc15;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.9), 0 0 15px rgba(236, 72, 153, 0.8);
  animation: rainbowGlow 4s linear infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(52, 211, 153, 0.5); }
  100% { transform: scale(1.04); box-shadow: 0 0 22px rgba(52, 211, 153, 0.9); }
}

@keyframes pulseRed {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(244, 63, 94, 0.6); }
  100% { transform: scale(1.05); box-shadow: 0 0 28px rgba(244, 63, 94, 1); }
}

@keyframes rainbowGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* プレイヤー情報テキスト */
.player-info-main {
  flex: 1;
}

.player-title-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  margin-bottom: 4px;
}

.player-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.player-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: white;
}

.player-lvl {
  font-size: 1.15rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* EXPバー */
.exp-bar-container {
  width: 100%;
}

.exp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-bottom: 3px;
  font-weight: 600;
}

.exp-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ステータス下部（デイリー宝箱など） */
.player-sub-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.sub-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-stat-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
}

.sub-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
}

.btn-daily-chest {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 4px 10px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-daily-chest:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-daily-chest:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.chest-icon {
  font-size: 1.3rem;
  animation: bounceChest 2s infinite ease-in-out;
}

@keyframes bounceChest {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.chest-title {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.chest-sub {
  font-size: 0.6rem;
  color: #fef3c7;
  line-height: 1.2;
}

/* ========================================================
   冒険ワールドマップ (World Map Container & Cards)
   ======================================================== */
.world-map-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding: 12px 0 12px 34px; /* 左側にタイムライン用の余白をしっかり確保！ */
}

/* タイムラインの縦点線（カードの左外側を通るため文字と絶対に重ならない！） */
.world-map-container::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 12px;
  width: 2px;
  border-left: 2px dashed #94a3b8;
  z-index: 1;
}

/* エリアカード本体（背景白・影・角丸を完全保証） */
.map-area-card,
.world-area-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  z-index: 2;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-area-card:hover,
.world-area-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* タイムライン上のステップノード（点線の上に正確に重なる丸アイコン） */
.map-area-card::before,
.world-area-card::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #64748b;
  z-index: 3;
  box-shadow: 0 0 0 3px #ffffff;
}

/* 状態別スタイル */
.map-area-card.cleared,
.world-area-card.cleared {
  border-color: #10b981;
  background: #f0fdf4 !important;
}

.map-area-card.cleared::before,
.world-area-card.cleared::before {
  border-color: #10b981;
  background: #10b981;
}

.map-area-card.active,
.world-area-card.active {
  border-color: #2563eb;
  background: #ffffff !important;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.15);
}

.map-area-card.active::before,
.world-area-card.active::before {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.map-area-card.locked,
.world-area-card.locked {
  background: #f8fafc !important;
  border-color: #e2e8f0;
  opacity: 0.88;
}

.map-area-card.locked::before,
.world-area-card.locked::before {
  border-color: #cbd5e1;
  background: #e2e8f0;
}

/* エリアヘッダー */
.map-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.area-badge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.area-num-badge {
  font-size: 0.72rem;
  font-weight: 900;
  background: #1e293b;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
}

.area-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pill.status-cleared {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.status-active {
  background: #dbeafe;
  color: #1d4ed8;
  animation: pulseActive 2s infinite;
}

.status-pill.status-locked {
  background: #f1f5f9;
  color: #64748b;
}

@keyframes pulseActive {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.map-area-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.map-area-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 12px 0;
}

/* プログレスバー */
.map-progress-wrap {
  margin-bottom: 12px;
}

.map-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.map-progress-bar-bg {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.map-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ボスゾーン */
.area-boss-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.boss-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.boss-tag {
  font-size: 0.68rem;
  font-weight: 800;
  background: #fee2e2;
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 4px;
}

.boss-rec-lv {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
}

.boss-box-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boss-icon-lg {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.boss-info {
  flex: 1;
}

.boss-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.boss-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.boss-hp-tag {
  font-size: 0.7rem;
  font-weight: 800;
  background: #fee2e2;
  color: #dc2626;
  padding: 1px 6px;
  border-radius: 4px;
}

.boss-quote {
  font-size: 0.74rem;
  color: #475569;
  font-style: italic;
  margin: 0;
  line-height: 1.35;
}

/* アクションボタン */
.map-area-actions {
  display: flex;
}

.btn-challenge-boss {
  width: 100%;
  padding: 9px 16px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-challenge-boss:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-challenge-boss.locked {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ========================================================
   ボスバトルモーダル演出
   ======================================================== */
.boss-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.boss-modal-content {
  background: #0f172a;
  border: 2px solid #ef4444;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  color: white;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
  overflow: hidden;
  animation: modalScale 0.25s ease;
}

.boss-modal-header {
  background: #1e293b;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.boss-skull {
  font-size: 0.7rem;
  font-weight: 900;
  color: #f87171;
  background: #450a0a;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.boss-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: white;
}

.boss-modal-body {
  padding: 24px 20px;
  text-align: center;
}

.boss-avatar-box {
  margin-bottom: 16px;
}

.boss-avatar-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.6));
  animation: floatBoss 3s infinite ease-in-out;
}

@keyframes floatBoss {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.boss-hp-bar-bg {
  width: 70%;
  height: 12px;
  background: #334155;
  border-radius: var(--radius-full);
  margin: 0 auto 6px auto;
  overflow: hidden;
  border: 1px solid #475569;
}

.boss-hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  border-radius: var(--radius-full);
  transition: width 0.4s;
}

.boss-hp-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fca5a5;
}

.boss-desc-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
  background: #1e293b;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
}

.boss-modal-footer {
  padding: 14px 18px;
  background: #1e293b;
  border-top: 1px solid #334155;
}

.btn-boss-fight {
  width: 100%;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.btn-boss-fight:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}





/* ==========================================================================
   ★ 新設：2大モード切替（シンプル / ゲーム）＆ 自動学習日誌 スタイル
   ========================================================================== */

/* --- 1. モード切替ピルスイッチ --- */
.mode-switch-pill {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px;
  margin: 0 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.mode-pill-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.mode-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(37,99,235,0.3);
}

.mode-pill-btn[data-mode="game"].active {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(124,58,237,0.35);
}

/* --- 2. シンプルモード (Focus Mode) --- */
body.mode-simple #header-player-status {
  display: none !important; /* RPGプレイヤーLvバッジを非表示にしてビジネスライクに */
}

/* ★所持ゴールドボタンはシンプルモードでは非表示、ゲームモードでのみ表示 */
body.mode-simple #header-gold-badge {
  display: none !important;
}
body.mode-game #header-gold-badge {
  display: inline-flex !important;
}

/* 工程マップ（nav-map）はシンプルモードでも全体の登山進捗として常時利用可能 */

body.mode-simple .game-only-content {
  display: none !important; /* ホーム画面等のゲーム専用ブロックを非表示 */
}

body.mode-simple .simple-only-content {
  display: block !important; /* シンプルモード専用の実戦分析サマリーを表示 */
}

body.mode-simple .game-battle-stage {
  display: none !important;
}

body.mode-simple .cbt-palette-container {
  margin-bottom: 12px;
}

body.mode-simple .question-card {
  border-left: 4px solid #2563eb;
  background: #ffffff;
}

body.mode-simple .quiz-option-btn {
  font-size: 0.95rem;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

body.mode-simple .quiz-option-btn:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

/* --- 3. ゲームモード (RPG Battle Mode) --- */
body.mode-game #header-player-status {
  display: flex !important; /* RPGプレイヤーLvバッジ・EXPゲージを表示 */
}

body.mode-game #nav-map {
  display: flex !important; /* ナビバーに「冒険マップ」を表示 */
}

body.mode-game .game-only-content {
  display: block !important; /* ホーム画面にRPG冒険ステータス＆ボス挑戦バナーを表示 */
}

body.mode-game .simple-only-content {
  display: none !important;
}

body.mode-game .game-battle-stage {
  display: block !important;
  margin-bottom: 14px;
}

.game-battle-stage {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 2px solid #8b5cf6;
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139,92,246,0.25);
  position: relative;
  overflow: hidden;
}

.enemy-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.enemy-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.enemy-img-box {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #1e293b;
  border: 2px solid #a855f7;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(168,85,247,0.4);
}

.enemy-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: enemyFloat 3s ease-in-out infinite;
}

.enemy-icon {
  font-size: 2rem;
  animation: enemyFloat 3s ease-in-out infinite;
}

@keyframes enemyFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.enemy-hit-effect {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.enemy-hit-effect.active {
  opacity: 1;
  transform: scale(1.1) translateY(-6px);
}

.enemy-info {
  flex: 1;
}

.enemy-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.enemy-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #e2e8f0;
}

.enemy-level {
  font-size: 0.72rem;
  font-weight: 700;
  background: #4c1d95;
  color: #c4b5fd;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #7c3aed;
}

.enemy-hp-bar-bg {
  width: 100%;
  height: 10px;
  background: #334155;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.enemy-hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.enemy-hp-text {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 3px;
  text-align: right;
  font-family: monospace;
}

.combo-badge-box {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(234,88,12,0.4);
  animation: comboPulse 0.8s ease-in-out infinite alternate;
}

.combo-number {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.combo-text {
  font-size: 0.6rem;
  font-weight: 800;
}

@keyframes comboPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* --- 4. 自動学習日誌カード スタイル --- */
.diary-auto-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.auto-summary-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.overall-progress-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.progress-percent {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2563eb;
}

.overall-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}

.overall-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.progress-sub-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #64748b;
}

.diary-player-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .diary-player-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.diary-stat-badge {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.diary-stat-badge .badge-lbl {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.diary-stat-badge .badge-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

/* マナブからの自動フィードバック */
.manabu-feedback-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(5,150,105,0.06);
}

.manabu-avatar-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.manabu-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(5,150,105,0.25);
}

.manabu-meta {
  display: flex;
  flex-direction: column;
}

.manabu-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #065f46;
}

.manabu-tag {
  font-size: 0.68rem;
  color: #059669;
  font-weight: 600;
}

.manabu-message {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #0f172a;
  background: rgba(255,255,255,0.7);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #059669;
}

/* =========================================================================
   全7大資格セレクター ポータル スタイル
   ========================================================================= */
.exam-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.exam-card-item {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.exam-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.exam-card-item.active-selected {
  border-color: #2563eb !important;
  box-shadow: 0 8px 24px rgba(37,99,235,0.18) !important;
  background: #f8fafc;
}

.exam-card-item.active-selected::after {
  content: '選択中';
  position: absolute;
  top: -9px;
  right: 12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(37,99,235,0.3);
}

/* =========================================================================
   ポータルモード用：ナビゲーションロック ＆ ガイドスタイル
   ========================================================================= */
.nav-item.is-locked {
  opacity: 0.55;
  position: relative;
  transition: all 0.2s ease;
}

.nav-item.is-locked::after {
  content: "🔒";
  font-size: 0.65rem;
  position: absolute;
  top: 6px;
  right: 10px;
  opacity: 0.7;
}

.nav-item.is-locked:hover {
  opacity: 0.9;
  background: rgba(37, 99, 235, 0.05);
}

/* ポータルカードのパルスアニメーション（誘導時） */
@keyframes portalPulseHighlight {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(37, 99, 235, 0); }
  50% { transform: scale(1.02); box-shadow: 0 0 22px rgba(37, 99, 235, 0.45); border-color: #2563eb !important; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(37, 99, 235, 0); }
}

.portal-pulse-highlight {
  animation: portalPulseHighlight 0.85s ease-in-out !important;
}

/* トースト通知 */
.app-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-toast i {
  color: #38bdf8;
  font-size: 1.1rem;
}

/* =========================================================================
   登山工程ロードマップ（山頂合格ビュー）スタイル（超大型・高視認性版）
   ========================================================================= */
.mountain-roadmap-card {
  position: relative;
  width: 100%;
  min-height: 720px;
  height: 720px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.6);
  background-image: url('assets/roadmap/mountain_roadmap_bg.jpg');
  background-size: cover;
  background-position: center bottom;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .mountain-roadmap-card {
    min-height: 580px;
    height: 580px;
  }
}

.mountain-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.65) 0%, rgba(15, 23, 42, 0) 18%, rgba(15, 23, 42, 0) 85%, rgba(15, 23, 42, 0.15) 100%);
  display: flex;
  flex-direction: column;
  padding: 22px 20px 16px;
  color: #ffffff;
}

.mountain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
}

.mountain-title-box {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mountain-title-box h2 {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 4px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mountain-title-box p {
  font-size: 0.8rem;
  margin: 0;
  color: #e0f2fe;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.mountain-summit-target-badge {
  background: rgba(245, 158, 11, 0.95);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 広大な登山ルートレイヤー */
.mountain-route-layer {
  position: relative;
  width: 100%;
  flex: 1;
  height: calc(100% - 60px);
}

/* つづら折り登山ルートSVGパス */
.mountain-trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ★工程マップ：行き先（登山口から山頂ゴール）へ流れる光の登山道アニメーション */
@keyframes mountain-trail-glow-dash {
  to {
    stroke-dashoffset: -100;
  }
}

.mountain-route-line-pulse {
  stroke-dasharray: 14 10;
  animation: mountain-trail-glow-dash 12s linear infinite;
  filter: drop-shadow(0 0 6px rgba(254, 240, 138, 0.95)) drop-shadow(0 0 12px rgba(234, 179, 8, 0.7));
}

/* 各合目ピン */
.station-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.station-pin:hover {
  transform: translate(-50%, -55%) scale(1.12);
  z-index: 15;
}

.station-pin-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: all 0.25s ease;
}

.station-pin.passed .station-pin-icon {
  background: #10b981;
  border-color: #a7f3d0;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.7);
}

.station-pin.summit .station-pin-icon {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  border-color: #fef08a;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.85);
}

/* ロックされた合目ピン */
.station-pin.locked {
  cursor: not-allowed !important;
  opacity: 0.62;
  filter: grayscale(40%);
}

.station-pin.locked .station-pin-icon {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: #64748b !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

.station-pin.locked .station-pin-label {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

.station-pin.locked:hover {
  transform: translate(-50%, -50%) !important;
}

.station-pin.locked:hover .station-pin-icon {
  transform: none !important;
  border-color: #64748b !important;
  box-shadow: none !important;
}

.station-pin-label {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
  min-width: 82px;
}

.pin-stage-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.pin-topic-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  line-height: 1.2;
}

.station-pin.summit .station-pin-label {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.95), rgba(146, 64, 14, 0.95));
  border-color: #fde047;
  padding: 5px 12px;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.6);
}

.station-pin.summit .pin-stage-badge {
  color: #fef08a;
}

.station-pin.summit .pin-topic-badge {
  font-size: 0.76rem;
  font-weight: 800;
}

/* ★各合目ホバー時の「ここのステージにいく」アクションポップアップ */
.stage-action-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 250px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  color: #0f172a;
  text-align: left;
}

/* 画面下部のピンは上向きに展開してはみ出し防止 */
.station-pin.popup-up .stage-action-popup {
  top: auto;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(-8px);
}

.station-pin:hover .stage-action-popup,
.station-pin.active-popup .stage-action-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.station-pin:hover {
  z-index: 120 !important;
}

.stage-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.stage-popup-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
}
.stage-popup-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}
.stage-popup-tag.border {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.stage-popup-tag.summit {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}
.stage-popup-topic {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.35;
}
.stage-popup-desc {
  font-size: 0.73rem;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.4;
}
.stage-popup-btn {
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
}
.stage-popup-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}
.stage-popup-btn:active {
  transform: translateY(0);
}

/* 現在地ピン（登山者アバター） */
.climber-current-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 30;
  pointer-events: none;
  transition: left 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), top 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.climber-tooltip {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
  margin-bottom: 12px;
  animation: bounceClimber 2.2s infinite ease-in-out;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #93c5fd;
}

.climber-avatar-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  position: relative;
}

.climber-pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  animation: pulseRing 1.8s infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes bounceClimber {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* =========================================================================
   独立型 登山計・高度計ダッシュボードカード（画像の下に配置）
   ========================================================================= */
.mountain-altimeter-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.mountain-altimeter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mountain-altimeter-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mountain-progress-wrap {
  width: 100%;
  margin-bottom: 16px;
}

.mountain-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 700;
  margin-bottom: 12px;
}

.mountain-progress-bg {
  width: 100%;
  height: 12px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.mountain-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 55%, #f59e0b 100%);
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mountain-altimeter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.altimeter-stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.altimeter-lbl {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.altimeter-val {
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--text-main);
}

.altimeter-val.highlight {
  color: #d97706;
}

.altimeter-val.success {
  color: #059669;
}






/* ==========================================================================
   RPG冒険ワールドマップ（完全新規・はみ出しゼロ設計）
   ========================================================================== */
.rpg-worldmap-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.35), 0 0 0 2px rgba(234, 179, 8, 0.4);
  margin-bottom: 22px;
  background-color: #0f172a;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.rpg-worldmap-header-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(234, 179, 8, 0.3);
  z-index: 10;
}

.rpg-map-title-box h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpg-map-title-box p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.rpg-worldmap-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  background-image: url('assets/rpg/rpg_world_map_masterpiece.jpg?v=70.0');
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.55), 0 10px 28px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(217, 119, 6, 0.45);
}

@keyframes route-glow-dash {
  to {
    stroke-dashoffset: -100;
  }
}

.rpg-route-line-pulse {
  stroke-dasharray: 8 6;
  animation: route-glow-dash 20s linear infinite;
}

.rpg-route-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.rpg-boss-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 6;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rpg-boss-pin:hover {
  transform: translate(-50%, -58%) scale(1.12);
  z-index: 12;
}

.rpg-boss-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid #64748b;
  background: #0f172a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rpg-boss-pin.unlocked .rpg-boss-badge {
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.7);
}

.rpg-boss-pin.active-target .rpg-boss-badge {
  border-color: #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.95), 0 0 40px rgba(245, 158, 11, 0.6);
  animation: targetPulse 1.4s ease-in-out infinite alternate;
}

@keyframes targetPulse {
  0% { transform: scale(1); box-shadow: 0 0 18px rgba(239, 68, 68, 0.8); }
  100% { transform: scale(1.08); box-shadow: 0 0 28px rgba(239, 68, 68, 1), 0 0 45px rgba(245, 158, 11, 0.8); }
}

.rpg-boss-pin.cleared .rpg-boss-badge {
  border-color: #eab308;
  background: #1e1b4b;
  box-shadow: 0 0 22px rgba(234, 179, 8, 0.85), inset 0 0 10px rgba(234, 179, 8, 0.5);
}
.rpg-boss-pin.cleared:hover .rpg-boss-badge {
  box-shadow: 0 0 28px rgba(234, 179, 8, 1);
}

.rpg-boss-pin.locked {
  opacity: 0.7;
  filter: grayscale(40%);
}
.rpg-boss-pin.locked .rpg-boss-badge {
  border-color: #64748b;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.rpg-boss-pin.demonlord .rpg-boss-badge {
  width: 68px;
  height: 68px;
  border-color: #eab308;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.85), 0 0 35px rgba(220, 38, 38, 0.6);
}

.rpg-boss-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rpg-boss-label {
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.rpg-boss-pin.unlocked .rpg-boss-label {
  border-color: #ef4444;
  color: #fca5a5;
}

.rpg-boss-pin.cleared .rpg-boss-label {
  border-color: #eab308;
  color: #fef08a;
  background: rgba(26, 20, 5, 0.95);
}

.rpg-boss-pin.cleared .rpg-boss-label {
  border-color: #10b981;
  color: #6ee7b7;
}

.rpg-hero-current-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 15;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.rpg-hero-tooltip {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: 1.5px solid #60a5fa;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  margin-bottom: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.6);
  animation: heroBounce 1.8s infinite ease-in-out;
  position: absolute;
  bottom: 50px;
  left: 0;
  transform: translateX(-15%);
}

.rpg-hero-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e3a8a;
  border: 3px solid #facc15;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.85), 0 4px 14px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
}

.rpg-hero-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

  50% { transform: translateY(-6px); }
}

/* 勇者ステータス＆装備インベントリ */
.rpg-inventory-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.rpg-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 14px;
}

.rpg-inv-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpg-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.rpg-inv-slot {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.rpg-inv-slot.legendary {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.rpg-slot-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #0f172a;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.rpg-inv-slot.legendary .rpg-slot-icon-wrap {
  border-color: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
}

.rpg-slot-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rpg-slot-info {
  flex: 1;
}

.rpg-slot-cat {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.rpg-slot-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  margin: 2px 0;
}

.rpg-slot-stat {
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
}


/* ==========================================================================
   RPGサイドバーステータス＆大マップ/詳細ステージ攻略＆トコトコ歩行
   ========================================================================== */

/* 1. 右サイドバー：勇者ステータス＆クリアバッジカード */
.rpg-side-status-card {
  background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #eab308;
  border-radius: var(--radius-lg);
  padding: 16px;
  color: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 14px rgba(234, 179, 8, 0.2);
}

.rpg-side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rpg-side-badge-lvl {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 3px 12px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.5);
}

.rpg-side-rank-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #a5b4fc;
}

.rpg-side-stage-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.rpg-side-stage-lbl {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 700;
}

.rpg-side-stage-val {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.rpg-stage-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
}

.rpg-stage-denom {
  font-size: 0.85rem;
  font-weight: 800;
  color: #cbd5e1;
}

.rpg-stage-badge {
  margin-left: auto;
  background: #059669;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.rpg-side-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.rpg-side-stat {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.rpg-side-stat .lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  display: block;
}

.rpg-side-stat .val {
  font-size: 1rem;
  font-weight: 900;
  color: #f8fafc;
}

.rpg-side-equip-preview {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rpg-side-equip-preview .equip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #e2e8f0;
}

/* 2. 大マップ ⇄ 詳細ステージマップの切り替えタブ */
.rpg-view-mode-tabs {
  display: flex;
  background: #0f172a;
  border-bottom: 1px solid rgba(234, 179, 8, 0.3);
  padding: 8px 16px;
  gap: 10px;
}

.rpg-view-tab-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rpg-view-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.rpg-view-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.rpg-tab-key-badge {
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 900;
}

/* 3. 詳細ステージ攻略マップ（ダンジョン・ツリー） */
.rpg-detail-stage-viewport {
  background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
  padding: 24px 20px;
  min-height: 480px;
  box-sizing: border-box;
}

.rpg-detail-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(234, 179, 8, 0.3);
}

.rpg-detail-area-badge {
  background: #eab308;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 4px;
}

.rpg-detail-stage-title-wrap h3 {
  margin: 6px 0 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.rpg-btn-back-world {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rpg-btn-back-world:hover {
  background: #334155;
  border-color: #94a3b8;
}

/* 小ステージツリー（鍵解除進行） */
.rpg-stage-nodes-tree {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.rpg-stage-card {
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rpg-stage-card.unlocked {
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
  cursor: pointer;
}

.rpg-stage-card.unlocked:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: #facc15;
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.35);
}

.rpg-stage-card.cleared {
  border-color: #10b981;
  background: rgba(6, 78, 59, 0.4);
}

.rpg-stage-card.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.rpg-stage-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rpg-stage-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #0f172a;
  border: 2px solid #64748b;
  flex-shrink: 0;
}

.rpg-stage-card.unlocked .rpg-stage-icon-circle {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.rpg-stage-card.cleared .rpg-stage-icon-circle {
  border-color: #10b981;
  background: #064e3b;
}

.rpg-stage-info .title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.rpg-stage-info .desc {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 3px;
}

.rpg-stage-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpg-key-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.rpg-key-status.locked {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #475569;
}

.rpg-key-status.unlocked {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

.rpg-key-status.cleared {
  background: #059669;
  color: #ffffff;
}

.rpg-btn-challenge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.82rem;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
  white-space: nowrap;
}

.rpg-btn-challenge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.6);
}

/* 4. シンプルモード：登山者トコトコ歩行移動アニメーション */
.station-pin {
  cursor: pointer;
}

.station-pin:hover .station-pin-icon {
  transform: scale(1.25);
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
}

/* トコトコ歩行中の足踏みキーフレーム */
@keyframes tocotocoWalk {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-8deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-8px) rotate(8deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.climber-current-pin.is-walking .climber-avatar-bubble {
  animation: tocotocoWalk 0.35s infinite ease-in-out;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.9), 0 0 40px rgba(56, 189, 248, 0.8);
}

.climber-current-pin {
  transition: left 1.2s cubic-bezier(0.4, 0, 0.2, 1), top 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   ★★★ モサ＆フサ RPGアバター ＆ 5大装備スロット (v30.0) ★★★
   ======================================================== */

/* 1. サイドバー：キャラクターアバター表示 */
.rpg-side-char-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.rpg-side-avatar-box {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #d97706);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rpg-side-avatar-box:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.8);
}

.rpg-side-avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f172a;
  display: block;
}

.rpg-side-char-switch-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  border: 1.5px solid #0f172a;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.rpg-side-char-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rpg-side-char-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.03em;
}

.rpg-side-rank-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. サイドバー：5大装備プレビュー */
.rpg-side-equip-preview-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.equip-5-item {
  position: relative;
  aspect-ratio: 1;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.equip-5-item:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.equip-5-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rpg-side-equip-active-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. メインエリア：冒険者インベントリヘッダー */
.rpg-inv-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rpg-inv-avatar-mini {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.rpg-inv-avatar-mini img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0f172a;
}

.rpg-inv-avatar-mini .avatar-tag-switch {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 9999px;
  border: 1px solid #fff;
}

.rpg-job-title-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-left: 8px;
}

.rpg-inv-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 3px;
}

.rpg-inv-power-badge {
  font-size: 0.8rem;
  font-weight: 900;
  color: #34d399;
  background: rgba(6, 78, 59, 0.4);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* 4. メインエリア：5大装備カードグリッド */
.rpg-inv-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.rpg-inv-slot {
  background: #0f172a;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.rpg-inv-slot:hover {
  transform: translateY(-3px);
}

.rpg-slot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rpg-slot-cat {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
}

.rpg-rarity-pill {
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.rpg-slot-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpg-slot-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.rpg-slot-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rpg-slot-info {
  min-width: 0;
  flex: 1;
}

.rpg-slot-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpg-slot-stat {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
}

/* レアリティ別装飾スタイル */
.rpg-inv-slot.rarity-common {
  border: 1.5px solid #334155;
}
.rpg-inv-slot.rarity-common .rpg-rarity-pill {
  background: #334155;
  color: #cbd5e1;
}

.rpg-inv-slot.rarity-rare {
  border: 1.5px solid #0284c7;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.25);
}
.rpg-inv-slot.rarity-rare .rpg-rarity-pill {
  background: #0369a1;
  color: #e0f2fe;
}
.rpg-inv-slot.rarity-rare .rpg-slot-name {
  color: #7dd3fc;
}

.rpg-inv-slot.rarity-epic {
  border: 1.5px solid #9333ea;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.35);
}
.rpg-inv-slot.rarity-epic .rpg-rarity-pill {
  background: #7e22ce;
  color: #f3e8ff;
}
.rpg-inv-slot.rarity-epic .rpg-slot-name {
  color: #d8b4fe;
}

.rpg-inv-slot.rarity-master {
  border: 1.5px solid #e11d48;
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.35);
}
.rpg-inv-slot.rarity-master .rpg-rarity-pill {
  background: #be123c;
  color: #ffe4e6;
}
.rpg-inv-slot.rarity-master .rpg-slot-name {
  color: #fda4af;
}

.rpg-inv-slot.rarity-legendary {
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
}
.rpg-inv-slot.rarity-legendary .rpg-rarity-pill {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}
.rpg-inv-slot.rarity-legendary .rpg-slot-name {
  color: #fef08a;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.5);
}


/* ==========================================================================
   v31.0: 冒険攻略マニュアル・Webアプリ使い方ガイド・キャラ選択/作成・よろず屋・Gold
   ========================================================================== */

/* 所持ゴールドバッジ（ヘッダー） */
.gold-coin-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border: 1px solid #f59e0b !important;
  color: #b45309 !important;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.82rem;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.gold-coin-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

/* ゴールド獲得トースト */
.gold-toast-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #fbbf24;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  z-index: 10000;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: goldToastIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), goldToastOut 0.4s ease 2.6s forwards;
}
@keyframes goldToastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes goldToastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* モーダル共通オーバーレイ */
.app-guide-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.app-guide-modal-overlay.active {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.app-guide-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
}
@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.app-guide-modal-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #334155;
}
.app-guide-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.app-guide-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.app-guide-modal-close:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

.app-guide-tab-nav {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 16px;
  overflow-x: auto;
  gap: 8px;
}
.app-guide-tab-btn {
  padding: 12px 18px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-guide-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #ffffff;
}

.app-guide-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.65;
}

/* ガイド内共通UIパーツ */
.guide-section-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.guide-section-block h3 {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-highlight-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.guide-step-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.guide-step-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
}
.guide-step-card.active-step {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.guide-step-num {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 6px;
}
.guide-step-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.guide-step-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}

/* ガイド用テーブル */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-top: 8px;
}
.guide-table th {
  background: #e2e8f0;
  color: #1e293b;
  padding: 8px 12px;
  font-weight: 800;
  text-align: left;
}
.guide-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

/* キャラクター選択モーダル専用 */
.char-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.char-card-item {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.char-card-item:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}
.char-card-item.selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}
.char-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 10px auto;
  overflow: hidden;
  border: 3px solid #fbbf24;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.char-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-card-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 2px;
}
.char-card-job {
  font-size: 0.75rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 6px;
}
.char-card-trait {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
}

/* カスタムマイキャラ作成フォーム */
.custom-maker-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 20px;
  color: #ffffff;
}
.custom-maker-flex {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.custom-preview-box {
  text-align: center;
  flex: 0 0 130px;
}
.custom-preview-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  margin: 0 auto 8px auto;
  overflow: hidden;
}
.custom-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.custom-controls-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.custom-input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 4px;
}
.custom-input-group input,
.custom-input-group select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #475569;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
}
.custom-save-btn {
  margin-top: 14px;
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* よろず屋（ショップ）モーダル専用 */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.shop-item-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}
.shop-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.shop-item-top {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.shop-item-icon {
  font-size: 2rem;
  background: #f1f5f9;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shop-item-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 2px;
}
.shop-item-effect {
  font-size: 0.78rem;
  color: #2563eb;
  font-weight: 700;
}
.shop-item-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.4;
}
.shop-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shop-item-price {
  font-size: 0.95rem;
  font-weight: 900;
  color: #b45309;
}
.shop-item-buy-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}
.shop-item-buy-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* クイックツールバー（ワールドマップ上部用） */
.rpg-quick-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rpg-quick-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.rpg-quick-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.rpg-quick-btn.gold-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.5));
  border-color: #f59e0b;
  color: #fef08a;
}

/* ========================================================
   ★ メダル＆トロフィー 栄光の殿堂 スタイル
   ======================================================== */
.trophy-item-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.trophy-item-card.unlocked {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffdf5, #fefce8);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}
.trophy-item-card.locked {
  opacity: 0.65;
  filter: grayscale(0.7);
  background: #f8fafc;
}
.trophy-icon-wrap {
  width: 58px;
  height: 58px;
  margin: 0 auto 8px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  transition: all 0.3s ease;
}
.trophy-item-card.unlocked .trophy-icon-wrap {
  background: radial-gradient(circle, #fef08a, #f59e0b);
  border-color: #d97706;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
  animation: trophyShine 3s infinite ease-in-out;
}
@keyframes trophyShine {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.18); }
}
.trophy-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}
.trophy-condition {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
}
.trophy-status-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}
.trophy-status-badge.unlocked {
  background: #22c55e;
  color: #ffffff;
}
.trophy-status-badge.locked {
  background: #cbd5e1;
  color: #475569;
}

/* メダル棚カード */
.medal-item-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.medal-item-card.unlocked {
  border-color: #eab308;
  background: linear-gradient(135deg, #ffffff, #fffbeb);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.18);
}
.medal-item-card.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
  background: #f8fafc;
}
.medal-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
}
.medal-item-card.unlocked .medal-icon-circle {
  background: radial-gradient(circle, #fef9c3, #facc15);
  border-color: #ca8a04;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.4);
}
.medal-info {
  flex: 1;
  min-width: 0;
}
.medal-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.medal-desc {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
}

/* 結果画面アクションボタン（常に確実に押せる安全スタイル） */
.result-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 18px !important;
  border-radius: 12px !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
  outline: none !important;
}
.result-action-btn:hover {
  transform: translateY(-2px) scale(1.02) !important;
  filter: brightness(1.06) !important;
}
.result-action-btn:active {
  transform: translateY(1px) scale(0.98) !important;
  filter: brightness(0.94) !important;
}

/* =========================================================================
   ★★★ 学習日記カレンダー ＆ 時間メトリクス ＆ 忘却曲線 ＆ 目標設定 ★★★
   ========================================================================= */

/* 1. 時間メトリクスカード */
.study-time-dashboard {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.time-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.time-metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.time-metric-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.time-metric-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  display: block;
  margin-bottom: 4px;
}

.time-metric-val {
  font-size: 1.35rem;
  font-weight: 900;
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  line-height: 1.2;
}

.time-metric-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

/* 2. マスター達成予測日バナー */
.master-forecast-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.forecast-text-col {
  flex: 1;
  min-width: 240px;
}

.forecast-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.forecast-main-date {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
  color: #fef08a;
}

.forecast-detail-desc {
  font-size: 0.8rem;
  opacity: 0.92;
  line-height: 1.4;
  margin: 0;
}

/* 3. 学習日記インタラクティブ月間カレンダー */
.study-calendar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

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

.calendar-month-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-nav-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-nav-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  padding: 6px 0;
}

.cal-weekday.sun { color: #ef4444; }
.cal-weekday.sat { color: #3b82f6; }

.cal-day-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 64px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.cal-day-cell:hover {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateY(-1px);
}

.cal-day-cell.other-month {
  opacity: 0.35;
  background: #f8fafc;
  cursor: default;
}

.cal-day-cell.is-today {
  border: 2px solid #2563eb !important;
  background: #eff6ff;
}

.cal-day-cell.is-selected {
  border-color: #059669 !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 2px rgba(5,150,105,0.2);
}

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e293b;
}

.cal-study-pill {
  background: #10b981;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 9999px;
  line-height: 1;
  margin-top: 2px;
  white-space: nowrap;
}

.cal-study-time {
  font-size: 0.62rem;
  font-weight: 700;
  color: #047857;
  margin-top: 2px;
}

/* 4. 忘却曲線アラート ＆ 間隔反復特訓カード */
.ebbinghaus-alert-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(245,158,11,0.12);
}

.ebbinghaus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.ebbinghaus-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ebbinghaus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ebbinghaus-item {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* 5. 過去間違い問題バンク（クリーン状態リベンジ） */
.wrong-bank-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.wrong-bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.wrong-bank-item {
  background: #fff;
  border: 1px solid #fee2e2;
  border-left: 4px solid #ef4444;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.wrong-bank-item:hover {
  box-shadow: 0 4px 12px rgba(239,68,68,0.08);
}

/* 6. 目標設定（合格ペースメーカー）タブ専用スタイル */
.goal-pace-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.pace-sim-meter {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
}

.pace-diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pace-diff-badge.on-track {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.pace-diff-badge.needs-boost {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* 7. スキマ時間・実施時間帯アナライザー */
.study-charts-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

.study-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.chart-panel-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-panel-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-svg-wrap {
  width: 100%;
  height: auto;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ========================================================
   アプリ改善要望＆開発ロードマップ スタイル
   ======================================================== */
.fb-nav-tab {
  transition: all 0.2s ease;
}
.fb-nav-tab:hover {
  background: #f8fafc !important;
}
.fb-nav-tab.active {
  border-bottom: 3px solid #16a34a !important;
  color: #16a34a !important;
  font-weight: 800 !important;
}

.fb-filter-pill {
  padding: 5px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.fb-filter-pill:hover {
  background: #e2e8f0;
}
.fb-filter-pill.active {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.fb-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.fb-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.fb-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.fb-card-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fb-cat-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.fb-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fb-status-reviewing {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.fb-status-in_progress {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.fb-status-custom {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.fb-status-completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.fb-status-rejected {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.fb-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.fb-card-body {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.55;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-admin-reply-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #86efac;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.fb-admin-reply-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.fb-admin-reply-text {
  color: #14532d;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.fb-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fb-vote-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}
.fb-vote-btn.has-voted {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}
.fb-vote-btn.has-voted i {
  color: #ef4444;
}

/* ========================================================
   グランバザール（お城ハウジング ＆ 装備着せ替え）スタイル
   ======================================================== */
.shop-tab-btn {
  transition: all 0.2s ease;
}
.shop-tab-btn:hover {
  background: #f8fafc;
}
.shop-tab-btn.active {
  border-bottom: 3px solid #f59e0b !important;
  color: #b45309 !important;
}

.shop-castles-grid,
.shop-equips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.shop-castle-card,
.shop-equip-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.shop-castle-card:hover,
.shop-equip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.shop-castle-card.is-dwelling,
.shop-equip-card.is-equipped {
  border: 2px solid #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.shop-castle-card.is-locked-card {
  opacity: 0.88;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.shop-castle-card.is-locked-card .castle-card-thumb {
  filter: grayscale(35%) contrast(90%);
}

.btn-castle-filter:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

.castle-card-thumb-wrap {
  width: 100%;
  height: 140px;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}
.castle-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.shop-castle-card:hover .castle-card-thumb {
  transform: scale(1.05);
}

.castle-card-badge-dwelling {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.castle-card-tier-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.castle-card-body,
.equip-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.castle-card-title,
.equip-card-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.castle-card-desc,
.equip-card-desc {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 10px 0;
  flex: 1;
}

.castle-card-perks {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.74rem;
  color: #1e293b;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.castle-card-footer,
.equip-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.castle-price-tag,
.equip-price-tag {
  font-size: 1.05rem;
  font-weight: 900;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-castle-action,
.btn-equip-action {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
.btn-castle-action.buy,
.btn-equip-action.buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}
.btn-castle-action.dwell,
.btn-equip-action.equip {
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1d4ed8;
}
.btn-castle-action.is-current,
.btn-equip-action.is-current {
  background: #dcfce7;
  border: 1.5px solid #10b981;
  color: #047857;
  cursor: default;
}

/* 装備カード専用 */
.equip-card-thumb-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.equip-card-icon-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #0f172a;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.equip-card-badge-cat {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

/* レアリティ別オーラとボーダー */
.rarity-common { border-color: #cbd5e1; }
.rarity-rare { border-color: #60a5fa; }
.rarity-epic { border-color: #c084fc; }
.rarity-master { border-color: #f43f5e; }
.rarity-legendary { border-color: #fbbf24; }
.rarity-god { border-color: #38bdf8; box-shadow: 0 0 16px rgba(56, 189, 248, 0.35); }

/* 神聖オーラパルス */
@keyframes heroAuraPulse {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 30px rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
}
.hero-has-aura {
  animation: heroAuraPulse 2.5s infinite ease-in-out !important;
}

/* ========================================================
   v32.0: キャラクター全体像（全身立ち絵）＆5大装備イラスト連動ステージ
   ======================================================== */
.rpg-fullbody-stage-container {
  position: relative;
  background: radial-gradient(circle at 50% 55%, rgba(56, 189, 248, 0.16) 0%, rgba(15, 23, 42, 0.8) 85%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  min-height: 220px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* 装備スロット */
.equip-stage-slot {
  width: 52px;
  height: 52px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.equip-stage-slot:hover {
  transform: scale(1.08);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
.equip-stage-slot img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.equip-slot-tag {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #0284c7;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* 中央の立ち絵ラッパー */
.rpg-fullbody-hero-wrapper {
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 210px;
}
.rpg-fullbody-hero-wrapper img {
  max-height: 210px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rpg-fullbody-hero-wrapper:hover img {
  transform: translateY(-4px) scale(1.03);
}

/* キャラクター選択モーダルの全身立ち絵サムネイルカード */
.char-card-full-thumb {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
  margin-bottom: 10px;
  border: 1.5px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
}
.char-card-full-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transition: transform 0.3s ease;
}
.char-card-item:hover .char-card-full-thumb img {
  transform: scale(1.05);
}
.char-thumb-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.char-card-item {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.char-card-item:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15);
}
.char-card-item.selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}
.char-card-name {
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 2px;
}
.char-card-job {
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 6px;
}
.char-card-trait {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
  margin-top: auto;
}

/* ========================================================
   v33.0: カレンダー予定・試験日・目標登録システム
   ======================================================== */
.cal-event-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cal-event-badge.exam {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: 1px solid #f87171;
  animation: pulseExamBadge 2s infinite ease-in-out;
}
@keyframes pulseExamBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1); }
}
.cal-event-badge.mock {
  background: #f59e0b;
  color: #fff;
  border: 1px solid #d97706;
}
.cal-event-badge.goal {
  background: #3b82f6;
  color: #fff;
  border: 1px solid #2563eb;
}
.cal-event-badge.memo {
  background: #8b5cf6;
  color: #fff;
  border: 1px solid #7c3aed;
}

.cal-type-btn {
  padding: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.cal-type-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.cal-type-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.cal-quick-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 9999px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}
.cal-quick-tag:hover {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #38bdf8;
}

.cal-day-cell.has-event {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
.cal-day-cell.has-exam {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

/* ========================================================
   ★ マイホーム・詳細ステータス専用画面（城塞ハウジング＆マルチ資格Lvボード）
   ======================================================== */
@keyframes hero-relaxing {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes bubble-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.home-stage-hero-img {
  animation: hero-relaxing 4.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.75));
}

.home-relax-bubble {
  animation: bubble-float 3s ease-in-out infinite;
}

.home-qual-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-qual-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #38bdf8 !important;
}




/* ==========================================
 * ★キラー復習機能：クイック演習モードバー＆ブックマークボタン
 * ========================================== */
.quick-review-mode-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 12px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.btn-quick-mode-pill {
  transition: all 0.2s ease;
  user-select: none;
}
.btn-quick-mode-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
.btn-quick-mode-pill.active {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  font-weight: 900;
}
#btn-quick-mode-wrong.has-items {
  animation: pulse-wrong-alert 2s infinite ease-in-out;
}
@keyframes pulse-wrong-alert {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }
}
#btn-quiz-bookmark {
  transition: all 0.2s ease;
}
#btn-quiz-bookmark:hover {
  transform: scale(1.04);
}
#btn-quiz-bookmark.bookmarked {
  border-color: #f59e0b !important;
  background: #fef3c7 !important;
  color: #b45309 !important;
}

/* ==========================================================================
   ★キラー暗記機能：赤シート風アクティブリコール暗記モード
   ========================================================================== */
.red-sheet-mask {
  display: inline-block;
  background-color: #ef4444;
  color: #ef4444;
  border-radius: 4px;
  padding: 1px 6px;
  margin: 0 2px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  border-bottom: 2px solid #b91c1c;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.25);
  position: relative;
}

.red-sheet-mask::after {
  content: " 👁️ タップ";
  font-size: 0.72em;
  opacity: 0.95;
  color: #ffffff;
  margin-left: 2px;
}

.red-sheet-mask.revealed {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
  box-shadow: none !important;
  user-select: text;
}

.red-sheet-mask.revealed::after {
  content: "";
}

.red-sheet-mask:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

#btn-quick-mode-redsheet.active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #991b1b !important;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
}

.red-sheet-banner {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1.5px solid #f87171;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #991b1b;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

.red-sheet-btn-action {
  background: #ffffff;
  border: 1px solid #f87171;
  color: #b91c1c;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.red-sheet-btn-action:hover {
  background: #dc2626;
  color: #ffffff;
}


/* =========================================================================
   ★★★ 本番模試モード（カウントダウンタイマー・足切り判定・総合合否）スタイル ★★★
   ========================================================================= */
.quiz-timer-box.mock-countdown {
  background: #f8fafc !important;
  border: 2px solid #0284c7 !important;
  color: #0369a1 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem !important;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2) !important;
  transition: all 0.3s ease;
}

.quiz-timer-box.timer-warning {
  background: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3) !important;
}

.quiz-timer-box.timer-critical {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45) !important;
  animation: timerCriticalPulse 1s infinite alternate;
}

@keyframes timerCriticalPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.04); opacity: 0.92; }
}

/* 本番模試 総合合否判定カード */
.mock-verdict-card {
  background: #ffffff;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-top: 24px;
  text-align: left;
}

.mock-verdict-banner {
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mock-verdict-banner.verdict-pass {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  color: #065f46;
}

.mock-verdict-banner.verdict-cutoff-fail {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  color: #92400e;
}

.mock-verdict-banner.verdict-score-fail {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #ef4444;
  color: #991b1b;
}

.mock-verdict-icon {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.mock-verdict-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.mock-verdict-desc {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 足切り判定テーブル */
.mock-cutoff-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px 0;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.mock-cutoff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #ffffff;
}

.mock-cutoff-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.mock-cutoff-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.mock-badge-clear {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #86efac;
  white-space: nowrap;
}

.mock-badge-fail {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #fca5a5;
  white-space: nowrap;
  animation: pulseFail 1.5s infinite alternate;
}

@keyframes pulseFail {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.mock-badge-warn {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

/* 模試モーダル内オプションカード */
.mock-option-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.mock-option-card:hover, .mock-option-card.selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   試験直前数字・成分 瞬殺暗記シート (Red Sheet Cheat Viewer)
   ========================================================================== */
.cheat-sheet-modal-card {
  max-width: 1040px;
  width: 95%;
  height: 88vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.cheat-sheet-header {
  background: linear-gradient(135deg, #1e1b4b, #312e81, #1e293b);
  color: #ffffff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #6366f1;
  flex-shrink: 0;
}

.cheat-sheet-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.cheat-sheet-toolbar {
  background: #f8fafc;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.cheat-sheet-search {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  position: relative;
}

.cheat-sheet-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.cheat-sheet-search input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.cheat-sheet-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.cheat-sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cheat-sheet-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid #e02424;
  background: #ffffff;
  color: #e02424;
}

.cheat-sheet-toggle-btn:hover {
  background: #fef2f2;
}

.cheat-sheet-toggle-btn.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.cheat-sheet-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid #d97706;
  background: #ffffff;
  color: #d97706;
}

.cheat-sheet-fav-btn:hover {
  background: #fffbeb;
}

.cheat-sheet-fav-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

.cheat-sheet-nav-tabs {
  background: #ffffff;
  padding: 10px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  min-height: 54px;
  box-sizing: border-box;
}

.cheat-sheet-nav-tabs::-webkit-scrollbar {
  height: 5px;
}

.cheat-sheet-nav-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.cheat-sheet-nav-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.cheat-sheet-tab-btn {
  padding: 7px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 30px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1.3;
  height: 38px;
  box-sizing: border-box;
}

.cheat-sheet-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.cheat-sheet-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  border-color: #3730a3;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.cheat-sheet-tab-btn.active i {
  color: #ffffff !important;
}

.cheat-sheet-tab-btn .cheat-tab-count {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.07);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 800;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cheat-sheet-tab-btn.active .cheat-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.cheat-sheet-body {
  flex: 1;
  min-height: 350px;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}

.cheat-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .cheat-sheet-modal-card {
    width: 98%;
    height: 92vh;
    max-height: 95vh;
    border-radius: 12px;
  }
  .cheat-sheet-header {
    padding: 12px 16px;
  }
  .cheat-sheet-toolbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .cheat-sheet-search {
    min-width: 100%;
    max-width: 100%;
  }
  .cheat-sheet-actions {
    width: 100%;
    justify-content: space-between;
  }
  .cheat-sheet-nav-tabs {
    padding: 8px 12px;
    gap: 6px;
    min-height: 48px;
  }
  .cheat-sheet-tab-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    height: 34px;
    gap: 6px;
  }
  .cheat-sheet-body {
    padding: 12px;
  }
  .cheat-sheet-grid {
    grid-template-columns: 1fr;
  }
}

.cheat-sheet-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 16px 18px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.cheat-sheet-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.cheat-sheet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed #f1f5f9;
}

.cheat-sheet-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.cheat-sheet-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.cheat-sheet-pin-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.15s, transform 0.15s;
}

.cheat-sheet-pin-btn:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.cheat-sheet-pin-btn.pinned {
  color: #f59e0b;
}

.cheat-sheet-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cheat-sheet-item-row {
  background: #f8fafc;
  border-left: 3.5px solid #6366f1;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.cheat-sheet-item-label {
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
}

.cheat-sheet-item-detail {
  color: #334155;
  font-size: 0.84rem;
}

/* ★赤シート マスク用スタイル */
.cheat-masked-term {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 2px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* 赤シートモード有効時（全マスク隠し） */
body.red-sheet-active .cheat-masked-term {
  background: #dc2626 !important;
  color: transparent !important;
  border-color: #b91c1c !important;
  text-shadow: none !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 赤シートモードでタップされた（めくられた）状態 */
body.red-sheet-active .cheat-masked-term.revealed {
  background: #fef08a !important;
  color: #854d0e !important;
  border-color: #eab308 !important;
  text-shadow: none !important;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(234, 179, 8, 0.3);
}

/* 単体クリックでも開閉可能 */
.cheat-masked-term.masked {
  background: #dc2626 !important;
  color: transparent !important;
  border-color: #b91c1c !important;
}

.cheat-card-tip {
  margin-top: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #166534;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

/* Header cheat-sheet button */
#btn-header-cheat-sheet {
  background: linear-gradient(135deg, #312e81, #1e1b4b);
  border: 1.5px solid #818cf8;
  color: #c7d2fe;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#btn-header-cheat-sheet:hover {
  background: linear-gradient(135deg, #4338ca, #312e81);
  color: #ffffff;
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}


/* ==========================================================================
   統一ヘッダーボタンスタイル (Unified Header Buttons System)
   ========================================================================== */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.header-action-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 16px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.18s ease-in-out;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1;
}

.header-action-btn i,
.header-action-btn img {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.header-action-btn:hover {
  transform: translateY(-1px);
}

.header-action-btn:active {
  transform: translateY(0);
}

/* 1. Googleログイン / 連携 */
.header-btn-google {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.header-btn-google:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* 2. 本番模試 (Dark Cyan / Navy) */
.header-btn-mock {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1.5px solid #38bdf8;
  color: #38bdf8;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.2);
}
.header-btn-mock:hover {
  background: linear-gradient(135deg, #1e293b, #334155);
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.35);
  border-color: #7dd3fc;
}

/* 3. 瞬殺暗記シート (Indigo / Gold Accent) */
.header-btn-sheet {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1.5px solid #818cf8;
  color: #e0e7ff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}
.header-btn-sheet:hover {
  background: linear-gradient(135deg, #312e81, #4338ca);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
  border-color: #a5b4fc;
}

/* 4. 殿堂・メダル (Gold / Amber) */
.header-btn-medal {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #b45309;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
}
.header-btn-medal:hover {
  background: #fef3c7;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* 5. 使い方マニュアル (Clean Slate) */
.header-btn-guide {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.header-btn-guide:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #94a3b8;
}

/* 6. 診断 (Warm Honey / Amber) */
.header-btn-shindan {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #b45309;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.1);
}
.header-btn-shindan:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

/* 7. プレイヤーステータス & 連続記録バッジの高さ統一 (32px) */
.player-mini-status {
  height: 32px !important;
  box-sizing: border-box !important;
  padding: 2px 10px 2px 3px !important;
}

.streak-badge {
  height: 32px !important;
  box-sizing: border-box !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
}


/* ==========================================================================
   2段構造ヘッダー レイアウト定義 (2-Tier Header Layout)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
  padding: 8px 24px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-to-blog {
  font-size: 0.8rem;
  color: #64748b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.back-to-blog:hover {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* ★スキマ資格App（全資格一覧）へ戻るヘッダーボタン */
.btn-back-to-portal {
  font-size: 0.8rem;
  color: #1d4ed8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.btn-back-to-portal:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-back-to-portal:active {
  transform: translateY(0);
}

.btn-portal-text-short {
  display: none;
}

@media (max-width: 680px) {
  .btn-portal-text-full {
    display: none;
  }
  .btn-portal-text-short {
    display: inline;
  }
}

.btn-back-to-portal-inline {
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.btn-back-to-portal-inline:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.app-title {
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.app-title:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.app-badge-cbt.is-clickable {
  cursor: pointer;
  background: #f0fdf4 !important;
  color: #15803d !important;
  border-color: #bbf7d0 !important;
}

.app-badge-cbt.is-clickable:hover {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}



.app-title {
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.app-badge-cbt {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  white-space: nowrap;
}

.header-top-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tier-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
}

.header-bottom-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-switch-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mode-pill-btn {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.mode-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.mode-pill-btn:hover:not(.active) {
  color: #0f172a;
  background: #e2e8f0;
}

@media (max-width: 768px) {
  .app-header {
    padding: 8px 12px 10px !important;
  }
  .header-tier-top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-tier-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .header-bottom-action-group {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}


/* ==========================================================================
   スマート復習BOXボタンスタイル (Proposal A)
   ========================================================================== */
.header-btn-review {
  background: linear-gradient(135deg, #450a0a, #7f1d1d);
  border: 1.5px solid #ef4444;
  color: #fecaca;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
  position: relative;
}
.header-btn-review:hover {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border-color: #f87171;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

.header-review-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1.1;
  min-width: 14px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.review-item-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}
.review-item-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.review-stage-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}



/* ==========================================================================
   スマホ・タブレット向け ゲームモード完全レスポンシブ最適化 (Mobile Game Mode Polish)
   ========================================================================== */

/* 1. モバイル時のPCサイドバー対応：
   スマホではサイドバーを単なる「画面下部の不要な余白」にせず、
   ゲームモード時は勇者ステータスカード（キャラ・Lv・HP・装備）をメイン画面の冒険マップ直下に美しく表示させる */
@media (max-width: 768px) {
  .app-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 12px 14px 24px 14px !important;
  }

  .tab-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  .pc-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  /* ポータルガイドはスマホ下部では冗長なので非表示 */
  #pc-side-portal-guide {
    display: none !important;
  }

  /* シンプルモード時の右サイドミニ合否はタブ内で完結するため非表示 */
  body.mode-simple .pc-sidebar {
    display: none !important;
  }

  /* ゲームモード時は勇者ステータスカードをスマホでも美しく表示 */
  body.mode-game .pc-sidebar {
    display: block !important;
    margin-top: 10px;
  }
}

/* 2. 冒険ワールドマップのスマホ最適化 */
@media (max-width: 768px) {
  .rpg-worldmap-card {
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }

  .rpg-worldmap-header-bar {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .rpg-map-title-box h2 {
    font-size: 1.05rem !important;
    gap: 6px !important;
  }

  .rpg-map-title-box p {
    font-size: 0.72rem !important;
  }

  .rpg-quick-action-bar {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .rpg-quick-btn {
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
  }

  .rpg-summit-target-badge {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
  }

  .rpg-view-mode-tabs {
    padding: 6px 10px !important;
    gap: 6px !important;
  }

  .rpg-view-tab-btn {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
  }

  /* ワールドマップビューポート：スマホでもタップしやすい縦横比とタップ領域 */
  .rpg-worldmap-viewport {
    aspect-ratio: 4 / 3 !important; /* スマホ縦画面で見やすい縦比率へ拡大 */
    border-radius: 10px !important;
  }

  /* スマホでのボスピンのサイズと文字サイズの最適化 */
  .rpg-boss-badge {
    width: 44px !important;
    height: 44px !important;
    border-width: 2.5px !important;
  }

  .rpg-boss-pin.demonlord .rpg-boss-badge {
    width: 54px !important;
    height: 54px !important;
  }

  .rpg-boss-label {
    padding: 2px 6px !important;
    font-size: 0.62rem !important;
    border-radius: 4px !important;
    margin-top: 2px !important;
  }

  .rpg-hero-bubble {
    width: 40px !important;
    height: 40px !important;
    border-width: 2.5px !important;
  }

  .rpg-hero-tooltip {
    font-size: 0.62rem !important;
    padding: 2px 7px !important;
    bottom: 42px !important;
  }
}

/* 3. クイズ演習画面でのモンスターバトルステージ（スマホ最適化） */
@media (max-width: 768px) {
  .game-battle-stage {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }

  .enemy-card {
    gap: 10px !important;
  }

  .enemy-avatar-wrap {
    width: 50px !important;
    height: 50px !important;
  }

  .enemy-name {
    font-size: 0.88rem !important;
  }

  .enemy-level {
    font-size: 0.68rem !important;
  }

  .enemy-hp-bar {
    height: 10px !important;
  }

  .combo-box {
    padding: 4px 10px !important;
  }

  .combo-count {
    font-size: 1.1rem !important;
  }

  .combo-label {
    font-size: 0.6rem !important;
  }
}

/* 4. モバイル時ボトムナビゲーションの安定配置（親指で届く固定バー） */
@media (max-width: 768px) {
  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 6px 4px 8px 4px !important;
    z-index: 100 !important;
  }

  .nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    min-width: 52px !important;
    text-align: center !important;
  }

  .nav-item i {
    font-size: 1.15rem !important;
  }

  .nav-item.active {
    color: #2563eb !important;
    background: #eff6ff !important;
  }

  /* 下部固定ナビが被らないようにコンテンツ下部にパディング追加 */
  body {
    padding-bottom: 70px !important;
  }
}


/* ==========================================================================
   モバイル・スマホ画面 視認性＆操作性 特化リファイン (v76.0 Mobile UX Refine)
   ========================================================================== */

/* デフォルト（PC）表示制御 */
.nav-label-short {
  display: none;
}
.nav-label-full {
  display: inline;
}
.btn-portal-text-mini {
  display: none;
}
.streak-text-short {
  display: none;
}
.streak-text-full {
  display: inline;
}
.back-text-short {
  display: none;
}
.back-text-full {
  display: inline;
}

@media (max-width: 768px) {
  /* ----------------------------------------------------
     0. スマホ画面 全幅＆はみ出し・左余白センタリング崩れ完全防止
     ---------------------------------------------------- */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #app-container {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .app-header,
  .header-tier-top,
  .header-tier-bottom {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* ----------------------------------------------------
     1. ボトムナビゲーション：7タブ等幅＆短縮ラベルで文字欠損完全解消
     ---------------------------------------------------- */
  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 56px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    border-top: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    padding: 3px 2px 5px 2px !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
  }

  .nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 3px 1px 4px 1px !important;
    gap: 2px !important;
    border-radius: 8px !important;
    text-align: center !important;
    color: #64748b !important;
    transition: all 0.15s ease !important;
  }

  .nav-item i {
    font-size: 1.15rem !important;
    margin-bottom: 1px !important;
  }

  .nav-label-full {
    display: none !important;
  }

  .nav-label-short {
    display: inline-block !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    letter-spacing: -0.02em !important;
  }

  .nav-item.active {
    color: #2563eb !important;
    background: #eff6ff !important;
  }

  .nav-item.active .nav-label-short {
    font-weight: 800 !important;
    color: #1d4ed8 !important;
  }

  body {
    padding-bottom: 72px !important;
  }

  /* ----------------------------------------------------
     2. ヘッダー上部（1段目）：タイトルの見切れ防止＆ステータス超コンパクト化
     ---------------------------------------------------- */
  .app-header {
    padding: 8px 10px 8px !important;
    gap: 6px !important;
  }

  .header-tier-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  .app-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .back-to-blog {
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
    gap: 3px !important;
  }
  .back-text-full {
    display: none !important;
  }
  .back-text-short {
    display: inline !important;
  }

  .btn-back-to-portal {
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
    gap: 3px !important;
  }
  .btn-portal-text-full,
  .btn-portal-text-short {
    display: none !important;
  }
  .btn-portal-text-mini {
    display: inline !important;
  }

  .app-title {
    font-size: 1.02rem !important;
    font-weight: 900 !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-title span {
    font-size: 1.02rem !important;
  }

  .app-badge-cbt {
    display: none !important; /* スマホ時はサブタイトルを省いてタイトル領域を最優先確保 */
  }

  .header-top-status-group {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .header-btn-google {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    height: 26px !important;
  }

  #header-google-user-badge {
    height: 26px !important;
    padding: 0 6px 0 3px !important;
    gap: 3px !important;
  }
  #header-google-user-badge img {
    width: 18px !important;
    height: 18px !important;
  }
  #header-google-user-name {
    max-width: 50px !important;
    font-size: 0.68rem !important;
  }

  .player-mini-status {
    padding: 2px 6px !important;
    gap: 4px !important;
    height: 26px !important;
  }
  .avatar-frame {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.75rem !important;
  }
  .header-lvl-text {
    font-size: 0.68rem !important;
  }
  .header-exp-mini-bar {
    width: 24px !important;
    height: 3px !important;
  }

  .streak-badge {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    height: 26px !important;
  }
  .streak-text-full {
    display: none !important;
  }
  .streak-text-short {
    display: inline !important;
  }

  /* ----------------------------------------------------
     3. ヘッダー下部（2段目）：モード切替ピル＆クイックアクションのスワイプ化
     ---------------------------------------------------- */
  .header-tier-bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .mode-switch-pill {
    align-self: center !important;
    padding: 2px !important;
  }
  .mode-pill-btn {
    padding: 3px 12px !important;
    font-size: 0.75rem !important;
  }

  .header-bottom-action-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    padding: 2px 1px 4px 1px !important;
  }
  .header-bottom-action-group::-webkit-scrollbar {
    display: none !important;
  }

  .header-bottom-action-group .header-action-btn {
    flex-shrink: 0 !important;
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 0.72rem !important;
    border-radius: 14px !important;
    gap: 5px !important;
  }

  /* ----------------------------------------------------
     4. RPG冒険ワールドマップ：重なり合い完全解消＆視認性劇的向上
     ---------------------------------------------------- */
  .rpg-worldmap-card {
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  .rpg-worldmap-header-bar {
    padding: 10px 12px !important;
    gap: 6px !important;
  }

  .rpg-map-title-box h2 {
    font-size: 0.95rem !important;
  }
  .rpg-map-title-box p {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
  }

  .rpg-quick-action-bar {
    gap: 6px !important;
    margin-top: 4px !important;
  }
  .rpg-quick-btn {
    padding: 3px 9px !important;
    font-size: 0.7rem !important;
  }
  .rpg-summit-target-badge {
    font-size: 0.68rem !important;
    padding: 3px 8px !important;
  }

  /* ワールドマップビューポート */
  .rpg-worldmap-viewport {
    aspect-ratio: 16 / 11 !important;
    min-height: 240px !important;
    border-radius: 12px !important;
    margin: 4px 6px 10px !important;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6) !important;
  }

  /* ボスピンのサイズ最適化 */
  .rpg-boss-badge {
    width: 40px !important;
    height: 40px !important;
    border-width: 2px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6) !important;
  }
  .rpg-boss-pin.demonlord .rpg-boss-badge {
    width: 48px !important;
    height: 48px !important;
  }

  /* ★★★ 重なり合いの主因：封印中ボスの長大テキストを完全非表示に */
  .rpg-boss-pin.locked .rpg-boss-label-status {
    display: none !important;
  }
  .rpg-boss-pin.locked .rpg-boss-label {
    padding: 2px 5px !important;
    font-size: 0.58rem !important;
    max-width: 68px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    margin-top: 2px !important;
  }

  /* 撃破済みボスのラベルもコンパクト化 */
  .rpg-boss-pin.cleared .rpg-boss-label-status {
    display: none !important;
  }
  .rpg-boss-pin.cleared .rpg-boss-label {
    padding: 2px 5px !important;
    font-size: 0.58rem !important;
    max-width: 68px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-top: 2px !important;
  }

  /* 現在挑戦中の標的ボスのみ、バッジとラベルを美しく強調 */
  .rpg-boss-pin.active-target {
    z-index: 20 !important;
  }
  .rpg-boss-pin.active-target .rpg-boss-badge {
    border-color: #ef4444 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8) !important;
  }
  .rpg-boss-pin.active-target .rpg-boss-label {
    padding: 2px 6px !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1.5px solid #ef4444 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
    margin-top: 2px !important;
  }
  .rpg-boss-pin.active-target .rpg-boss-label-name {
    font-size: 0.68rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
  }
  .rpg-boss-pin.active-target .rpg-boss-label-status {
    font-size: 0.6rem !important;
    color: #fca5a5 !important;
    font-weight: 800 !important;
  }

  /* ★★★ 勇者現在地ピンのツールチップ重複を解消 */
  .rpg-hero-tooltip {
    display: none !important;
  }
  .rpg-hero-bubble {
    width: 32px !important;
    height: 32px !important;
    border-width: 2px !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.9) !important;
  }

  /* ----------------------------------------------------
     5. 科学的根拠バナー（脳科学×行動経済学）のスマホ最適化
     ---------------------------------------------------- */
  .brain-hybrid-method-card {
    padding: 8px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
  }

  /* ----------------------------------------------------
     6. キャラクターステータスカード（rpg-side-status-card）のスマホ最適化
     ---------------------------------------------------- */
  .rpg-side-status-card {
    padding: 12px 12px !important;
    border-radius: 14px !important;
  }
  .rpg-side-char-name {
    font-size: 0.98rem !important;
  }
  .rpg-fullbody-stage-container {
    min-height: 180px !important;
    margin: 8px 0 !important;
    padding: 6px !important;
  }
  .rpg-fullbody-hero-wrapper {
    height: 180px !important;
  }
  .rpg-fullbody-hero-wrapper img {
    max-height: 180px !important;
  }
}

/* ★★★ キャラクター選択＆きせかえ画面：全身・バストアップを完璧に美しく表示 */
.char-card-full-thumb {
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  min-height: 180px !important;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%) !important;
}
.char-card-full-thumb img {
  object-fit: cover !important;
  object-position: center 65% !important;
}

#dresser-hero-img {
  object-fit: contain !important;
  object-position: center bottom !important;
}

@media (max-width: 768px) {
  /* スマホでのキャラクター一覧グリッド：2列表示で全身をバランスよく表示 */
  .char-select-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    max-height: 62vh !important;
  }
  .char-card-item {
    padding: 7px !important;
  }
  .char-card-full-thumb {
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
    min-height: 170px !important;
    max-height: 220px !important;
    margin-bottom: 6px !important;
  }
  .char-card-full-thumb img {
    object-fit: cover !important;
    object-position: center 65% !important;
  }
  .char-card-name {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
  }
  .char-card-job {
    font-size: 0.68rem !important;
  }
  .char-card-trait {
    font-size: 0.62rem !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}


/* 改善要望・ロードマップボタン (Emerald / Mint Green) */
.header-btn-feedback {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.1);
}
.header-btn-feedback:hover {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.2);
}

/* 改善要望：賛同投票ボタンスタイル強化 */
.fb-vote-btn {
  background: #fff7ed !important;
  border: 1.5px solid #fdba74 !important;
  color: #ea580c !important;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.12) !important;
  display: inline-flex !important;
  align-items: center !important;
}
.fb-vote-btn:hover {
  background: #ffedd5 !important;
  border-color: #f97316 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25) !important;
}
.fb-vote-btn.has-voted {
  background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
  border-color: #c2410c !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.35) !important;
}
.fb-vote-btn.has-voted i {
  color: #fef08a !important;
  filter: drop-shadow(0 0 3px rgba(254, 240, 138, 0.8));
}

