/* ===========================================================
   Nihongo Drills — main stylesheet
   Mobile-first, dark-mode-default, with light variant.
   =========================================================== */

:root {
  /* Dark theme (default) */
  --bg: #0f1419;
  --bg-elev: #161c24;
  --bg-elev-2: #1d2530;
  --bg-soft: #232c39;
  --line: #2a3340;
  --text: #e7ecf2;
  --text-dim: #9aa6b3;
  --text-faint: #6b7785;
  --accent: #ff5d6c;        /* Japanese-flag-ish red */
  --accent-soft: #ff5d6c33;
  --info: #5fa8ff;
  --info-soft: #5fa8ff22;
  --good: #51cf66;
  --good-soft: #51cf6622;
  --bad: #ff6b6b;
  --bad-soft: #ff6b6b22;
  --warn: #ffd43b;
  --warn-soft: #ffd43b22;
  --shadow: 0 4px 18px rgba(0,0,0,0.35);

  --jp-font: "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --en-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: 16px;
  --radius: 14px;
  --tabbar-h: 64px;
  --header-h: 56px;
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f2f6;
  --bg-soft: #e7ebf1;
  --line: #d8dde6;
  --text: #161c24;
  --text-dim: #4a5563;
  --text-faint: #7a8493;
  --accent: #d63d4b;
  --accent-soft: #d63d4b22;
  --info: #2c7be5;
  --info-soft: #2c7be522;
  --good: #2f9e44;
  --good-soft: #2f9e4422;
  --bad: #e03131;
  --bad-soft: #e0313122;
  --warn: #f08c00;
  --warn-soft: #f08c0022;
  --shadow: 0 4px 18px rgba(20,30,50,0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--en-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
a { color: inherit; text-decoration: none; }

.jp, .ja, .kanji, [lang="ja"] { font-family: var(--jp-font); }

/* ====== Header ====== */
.app-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
}
.app-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.app-title .jp { font-family: var(--jp-font); font-size: 18px; }
.app-title .dot { color: var(--accent); }
.app-title .en { color: var(--text-dim); font-weight: 600; font-size: 14px; }

.header-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-dim);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover, .icon-btn:active, .icon-btn.on {
  background: var(--bg-elev-2);
  color: var(--text);
}
.icon-btn.on { color: var(--accent); }

/* ====== View ====== */
.view {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.loading {
  text-align: center;
  color: var(--text-faint);
  padding: 60px 0;
}

/* ====== Tab bar ====== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 5;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s;
}
.tab .tab-icon { font-size: 20px; line-height: 1; filter: grayscale(0.4); }
.tab[aria-current="page"] {
  color: var(--accent);
}
.tab[aria-current="page"] .tab-icon {
  filter: none;
  transform: translateY(-1px);
}

/* ====== Generic components ====== */
.section { margin-bottom: 28px; }
.section h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin: 0 0 10px 0;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.06s ease, background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--bg-elev-2); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
[data-theme="dark"] .btn-primary { color: #fff; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-dim);
}
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-bad  { background: var(--bad-soft);  color: var(--bad);  }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
}
.empty-state .big {
  font-size: 40px;
  margin-bottom: 8px;
}
.empty-state .title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

/* ====== Dashboard ====== */
.hero-greeting {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}
.hero-greeting .jp { font-family: var(--jp-font); color: var(--accent); }
.hero-sub {
  color: var(--text-dim);
  margin: 0 0 18px 0;
  font-size: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.stat-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.stat-num.accent { color: var(--accent); }
.stat-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
}
.action-card:active { transform: scale(0.99); }
.action-card .ico {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev-2);
  border-radius: 12px;
  flex: 0 0 auto;
}
.action-card .body { flex: 1; min-width: 0; }
.action-card .body .title { font-weight: 600; font-size: 15px; }
.action-card .body .sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.action-card .arr { color: var(--text-faint); }
.action-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-elev), var(--accent-soft));
}
.action-card.featured .ico { background: var(--accent); color: #fff; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.bar-row:last-child { border-bottom: 0; }
.bar-row .label {
  flex: 0 0 110px;
  font-size: 13px;
  text-transform: capitalize;
}
.bar-row .meter {
  flex: 1;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-row .meter-fill {
  height: 100%;
  background: var(--good);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.bar-row .meter-fill.low { background: var(--bad); }
.bar-row .meter-fill.mid { background: var(--warn); }
.bar-row .pct {
  flex: 0 0 64px;
  text-align: right;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.profile-list { list-style: none; margin: 0; padding: 0; }
.profile-list li {
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--line);
}
.profile-list li:last-child { border-bottom: 0; }
.profile-list li::before {
  content: "•";
  color: var(--accent);
  margin-right: 8px;
}
.profile-list.weak li::before { color: var(--warn); }

/* ====== Cards (flashcards) ====== */
.cards-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.cards-meta .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cards-meta .pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 11.5px;
}
.cards-meta .pill.due { background: var(--accent-soft); color: var(--accent); }
.cards-meta .pill.new { background: var(--info-soft); color: var(--info); }
.cards-meta .pill.rev { background: var(--good-soft); color: var(--good); }

.flashcard {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px 22px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
}
.flashcard.flash-good { animation: flashGood 0.35s ease; }
.flashcard.flash-bad  { animation: flashBad 0.35s ease;  }
@keyframes flashGood {
  0% { box-shadow: 0 0 0 0 var(--good-soft); }
  50% { box-shadow: 0 0 0 8px var(--good-soft); }
  100% { box-shadow: var(--shadow); }
}
@keyframes flashBad {
  0% { box-shadow: 0 0 0 0 var(--bad-soft); }
  50% { box-shadow: 0 0 0 8px var(--bad-soft); }
  100% { box-shadow: var(--shadow); }
}

.flashcard .badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fc-front {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 0;
  cursor: pointer;
}
.fc-furigana {
  font-family: var(--jp-font);
  font-size: 16px;
  color: var(--text-faint);
  margin-bottom: 6px;
  min-height: 22px;
}
.fc-kanji {
  font-family: var(--jp-font);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 1px;
  word-break: break-all;
  line-height: 1.2;
}
.fc-front-hint {
  margin-top: 18px;
  color: var(--text-faint);
  font-size: 13px;
}

.fc-back {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fc-back .reading {
  font-family: var(--jp-font);
  font-size: 22px;
  color: var(--accent);
  text-align: center;
}
.fc-back .english {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}
.fc-back .example {
  background: var(--bg-elev-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.fc-back .example .jp {
  font-family: var(--jp-font);
  font-size: 17px;
  margin-bottom: 4px;
}
.fc-back .example .en {
  color: var(--text-dim);
}
.fc-back .notes {
  font-size: 13px;
  color: var(--text-dim);
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 10px;
  background: var(--bg-elev-2);
  border-radius: 4px;
}
.fc-back .notes.warn {
  border-left-color: var(--warn);
  color: var(--warn);
}

.answer-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.ans-btn {
  padding: 12px 6px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.06s ease;
}
.ans-btn:active { transform: scale(0.96); }
.ans-btn .ans-sub { font-size: 10px; font-weight: 500; color: var(--text-faint); }
.ans-btn.again { color: var(--bad); border-color: var(--bad-soft); background: var(--bad-soft); }
.ans-btn.hard  { color: var(--warn); border-color: var(--warn-soft); background: var(--warn-soft); }
.ans-btn.good  { color: var(--good); border-color: var(--good-soft); background: var(--good-soft); }
.ans-btn.easy  { color: var(--info); border-color: var(--info-soft); background: var(--info-soft); }

/* ====== Grammar / drills ====== */
.drill-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.drill-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drill-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  font-weight: 600;
}
.drill-prompt {
  font-size: 17px;
  font-weight: 500;
  font-family: var(--jp-font);
  line-height: 1.5;
}
.drill-prompt .blank {
  display: inline-block;
  min-width: 36px;
  border-bottom: 2px solid var(--accent);
  text-align: center;
  margin: 0 4px;
  font-weight: 700;
  color: var(--accent);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choices.row-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choice {
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-elev-2);
  border: 2px solid transparent;
  font-family: var(--jp-font);
  font-size: 16px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.choice .marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  flex-shrink: 0;
  font-family: var(--en-font);
}
.choice:hover { background: var(--bg-soft); }
.choice:active { transform: scale(0.99); }
.choice.is-correct {
  background: var(--good-soft);
  border-color: var(--good);
  color: var(--good);
}
.choice.is-correct .marker { background: var(--good); color: #fff; }
.choice.is-wrong {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
}
.choice.is-wrong .marker { background: var(--bad); color: #fff; }
.choice.dim { opacity: 0.55; }
.choice[disabled] { cursor: default; }

.explanation {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-elev-2);
  border-left: 4px solid var(--info);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.explanation.correct { border-left-color: var(--good); }
.explanation.wrong   { border-left-color: var(--bad);  }
.explanation .verdict {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.explanation.correct .verdict { color: var(--good); }
.explanation.wrong   .verdict { color: var(--bad); }

.drill-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.cat-pill[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ====== Pronunciation ====== */
.trap-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.trap-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.trap-word {
  font-family: var(--jp-font);
  font-size: 24px;
  font-weight: 700;
}
.severity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 7px;
  border-radius: 999px;
}
.severity.high { background: var(--bad-soft); color: var(--bad); }
.severity.medium { background: var(--warn-soft); color: var(--warn); }
.severity.low { background: var(--info-soft); color: var(--info); }

.trap-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  margin: 4px 0;
}
.trap-row .label {
  color: var(--text-faint);
  min-width: 86px;
  font-size: 12px;
}
.trap-row .reading {
  font-family: var(--jp-font);
  font-weight: 600;
}
.trap-row .reading.correct { color: var(--good); }
.trap-row .reading.wrong { color: var(--bad); text-decoration: line-through; }
.trap-meaning {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}
.trap-notes {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  line-height: 1.5;
}

.pair-quiz {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.pair-prompt {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.pair-prompt strong { color: var(--text); }
.pair-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pair-options .choice {
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 18px;
  padding: 16px 10px;
}
.pair-options .choice .reading-sub {
  font-family: var(--jp-font);
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 4px;
  font-weight: 500;
}
.pair-options .choice.is-correct .reading-sub { color: var(--good); }
.pair-options .choice.is-wrong .reading-sub { color: var(--bad); }

/* ====== Lessons timeline ====== */
.lesson-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.lesson-head {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.lesson-head .meta { flex: 1; min-width: 0; }
.lesson-head .date {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lesson-head .title {
  font-weight: 600;
  font-size: 15px;
  margin-top: 2px;
}
.lesson-head .toggle { color: var(--text-faint); font-size: 18px; }
.lesson-body {
  padding: 0 16px 14px 16px;
  border-top: 1px solid var(--line);
  display: none;
}
.lesson-card.open .lesson-body { display: block; }
.lesson-card.open .toggle { transform: rotate(180deg); }
.lesson-body h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin: 12px 0 6px 0;
  font-weight: 600;
}
.lesson-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lesson-body ul li {
  padding: 4px 0;
  font-size: 13.5px;
  color: var(--text-dim);
}
.lesson-body ul li::before { content: "·"; color: var(--accent); margin-right: 8px; }

.correction {
  background: var(--bg-elev-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0;
  font-size: 13px;
}
.correction .said {
  font-family: var(--jp-font);
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-color: var(--bad);
}
.correction .arr { margin: 0 6px; color: var(--text-faint); }
.correction .should {
  font-family: var(--jp-font);
  color: var(--good);
  font-weight: 600;
}
.correction .fixes {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ====== Filter sheet ====== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ====== Utility ====== */
.hidden { display: none !important; }
.center { text-align: center; }
.spacer { flex: 1; }

@media (min-width: 600px) {
  .answer-bar { gap: 10px; }
  .ans-btn { font-size: 14px; }
  .stat-grid { gap: 14px; }
  .stat-num { font-size: 30px; }
  .pair-options { gap: 14px; }
}

/* ====== Ruby annotations (furigana over kanji) ====== */
ruby {
  ruby-position: over;
  ruby-align: center;
}
rt {
  font-family: var(--jp-font);
  font-size: 0.5em;
  font-weight: 400;
  color: var(--text-faint);
  line-height: 1.1;
  letter-spacing: 0;
  user-select: none;
}
/* Furigana toggle: when off, hide all rt elements globally. */
[data-furigana="off"] rt { display: none; }

.fc-kanji rt { font-size: 0.4em; color: var(--accent); opacity: 0.85; }
.fc-back .reading rt { font-size: 0.5em; }
.drill-prompt rt { color: var(--text-dim); }

/* ====== Play / TTS button ====== */
.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 44px;          /* touch target */
  min-height: 44px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, transform 0.06s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.play-btn:hover { background: var(--bg-soft); color: var(--text); }
.play-btn:active { transform: scale(0.92); }
.play-btn.playing {
  background: var(--accent-soft);
  color: var(--accent);
  animation: playPulse 0.8s ease-in-out;
}
.play-btn-sm {
  width: 30px;
  height: 30px;
  min-width: 36px;
  min-height: 36px;
  font-size: 12px;
}
@keyframes playPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* Layout helper: inline jp text + play button */
.jp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jp-row .jp-text { flex: 1 1 auto; min-width: 0; }
.jp-row.center { justify-content: center; }

/* Flashcard front gets a centered play button below the kanji */
.fc-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* Choice rows: when audio is enabled, left side is the label, right is the play button */
.choice {
  cursor: pointer;
  user-select: none;
}
.choice .choice-label {
  flex: 1 1 auto;
  min-width: 0;
}
.choice[disabled] { cursor: default; }
.choice .play-btn { width: 30px; height: 30px; min-width: 36px; min-height: 36px; font-size: 12px; }

.pair-options .choice {
  flex-direction: column;
  position: relative;
}
.pair-options .choice .play-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* Trap card with play button */
.trap-head .play-btn { width: 32px; height: 32px; min-width: 40px; min-height: 40px; font-size: 13px; }

/* ====== Senseis section ====== */
.senseis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sensei-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sensei-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  overflow: hidden;
  border: 2px solid var(--line);
}
.sensei-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sensei-title {
  font-family: var(--jp-font);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
.sensei-role {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}
