/* app-extra.css — 追加スタイル (lesson/quiz/chapter 共通) */

/* ── CSS変数補完 ── */
:root {
  --navy-200: #BFCEF7;
  --navy-400: #6B8DD8;
  --ink-400:  #8B93B0;
  --ink-600:  #4B5478;
  --gold-300: #FFD07A;
  --gold-50:  #FFFBEB;
  --green-50:  #F0FDF4;
  --green-100: #DCFCE7;
  --green-200: #BBF7D0;
  --green-400: #4ADE80;
  --green-700: #15803D;
  --navy-50-alt: #EEF2FF;
}

/* ── アプリ全体 ── */
.app {
  padding-bottom: 80px; /* ProtoTabs分の余白 */
}
.app.no-sidebar {
  display: block;
  grid-template-columns: none;
}

/* ── メインエリア（ダッシュボード・チャプター用） ── */
.main-area {
  padding: 40px 48px;
  max-width: 1100px;
  overflow-y: auto;
}

/* ── ボタン基本 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: opacity .15s, background .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--navy-900);
  color: white;
}
.btn-primary:hover { background: var(--navy-700); }

/* ── タグ ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

/* ── カード ── */
.card {
  background: white;
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── サイドバー ── */
.sidebar {
  background: var(--navy-900);
  color: white;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 12px;
}
.sidebar-logo .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gold-500); color: var(--navy-900);
  font-size: 18px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo .name {
  font-size: 15px; font-weight: 800; letter-spacing: .02em;
}
.sidebar-logo .name small {
  display: block; font-size: 9px; letter-spacing: .12em;
  color: rgba(255,255,255,.5); margin-top: -1px;
}
.nav-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  color: rgba(255,255,255,.35); padding: 8px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 20px;
  color: rgba(255,255,255,.65); font-size: 13px;
  background: none; border: none; cursor: pointer;
  text-align: left; transition: background .12s;
}
.nav-item:hover:not(:disabled) { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: rgba(255,255,255,.12); color: white; }
.nav-item:disabled { opacity: .4; cursor: not-allowed; }
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── ストリークカード ── */
.streak-card {
  margin: auto 16px 0;
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12px;
}
.streak-num {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 2px;
}
.streak-num .mono { font-size: 26px; font-weight: 900; font-family: var(--font-en); color: var(--gold-400); }
.streak-label { font-size: 11px; color: rgba(255,255,255,.5); margin-bottom: 8px; }
.streak-dots { display: flex; gap: 5px; margin-bottom: 8px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  transition: background .3s;
}
.dot.on { background: var(--gold-400); }
.streak-foot { font-size: 11px; color: rgba(255,255,255,.4); }

.sidebar-legal {
  margin-top: 20px;
  padding: 16px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.sidebar-legal a {
  font-size: 10px;
  color: rgba(255,255,255,.45);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sidebar-legal a:hover { color: rgba(255,255,255,.75); }
.sidebar-copyright {
  width: 100%;
  font-size: 10px;
  color: rgba(255,255,255,.30);
  margin-top: 4px;
}

/* ── マスコット共通 ── */
.mascot { display: inline-block; }
.mascot-spark {
  position: absolute;
  font-size: 1.2em;
  animation: sparkle .8s ease-in-out infinite alternate;
}
@keyframes sparkle {
  from { transform: scale(.9) rotate(-5deg); opacity: .8; }
  to   { transform: scale(1.1) rotate(5deg); opacity: 1; }
}

/* ── プログレスリング（ダッシュボード用） ── */
.progress-ring-track { stroke: var(--ink-200); }
.progress-ring-fill  { stroke: var(--gold-400); transition: stroke-dashoffset .5s; }

/* ── レスポンシブ補完 ── */
@media (max-width: 900px) {
  .lesson-wrap { grid-template-columns: 1fr; }
  .lesson-sidebar { display: none; }
  .lesson-main { padding: 24px 20px; }
}

@media (max-width: 768px) {
  /* モバイルアプリバー分のトップ余白 */
  .app { padding-top: 0; }

  /* ダッシュボードメインエリア */
  .main-area { padding: 16px 14px 100px; }

  /* レッスン・クイズページ（下部タブバー分の余白） */
  .lesson-main { padding: 20px 16px 100px; }
  .quiz-wrap { padding-bottom: 100px; }

  /* チャプターページ */
  .chap-hero { padding: 20px 16px !important; }
}

@media (max-width: 480px) {
  .main-area { padding: 12px 12px 100px; }
  .lesson-main { padding: 16px 12px 100px; }
}

/* ====== モバイルハンバーガードロワー ====== */

/* オーバーレイ */
.mb-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 79;
  animation: mbOverlayFadeIn 200ms ease;
}
@keyframes mbOverlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ドロワー本体 */
.mb-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--navy-900);
  color: white;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 40px;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(.25, .46, .45, .94);
  will-change: transform;
}
.mb-drawer.open {
  transform: translateX(0);
}

/* デスクトップでは非表示（768px超） */
@media (min-width: 769px) {
  .mb-drawer,
  .mb-drawer-overlay {
    display: none !important;
  }
}

/* ドロワーヘッダー */
.mb-drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.mb-drawer-done {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-400);
  margin-top: 10px;
}
