:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-fg: #0f172a;
  --ok: #22c55e;
  --ng: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app { max-width: 640px; margin: 0 auto; padding: 1rem; }

.screen { display: flex; flex-direction: column; gap: 1rem; }

/* ヘッダ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface2);
}
.header-left { flex: 1; }
.header-title { font-weight: 600; }
.header #logout, .link {
  flex: 1;
  text-align: right;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.header-left .link { text-align: left; }
.icon-btn {
  background: none; border: none; color: var(--text);
  font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}

/* ハンバーガーメニュー */
.menu-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 200; }
.menu {
  position: absolute; top: 3.2rem; left: 1rem; min-width: 210px;
  background: var(--surface); border: 1px solid var(--surface2); border-radius: 12px;
  padding: 0.4rem; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column;
}
.menu-item {
  background: none; border: none; color: var(--text); text-align: left;
  padding: 0.75rem 0.9rem; border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.menu-item:hover { background: var(--surface2); }

/* 評価の基準テーブル */
.grade-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.grade-table th, .grade-table td {
  text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--surface2);
  font-size: 0.9rem;
}
.grade-table th { color: var(--muted); font-weight: 600; }
.grade-table .rank { width: 1.7rem; height: 1.7rem; font-size: 0.95rem; }

/* カード */
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.card.center { text-align: center; display: flex; flex-direction: column; gap: 0.75rem; }
.big { font-size: 3rem; }

/* 認証 */
.auth { max-width: 380px; margin: 3rem auto; text-align: center; }
.auth h1 { margin: 0 0 0.35rem; letter-spacing: 0.02em; }
/* サブタイトル（何のアプリかを一目で伝える） */
.tagline { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.85rem; }
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.tab {
  flex: 1; padding: 0.6rem; border: none; border-radius: 10px;
  background: var(--surface2); color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--accent-fg); font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 0.75rem; text-align: left; }
.form input {
  padding: 0.75rem; border-radius: 10px; border: 1px solid var(--surface2);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
.hint { color: var(--muted); font-size: 0.9rem; }

/* お問い合わせフォーム */
.field-label { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; }
.select, .textarea {
  padding: 0.75rem; border-radius: 10px; border: 1px solid var(--surface2);
  background: var(--bg); color: var(--text); font-size: 1rem;
  font-family: inherit; width: 100%;
}
.textarea { resize: vertical; line-height: 1.6; }
.counter-right { text-align: right; font-size: 0.75rem; color: var(--muted); margin-top: -0.4rem; }
.link-inline.forgot {
  color: var(--muted); font-size: 0.82rem; font-weight: 400;
  text-decoration: underline; align-self: center; margin-top: 0.2rem;
}

/* ボタン */
.btn-primary {
  padding: 0.75rem 1rem; border: none; border-radius: 10px;
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
  cursor: pointer; font-size: 1rem;
}
.btn-primary:disabled { opacity: 0.5; cursor: default; }
/* 開始ボタンの状態別カラー（高得点=緑=もう一度学習、低得点=橙=復習する） */
.btn-primary.start-again { background: var(--ok); color: #052e12; }
.btn-primary.start-review { background: #f59e0b; color: #3a2400; }
.btn-ghost {
  padding: 0.6rem 1rem; border: 1px solid var(--surface2); border-radius: 10px;
  background: none; color: var(--text); cursor: pointer;
}
.btn-round {
  padding: 0.75rem 1.5rem; border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
  cursor: pointer; font-size: 1.1rem;
}

/* 再生中の状態（ボタンが動いている感じ） */
.playing {
  background: var(--surface2) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}
.eq {
  display: inline-flex; align-items: flex-end; gap: 3px;
  height: 1em; vertical-align: middle;
}
.eq i {
  width: 3px; height: 100%;
  background: var(--accent); border-radius: 2px;
  transform-origin: bottom;
  animation: eq 0.9s infinite ease-in-out;
}
.eq i:nth-child(1) { animation-delay: 0s; }
.eq i:nth-child(2) { animation-delay: 0.25s; }
.eq i:nth-child(3) { animation-delay: 0.45s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

/* レッスン一覧 */
/* 現在のレベル＋学習実績パネル */
.stats-panel {
  background: var(--surface); border-radius: 12px; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}
.stats-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.stats-label { font-size: 0.85rem; color: var(--muted); }
.points {
  font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.15;
}
.points-unit { font-size: 1rem; font-weight: 600; color: var(--muted); }
.next-point { font-size: 0.78rem; color: var(--muted); padding-bottom: 0.3rem; }
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
  border-top: 1px solid var(--surface2); padding-top: 0.85rem;
}
.stat { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat-sub { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.stat-label { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.stats-levels {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text);
  border-top: 1px solid var(--surface2); padding-top: 0.7rem;
}
.stats-hint { font-size: 0.7rem; color: var(--muted); margin-left: auto; }
.stats-grades { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.grade-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.8rem; color: var(--muted);
}
.stats-grades .rank { width: 1.5rem; height: 1.5rem; font-size: 0.85rem; }

.level-banner {
  background: var(--surface); border-radius: 10px; padding: 0.6rem 0.9rem;
  font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem;
}
.cap-banner {
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.85rem; color: var(--text);
}
.link-inline {
  background: none; border: none; color: #fbbf24; font-weight: 700;
  cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline;
}
/* 次に解放されるレッスン（内容は伏せる） */
.lesson.locked-next {
  border: 1px dashed var(--surface2);
  background: transparent;
  opacity: 0.75;
}
.locked-title { color: var(--muted); }
.btn-lock {
  padding: 0.7rem 0.9rem; border: 1px solid var(--surface2); border-radius: 10px;
  background: var(--surface2); color: var(--muted);
  cursor: default; font-size: 1.1rem; line-height: 1;
}
.recommend-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.06));
  border: 1px solid var(--accent); border-radius: 12px; padding: 0.8rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.rec-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; }
.rec-tag {
  background: var(--accent); color: var(--accent-fg); font-size: 0.72rem;
  font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px;
}
.rec-badge { color: var(--accent); font-size: 0.72rem; font-weight: 700; }
.lesson.rec { border: 1px solid var(--accent); }

.premium-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.premium-list li { background: var(--surface2); border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.9rem; }
/* アカウント削除（危険操作） */
.menu-item.danger { color: var(--ng); }
.danger-box {
  background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 10px; padding: 1rem; font-size: 0.9rem; line-height: 1.7;
}
.danger-title { color: var(--ng); font-weight: 700; margin: 0 0 0.5rem; }
.danger-list { margin: 0.5rem 0; padding-left: 1.2rem; }
.danger-list li { margin: 0.2rem 0; }
.btn-danger {
  padding: 0.75rem 1rem; border: none; border-radius: 10px;
  background: var(--ng); color: #3a0000; font-weight: 700;
  cursor: pointer; font-size: 1rem;
}
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
code {
  background: var(--surface2); padding: 0.1rem 0.35rem;
  border-radius: 4px; font-size: 0.9em;
}

.price {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  margin: 0.25rem 0 0.75rem;
}
.price-unit { font-size: 0.95rem; font-weight: 600; color: var(--muted); margin-left: 0.25rem; }
.premium-active {
  background: rgba(34, 197, 94, 0.15); color: var(--ok);
  border-radius: 10px; padding: 0.7rem 0.9rem; font-weight: 600;
  text-align: center; margin: 0 0 0.75rem;
}
.soon {
  margin-left: 0.4rem; font-size: 0.68rem; color: #fbbf24;
  border: 1px solid #fbbf24; border-radius: 999px; padding: 0.05rem 0.4rem;
}

.list { display: flex; flex-direction: column; gap: 0.75rem; }
.lesson {
  display: flex; align-items: flex-start; gap: 0.5rem;
  background: var(--surface); border-radius: 12px; padding: 1rem;
}
.lesson-main { flex: 1; min-width: 0; }
.lesson-right {
  flex: 0 0 auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 0.4rem;
}
.right-top { display: flex; align-items: center; gap: 0.6rem; }
.rank-col { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rank-label { font-size: 0.62rem; color: var(--muted); }
.lesson-title { font-weight: 600; }
.lesson-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.level {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700;
}
.level-beginner { background: rgba(34, 197, 94, 0.18); color: var(--ok); }
.level-intermediate { background: rgba(56, 189, 248, 0.18); color: var(--accent); }
.level-advanced { background: rgba(248, 113, 113, 0.18); color: var(--ng); }
.badge {
  display: inline-block; margin-top: 0.5rem; padding: 0.15rem 0.6rem;
  border-radius: 999px; background: var(--surface2); font-size: 0.75rem; color: var(--muted);
}
.badge.done { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.score { font-size: 0.8rem; color: var(--ok); margin-top: 0.35rem; }
.btn-retry {
  padding: 0.4rem 0.7rem; border: 1px solid var(--ng); border-radius: 8px;
  background: transparent; color: var(--ng); font-size: 0.8rem;
  cursor: pointer; white-space: nowrap;
}

/* リスニング */
.listening { display: flex; flex-direction: column; gap: 1.25rem; }
.counter { color: var(--muted); font-size: 0.85rem; }
.player { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
/* 再生ボタンは常に中央。「次へ」はその右に置き、再生の位置をずらさない */
.player-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.player-row > #play { grid-column: 2; justify-self: center; }
.player-row > .btn-next-quick { grid-column: 3; justify-self: start; }
.btn-next-quick {
  padding: 0.5rem 0.9rem; border: 1px solid var(--accent); border-radius: 999px;
  background: transparent; color: var(--accent); font-weight: 600;
  cursor: pointer; font-size: 0.9rem; white-space: nowrap;
}
.play-count { font-size: 0.85rem; color: var(--muted); }
.play-count.maxed { color: var(--ng); }

/* 評価バッジ S〜C */
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px;
  font-weight: 800; font-size: 1.1rem;
  background: var(--surface2); color: var(--text);
}
.rank-S { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1300; }
.rank-A { background: rgba(34, 197, 94, 0.2); color: var(--ok); }
.rank-B { background: rgba(56, 189, 248, 0.2); color: var(--accent); }
.rank-C { background: rgba(167, 139, 250, 0.2); color: #a78bfa; }
.rank-D { background: rgba(251, 146, 60, 0.2); color: #fb923c; }
.rank-E { background: rgba(248, 113, 113, 0.2); color: var(--ng); }
.rank-none { background: transparent; color: var(--surface2); border: 1px dashed var(--surface2); }
.big-rank { width: 3.5rem; height: 3.5rem; font-size: 2rem; margin: 0.5rem auto; }
.speeds { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.speed {
  padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid var(--surface2);
  background: none; color: var(--muted); cursor: pointer; font-size: 0.85rem;
}
.speed.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.answer-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.answer-box {
  min-height: 3rem; padding: 0.75rem; border-radius: 10px;
  background: var(--bg); border: 1px dashed var(--surface2);
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: flex-start;
}
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.chip {
  padding: 0.5rem 0.8rem; border-radius: 8px; border: 1px solid var(--surface2);
  background: var(--surface2); color: var(--text); cursor: pointer; font-size: 0.95rem;
}
.chip-answer { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.reveal { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--surface2); }
.result { font-weight: 700; font-size: 1.1rem; }
.result.ok { color: var(--ok); }
.result.ng { color: var(--ng); }
.reveal-line { font-size: 0.95rem; line-height: 1.7; }
.hint-inline { color: var(--muted); font-size: 0.78rem; }

/* 発音ガイド（弱形・連結のカタカナ）: 英文の下に点線で区切って表示 */
.pron-block {
  border-top: 1px dashed var(--surface2);
  margin-top: 0.35rem; padding-top: 0.45rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.pron-label { font-size: 0.7rem; color: var(--muted); }
.pron { font-size: 0.98rem; letter-spacing: 0.04em; color: var(--accent); }

/* 回答後の単語ハイライト */
.wm-en { cursor: pointer; border-radius: 4px; padding: 0 1px; }
.wm-en:hover { text-decoration: underline dotted; }
.hl { color: var(--ok) !important; font-weight: 700; }
.tag {
  display: inline-block; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 6px;
  background: var(--surface2); color: var(--muted); margin-right: 0.4rem;
}

/* トースト */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface2); color: var(--text); padding: 0.75rem 1.25rem;
  border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); z-index: 100;
}
.toast-error { background: #7f1d1d; color: #fecaca; }

/* ---- 法務文書（利用規約・プライバシーポリシー・特商法表記）---- */
.menu-sep { height: 1px; background: var(--surface2); margin: 0.35rem 0.3rem; }
.menu-item.small { font-size: 0.85rem; color: var(--muted); padding: 0.55rem 0.9rem; }
.menu-item.small:hover { color: var(--text); }

.legal { font-size: 0.9rem; line-height: 1.85; }
.legal h3 {
  font-size: 0.95rem; margin: 1.6rem 0 0.5rem; padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--surface2);
}
.legal h3:first-child { margin-top: 0; }
.legal p { margin: 0.5rem 0; }
.legal ol, .legal ul { margin: 0.5rem 0; padding-left: 1.4rem; }
.legal li { margin: 0.3rem 0; }
.legal a { color: var(--accent); word-break: break-all; }
.legal-note { color: var(--muted); font-size: 0.85rem; }
.legal-date { color: var(--muted); font-size: 0.85rem; margin-top: 1.8rem; text-align: right; }

/* 特商法表記の定義リスト */
.legal-dl { margin: 0; }
.legal-dl dt {
  font-weight: 700; color: var(--accent); font-size: 0.85rem;
  margin-top: 1.2rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--surface2);
}
.legal-dl dt:first-child { margin-top: 0; }
.legal-dl dd { margin: 0.5rem 0 0; padding: 0; }

/* 法務文書へのリンク（購入前・登録前に確認できるようにする） */
.link-sm {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: inherit; text-decoration: underline;
}
.link-sm:hover { opacity: 0.8; }
.legal-links {
  display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--surface2);
  font-size: 0.8rem;
}
.consent { color: var(--muted); font-size: 0.8rem; line-height: 1.7; margin: 0.2rem 0 0; }

/* ---- 回答確定後：回答を固定し、タップで発音する ---- */
/* 確定した回答は動かせない。破線→実線にして「確定済み」を示す */
.answer-box.locked { border-style: solid; border-color: var(--surface2); }
.answer-box.locked .chip-answer { cursor: pointer; }
/* 選び直しはできないが、発音のためタップは受け付ける */
.choices.locked .chip { opacity: 0.65; cursor: pointer; }
.choices.locked .chip:hover { opacity: 1; }
/* 発音中の単語を強調 */
.chip.speaking {
  outline: 2px solid var(--ok); outline-offset: 1px;
  animation: chip-speak 0.45s ease-out;
}
@keyframes chip-speak {
  from { transform: scale(1); }
  50%  { transform: scale(1.08); }
  to   { transform: scale(1); }
}

/* ---- トップ（未ログイン）---- */
.landing { gap: 0.9rem; }
.hero {
  padding-top: 2rem; padding-bottom: 1.8rem;
  /* 上部にごく淡いアクセントの光を入れて、のっぺりした印象を避ける */
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(56, 189, 248, 0.12), transparent 62%),
    var(--surface);
}

/* ロゴマーク（favicon と同じ図形。アプリアイコンとして見せる） */
.logo-mark {
  display: block; margin: 0 auto 1rem; border-radius: 22%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.logo-sm { margin-bottom: 0.8rem; border-radius: 24%; }

/* サービス名はヘッダーに出すので、ヒーローの見出しはキャッチコピーにする */
.hero-title {
  margin: 0 0 1rem; font-size: 1.7rem; font-weight: 700; line-height: 1.45;
  letter-spacing: 0.02em;
  animation: hero-in 0.6s ease-out both; /* 表示時にふわっと出す */
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 「聞いて」「並べる」を順に強調し、何をするアプリかを動きで伝える */
.hero-title .kw {
  display: inline-block;
  transition: color 0.45s ease, transform 0.45s ease;
}
.hero-title .kw.on { color: var(--accent); transform: translateY(-3px); }

/* 本文中の操作語（聞いて／ならべて）を強調し、何をするのか一目で分かるようにする */
.em-kw { color: var(--accent); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; }
  .hero-title .kw { transition: none; }
}

.hero-lead { margin: 0 0 1.4rem; font-size: 0.9rem; line-height: 1.9; color: var(--text); }
.back-top { display: block; text-align: left !important; margin-bottom: 0.6rem; }

.sec-title {
  margin: 0 0 0.9rem; font-size: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--surface2);
}

/* 料金 */
.plans { display: flex; flex-direction: column; gap: 0.8rem; }
.plan { border: 1px solid var(--surface2); border-radius: 12px; padding: 1rem; }
/* プレミアムは枠線で強調しない。このアプリではアクセント色の枠＝選択中を意味するため、
   料金表で使うと「選択済み」に見えてしまう。強調は価格の色で行う */
.plan-premium .plan-price { color: var(--accent); }
.plan-name { font-size: 0.8rem; color: var(--muted); }
.plan-price { font-size: 1.5rem; font-weight: 700; margin: 0.2rem 0 0.6rem; }
.plan-unit { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.plan-list { margin: 0; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.8; }

/* フッター（法務文書・問い合わせ先。未ログインでも到達できること） */
.landing-footer {
  display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center;
  padding: 0.5rem 0 1.5rem; font-size: 0.78rem;
}
.footer-contact { flex-basis: 100%; text-align: center; color: var(--muted); }
.footer-contact a { color: var(--accent); word-break: break-all; }

/* お試し完了時の登録導線 */
.demo-cta {
  margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--surface2);
}
.demo-cta p { font-size: 0.88rem; line-height: 1.8; }

/* ---- 使い方（1.聞く / 2.ならべる / 3.確かめる）---- */
.usteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.3rem; }
.ustep-head { display: flex; align-items: center; gap: 0.5rem; }
.ustep-no {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
.ustep-title { font-size: 0.95rem; }
.ustep-desc { margin: 0.45rem 0 0.7rem; font-size: 0.85rem; line-height: 1.8; color: var(--muted); }

/* 実演本体。レッスン画面と同じクラス(.player/.answer-box/.chip/.reveal)をそのまま使い、
   ここでは「縮小して埋め込む」ための調整だけを行う。動画は使わない（転送量ゼロ） */
.udemo {
  background: var(--bg); border: 1px solid var(--surface2); border-radius: 12px;
  padding: 0.85rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  pointer-events: none; /* 見せるだけ。操作は「登録せずに試してみる」から */
}
.udemo:empty { display: none; } /* 読み込み前・失敗時は枠を出さない */
.udemo .btn-round { padding: 0.45rem 1rem; font-size: 0.9rem; }
.udemo .play-count { font-size: 0.72rem; }
.udemo .speed { font-size: 0.72rem; padding: 0.25rem 0.5rem; }
.udemo .answer-label { font-size: 0.72rem; }
.udemo .answer-box { min-height: 2.5rem; padding: 0.45rem; }
.udemo .chip { font-size: 0.8rem; padding: 0.33rem 0.55rem; }
.udemo .reveal { font-size: 0.83rem; padding-top: 0; border-top: none; }
.udemo .result { font-size: 0.92rem; }

/* 回答へ移した単語は選択肢から消える（実際の挙動と同じ） */
.udemo .chip.used { opacity: 0; transform: scale(0.85); transition: opacity 0.2s, transform 0.2s; }
.udemo .chip.pop { animation: udemo-pop 0.26s ease-out; }
@keyframes udemo-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
/* タップされた瞬間を示す */
.udemo .tapped { animation: udemo-tap 0.35s ease-out; }
@keyframes udemo-tap {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.udemo .wm-en { border-radius: 4px; }

/* ---- トップのヘッダー（未ログイン） ----
   ログイン後の画面は既存の .header を使うため、クラス名を分けている。
   配色は白背景ではなくアプリ既存のダークトーンに合わせる（サイト全体との整合） */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--surface2);
}

.site-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
}
.site-logo { border-radius: 24%; flex: none; }

.site-nav { display: flex; align-items: center; gap: 0.35rem; }
.nav-link {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; color: var(--muted);
  padding: 0.45rem 0.5rem; border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-link:hover { color: var(--text); }

.nav-login { color: var(--accent); font-weight: 600; }
.nav-login:hover { color: var(--accent); background: rgba(56, 189, 248, 0.12); }

/* 無料登録は最も押してほしい操作なので塗りボタンにする */
.nav-signup {
  background: var(--accent); color: var(--accent-fg);
  font-weight: 700; padding: 0.45rem 0.8rem;
}
.nav-signup:hover { background: var(--accent); color: var(--accent-fg); filter: brightness(1.08); }

/* 狭い画面では区分リンクを隠し、ログイン／無料登録を残す
   （縦積みにするとヘッダーが高くなり、本文が押し下げられるため） */
@media (max-width: 480px) {
  .site-header { padding: 0.6rem 0; }
  .site-title { font-size: 1.05rem; }
  .nav-link[data-scroll] { display: none; }
}
