:root {
  --cream: #FFFBF8;
  --peach: #F6C6B8;
  --peach-light: #FBE4DA;
  --navy: #241B47;
  --navy-dark: #1A1333;
  --text: #1A1A1A;
  --muted: #6B6B76;
  --white: #FFFFFF;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --ink: #241B47;
}

:root[data-theme="dark"] {
  --cream: #15111f;
  --peach: #D9A088;
  --peach-light: #2b2140;
  --navy: #C9BFFF;
  --navy-dark: #DDD5FF;
  --text: #EDEAF5;
  --muted: #A9A3BE;
  --white: #1E1830;
}

* { box-sizing: border-box; }

button, input, select, textarea {
  color: inherit;
  font-family: inherit;
}

h1, h2, h3, h4,
.logo,
.widget-title,
.btn,
.kana-card .glyph,
.kanji-glyph,
.flashcard,
.glyph-big,
.romaji-big,
.quiz-glyph,
.char-of-day-glyph,
.special-mark-glyph,
.chip,
.stamp {
  font-family: "Zen Maru Gothic", "Nunito", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(36,27,71,0.07) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  overflow-x: hidden;
  animation: page-fade-in 0.4s ease;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background-image: radial-gradient(rgba(255,255,255,0.06) 1.5px, transparent 1.5px);
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img, svg { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(36,27,71,0.5);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 248, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span.kanji {
  color: var(--navy);
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  padding-bottom: 4px;
  transition: color 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--navy);
  transition: width 0.25s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 22px rgba(36,27,71,0.18);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(246,198,184,0.9), 0 0 0 5px rgba(36,27,71,0.4);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(36,27,71,0.18);
  transform: scale(0);
  animation: btn-ripple-anim 0.6s ease-out;
  pointer-events: none;
}

.btn-primary .btn-ripple {
  background: rgba(255,255,255,0.35);
}

@keyframes btn-ripple-anim {
  to { transform: scale(2.4); opacity: 0; }
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-dark);
  box-shadow: 0 10px 24px rgba(36,27,71,0.32), 0 0 0 5px rgba(246,198,184,0.28);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--navy);
  color: var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
  background: var(--peach-light);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 40px;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

/* ---------- Floating kanji background ---------- */
.floating-kanji-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floating-kanji {
  position: absolute;
  font-weight: 800;
  color: var(--navy);
  opacity: 0.08;
  animation: kanji-float 11s ease-in-out infinite;
}

@keyframes kanji-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

.fk1 { top: 8%;  left: 6%;  font-size: 3rem;   animation-duration: 10s; }
.fk2 { top: 62%; left: 3%;  font-size: 2.2rem; animation-duration: 13s; animation-delay: 1s; }
.fk3 { top: 78%; left: 20%; font-size: 1.8rem; animation-duration: 9s;  animation-delay: 2s; }
.fk4 { top: 14%; left: 46%; font-size: 2.4rem; animation-duration: 12s; animation-delay: 0.5s; }
.fk5 { top: 6%;  left: 88%; font-size: 2rem;   animation-duration: 10.5s; animation-delay: 1.5s; }
.fk6 { top: 48%; left: 92%; font-size: 3.2rem; animation-duration: 14s; animation-delay: 0.8s; }
.fk7 { top: 82%; left: 70%; font-size: 2.6rem; animation-duration: 11.5s; animation-delay: 2.4s; }

/* ---------- Floating sakura petals ---------- */
.sakura-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.sakura {
  position: absolute;
  top: -6%;
  width: 12px;
  height: 12px;
  background: var(--peach);
  border-radius: 0 60% 0 60%;
  opacity: 0;
  animation: sakura-fall linear infinite;
}

@keyframes sakura-fall {
  0%   { transform: translate(0, 0) rotate(0deg);      opacity: 0; }
  8%   { opacity: 0.6; }
  92%  { opacity: 0.6; }
  100% { transform: translate(50px, 640px) rotate(320deg); opacity: 0; }
}

.s1 { left: 8%;  animation-duration: 13s; animation-delay: 0s; }
.s2 { left: 26%; animation-duration: 16s; animation-delay: 3s; width: 9px;  height: 9px; }
.s3 { left: 48%; animation-duration: 14s; animation-delay: 6s; }
.s4 { left: 66%; animation-duration: 18s; animation-delay: 1.5s; width: 10px; height: 10px; }
.s5 { left: 84%; animation-duration: 15s; animation-delay: 4.5s; }
.s6 { left: 94%; animation-duration: 17s; animation-delay: 8s; width: 8px; height: 8px; }

/* ---------- Fade in on load ---------- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fade-in-up 0.7s ease both;
}

.fade-in-delay {
  animation-delay: 0.15s;
}

.hero-text h1 {
  font-size: 3.4rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}

.hero-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 440px;
  margin: 0 0 32px;
}

.hero-illustration {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illo-parallax {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s linear;
}

.hero-illo-parallax::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 0;
  background:
    radial-gradient(circle at 32% 24%, rgba(246,198,184,0.55), transparent 60%),
    radial-gradient(circle at 72% 74%, rgba(36,27,71,0.3), transparent 55%);
  filter: blur(50px);
  pointer-events: none;
}

[data-theme="dark"] .hero-illo-parallax::before {
  background:
    radial-gradient(circle at 32% 24%, rgba(201,191,255,0.25), transparent 60%),
    radial-gradient(circle at 72% 74%, rgba(185,118,95,0.3), transparent 55%);
}

.hero-typo {
  position: relative;
  z-index: 1;
  width: 88%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-typo-kanji {
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 800;
  font-size: clamp(6.5rem, 17vw, 12rem);
  line-height: 1;
  color: var(--ink);
  text-shadow: 10px 10px 0 var(--peach);
  animation: person-bob 6s ease-in-out infinite;
}

@keyframes person-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-typo-romaji {
  position: absolute;
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  z-index: 2;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--white);
  background: var(--navy);
  padding: 8px 18px;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-typo-float {
  position: absolute;
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 800;
  color: var(--navy);
  opacity: 0.5;
  animation: kanji-float 11s ease-in-out infinite;
}

.htf1 {
  top: 30%;
  left: 0%;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  opacity: 0.4;
  animation-duration: 10s;
}
.htf2 {
  top: 12%;
  right: 8%;
  font-size: 2.1rem;
  animation-duration: 12.5s;
  animation-delay: 1s;
}
.htf3 {
  bottom: 24%;
  left: 2%;
  font-size: 2.4rem;
  animation-duration: 9.5s;
  animation-delay: 0.5s;
}
.htf4 {
  bottom: 10%;
  right: 10%;
  font-size: 2rem;
  color: var(--white);
  opacity: 0.85;
  animation-duration: 13s;
  animation-delay: 1.6s;
}

.blob {
  position: absolute;
  z-index: 0;
  border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
  animation: blob-float 7s ease-in-out infinite, blob-morph 12s ease-in-out infinite;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -14px); }
}

@keyframes blob-morph {
  0%, 100% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
  33%      { border-radius: 42% 58% 68% 32% / 40% 62% 38% 60%; }
  66%      { border-radius: 55% 45% 38% 62% / 62% 35% 65% 38%; }
}

.blob-peach-1 {
  width: 55%;
  height: 55%;
  background: var(--peach);
  top: -6%;
  right: 4%;
  animation-duration: 8s;
}

.blob-peach-2 {
  width: 40%;
  height: 40%;
  background: var(--peach-light);
  bottom: -4%;
  left: 0%;
  animation-duration: 6s;
  animation-delay: 0.5s;
}

.blob-navy {
  width: 34%;
  height: 34%;
  background: var(--ink);
  bottom: -6%;
  right: -6%;
  animation-duration: 9s;
  animation-delay: 1s;
}

.stamp {
  position: absolute;
  top: 6%;
  left: 2%;
  z-index: 2;
  width: 76px;
  height: 76px;
  border: 3px solid #C0392B;
  border-radius: 12px;
  color: #C0392B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  transform: rotate(-6deg);
  background: rgba(255,255,255,0.6);
}
.stamp small { font-size: 0.6rem; letter-spacing: 0.1em; margin-top: 4px; }

/* ---------- Generic section ---------- */
.section {
  padding: 70px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.section-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 0 40px;
}

/* ---------- Scroll reveal ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

.home-widgets [data-animate]:nth-child(2) { transition-delay: 0.08s; }
.home-widgets [data-animate]:nth-child(3) { transition-delay: 0.16s; }
.home-widgets [data-animate]:nth-child(4) { transition-delay: 0.24s; }
.feature-cards .feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-cards .feature-card:nth-child(3) { transition-delay: 0.16s; }

/* ---------- Home widgets ---------- */
.home-widgets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.home-widgets .quick-quiz {
  grid-column: 1 / -1;
}

.widget-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 8px 24px rgba(36,27,71,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--peach), var(--navy));
  opacity: 0.75;
}

.widget-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(36,27,71,0.12);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Character of the day */
.char-of-day-display {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.char-of-day-glyph {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--navy);
  background: var(--peach-light);
  border-radius: var(--radius-md);
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-of-day-meta, .char-of-day-meaning {
  text-align: center;
  margin: 0 0 6px;
  color: var(--muted);
}

.widget-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.speaker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.speaker-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.speaker-btn:hover {
  background: var(--navy);
  color: var(--white);
}

.speaker-btn:hover svg {
  transform: scale(1.15);
}

/* Daily challenge */
.challenge-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 18px;
}

.challenge-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.progress-square {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(36,27,71,0.1);
}

.progress-square.filled {
  background: var(--navy);
}

/* Learning progress */
.level-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 12px;
}

.xp-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(36,27,71,0.1);
  overflow: hidden;
  margin-bottom: 10px;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--peach), var(--navy));
  transition: width 0.6s ease;
}

.xp-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 14px;
}

.streak-label {
  font-weight: 700;
  margin: 0;
}

/* Quick quiz */
.quiz-question {
  color: var(--muted);
  margin: 0 0 16px;
}

.quiz-glyph-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.quiz-glyph {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--navy);
}

.quiz-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.quiz-option {
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quiz-option:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--navy);
}

.quiz-option.correct {
  background: #2ECC71;
  border-color: #2ECC71;
  color: var(--white);
}

.quiz-option.wrong {
  background: #E74C3C;
  border-color: #E74C3C;
  color: var(--white);
}

.quiz-feedback {
  text-align: center;
  min-height: 22px;
  font-weight: 700;
  margin: 0;
}

.quiz-feedback.correct { color: #219150; }
.quiz-feedback.wrong { color: #C0392B; }

.quiz-shake { animation: quiz-shake 0.4s ease; }
.quiz-pop { animation: quiz-pop 0.4s ease; }

@keyframes quiz-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes quiz-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ---------- Feature cards ---------- */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(36,27,71,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--peach), var(--navy));
  opacity: 0.75;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(36,27,71,0.14);
}

.feature-card-icon {
  font-size: 2.4rem;
  margin-bottom: 4px;
}

.feature-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.feature-card p {
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.6;
}

/* ---------- Page hero (kana pages) ---------- */
.page-hero {
  padding: 56px 0 24px;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.page-hero p {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- Search / filter ---------- */
.kana-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0 8px;
  flex-wrap: wrap;
}

.kana-search {
  width: 100%;
  max-width: 340px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text);
}
.kana-search:focus {
  outline: none;
  border-color: var(--navy);
}

.kana-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.kana-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}
.kana-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ---------- Kana grid ---------- */
.kana-group {
  margin: 40px 0;
}

.kana-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kana-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kana-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.kana-row-num {
  flex-shrink: 0;
  width: 26px;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.95rem;
}

.kana-row-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kana-card {
  background: var(--white);
  border: 2px solid rgba(36,27,71,0.08);
  border-radius: var(--radius-sm);
  padding: 18px 8px;
  width: 76px;
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.kana-card:hover {
  transform: translateY(-4px);
  border-color: var(--peach);
  background: var(--peach-light);
}

.kana-card.speaking {
  animation: kana-pulse 0.5s ease;
  border-color: var(--navy);
}

@keyframes kana-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.kana-card .glyph {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  white-space: nowrap;
}

.kana-card .glyph.glyph-small {
  font-size: 1.4rem;
}

.kana-card .romaji {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kana-card.empty {
  visibility: hidden;
}

.kana-card.hidden {
  display: none;
}

/* ---------- Kanji grid ---------- */
.kanji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.kanji-card {
  position: relative;
  background: var(--white);
  border: 2px solid rgba(36,27,71,0.08);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.kanji-card:hover {
  transform: translateY(-4px);
  border-color: var(--peach);
  background: var(--peach-light);
}

.kanji-card.speaking {
  animation: kana-pulse 0.5s ease;
  border-color: var(--navy);
}

.kanji-card.hidden { display: none; }

.kanji-glyph {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 8px;
}

.kanji-meaning {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.kanji-readings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.kanji-example {
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.5;
}

.kanji-example small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Special marks (sokuon / chōonpu) ---------- */
.special-marks {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 8px 24px rgba(36,27,71,0.06);
}

.special-marks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.special-mark-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.special-mark-glyph {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--peach-light);
  color: var(--navy);
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.special-mark-name {
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 6px;
}

.special-mark-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

/* ---------- Flashcard practice ---------- */
.practice {
  position: relative;
  background: var(--peach-light);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  margin-top: 20px;
  overflow: hidden;
}

.practice h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.practice p.sub {
  color: var(--muted);
  margin: 0 0 32px;
}

.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.mode-tab {
  padding: 8px 20px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}

.mode-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.flashcard {
  background: var(--white);
  border-radius: var(--radius-md);
  max-width: 320px;
  margin: 0 auto 28px;
  padding: 48px 24px;
  font-size: 4rem;
  font-weight: 800;
  color: var(--navy);
  box-shadow: 0 12px 30px rgba(36,27,71,0.12);
}

.flashcard-hint {
  margin: -18px 0 24px;
  color: var(--muted);
  font-size: 0.8rem;
}

.type-answer {
  display: flex;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto 16px;
}

.type-answer input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.15);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
}

.type-answer input:focus {
  outline: none;
  border-color: var(--navy);
}

.type-answer input:disabled {
  opacity: 0.7;
}

.type-feedback {
  min-height: 24px;
  font-weight: 700;
  margin: 0 0 16px;
}

.type-feedback.correct { color: #219150; }
.type-feedback.wrong { color: #C0392B; }

.quiz-complete {
  padding: 20px 0 8px;
}

.complete-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
}

.complete-score {
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 24px;
}

/* ---------- Confetti ---------- */
.confetti-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% { top: -20px; opacity: 1; }
  100% { top: 105%; opacity: 0.4; }
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 460px;
  margin: 0 auto 24px;
}

.answer-btn {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.answer-btn.correct {
  background: #2ECC71;
  border-color: #2ECC71;
  color: var(--white);
}
.answer-btn.wrong {
  background: #E74C3C;
  border-color: #E74C3C;
  color: var(--white);
}

.practice-score {
  font-weight: 700;
  color: var(--navy);
}

/* ---------- Practice setup (choose sections) ---------- */
.practice-setup {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px;
  box-shadow: 0 12px 30px rgba(36,27,71,0.08);
}

.setup-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 24px;
}

.script-radios {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.script-radios label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.script-radios input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.setup-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.setup-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 16px;
  cursor: pointer;
}

.setup-col-header input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.setup-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.setup-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

.setup-row .chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 14px;
  border: 2px solid rgba(36,27,71,0.15);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.setup-row:has(input:checked) .chip {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.setup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.setup-count {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.setup-warning {
  color: #C0392B;
  font-weight: 600;
  font-size: 0.9rem;
  display: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 64px 0 32px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h4 {
  color: var(--white);
  font-size: 1rem;
  letter-spacing: 0.03em;
  margin: 0 0 18px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-grid ul a {
  position: relative;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-grid ul a:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-credit {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
}

.footer-credit a {
  color: inherit;
  transition: color 0.2s ease;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: rgba(255,255,255,0.85);
}

/* ---------- Search bar ---------- */
.search-section {
  padding: 8px 0 0;
}

.search-bar-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-bar-input {
  width: 100%;
  padding: 14px 20px 14px 46px;
  border-radius: 999px;
  border: 2px solid rgba(36,27,71,0.12);
  background: var(--white);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 8px 20px rgba(36,27,71,0.1);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(36,27,71,0.16);
  overflow: hidden;
  z-index: 20;
  display: none;
}

.search-results.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover, .search-result-item.active {
  background: var(--peach-light);
}

.search-result-glyph {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

.search-result-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.search-no-results {
  padding: 16px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Continue Learning ---------- */
.continue-learning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  background: linear-gradient(120deg, var(--peach-light), var(--white));
  flex-wrap: wrap;
}

.continue-learning-info {
  flex: 1;
  min-width: 220px;
}

.continue-lesson-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 14px;
}

.continue-progress-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------- Progress stats grid ---------- */
.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.progress-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
}

.progress-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.progress-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ---------- Favorites widget ---------- */
.favorites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.favorite-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--peach-light);
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}

.favorite-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}

.favorite-chip button:hover { color: #C0392B; }

.favorites-empty {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

.favorite-btn {
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: #C0392B;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.favorite-btn:hover { transform: scale(1.1); }
.favorite-btn.active { background: rgba(192,57,43,0.1); }

/* Heart button inside kana chart cards */
.kana-card { position: relative; }

.kana-favorite-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: none;
  color: rgba(36,27,71,0.3);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.kana-favorite-btn:hover { transform: scale(1.2); color: #C0392B; }
.kana-favorite-btn.active { color: #C0392B; }

/* ---------- Achievements ---------- */
.achievements-title { margin-bottom: 20px; }

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 6px 16px rgba(36,27,71,0.06);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  filter: grayscale(1);
  opacity: 0.55;
  transition: all 0.3s ease;
}

.achievement-badge.unlocked {
  filter: grayscale(0);
  opacity: 1;
  color: var(--navy);
  background: var(--peach-light);
}

.achievement-badge .badge-icon { font-size: 1.2rem; }

/* ---------- Toast / achievement unlock ---------- */
.toast-host {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.achievement-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(36,27,71,0.3);
  max-width: 300px;
  animation: toast-in 0.4s ease;
}

.achievement-toast.leaving {
  animation: toast-out 0.4s ease forwards;
}

.achievement-toast p { margin: 2px 0 0; font-size: 0.85rem; opacity: 0.9; }
.achievement-toast-icon { font-size: 1.6rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

.confetti-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999;
}

/* ---------- Flashcard flip mode ---------- */
.flip-card-wrap {
  perspective: 1200px;
  max-width: 320px;
  margin: 0 auto 20px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 220px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(36,27,71,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.flip-card-front .glyph-big {
  font-size: 4.2rem;
  font-weight: 800;
  color: var(--navy);
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--peach-light);
}

.flip-card-back .romaji-big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy);
}

.flip-card-back .example-word {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}

.flip-card-back .example-meaning {
  font-size: 0.85rem;
  color: var(--muted);
}

.flip-card-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 20px;
}

.flashcard-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.flashcard-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(36,27,71,0.15);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.flashcard-nav-btn:hover { transform: scale(1.08); background: var(--peach-light); }

.flashcard-counter {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Review mistakes ---------- */
.review-section {
  margin-top: 20px;
}

.mistakes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.mistake-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 2px solid rgba(231,76,60,0.25);
  font-weight: 700;
  color: var(--text);
}

.mistake-chip .mistake-count {
  font-size: 0.75rem;
  color: #C0392B;
  font-weight: 800;
}

.mistakes-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Quiz explanation / xp earned ---------- */
.quiz-explanation {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 6px 0 0;
}

.xp-earned-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--peach-light);
  color: var(--navy);
  font-weight: 800;
  font-size: 0.8rem;
  animation: xp-pop 0.4s ease;
}

@keyframes xp-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- Dark theme overrides ---------- */
[data-theme="dark"] .site-header {
  background: rgba(21,17,31,0.85);
  border-bottom-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .site-footer { background: #120e1e; }
[data-theme="dark"] .achievement-toast { background: #2b2140; }

[data-theme="dark"] .kana-card,
[data-theme="dark"] .kanji-card,
[data-theme="dark"] .answer-btn,
[data-theme="dark"] .quiz-option,
[data-theme="dark"] .mode-tab,
[data-theme="dark"] .kana-tab,
[data-theme="dark"] .kana-search,
[data-theme="dark"] .search-bar-input,
[data-theme="dark"] .type-answer input,
[data-theme="dark"] .speaker-btn,
[data-theme="dark"] .chip,
[data-theme="dark"] .favorite-btn,
[data-theme="dark"] .flashcard-nav-btn,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .mistake-chip {
  border-color: rgba(255,255,255,0.14);
}

[data-theme="dark"] .widget-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .practice-setup,
[data-theme="dark"] .achievement-badge,
[data-theme="dark"] .flashcard,
[data-theme="dark"] .flip-card-front,
[data-theme="dark"] .flip-card-back,
[data-theme="dark"] .special-marks,
[data-theme="dark"] .search-results {
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

[data-theme="dark"] .progress-square,
[data-theme="dark"] .xp-bar-track {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .kana-favorite-btn {
  color: rgba(255,255,255,0.35);
}

[data-theme="dark"] .achievement-badge { background: var(--white); }
[data-theme="dark"] .achievement-badge.unlocked { background: var(--peach-light); }

[data-theme="dark"] .stamp { background: rgba(30,24,48,0.7); }
[data-theme="dark"] .blob-peach-1 { background: #B9765F; }
[data-theme="dark"] .blob-peach-2 { background: #241B36; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-illustration { max-width: 380px; margin: 0 auto; }
  .home-widgets { grid-template-columns: 1fr; }
  .feature-cards { grid-template-columns: 1fr; }
  .kana-card { width: 64px; padding: 14px 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .setup-columns { grid-template-columns: 1fr; }
  .practice-setup { padding: 28px; }
}

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .site-header .container { flex-wrap: nowrap; gap: 8px; padding: 0 16px; }
  .theme-toggle { width: 38px; height: 38px; font-size: 1rem; flex-shrink: 0; }
}

@media (max-width: 720px) {
  .hero-text h1 { font-size: 2.4rem; }
  .kana-row { align-items: flex-start; gap: 10px; }
  .kana-row-cards { gap: 8px; }
  .kana-card { width: 56px; padding: 10px 4px; }
  .kana-card .glyph { font-size: 1.5rem; }
  .answers { grid-template-columns: 1fr; }
  .practice { padding: 32px 20px; }
  .logo { font-size: 1rem; gap: 6px; white-space: nowrap; }
  .logo span.kanji { font-size: 1.1rem; }
  .continue-learning { flex-direction: column; align-items: stretch; text-align: center; }
  .progress-stats-grid { grid-template-columns: 1fr 1fr; }
  .toast-host { top: auto; bottom: 16px; right: 16px; left: 16px; }
  .achievement-toast { max-width: none; }
  .kanji-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .special-marks { padding: 24px; }
  .special-marks-grid { grid-template-columns: 1fr; }
  .special-mark-item { flex-direction: column; align-items: center; text-align: center; }
  .progress-actions { justify-content: center; }
}

body.nav-open .nav-links {
  display: flex;
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  background: var(--white);
  flex-direction: column;
  padding: 24px;
  gap: 20px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
