/* ══════════════ Practice ══════════════ */
.practice-page { padding: 1rem; max-width: 1100px; margin: 0 auto; }
@media (min-width: 640px) { .practice-page { padding: 1.5rem; } }
@media (min-width: 768px) { .practice-page { padding: 2.5rem; } }
.practice-page > * + * { margin-top: 2rem; }

.setup-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 1024px) { .setup-grid { grid-template-columns: 2fr 1fr; } }

.setup-panel {
  background: var(--color-warm-white);
  border-radius: 24px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.04);
  padding: 1.5rem;
}
.setup-panel > * + * { margin-top: 1.5rem; }
.setup-label { font-size: 0.75rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.75rem; }

.opt-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.opt-card {
  display: flex; flex-direction: column;
  padding: 0.75rem 1.25rem;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  background: var(--color-cloud);
  color: #4b5563;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--font-jakarta);
}
.opt-card:hover { border-color: rgba(91,138,114,0.4); }
.opt-card.active { border-color: var(--color-sage); background: var(--color-sage-light); color: var(--color-sage-dark); }
.opt-card .t { font-weight: 900; font-size: 0.875rem; }
.opt-card .d { font-size: 11px; font-weight: 500; opacity: 0.7; margin-top: 0.125rem; }

.mode-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .mode-grid { grid-template-columns: 1fr 1fr 1fr; } }
.mode-card {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  background: var(--color-cloud);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--font-jakarta);
  position: relative;
}
.mode-card:hover { border-color: rgba(91,138,114,0.4); }
.mode-card.active { border-color: var(--color-sage); background: var(--color-sage-light); }
.mode-card .icon { font-size: 1.5rem; margin-top: 0.125rem; }
.mode-card .t { font-weight: 900; font-size: 0.875rem; color: #111827; }
.mode-card.active .t { color: var(--color-sage-dark); }
.mode-card .d { font-size: 0.75rem; color: #6b7280; font-weight: 500; margin-top: 0.125rem; }
.mode-card .check {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 1.25rem; height: 1.25rem;
  border-radius: 999px;
  background: var(--color-sage);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

.start-btn {
  width: 100%;
  background: var(--color-sage);
  color: #fff;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
  font-family: var(--font-jakarta);
}
.start-btn:hover { background: var(--color-sage-dark); transform: translateY(-1px); }
.start-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.rows-panel {
  background: var(--color-warm-white);
  border-radius: 24px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.04);
  padding: 1.25rem;
}
.rows-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.rows-head .setup-label { margin: 0; }
.rows-count { color: var(--color-sage); font-weight: 900; margin-left: 0.5rem; }
.rows-toggle-all { font-size: 0.75rem; font-weight: 700; color: var(--color-sage-dark); background: none; border: none; cursor: pointer; }
.rows-toggle-all:hover { text-decoration: underline; }
.rows-list { display: flex; flex-direction: column; gap: 0.5rem; }
.row-card {
  width: 100%;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  background: var(--color-cloud);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--font-jakarta);
}
.row-card:hover { border-color: rgba(91,138,114,0.4); }
.row-card.active { border-color: var(--color-sage); background: var(--color-sage-light); }
.row-checkbox {
  width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  border-radius: 6px; border: 2px solid #d1d5db;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff;
  transition: all 0.15s;
}
.row-card.active .row-checkbox { border-color: var(--color-sage); background: var(--color-sage); }
.row-name { font-size: 0.75rem; font-weight: 700; width: 3.5rem; flex-shrink: 0; color: #6b7280; }
.row-card.active .row-name { color: var(--color-sage-dark); }
.row-chars { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.row-chars span { font-family: var(--font-klee); font-size: 1rem; font-weight: 600; line-height: 1; color: #9ca3af; }
.row-card.active .row-chars span { color: #1f2937; }
.rows-footer { text-align: center; font-size: 0.75rem; color: #9ca3af; font-weight: 500; margin-top: 0.75rem; }

.allchars-banner {
  background: var(--color-sage-light);
  border: 1px solid rgba(91,138,114,0.2);
  border-radius: 24px;
  padding: 1.25rem;
}
.allchars-banner .t { font-weight: 900; font-size: 0.875rem; color: var(--color-sage-dark); margin: 0 0 0.25rem; }
.allchars-banner .d { font-size: 0.75rem; font-weight: 500; color: var(--color-sage-dark); opacity: 0.7; line-height: 1.5; margin: 0; }

/* ── Session ── */
.session-page { min-height: 100vh; display: flex; flex-direction: column; padding: 1rem; }
@media (min-width: 640px) { .session-page { padding: 1.5rem; } }
@media (min-width: 768px) { .session-page { padding: 2.5rem; } }
.session-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
@media (min-width: 640px) { .session-header { margin-bottom: 2rem; } }
.exit-btn { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; color: #9ca3af; background: none; border: none; cursor: pointer; }
.exit-btn:hover { color: #374151; }
.progress-wrap { flex: 1; margin: 0 0.75rem; }
@media (min-width: 640px) { .progress-wrap { margin: 0 1.5rem; } }
.progress-track { height: 10px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-sage); border-radius: 999px; transition: width 0.5s; }
.progress-label { text-align: center; font-size: 11px; color: #9ca3af; font-weight: 500; margin-top: 0.25rem; }
.session-stats { display: flex; align-items: center; gap: 0.5rem; }
.score-pill { padding: 0.25rem 0.625rem; background: #f3f4f6; border-radius: 8px; font-size: 0.75rem; font-weight: 900; color: #6b7280; }
.mute-btn { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: transparent; border: none; cursor: pointer; color: #9ca3af; font-size: 0.9rem; }
.mute-btn:hover { background: #f3f4f6; }

.question-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 28rem; margin: 0 auto; width: 100%; gap: 1rem; }
@media (min-width: 640px) { .question-area { gap: 2rem; } }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.animate-shake { animation: shake 0.4s; }

.q-card {
  border-radius: 24px;
  border: 2px solid #f3f4f6;
  background: var(--color-warm-white);
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.04);
  width: 10rem;
  min-height: 9rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  transition: all 0.2s;
}
@media (min-width: 640px) { .q-card { border-radius: 32px; width: 12rem; min-height: 10rem; padding: 1.5rem 1rem; } }
.q-card.correct { border-color: var(--color-sage); background: var(--color-sage-light); transform: scale(1.05); }
.q-card.wrong { border-color: #f87171; background: #fef2f2; }
.q-card .big { font-size: 3.75rem; font-family: var(--font-klee); font-weight: 600; line-height: 1; color: #111827; }
@media (min-width: 640px) { .q-card .big { font-size: 6rem; } }
.q-card .romaji-big { font-size: 2.25rem; font-weight: 900; color: #111827; letter-spacing: 0.02em; }
.q-card .translit-med { font-size: 1.125rem; font-weight: 700; color: #9ca3af; }
.q-card .script-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.125rem 0.5rem; border-radius: 999px; }
.q-card .script-tag.hira { background: #dbeafe; color: #2563eb; }
.q-card .script-tag.kata { background: #f3e8ff; color: #9333ea; }
.audio-play-btn {
  width: 5rem; height: 5rem;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-sage); color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 2rem;
  transition: all 0.2s;
}
.audio-play-btn:hover { transform: scale(1.05); }
.audio-play-btn.wrong { background: #f87171; }
.audio-hint { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

.prompt-label { font-size: 0.875rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; width: 100%; }
.choice-btn {
  padding: 0.875rem;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  background: var(--color-warm-white);
  color: #374151;
  font-weight: 900;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: all 0.2s;
  font-family: var(--font-jakarta);
}
@media (min-width: 640px) { .choice-btn { padding: 1rem; } }
.choice-btn:hover:not(:disabled) { border-color: rgba(91,138,114,0.5); background: var(--color-sage-light); }
.choice-btn.kana-style { font-family: var(--font-klee); font-size: 2.25rem; }
.choice-btn.state-correct { border-color: var(--color-sage); background: var(--color-sage-light); color: var(--color-sage-dark); }
.choice-btn.state-wrong { border-color: #f87171; background: #fef2f2; color: #b91c1c; }
.choice-btn.state-dim { border-color: #f3f4f6; background: #f9fafb; color: #9ca3af; }
.choice-btn:disabled { cursor: default; }
.choice-btn .opt-stack { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.choice-btn .opt-translit { font-size: 0.75rem; font-weight: 700; opacity: 0.7; }

.input-wrap { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
.answer-input {
  width: 100%; text-align: center; font-weight: 900;
  background: var(--color-cloud);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem;
  font-size: 1.5rem;
  font-family: var(--font-jakarta);
  transition: all 0.2s;
}
.answer-input.kana-style { font-size: 2.25rem; font-family: var(--font-klee); }
.answer-input:focus { outline: none; border-color: rgba(91,138,114,0.5); }
.answer-input.state-correct { border-color: var(--color-sage); background: var(--color-sage-light); color: var(--color-sage-dark); }
.answer-input.state-wrong { border-color: #f87171; background: #fef2f2; color: #b91c1c; }
.correct-answer-note { text-align: center; font-size: 0.875rem; font-weight: 700; color: #dc2626; }
.correct-answer-note .kana-ans { font-family: var(--font-klee); font-size: 1.25rem; color: #111827; }
.correct-answer-note .romaji-ans { color: var(--color-sage-dark); }
.correct-answer-note .translit-ans { color: #9ca3af; }

.next-btn, .check-btn {
  width: 100%;
  background: var(--color-sage);
  color: #fff;
  border: none;
  padding: 0.875rem;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
  font-family: var(--font-jakarta);
}
.next-btn:hover, .check-btn:hover { background: var(--color-sage-dark); }
.next-btn.disabled { background: #f3f4f6; color: #9ca3af; cursor: default; box-shadow: none; }
.next-btn.invisible { visibility: hidden; pointer-events: none; }

/* ── Done ── */
.done-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.done-inner { width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 1rem; }
.done-emoji { font-size: 3rem; text-align: center; margin-bottom: 0.5rem; }
@media (min-width: 640px) { .done-emoji { font-size: 3.5rem; } }
.done-title { font-size: 1.25rem; font-weight: 900; color: #111827; text-align: center; margin: 0; }
@media (min-width: 640px) { .done-title { font-size: 1.5rem; } }
.done-subtitle { font-size: 0.875rem; color: #6b7280; font-weight: 500; text-align: center; margin: 0.25rem 0 0; }
.done-stats {
  background: var(--color-warm-white);
  border-radius: 24px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.04);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.done-stat { text-align: center; flex: 1; }
.done-stat .num { font-size: 2.25rem; font-weight: 900; color: #111827; }
.done-stat .num .of { font-size: 1.25rem; color: #d1d5db; }
.done-stat .label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }
.done-divider { width: 1px; height: 2.5rem; background: #f3f4f6; }
.done-btn-secondary {
  width: 100%; background: #f3f4f6; color: #374151;
  border: none; padding: 0.875rem; border-radius: 12px;
  font-weight: 900; font-size: 0.875rem; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-jakarta);
}
.done-btn-secondary:hover { background: #e5e7eb; }
