/* ==========================================================================
   ストイック暗記フラッシュカード専用スタイルシート
   - アニメーション・トランジション完全ゼロ (0.00秒 DOM切替)
   - iOS Safari / PC 1画面完結レイアウト
   - SRS 6段階レベル制・短期差し込み・途中再開＆問題一覧ジャンプ対応
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: none !important;
  animation: none !important;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #0b1120;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.45;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

.hidden {
  display: none !important;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   パスワード復号モーダル ＆ 問題一覧ジャンプモーダル
   ========================================================================== */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(11, 17, 32, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.jump-card {
  width: 100%;
  max-width: 680px;
  height: 82dvh;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.jump-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

.jump-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.jump-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #1e293b;
  border: 1px solid #334155;
  text-align: left;
}

.jump-item.current {
  border-color: #38bdf8;
  background: #172554;
}

.jump-idx {
  font-size: 0.76rem;
  font-weight: 800;
  color: #93c5fd;
  min-width: 42px;
}

.jump-lv {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #0f172a;
  color: #cbd5e1;
  white-space: nowrap;
}

.jump-prompt {
  font-size: 0.82rem;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-icon {
  font-size: 1.35rem;
}

.auth-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #f8fafc;
}

.auth-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
}

.auth-input {
  width: 100%;
  padding: 11px 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.auth-input:focus {
  border-color: #3b82f6;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.auth-error {
  padding: 8px 10px;
  border-radius: 6px;
  background: #7f1d1d;
  border: 1px solid #ef4444;
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-submit-btn {
  padding: 12px;
  border-radius: 8px;
  background: #2563eb;
  border: 1px solid #60a5fa;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

/* ==========================================================================
   ① デッキ選択＆フィルタ画面（ホーム）
   ========================================================================== */

.home-header {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
  flex-shrink: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto 10px;
}

.title-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.app-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f8fafc;
}

.course-overall-stats {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.header-sync-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  white-space: nowrap;
}

.sync-badge.compact {
  padding: 3px 7px;
  font-size: 0.72rem;
}

.sync-badge.synced {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(22, 101, 52, 0.25);
}

.sync-badge.syncing {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 58, 138, 0.3);
}

.sync-badge.offline {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(120, 53, 15, 0.3);
}

.pw-btn {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #334155;
}

.course-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
}

.course-tab {
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #94a3b8;
  background: #1e293b;
  border-radius: 8px 8px 0 0;
  border: 1px solid #334155;
  border-bottom: none;
  text-align: center;
}

.course-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.home-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  max-width: 892px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 前回の続きから再開バナー */
.resume-banner {
  background: #172554;
  border: 1px solid #3b82f6;
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

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

.resume-tag {
  font-size: 0.76rem;
  font-weight: 800;
  color: #93c5fd;
}

.resume-detail {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.resume-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.resume-start-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #2563eb;
  border: 1px solid #60a5fa;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
}

/* SRS 3フェーズ＆期限切れサマリバー */
.srs-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.srs-stat-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.srs-stat-box.learning {
  border-color: rgba(248, 113, 113, 0.4);
}
.srs-stat-box.due {
  border-color: rgba(250, 204, 21, 0.45);
}
.srs-stat-box.review {
  border-color: rgba(74, 222, 128, 0.4);
}

.srs-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
}

.srs-stat-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: #f8fafc;
}

.srs-stat-box.learning .srs-stat-val { color: #f87171; }
.srs-stat-box.due .srs-stat-val      { color: #facc15; }
.srs-stat-box.review .srs-stat-val   { color: #4ade80; }

.panel {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 14px;
}

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

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.filter-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.random-toggle-btn {
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #475569;
  color: #cbd5e1;
}

.random-toggle-btn.active {
  background: #7c3aed;
  border-color: #c4b5fd;
  color: #ffffff;
}

.section-note {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  padding: 2px 8px;
  border-radius: 999px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}

.filter-start-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: left;
  border: 1px solid #334155;
  background: #1e293b;
}

.filter-start-btn.smart {
  grid-column: 1 / -1;
  background: #1e3a8a;
  border: 1px solid #60a5fa;
  color: #ffffff;
  padding: 13px 15px;
}

.filter-start-btn.random-direct {
  background: #5b21b6;
  border-color: #a78bfa;
  color: #f5f3ff;
}

.filter-label-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-sub-desc {
  font-size: 0.74rem;
  font-weight: 600;
  color: #bfdbfe;
}

.filter-start-btn.primary {
  background: #172554;
  border-color: #3b82f6;
  color: #e0f2fe;
}

.filter-start-btn.danger {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fecaca;
}

.filter-start-btn.challenge {
  background: #78350f;
  border-color: #f59e0b;
  color: #fef3c7;
}

.filter-start-btn.standard {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

.filter-count {
  font-size: 0.82rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  white-space: nowrap;
}

.subtype-filter-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #1e293b;
}

.subtype-label-title {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 600;
}

.subtype-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subtype-btn {
  padding: 7px 11px;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sub-cnt {
  color: #93c5fd;
  font-size: 0.78rem;
}

/* 章別リスト */
.chapter-bulk-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.mini-btn.danger-outline {
  color: #fca5a5;
  border-color: #7f1d1d;
}

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

.chapter-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
}

.chapter-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.chapter-row.unchecked {
  opacity: 0.55;
}

.chapter-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
  cursor: pointer;
}

.chapter-info {
  min-width: 0;
  cursor: pointer;
}

.chapter-title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chapter-code {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
}

.chapter-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-stats-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.stat-pill-perfect { color: #4ade80; font-weight: 700; }
.stat-pill-vague   { color: #facc15; font-weight: 700; }
.stat-pill-forgot  { color: #f87171; font-weight: 700; }
.stat-pill-unseen  { color: #94a3b8; }

.progress-track {
  width: 100%;
  height: 7px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #22c55e;
}

.chapter-single-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapter-resume-btn {
  padding: 5px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 5px;
  background: #0284c7;
  color: #ffffff;
  white-space: nowrap;
}

.chapter-btn-row1 {
  display: flex;
  gap: 4px;
}

.chapter-play-btn {
  flex: 1;
  padding: 6px 9px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  white-space: nowrap;
}

.chapter-random-btn {
  padding: 6px 8px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 6px;
  background: #6d28d9;
  color: #f5f3ff;
  white-space: nowrap;
}

.chapter-btn-row2 {
  display: flex;
  gap: 4px;
}

.chapter-play-all-btn, .chapter-unit-toggle-btn {
  flex: 1;
  padding: 4px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 5px;
  background: #334155;
  color: #cbd5e1;
  white-space: nowrap;
}

/* Unit小分け展開リスト */
.unit-drawer {
  background: #0f172a;
  border-top: 1px solid #334155;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #1e293b;
  font-size: 0.78rem;
}

.unit-name {
  font-weight: 700;
  color: #e2e8f0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.unit-stat {
  font-size: 0.72rem;
  color: #94a3b8;
}

.unit-start-btn {
  padding: 4px 8px;
  border-radius: 5px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
}

.unit-random-btn {
  padding: 4px 7px;
  border-radius: 5px;
  background: #6d28d9;
  color: #f5f3ff;
  font-size: 0.72rem;
  font-weight: 800;
}

/* ==========================================================================
   ② フラッシュカード高速周回画面（1画面完結・スクロール不要）
   ========================================================================== */

#screen-study {
  max-width: 860px;
  margin: 0 auto;
  background: #0b1120;
}

.study-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.study-top-left, .study-top-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.exit-btn, .nav-ctrl-btn, .jump-trigger-btn {
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  white-space: nowrap;
}

.jump-trigger-btn {
  background: #172554;
  border-color: #3b82f6;
  color: #93c5fd;
}

.study-progress-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}

.progress-mode-badge {
  font-size: 0.74rem;
  padding: 3px 6px;
  border-radius: 999px;
  background: #5b21b6;
  border: 1px solid #a78bfa;
  color: #f5f3ff;
}

.progress-learning {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid #ef4444;
  color: #fecaca;
  white-space: nowrap;
}

.progress-queue {
  font-size: 0.74rem;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  white-space: nowrap;
}

/* カード＆解答本体 */
.study-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

/* 表面エリア */
.card-front {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px 14px;
  flex-shrink: 0;
}

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

.badges-left, .badges-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 5px;
}

.subtype-badge {
  background: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.challenge-badge {
  background: #78350f;
  color: #fde68a;
  border: 1px solid #f59e0b;
}

.interleave-badge {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #ef4444;
}

.status-badge {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-size: 0.72rem;
}

.status-badge.lv-1 { background: #991b1b; color: #fee2e2; border-color: #ef4444; }
.status-badge.lv-2 { background: #9a3412; color: #ffedd5; border-color: #f97316; }
.status-badge.lv-3 { background: #854d0e; color: #fef9c3; border-color: #eab308; }
.status-badge.lv-4 { background: #075985; color: #e0f2fe; border-color: #0ea5e9; }
.status-badge.lv-5 { background: #166534; color: #dcfce7; border-color: #22c55e; }

.card-id-label {
  font-size: 0.72rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.card-prompt {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.45;
  margin-bottom: 10px;
  white-space: pre-line;
  user-select: text;
  -webkit-user-select: text;
}

.card-hint-box {
  background: #1e293b;
  border-left: 3px solid #64748b;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 0.84rem;
  line-height: 1.38;
}

.hint-prefix {
  font-weight: 700;
  color: #94a3b8;
  margin-right: 4px;
}

/* 裏面（解答）エリア */
.card-back {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 必須キーワードバッジ（最優先視認：アンバー/ゴールド系ピル型バッジ） */
.keypoints-section {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
}

.keypoints-header {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.keypoints-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keypoint-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 正解 */
.answer-section {
  padding: 2px 2px;
}

.answer-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 4px;
}

.card-answer {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: pre-line;
  line-height: 1.48;
  user-select: text;
  -webkit-user-select: text;
}

/* 解説＆ページ数 */
.explanation-section {
  border-top: 1px solid #1e293b;
  padding-top: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
}

.card-page {
  display: inline-block;
  font-weight: 800;
  color: #cbd5e1;
  background: #1e293b;
  padding: 1px 7px;
  border-radius: 4px;
  margin-right: 6px;
}

/* 下部固定コントローラー（親指エリア固定：5段階LV直接設定） */
.study-bottom-bar {
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: #0f172a;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.show-answer-btn {
  width: 100%;
  height: 62px;
  border-radius: 10px;
  background: #2563eb;
  border: 1px solid #60a5fa;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.lv-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  height: 62px;
}

.lv-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 4px 2px;
  font-weight: 900;
  opacity: 0.78;
}

.lv-now-tag {
  display: none;
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 5px;
  font-size: 0.6rem;
  font-weight: 900;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  line-height: 1.35;
  white-space: nowrap;
}

.lv-btn.is-current-lv {
  opacity: 1;
  box-shadow: 0 0 0 2px #ffffff, 0 0 12px rgba(255, 255, 255, 0.35);
}

.lv-btn.is-current-lv .lv-now-tag {
  display: inline-block;
}

.lv-main {
  font-size: 0.94rem;
  line-height: 1.15;
}

.lv-sub {
  font-size: 0.64rem;
  font-weight: 700;
  opacity: 0.92;
  white-space: nowrap;
}

/* ベース色（未選択LV） */
.lv-btn-1 { background: #450a0a; border: 1px solid #991b1b; color: #fecaca; }
.lv-btn-2 { background: #431407; border: 1px solid #9a3412; color: #fed7aa; }
.lv-btn-3 { background: #422006; border: 1px solid #854d0e; color: #fef08a; }
.lv-btn-4 { background: #082f49; border: 1px solid #075985; color: #bae6fd; }
.lv-btn-5 { background: #052e16; border: 1px solid #166534; color: #bbf7d0; }

/* 解いた時点で設定されているLVの鮮やかなハイライト色 */
.lv-btn-1.is-current-lv { background: #dc2626; border-color: #ffffff; color: #ffffff; }
.lv-btn-2.is-current-lv { background: #ea580c; border-color: #ffffff; color: #ffffff; }
.lv-btn-3.is-current-lv { background: #ca8a04; border-color: #ffffff; color: #ffffff; }
.lv-btn-4.is-current-lv { background: #0284c7; border-color: #ffffff; color: #ffffff; }
.lv-btn-5.is-current-lv { background: #16a34a; border-color: #ffffff; color: #ffffff; }

@media (max-width: 520px) {
  .srs-summary-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-prompt {
    font-size: 1.02rem;
  }
  .card-term {
    font-size: 1.28rem;
  }
  .card-formula {
    font-size: 0.96rem;
  }
  .card-answer {
    font-size: 0.95rem;
  }
  .keypoint-pill {
    font-size: 0.85rem;
    padding: 3px 10px;
  }
  .lv-buttons {
    gap: 4px;
  }
  .lv-main {
    font-size: 0.84rem;
  }
  .lv-sub {
    font-size: 0.56rem;
  }
}

/* ==========================================================================
   用語 ➔ 意味・計算式 特化UIスタイル
   ========================================================================== */

.filter-start-btn.formula-direct {
  background: #0e4a5e;
  border-color: #22d3ee;
  color: #ecfeff;
}

.subtype-btn.formula-sub {
  background: #0c3a4b;
  border-color: #06b6d4;
  color: #cffafe;
}

.subtype-badge.formula-badge {
  background: #0e4a5e;
  color: #67e8f9;
  border-color: #06b6d4;
}

.stat-pill-formula {
  color: #22d3ee;
  font-weight: 800;
}

/* 表面：用語ヒーロー表示 */
.term-hero-block {
  background: #0b1325;
  border: 1px solid #1e293b;
  border-radius: 9px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
}

.term-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.card-subterm {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
}

.ask-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid #3b82f6;
  color: #bfdbfe;
  white-space: nowrap;
}

.ask-pill.is-formula {
  background: rgba(6, 182, 212, 0.18);
  border-color: #22d3ee;
  color: #a5f3fc;
}

.card-term {
  font-size: 1.48rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.35;
  letter-spacing: 0.01em;
  white-space: pre-line;
  user-select: text;
  -webkit-user-select: text;
}

.card-detail-prompt {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #1e293b;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.45;
  white-space: pre-line;
  user-select: text;
  -webkit-user-select: text;
}

/* 裏面：計算式・公式専用ハイライトボックス */
.formula-section {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.55);
  border-left: 4px solid #22d3ee;
  border-radius: 8px;
  padding: 10px 12px;
}

.formula-header {
  font-size: 0.74rem;
  font-weight: 800;
  color: #67e8f9;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.card-formula {
  font-size: 1.06rem;
  font-weight: 900;
  color: #ecfeff;
  line-height: 1.5;
  white-space: pre-line;
  font-family: "Yu Gothic UI", "Hiragino Sans", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: text;
  -webkit-user-select: text;
}

