/* ==========================================================================
   HALAMAN KANA — NihongoDo v2
   Mencakup: hub kana, halaman belajar (learn), kuis, dan ulasan adaptif.
   ========================================================================== */

/* ─── HERO ──────────────────────────────────────────────── */
.kana-learn-hero .kana-hero-title {
  font-size: var(--fs-xl);
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-soft);
  margin: var(--space-2) 0 0;
}
.kana-hero-title {
  margin-bottom: 0;
}

/* ─── KARTU SCRIPT (hub kana: Hiragana / Katakana) ──────── */
.kana-script-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-4);
}
.ksc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ksc-glyph {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: var(--indigo-light);
}
.ksc-badge {
  font-size: 10px;
}
.ksc-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.ksc-desc {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 0;
}
.ksc-stats {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-soft);
  font-family: var(--font-mono);
}
.ksc-num {
  font-weight: 700;
  color: var(--gold-light);
}
.ksc-bar {
  height: 5px;
  margin: 2px 0;
}
.ksc-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
}
.text-small {
  font-size: 10px;
}

/* ─── ACTION CARDS ───────────────────────────────────────── */
.action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: var(--space-3);
}
.act-icon {
  font-size: 28px;
}
.act-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.act-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
  flex: 1;
}
.action-card .c-button {
  margin-top: auto;
}

/* ─── LEARNING PATH GRID ─────────────────────────────────── */
.learning-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.path-step {
  border: 1px solid var(--border);
  background: var(--color-surface);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.path-step:focus-visible {
  outline: 2px solid var(--indigo-light);
  outline-offset: 2px;
}
.path-step.unlocked:hover {
  border-color: var(--indigo-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.path-step.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--ink-2);
}
.ps-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-step {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.path-step.locked .ps-step {
  background: var(--ink-5);
}
.ps-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
}
.ps-lock {
  font-size: 14px;
  margin-left: auto;
}
.ps-desc {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}
.ps-chars {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.ps-char {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--indigo-light);
}
.ps-more {
  font-size: 11px;
  color: var(--text-ghost);
  align-self: flex-end;
}
.ps-bar {
  height: 3px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.ps-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* Langkah yang sudah dikuasai */
.path-step.unlocked .ps-step {
  background: var(--jade);
}

/* ─── CHAR GRID (kisi karakter dalam sebuah grup) ────────── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: var(--space-2);
}

.char-card {
  overflow: hidden;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
  background: var(--color-surface);
}
.char-card:hover {
  border-color: var(--indigo-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.char-card:focus-visible {
  outline: 2px solid var(--indigo-light);
}
.char-card.cc-highlight-flash {
  animation: cc-highlight-pulse 1.6s ease;
}
@keyframes cc-highlight-pulse {
  0%,
  100% {
    box-shadow: none;
    border-color: var(--border);
  }
  15%,
  45% {
    box-shadow: var(--shadow-glow-indigo);
    border-color: var(--indigo-light);
  }
}

/* Status karakter */
.char-card.new {
  background: var(--ink-2);
}
.char-card.seen {
  background: var(--ink-3);
  border-color: var(--border-light);
}
.char-card.learning {
  background: linear-gradient(135deg, var(--ink-2), var(--indigo-ghost));
  border-color: var(--indigo-dim);
}
.char-card.mastered {
  border-color: var(--gold-dim);
  border-color: var(--jade);
  background: rgba(47, 139, 99, 0.16);
}
.char-card.mastered::after {
  content: "済";
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 9px;
  color: var(--gold-light);
  font-family: var(--font-display);
}

.char-card .glyph {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
}
.char-card .romaji {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--indigo-light);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.char-card:hover .romaji,
.char-card.flipped .romaji,
.char-card.mastered .romaji {
  opacity: 1;
}

/* Titik akurasi */
.char-card .acc-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* ─── DETAIL PANEL KARAKTER ──────────────────────────────── */
.char-detail-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--ink-2);
  padding: var(--space-4);
  margin-top: var(--space-3);
  position: relative;
  box-shadow: var(--shadow-lg);
}
.cdp-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cdp-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}
.cdp-char {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  color: var(--indigo-light);
  margin-bottom: 12px;
}
.cdp-glyph {
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 1;
  color: var(--text);
}
.cdp-romaji {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  color: var(--indigo-light);
  font-weight: 700;
}
.cdp-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.cdp-strokes {
  font-size: 12px;
  color: var(--text-faint);
}
.cdp-diff {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}
.diff-1 {
  background: var(--jade-ghost);
  color: var(--jade-light);
}
.diff-2 {
  background: var(--gold-ghost);
  color: var(--gold-light);
}
.diff-3 {
  background: var(--shu-ghost);
  color: var(--shu-light);
}

/* SRS status badge */
.cdp-srs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.srs-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 600;
}
.srs-badge.new {
  background: var(--ink-4);
  color: var(--text-faint);
  border: 1px solid var(--border);
}
.srs-badge.seen {
  background: var(--indigo-ghost);
  color: var(--indigo-light);
  border: 1px solid var(--indigo-dim);
}
.srs-badge.learning {
  background: var(--gold-ghost);
  color: var(--gold-light);
  border: 1px solid var(--gold-dim);
}
.srs-badge.mastered {
  background: var(--jade-ghost);
  color: var(--jade-light);
  border: 1px solid var(--jade-dim);
}
.cdp-acc,
.cdp-streak {
  font-size: 12px;
  color: var(--text-soft);
}

/* Stroke order */
.cdp-stroke-order h4,
.cdp-examples h4,
.cdp-confusing h4,
.cdp-writing h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}
/* ── Stroke Order Interactive ─────────────────────────── */
.stroke-vis {
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Pratinjau karakter + progress bar sapuan */
.stroke-char-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scp-glyph {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  color: var(--indigo-light);
  opacity: 0.15;
  transition:
    opacity 0.35s ease,
    color 0.35s ease;
}
.scp-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--ink-5);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.scp-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--indigo), var(--jade-light));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Tombol sapuan */
.stroke-btns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stroke-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-4);
  border: 2px solid var(--border);
  color: var(--text-faint);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}
.stroke-btn:hover {
  border-color: var(--indigo-light);
  color: var(--indigo-light);
  transform: scale(1.08);
}
.stroke-btn:focus-visible {
  outline: 2px solid var(--indigo-light);
  outline-offset: 2px;
}
.stroke-btn.stroke-done {
  background: var(--indigo-ghost);
  border-color: var(--indigo-dim);
  color: var(--indigo-light);
}
.stroke-btn.stroke-active {
  background: var(--indigo) !important;
  border-color: var(--indigo-light) !important;
  color: #fff !important;
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(74, 109, 161, 0.5);
}

/* Detail box sapuan */
.stroke-detail-box {
  min-height: 52px;
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}
.sdb-idle {
  color: var(--text-ghost);
  font-style: italic;
}
.sdb-active {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sdb-step {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sdb-arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--indigo-light);
}
.sdb-done {
  font-size: 12px;
  color: var(--jade-light);
}
.sdb-next {
  font-size: 11px;
  color: var(--text-ghost);
}

/* Examples */
.cdp-ex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.cdp-ex:last-child {
  border-bottom: none;
}
.cdp-ex-word {
  font-family: var(--font-display);
  font-size: 18px;
}
.cdp-ex-romaji {
  font-family: var(--font-mono);
  font-size: 12px;
}
.cdp-ex-meaning {
  font-size: 13px;
  flex: 1;
}

/* Confusing chars */
.cdp-conf-chars {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cdp-conf-char {
  font-family: var(--font-display);
  font-size: 24px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shu-dim);
  background: var(--shu-ghost);
  color: var(--shu-light);
}
.cdp-conf-char small {
  font-family: var(--font-mono);
  font-size: 10px;
  display: block;
  color: var(--text-faint);
}

/* Writing practice */
.writing-canvas-wrap {
  position: relative;
  display: inline-block;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--washi);
}
#writing-canvas {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  width: 200px;
  height: 200px;
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.writing-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 120px;
  color: rgba(74, 109, 161, 0.12);
  pointer-events: none;
  user-select: none;
}
.writing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Actions */
.cdp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── SEARCH ─────────────────────────────────────────────── */
.kana-search-section {
  margin-bottom: var(--space-4);
}
.kana-search-wrap {
  max-width: 400px;
}
.search-results-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  min-height: 4px;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  gap: 3px;
  cursor: pointer;
}
.sr-glyph {
  font-family: var(--font-display);
  font-size: 28px;
}
.sr-romaji {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--indigo-light);
}

/* ─── HARDEST CHARS ──────────────────────────────────────── */
.hardest-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hard-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}
.hard-glyph {
  font-family: var(--font-display);
  font-size: 28px;
}
.hard-acc {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.kana-hardest {
  margin-bottom: var(--space-4);
}

/* ─── CONFUSING PAIRS ────────────────────────────────────── */
.confusing-pairs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.confusing-pair-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--space-3);
  align-items: flex-start;
}
.cp-chars {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--shu-light);
  line-height: 1;
}
.cp-label {
  font-size: 12px;
  color: var(--text-faint);
}

/* ─── KUIS ───────────────────────────────────────────────── */
.quiz-page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.quiz-page-title {
  margin: 0;
  font-size: var(--fs-xl);
}

.quiz-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.qc-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.qc-label {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
  min-width: 52px;
  flex: 1;
  text-align: center;
}
.qc-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qc-btns .c-button.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

.quiz-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 340px;
}

/* Progress bar */
.quiz-header {
  margin-bottom: var(--space-4);
}
.quiz-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-progress-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--ink-4);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.quiz-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--indigo-light));
  border-radius: var(--radius-full);
  transition: width var(--dur-med) var(--ease);
}
.quiz-progress-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Prompt */
.quiz-prompt {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-char {
  font-family: var(--font-display);
  font-size: clamp(64px, 15vw, 96px);
  line-height: 1;
  color: var(--text);
}
.quiz-romaji-prompt {
  font-family: var(--font-mono);
  font-size: clamp(32px, 8vw, 56px);
  color: var(--indigo-light);
  font-weight: 700;
}

/* Pilihan ganda */
.quiz-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.quiz-choice {
  height: 52px !important;
  font-size: 14px !important;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.quiz-choice-char {
  font-family: var(--font-display);
  font-size: 28px !important;
  height: 64px !important;
}
.quiz-choice.correct-choice {
  background: var(--jade) !important;
  border-color: var(--jade) !important;
  color: #fff !important;
}
.quiz-choice.wrong-choice {
  background: var(--shu) !important;
  border-color: var(--shu) !important;
  color: #fff !important;
}

/* Ketikan */
.quiz-typing-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  font-family: var(--font-mono);
  background: var(--ink-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  margin-bottom: 8px;
  transition: border-color var(--dur-fast) var(--ease);
}
.quiz-typing-input:focus {
  border-color: var(--indigo-light);
}
.quiz-typing-input::placeholder {
  color: var(--text-ghost);
}

/* Feedback */
.quiz-feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-feedback.correct {
  background: var(--jade-ghost);
  color: var(--jade-light);
  border: 1px solid var(--jade-dim);
}
.quiz-feedback.wrong {
  background: var(--shu-ghost);
  color: var(--shu-light);
  border: 1px solid var(--shu-dim);
}
.fb-icon {
  font-size: 20px;
}

/* Hasil kuis */
.quiz-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  text-align: center;
}
.qr-score {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
}
.qr-score.qr-great {
  background: var(--jade-ghost);
  border: 2px solid var(--jade);
}
.qr-score.qr-ok {
  background: var(--gold-ghost);
  border: 2px solid var(--gold);
}
.qr-score.qr-retry {
  background: var(--shu-ghost);
  border: 2px solid var(--shu);
}
.qr-pct {
  display: block;
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}
.qr-label {
  display: block;
  font-size: 16px;
  margin-top: 6px;
  font-weight: 600;
}
.qr-stats {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}
.qr-stat {
  text-align: center;
}
.qr-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
}
.qr-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.qr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.qr-perfect-badge {
  background: var(--gold-ghost);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

/* Pintasan keyboard */
.quiz-shortcuts {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-4);
  font-size: 11px;
  color: var(--text-ghost);
}
.qs-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
kbd {
  background: var(--ink-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-soft);
}

/* Loading spinner */
.quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-faint);
}
.ql-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--indigo-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Confusing info banner */
.confusing-info {
  background: var(--indigo-ghost);
  border: 1px solid var(--indigo-dim);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.confusing-info h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.conf-pairs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.conf-pair-badge {
  border: 1px solid var(--border-light);
  background: var(--indigo);
  color: #fff;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: var(--font-display);
}

/* ─── ULASAN ADAPTIF ─────────────────────────────────────── */
.review-page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.review-page-title {
  margin: 0;
  font-size: var(--fs-xl);
  flex: 1;
}
.review-srs-badge {
  background: var(--amethyst-dim);
  border: 1px solid var(--amethyst, #7b5fc0);
  color: var(--amethyst-light);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* Session bar */
.review-session-bar {
  margin-bottom: var(--space-3);
}
.rsb-stats {
  display: flex;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.rsb-left {
  color: var(--shu-light);
}
.rsb-bar {
  height: 6px;
}

/* Keyboard hints */
.review-hints {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  font-size: 11px;
  color: var(--text-ghost);
}
.rh-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Flash card */
.review-card-container {
  max-width: 500px;
  margin: 0 auto var(--space-4);
}
.review-flashcard {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--ink-2);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.fc-front,
.fc-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}
.fc-char {
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--text);
}
.fc-hint {
  font-size: 13px;
}
.fc-flip-btn {
  margin-top: var(--space-2);
}
.fc-romaji {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--indigo-light);
}
.fc-type {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fc-example {
  font-size: 13px;
  line-height: 1.5;
}
.fc-acc {
  font-family: var(--font-mono);
  font-size: 12px;
}
.fc-audio {
  align-self: center;
}

/* Eval buttons — 3 kolom sejajar, tidak wrap */
.fc-eval-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-3);
}
.fc-btn {
  width: 100%;
  min-width: 0;
  padding-left: var(--space-2) !important;
  padding-right: var(--space-2) !important;
  font-size: 13px !important;
}

/* Selesai */
.review-complete,
.review-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  text-align: center;
}
.rc-icon,
.re-icon {
  font-size: 48px;
}
.rc-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.rc-next {
  max-width: 320px;
  font-size: 13px;
}
.rc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* SRS explainer */
.srs-explainer {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-4);
  background: var(--ink-2);
}
.srs-explainer summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  user-select: none;
}
.srs-exp-body {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.7;
}
.srs-exp-body ul {
  padding-left: var(--space-3);
  margin: var(--space-2) 0;
}
.srs-exp-body li {
  margin-bottom: 6px;
}

/* ─── RESPONSIF ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .quiz-choices {
    grid-template-columns: 1fr;
  }
  .fc-char {
    font-size: 72px;
  }
  .cdp-glyph {
    font-size: 56px;
  }
  .learning-path-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }
  .ksc-glyph {
    font-size: 36px;
  }
  .qr-pct {
    font-size: 40px;
  }
  .quiz-controls {
    gap: var(--space-3);
  }
}

/* ─── PROFIL PROGRES DI HUB ──────────────────────────────── */
.text-jade {
  color: var(--jade-light);
}
.text-shu {
  color: var(--shu-light);
}
.has-due {
  color: var(--shu-light) !important;
}

/* ─── ACHIEVEMENTS GRID ──────────────────────────────────── */
#kana-achievements .ach-card {
  min-width: 150px;
}

/* ─── SKIP LINK ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  background: var(--indigo);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: var(--z-tooltip);
  font-weight: 700;
  text-decoration: none;
}

/* ==========================================================================
   FITUR BARU v3 — Mastery, Adaptive, Mnemonic, Writing, Analytics, dll.
   ========================================================================== */

/* ─── MASTERY SCORE COLORS ──────────────────────────────── */
.text-gold {
  color: var(--gold-light);
}

/* ─── LEARNING LAYOUT (sidebar + main) ──────────────────── */
.kana-learn-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-3);
  align-items: start;
  margin-top: var(--space-3);
}
.learn-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  .kana-learn-layout {
    grid-template-columns: 1fr;
  }
  .learn-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}
.sidebar-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.learn-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Path steps in sidebar */
.path-step.active {
  border-color: var(--indigo-light);
  background: var(--indigo-ghost);
}
.ps-count {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.ps-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Char grid */
.learn-grid-section {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.char-card.active {
  border-color: var(--indigo-light);
  background: var(--indigo-ghost);
}
.char-card.learned {
  border-color: var(--jade-dim);
  background: rgba(47, 139, 99, 0.08);
}
.cc-char {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  color: var(--text);
}
.cc-romaji {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.cc-mastery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
}

/* ─── CHAR DETAIL PANEL ──────────────────────────────────── */
.char-detail {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.cd-placeholder {
  text-align: center;
  padding: var(--space-5);
  color: var(--text-faint);
}

.detail-header {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.detail-char-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.detail-char {
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 1;
  color: var(--text);
}
.detail-audio {
  font-size: 20px;
}
.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-romaji {
  font-size: 32px;
  font-weight: 800;
  color: var(--indigo-light);
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ink-4);
  color: var(--text-soft);
}
.badge.outline {
  background: transparent;
  border: 1px solid var(--border-light);
}

/* Mastery bar in detail */
.detail-mastery {
  margin: var(--space-3) 0;
}
.dm-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.dm-bar {
  flex: 1;
  height: 6px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.dm-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.dm-label {
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.dm-stats {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
}

/* Mnemonic in detail */
.detail-mnemonic {
  background: var(--gold-ghost);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-3) 0;
}
.dm-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-soft);
}
.dm-visual-hint {
  font-size: 12px;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 4px;
}
.dm-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 4px;
}
.dm-tip {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}

/* Stroke order */
.detail-stroke-order {
  margin: var(--space-3) 0;
}
.stroke-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stroke-step {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ink-3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
}
.ss-num {
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.ss-char {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--indigo-light);
}
.ss-desc {
  color: var(--text-faint);
  font-size: 14px;
  margin: 0;
}

/* Examples */
.detail-examples {
  margin: var(--space-3) 0;
}
.example-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.example-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ex-word {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--indigo-light);
  padding: 0;
}
.ex-reading {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-ghost);
}
.ex-meaning {
  font-size: 12px;
  color: var(--text-soft);
}

/* Writing practice */
.detail-writing {
  margin: var(--space-3) 0;
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}
.writing-mode-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.writing-mode-btn.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.trace-char {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 180px;
  color: rgba(99, 102, 241, 0.12);
  pointer-events: none;
  user-select: none;
}
.guide-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-color: rgba(99, 102, 241, 0.2);
}
.guide-grid span {
  border: 1px dashed rgba(99, 102, 241, 0.2);
}

.writing-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.writing-score {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}
.writing-score.visible {
  opacity: 1;
}
.writing-score.good {
  background: var(--jade-ghost);
  border: 1px solid var(--jade-dim);
  color: var(--jade-light);
}
.writing-score.ok {
  background: var(--gold-ghost);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: var(--space-3);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

/* ─── MASTERY BAR (quiz, review, detail) ─────────────────── */
.quiz-mastery-row {
  height: 3px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0;
}
.quiz-mastery-fill {
  height: 100%;
  border-radius: 99px;
  transition:
    width 0.4s ease,
    background 0.4s ease;
}
.fc-mastery-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.fc-mastery-track {
  flex: 1;
  height: 4px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.fc-mastery-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.fc-mastery-label {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ─── MNEMONIC in QUIZ / REVIEW ─────────────────────────── */
.quiz-mnemonic {
  margin: 10px 0;
}
.quiz-mnemonic-box {
  background: var(--gold-ghost);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.qmn-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.qmn-text {
  font-size: 13px;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.6;
}
.qmn-tip {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
}

.fc-mnemonic-hint summary {
  list-style: none;
}
.fc-mnemonic-hint summary::-webkit-details-marker {
  display: none;
}
.fc-mnemonic-toggle {
  font-size: 11px;
  color: var(--gold-light);
}
.fc-mnemonic-body {
  margin-top: 8px;
  background: var(--gold-ghost);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-faint);
}
.fc-mnemonic-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 4px;
}

/* ─── WEAK KANA BOX ─────────────────────────────────────── */
.weak-kana-box {
  background: rgba(200, 69, 46, 0.06);
  border: 1px solid var(--shu-dim);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.wk-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--shu-light);
  margin: 0 0 10px;
}
.wk-chars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wk-char-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
}
.wk-char {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}
.wk-romaji {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-faint);
}
.wk-score {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
}
.wk-practice-btn {
  display: inline-flex;
}

/* ─── QUIZ NEW: feedback time, choice highlighting ───────── */
.fb-time {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 8px;
  font-family: var(--font-mono);
}
.correct-choice {
  border-color: var(--jade-light) !important;
  background: var(--jade-ghost) !important;
  color: var(--jade-light);
}
.wrong-choice {
  border-color: var(--shu-light) !important;
  background: var(--shu-ghost) !important;
  color: var(--shu-light);
}

/* ─── ANALYTICS SECTION ──────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.an-card {
  padding: var(--space-3);
}
.an-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.an-mastery-big {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}
.an-mastery-num {
  font-size: 48px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.an-mastery-max {
  font-size: 20px;
  color: var(--text-faint);
}
.an-mastery-bar-bg {
  height: 6px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.an-mastery-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.an-mastery-label {
  font-size: 12px;
  color: var(--text-faint);
}
.an-kana-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.an-kana-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.an-kana-char {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  width: 30px;
  text-align: center;
  flex-shrink: 0;
}
.an-kana-romaji {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  min-width: 28px;
}
.an-kana-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.an-kana-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.an-kana-score {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.an-action-btn {
  margin-top: 4px;
}
.an-conf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.an-conf-pair {
  display: flex;
  align-items: center;
  gap: 10px;
}
.an-conf-chars {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--indigo-light);
  min-width: 70px;
}
.an-conf-sub {
  font-size: 11px;
  flex: 1;
}
.an-conf-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--shu-light);
  font-family: var(--font-mono);
}

/* ─── DAILY CHALLENGE ────────────────────────────────────── */
.kana-daily-challenge {
  padding: var(--space-3);
}
.kdc-inner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  flex-wrap: wrap;
}
.kdc-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.kdc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kdc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.kdc-desc {
  font-size: 13px;
}
.kdc-bar-bg {
  height: 5px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0;
}
.kdc-fill {
  height: 100%;
  background: var(--indigo-light);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.kdc-fill.done {
  background: var(--jade-light);
}
.kdc-progress {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* Home page daily challenge */
.dc-header {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: 10px;
}
.dc-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.dc-text {
  flex: 1;
}
.dc-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
}
.dc-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}
.dc-xp {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.dc-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.dc-bar {
  flex: 1;
  height: 5px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.dc-fill {
  height: 100%;
  background: var(--indigo-light);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.dc-fill.done {
  background: var(--jade-light);
}
.dc-progress {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.dc-claimed {
  display: flex;
  align-items: center;
  color: var(--jade-light);
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}
.dc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-claim-btn {
  margin-top: 4px;
}

/* ─── HEATMAP ────────────────────────────────────────────── */
.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}
.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hm-stats {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hm-stat {
  font-size: 12px;
  color: var(--text-faint);
}
.hm-stat strong {
  color: var(--text);
}
.hm-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hm-leg-label {
  font-size: 10px;
  color: var(--text-ghost);
}
.heatmap-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 12px);
  gap: 2px;
  margin-bottom: 4px;
  margin-left: 4px;
}
.heatmap-day-labels span {
  font-size: 9px;
  color: var(--text-ghost);
  text-align: center;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(53, 12px);
  grid-auto-rows: 12px;
  gap: 2px;
}
.hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: default;
  transition: transform 0.1s;
}
.hm-cell:hover {
  transform: scale(1.4);
  z-index: 1;
}
.hm-pad {
  background: transparent;
  pointer-events: none;
}
.hm-l0 {
  background: var(--ink-4);
}
.hm-l1 {
  background: rgba(74, 109, 161, 0.3);
}
.hm-l2 {
  background: rgba(74, 109, 161, 0.55);
}
.hm-l3 {
  background: rgba(74, 109, 161, 0.8);
}
.hm-l4 {
  background: var(--indigo-light);
}
.heatmap-month-labels {
  display: grid;
  grid-template-columns: repeat(53, 12px);
  gap: 2px;
  margin-top: 4px;
  font-size: 9px;
  color: var(--text-ghost);
}
.heatmap-month-labels span {
  grid-row: 1;
}

/* ─── HOME DASHBOARD IMPROVEMENTS ───────────────────────── */
/* Mini kana cards */
.mini-kana-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 60px;
}
.mini-kana-card.weak {
  border-color: var(--shu-dim);
  background: var(--shu-ghost);
}
.mini-kana-card.strong {
  border-color: var(--jade-dim);
  background: var(--jade-ghost);
}
.mkc-char {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
}
.mkc-romaji {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.mkc-bar {
  width: 100%;
  height: 3px;
  background: var(--ink-5);
  border-radius: 99px;
  overflow: hidden;
}
.mkc-fill {
  height: 100%;
  border-radius: 99px;
}

/* Review due card */
.review-due-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.review-due-card.has-due {
  border-color: var(--shu-dim);
  background: var(--shu-ghost);
}
.rdc-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.rdc-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rdc-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}
.rdc-label {
  font-size: 13px;
  color: var(--text-faint);
}
.rdc-sub {
  font-size: 12px;
  color: var(--text-ghost);
}

/* Activity today */
.activity-today {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.act-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-faint);
}

/* Lesson items */
.lesson-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  text-decoration: none;
  color: var(--text);
}
.li-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.li-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.li-title {
  font-size: 15px;
  font-weight: 700;
}
.li-desc {
  font-size: 12px;
  color: var(--text-faint);
}
.li-bar {
  height: 3px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.li-fill {
  height: 100%;
  background: var(--indigo-light);
  border-radius: 99px;
}
.li-arrow {
  font-size: 20px;
  color: var(--text-ghost);
  flex-shrink: 0;
}

/* XP bar */
.user-xp-bar-wrap {
  height: 6px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
#user-xp-bar {
  height: 100%;
  background: var(--gold-light);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Streak calendar */
.streak-calendar {
  display: flex;
  gap: 4px;
}
.streak-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--ink-4);
}
.streak-dot.active {
  background: var(--shu-light);
}

/* ─── SPEED TEST ─────────────────────────────────────────── */
.speed-container {
  max-width: 600px;
  margin: 0 auto;
}
.speed-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3);
}
.ss-header {
  text-align: center;
}
.ss-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
}
.ss-config {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ss-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ss-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ss-opts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ss-dur-btn.active,
.ss-type-btn.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.ss-start-btn {
  align-self: center;
  padding: 14px 32px;
  font-size: 16px;
}
.ss-tips {
  background: var(--ink-3);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.ss-tips h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.ss-tips ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.8;
}

/* Speed test running */
.speed-test-running {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
}
.st-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--space-3);
  width: 100%;
}
.st-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.st-timer {
  font-size: 36px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--indigo-light);
  line-height: 1;
  transition: color 0.3s;
}
.st-timer-bar-bg {
  width: 80px;
  height: 4px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.st-timer-bar {
  height: 100%;
  background: var(--indigo-light);
  border-radius: 99px;
  transition: width 0.25s linear;
}
.st-score-wrap,
.st-kpm-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.st-score {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--gold-light);
  line-height: 1;
}
.st-score-label,
.st-kpm-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.st-kpm {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--jade-light);
  line-height: 1;
}
.st-char-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
}
.st-big-char {
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--text);
  animation: charPop 0.15s ease;
}
@keyframes charPop {
  from {
    transform: scale(0.8);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.st-mastery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.st-input-wrap {
  width: 100%;
  max-width: 320px;
}
.st-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  font-family: var(--font-mono);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  text-align: center;
}
.st-input:focus {
  border-color: var(--indigo-light);
}
.st-feedback {
  min-height: 24px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.st-feedback.fb-correct {
  color: var(--jade-light);
}
.st-feedback.fb-wrong {
  color: var(--shu-light);
}
.st-stats-row {
  display: flex;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 14px;
}
.st-stat {
  color: var(--text-faint);
}

/* Speed results */
.speed-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  text-align: center;
}
.sr-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}
.sr-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sr-kpm {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sr-kpm-num {
  font-size: 72px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--indigo-light);
  line-height: 1;
}
.sr-kpm-label {
  font-size: 14px;
  color: var(--text-faint);
}
.sr-best-badge {
  font-size: 13px;
  color: var(--gold-light);
}
.sr-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  width: 100%;
}
.sr-stat-card {
  background: var(--ink-3);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sr-stat-num {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.sr-stat-lbl {
  font-size: 10px;
  color: var(--text-faint);
}
.sr-times {
  display: flex;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--text-faint);
}
.sr-best-scores {
  width: 100%;
  background: var(--ink-3);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.sr-best-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
}
.sr-best-grid {
  display: flex;
  justify-content: space-around;
}
.sr-best-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sr-best-dur {
  font-size: 11px;
  color: var(--text-faint);
}
.sr-best-kpm {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--indigo-light);
}
.sr-best-acc {
  font-size: 10px;
}
.sr-xp {
  font-size: 14px;
  color: var(--gold-light);
  font-weight: 700;
}
.sr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Best scores mini */
.speed-best-scores-mini {
  display: flex;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  background: var(--ink-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.sbs-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  align-self: center;
}
.sbs-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
}
.sbs-item span:first-child {
  color: var(--text-faint);
}
.sbs-item span:last-child {
  color: var(--indigo-light);
  font-weight: 700;
}

/* ─── READING DRILL ──────────────────────────────────────── */
.reading-container {
  max-width: 600px;
  margin: 0 auto;
}
.rd-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3);
}
.rd-header {
  text-align: center;
}
.rd-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
}
.rd-desc {
  font-size: 14px;
  margin: 0;
}
.rd-config {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.rd-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rd-opts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rd-diff-btn.active,
.rd-mode-btn.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.rd-btn-label {
  display: block;
  font-weight: 700;
}
.rd-btn-sub {
  display: block;
  font-size: 10px;
}
.rd-start-btn {
  align-self: center;
  padding: 14px 32px;
  font-size: 16px;
}
.rd-preview {
  background: var(--ink-3);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.rd-preview h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.rd-word-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rd-word-ex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rd-ex-word {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--indigo-light);
}

/* Running drill */
.rd-running {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-3);
}
.rd-prog-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rd-prog-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--ink-4);
  border-radius: 99px;
  overflow: hidden;
}
.rd-prog-fill {
  height: 100%;
  background: var(--indigo-light);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.rd-prog-count {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.rd-word-display {
  text-align: center;
  padding: var(--space-4) var(--space-3);
  background: var(--ink-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.rd-word {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 10px;
}
.rd-word-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rd-instruction {
  font-size: 13px;
}
.rd-answer-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rd-type-wrap {
  display: flex;
  gap: 8px;
}
.rd-type-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-mono);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.rd-type-input:focus {
  border-color: var(--indigo-light);
}
.rd-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rd-choice-btn {
  padding: 14px;
  font-size: 15px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
}
.rd-choice-correct {
  border-color: var(--jade-light) !important;
  background: var(--jade-ghost) !important;
  color: var(--jade-light);
}
.rd-choice-wrong {
  border-color: var(--shu-light) !important;
  background: var(--shu-ghost) !important;
  color: var(--shu-light);
}
.rd-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
.rd-feedback.correct {
  background: var(--jade-ghost);
  border: 1px solid var(--jade-dim);
  color: var(--jade-light);
}
.rd-feedback.wrong {
  background: var(--shu-ghost);
  border: 1px solid var(--shu-dim);
  color: var(--shu-light);
}
.fb-meaning {
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

/* Results */
.rd-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  text-align: center;
}
.rdr-score {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
}
.rdr-score.great {
  background: var(--jade-ghost);
  border: 1px solid var(--jade-dim);
}
.rdr-score.ok {
  background: var(--gold-ghost);
  border: 1px solid var(--gold-dim);
}
.rdr-score.retry {
  background: var(--shu-ghost);
  border: 1px solid var(--shu-dim);
}
.rdr-pct {
  font-size: 48px;
  font-weight: 800;
  font-family: var(--font-mono);
  display: block;
}
.rdr-label {
  font-size: 15px;
  font-weight: 700;
}
.rdr-stats {
  display: flex;
  gap: var(--space-4);
}
.rdr-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rdr-num {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.rdr-word-list {
  width: 100%;
  text-align: left;
}
.rdr-word-list h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.rdr-answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.rdr-answer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}
.rdr-answer-item.correct {
  background: var(--jade-ghost);
}
.rdr-answer-item.wrong {
  background: var(--shu-ghost);
}
.rdr-word-glyph {
  font-family: var(--font-display);
  font-size: 20px;
  width: 50px;
}
.rdr-word-romaji {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  flex: 1;
}
.rdr-user-ans {
  font-size: 11px;
}
.rdr-check {
  font-weight: 700;
  font-size: 16px;
}
.rdr-answer-item.correct .rdr-check {
  color: var(--jade-light);
}
.rdr-answer-item.wrong .rdr-check {
  color: var(--shu-light);
}
.rdr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── REVIEW PAGE IMPROVEMENTS ───────────────────────────── */
.rc-weak {
  text-align: left;
  width: 100%;
}
.rc-weak-label {
  font-size: 13px;
  color: var(--shu-light);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}
.rc-weak-chars {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rc-weak-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--ink-3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.rc-weak-glyph {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
}
.rc-weak-score {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ─── CONFUSING PAIRS (updated) ─────────────────────────── */

/* ─── QUIZ QR (results) IMPROVEMENTS ────────────────────── */
.qr-weak-kana {
  width: 100%;
  text-align: left;
  background: var(--shu-ghost);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.qr-weak-label {
  font-size: 12px;
  color: var(--shu-light);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.qr-weak-chars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.qr-weak-char {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
  background: var(--ink-3);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── MOBILE RESPONSIVE ──────────────────────────────────── */
@media (max-width: 640px) {
  .st-timer {
    font-size: 28px;
  }
  .st-big-char {
    font-size: 72px;
  }
  .sr-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rd-word {
    font-size: 48px;
  }
  .rd-choices-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .heatmap-grid {
    grid-template-columns: repeat(53, 10px);
    grid-auto-rows: 10px;
  }
  .hm-cell {
    width: 10px;
    height: 10px;
  }
}

/* ── FITUR-15: Keyboard shortcut hints di tombol quiz ─────── */
.qc-key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--ink-1);
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1;
}
.quiz-choice.correct .qc-key-hint,
.quiz-choice.wrong .qc-key-hint {
  opacity: 0.4;
}

/* ── FITUR-12: Furigana toggle (hide-furigana class) ─────── */
.hide-furigana ruby rt {
  visibility: hidden;
  font-size: 0;
  line-height: 0;
}
.hide-furigana .vc-furigana,
.hide-furigana .furigana,
.hide-furigana .ex-reading-furigana {
  display: none;
}
