/* ============================================================
   EIKEN Grade 3 Preparation Course — Global Stylesheet (purple theme; Grade 4 uses blue, Grade 5 red)
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --primary:       #7c3aed;
  --primary-dark:  #4c1d95;
  --secondary:     #059669;
  --secondary-dark:#064e3b;
  --accent:        #f59e0b;
  --accent-dark:   #d97706;
  --success:       #16a34a;
  --warning:       #eab308;
  --danger:        #dc2626;
  --grade-badge:   #facc15;
  --bg:            #f8f9fa;
  --bg-card:       #ffffff;
  --text:          #212529;
  --text-muted:    #6c757d;
  --border:        #dee2e6;
  --shadow-sm:     0 2px 8px rgba(0,0,0,.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.16);
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     24px;
  --font-jp:       'Hiragino Kaku Gothic ProN', 'Meiryo', 'Yu Gothic', sans-serif;
  --font-en:       'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --transition:    all .25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

.en { font-family: var(--font-en); }
.jp { font-family: var(--font-jp); }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem; }
.section { padding: 3rem 0; }
.section-sm { padding: 1.5rem 0; }

/* ---------- Header / Navbar ---------- */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.2rem;
  max-width: 1100px;
  margin: 0 auto;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-badge {
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  font-size: .85rem;
  padding: .2rem .55rem;
  border-radius: 6px;
  letter-spacing: .5px;
  font-family: var(--font-en);
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navbar-nav a {
  color: rgba(255,255,255,.9);
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.navbar-nav a.active {
  background: rgba(255,255,255,.25);
  box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}

/* ---------- Hero Banner ---------- */
.hero {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
  color: #fff;
  padding: 3.5rem 1.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/eiken-students.jpg') center/cover no-repeat;
  opacity: .15;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 { margin-bottom: .6rem; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero p { font-size: 1.1rem; opacity: .92; margin-bottom: 1.5rem; }

.hero-badges {
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .3px;
}

.badge-white  { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.badge-accent { background: var(--accent); color: #fff; }
.badge-success{ background: var(--success); color: #fff; }
.badge-primary{ background: var(--primary); color: #fff; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 1.4rem; }
.card-header { padding: 1rem 1.4rem; font-weight: 700; }

/* ---------- Skill Cards (Homepage) ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  padding: 2rem 0;
}

.skill-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  border-top: 5px solid transparent;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
}

.skill-card.reading::before   { background: var(--secondary); }
.skill-card.writing::before   { background: var(--success); }
.skill-card.speaking::before  { background: var(--accent-dark); }
.skill-card.listening::before { background: var(--primary); }
.skill-card.vocab::before     { background: #0284c7; }

.skill-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: .8rem;
  display: block;
}

.skill-card h3 { margin-bottom: .4rem; font-size: 1.15rem; }
.skill-card .skill-jp { color: var(--text-muted); font-size: .9rem; margin-bottom: .8rem; }
.skill-card .skill-desc { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-jp);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* ---------- Progress Bar ---------- */
.progress-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin: .5rem 0;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width .5s ease;
}

/* ---------- Quiz / Exercise Styles ---------- */
.quiz-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--secondary-dark);
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  margin-bottom: 1.2rem;
}

.quiz-option {
  padding: .8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  transition: var(--transition);
  text-align: left;
  font-family: var(--font-jp);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--secondary);
  background: #e8f4f8;
  transform: translateX(3px);
}

.quiz-option.correct {
  border-color: var(--success);
  background: #d4edda;
  color: #155724;
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: #f8d7da;
  color: #721c24;
}

.quiz-option:disabled { cursor: not-allowed; }

.quiz-feedback {
  padding: .8rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  margin-top: .8rem;
  display: none;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.quiz-feedback.wrong   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }

.score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
  color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.score-number { font-size: 2rem; font-weight: 900; font-family: var(--font-en); }
.score-label  { font-size: .85rem; opacity: .85; }

/* ---------- Flashcard ---------- */
.flashcard-wrap {
  perspective: 1000px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 1.5rem;
  height: 220px;
  cursor: pointer;
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s ease;
}

.flashcard.flipped { transform: rotateY(180deg); }

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.flashcard-front {
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
  color: #fff;
}

.flashcard-back {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  transform: rotateY(180deg);
}

.flashcard-word {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--font-en);
  margin-bottom: .5rem;
}

.flashcard-hint { font-size: .85rem; opacity: .75; }
.flashcard-meaning { font-size: 1.4rem; font-weight: 700; margin-bottom: .4rem; }
.flashcard-example { font-size: .85rem; opacity: .85; font-style: italic; }

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.8rem;
  padding-bottom: .8rem;
  border-bottom: 3px solid var(--border);
}

.section-header .icon {
  font-size: 1.8rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-reading  { background: #ede9fe; }
.icon-writing  { background: #dcfce7; }
.icon-speaking { background: #fef3c7; }
.icon-listening{ background: #fce7f3; }
.icon-vocab    { background: #ede9fe; }

.section-header h2 { margin: 0; }
.section-header .subtitle { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* ---------- Tip Box ---------- */
.tip-box {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border-left: 5px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.3rem;
  margin: 1.2rem 0;
}

.tip-box .tip-title {
  font-weight: 800;
  color: #856404;
  margin-bottom: .4rem;
  font-size: .95rem;
}

.tip-box p { color: #533f03; font-size: .9rem; margin: 0; }

/* ---------- Advice Box ---------- */
.advice-box {
  background: linear-gradient(135deg, #e8f4f8, #ede9fe);
  border-left: 5px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  overflow: hidden;
}

.advice-box summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.2rem;
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  color: var(--secondary-dark);
  user-select: none;
}
.advice-box summary::-webkit-details-marker { display: none; }
.advice-box summary::after {
  content: '▼';
  font-size: .7rem;
  margin-left: auto;
  transition: transform .25s ease;
  color: var(--secondary);
}
.advice-box[open] summary::after { transform: rotate(-180deg); }
.advice-box summary:hover { background: rgba(69,123,157,.08); }

.advice-box ul {
  padding: .2rem 1.5rem 1rem 2rem;
  margin: 0;
}
.advice-box li { color: var(--secondary-dark); font-size: .9rem; margin-bottom: .3rem; }

/* ---------- Lesson Placeholder ---------- */
.placeholder-lesson {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 2rem 0;
}
.placeholder-lesson .placeholder-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.placeholder-lesson h3 { font-size: 1.3rem; margin-bottom: .5rem; color: var(--secondary-dark); }
.placeholder-lesson p { color: var(--text-muted); margin: .3rem 0; }
.placeholder-lesson .placeholder-sub { font-size: .9rem; }

/* ---------- Page Hero (sub-pages) ---------- */
.page-hero {
  padding: 2.5rem 1.2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.page-hero-reading   { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.page-hero-writing   { background: linear-gradient(135deg, #064e3b, #10b981); }
.page-hero-speaking  { background: linear-gradient(135deg, #78350f, #d97706); }
.page-hero-listening { background: linear-gradient(135deg, #312e81, #6366f1); }
.page-hero-vocab     { background: linear-gradient(135deg, #0c4a6e, #0284c7); }

.page-hero h1 { margin-bottom: .4rem; }
.page-hero p  { opacity: .9; font-size: 1rem; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: .3rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: .6rem 1.2rem;
  border: none;
  background: none;
  font-family: var(--font-jp);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Stars / Rating ---------- */
.stars { color: var(--warning); font-size: 1.2rem; letter-spacing: 2px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--secondary-dark);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 2rem 1.2rem;
  margin-top: 4rem;
  font-size: .85rem;
}

.site-footer a { color: rgba(255,255,255,.9); }
.site-footer strong { color: #fff; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.fade-in-up { animation: fadeInUp .5s ease both; }
.bounce      { animation: bounce 1.5s ease infinite; }
.pulse       { animation: pulse 2s ease infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .quiz-options { grid-template-columns: 1fr; }
  .skill-grid   { grid-template-columns: 1fr 1fr; }
  .navbar-nav a { padding: .35rem .5rem; font-size: .8rem; }
}

@media (max-width: 480px) {
  .skill-grid { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1rem; }
  .quiz-container { padding: 1.2rem; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--secondary-dark);
  color: #fff;
  padding: .75rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(40px);
  transition: all .3s ease;
  pointer-events: auto;
  max-width: 300px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.info    { background: var(--secondary-dark); }
.toast.success { background: var(--success); }
.toast.warning { background: #b45309; }
.toast.error   { background: var(--primary-dark); }

/* ---------- Confetti ---------- */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9998;
  animation: confetti-fall 2s ease forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---------- Animate on Scroll ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Question Number Badge ---------- */
.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* ---------- JP Translation Box ---------- */
.jp-translation {
  background: #fff8e1;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  font-size: .85rem;
  color: #7c4700;
  margin: .4rem 0;
}

/* ---------- Exam Info Grid (homepage) ---------- */
.exam-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.exam-info-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-top: 3px solid var(--secondary);
}
.exam-info-card .num { font-size: 1.8rem; font-weight: 900; font-family: var(--font-en); color: var(--secondary-dark); }
.exam-info-card .lbl { font-size: .8rem; color: var(--text-muted); }

/* ---------- Progress Dashboard ---------- */
.progress-dashboard {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}
.progress-dashboard h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.progress-item { margin-bottom: .8rem; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--text-muted);
}
.progress-label span:last-child { color: var(--secondary-dark); }

/* ---------- Btn outline secondary ---------- */
.btn-outline-secondary {
  background: transparent;
  color: var(--secondary);
  border-color: var(--secondary);
}
.btn-outline-secondary:hover { background: var(--secondary); color: #fff; }

/* ---------- Passage container (reading) ---------- */
.passage-container {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  border-left: 5px solid var(--secondary);
}
.passage-container h3 { color: var(--secondary-dark); margin-bottom: 1rem; }
.passage-body {
  font-family: var(--font-en);
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text);
}
.passage-body .blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 3px solid var(--secondary);
  text-align: center;
  font-weight: 900;
  color: var(--secondary-dark);
  margin: 0 4px;
}

/* ---------- Writing area ---------- */
.writing-area {
  width: 100%;
  min-height: 120px;
  padding: .85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-en);
  font-size: 1rem;
  line-height: 1.8;
  resize: vertical;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text);
}
.writing-area:focus { outline: none; border-color: var(--success); box-shadow: 0 0 0 3px rgba(42,157,143,.1); }

/* ---------- Hero section (homepage) ---------- */
.hero-section {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, #2a6496 50%, var(--primary) 100%);
  color: #fff;
  padding: 4rem 1.25rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -200px; right: -100px;
}
.hero-section::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -100px; left: -50px;
}
.hero-section > * { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: #fff;
  text-shadow: 0 3px 12px rgba(0,0,0,.3);
  margin-bottom: .5rem;
}
.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.2rem);
  opacity: .9;
  margin-bottom: 2rem;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .3rem .9rem;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

/* ---------- Skill card animations ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.skill-icon { animation: float 3s ease infinite; }
.skill-card:nth-child(2) .skill-icon { animation-delay: .3s; }
.skill-card:nth-child(3) .skill-icon { animation-delay: .6s; }
.skill-card:nth-child(4) .skill-icon { animation-delay: .9s; }
.skill-card:nth-child(5) .skill-icon { animation-delay: 1.2s; }

/* ---------- Selected quiz option ---------- */
.quiz-option.selected {
  border-color: var(--secondary);
  background: #ede9fe;
}


/* ============================================================
   GAMIFICATION & KID-FRIENDLY STYLES
   ============================================================ */

/* ---- XP & Level Display ---- */
.xp-bar {
  background: var(--bg);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  margin: 0.5rem 0;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FFA500);
  transition: width 0.4s ease;
  border-radius: 20px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  animation: levelPulse 2s ease infinite;
}

@keyframes levelPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---- Badge Display ---- */
.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.8rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 80px;
  transition: var(--transition);
  cursor: pointer;
}

.badge-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.badge-item.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.badge-emoji {
  font-size: 2rem;
  display: block;
}

.badge-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.badge-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ---- Streak Counter ---- */
.streak-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  animation: streakGlow 2s ease infinite;
}

@keyframes streakGlow {
  0%, 100% { box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3); }
  50% { box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5); }
}

/* ---- Progress Ring (Circular Progress) ---- */
.progress-ring-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 120px;
  height: 120px;
  margin: 1rem auto;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 120px;
  height: 120px;
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.35s;
  transform-origin: 50% 50%;
  stroke: var(--secondary);
  stroke-linecap: round;
}

.progress-ring-bg {
  stroke: var(--border);
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.progress-ring-text .num {
  display: block;
  font-size: 1.8rem;
  color: var(--secondary-dark);
}

.progress-ring-text .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Lesson Progress Card ---- */
.lesson-progress-card {
  background: linear-gradient(135deg, var(--bg-card), #f5f5f5);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 5px solid var(--secondary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.lesson-progress-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.lesson-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lesson-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--secondary-dark);
  font-family: var(--font-en);
}

.lesson-status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.lesson-status.completed {
  background: var(--success);
  color: #fff;
}

.lesson-status.in-progress {
  background: var(--warning);
  color: #fff;
}

.lesson-status.locked {
  background: var(--border);
  color: var(--text-muted);
}

/* ---- Fun Animations ---- */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.bounce { animation: bounce 0.6s ease infinite; }
.wiggle { animation: wiggle 0.4s ease infinite; }
.pulse { animation: pulse 1.5s ease infinite; }

/* ---- Star Rating ---- */
.star-rating {
  display: flex;
  gap: 0.3rem;
  font-size: 1.5rem;
}

.star {
  cursor: pointer;
  transition: var(--transition);
  filter: grayscale(100%);
}

.star.filled {
  filter: grayscale(0%);
  animation: starPop 0.3s ease;
}

@keyframes starPop {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}

/* ---- Reward Popup ---- */
.reward-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  z-index: 10001;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: rewardPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rewardPop {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1) rotate(5deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.reward-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
  animation: bounce 0.6s ease infinite;
}

.reward-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.reward-desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ---- Achievement Unlocked ---- */
.achievement-banner {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
  z-index: 10000;
  animation: slideInRight 0.5s ease;
  max-width: 300px;
}

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.achievement-desc {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ---- Lesson Lock Icon ---- */
.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* ---- Fun Card Hover Effects ---- */
.fun-card {
  position: relative;
  overflow: hidden;
}

.fun-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.fun-card:hover::before {
  opacity: 1;
}

/* ---- Responsive Gamification ---- */
@media (max-width: 768px) {
  .level-badge {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .badge-item {
    min-width: 70px;
    padding: 0.6rem;
  }

  .badge-emoji {
    font-size: 1.5rem;
  }

  .reward-popup {
    padding: 1.5rem;
  }

  .reward-emoji {
    font-size: 2rem;
  }

  .achievement-banner {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* ============================================================
   Navigation upgrades (2026-11)
   ============================================================ */

/* Lesson stepper: ◀ [select] ▶ */
.lesson-stepper {
  display: inline-flex;
  align-items: stretch;
  gap: .4rem;
  max-width: 100%;
  vertical-align: middle;
}
.lesson-stepper .lesson-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  padding: .55rem 1rem;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,.08);
  font-size: .95rem;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-jp);
}
.lesson-stepper .lesson-select:focus-visible { outline: 3px solid var(--warning); outline-offset: 2px; }
.stepper-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 10px;
  padding: .5rem .85rem;
  background: rgba(255,255,255,.95);
  color: var(--secondary-dark);
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  font-family: var(--font-jp);
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: var(--transition);
}
.stepper-btn:hover:not(:disabled) { transform: translateY(-1px); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.stepper-btn:focus-visible { outline: 3px solid var(--warning); outline-offset: 2px; }
.stepper-btn:disabled { opacity: .4; cursor: not-allowed; }
/* On light backgrounds (home page) give the buttons an edge */
.lesson-dropdown-wrapper .stepper-btn { background: var(--secondary-dark); color: #fff; }
.lesson-dropdown-wrapper .stepper-btn:hover:not(:disabled) { background: var(--secondary); }

/* Skill flow card at the bottom of each skill page */
.skill-flow {
  margin: 3rem 0 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border-top: 5px solid var(--accent);
}
.flow-title { font-weight: 800; color: var(--secondary-dark); margin-bottom: 1rem; }
.flow-steps {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.flow-step {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  border: 2px solid var(--border);
}
.flow-step:hover { border-color: var(--secondary); color: var(--secondary-dark); }
.flow-step.current { background: var(--secondary-dark); border-color: var(--secondary-dark); color: #fff; }
.flow-num {
  display: inline-grid; place-items: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: rgba(0,0,0,.08); font-size: .75rem; font-family: var(--font-en);
}
.flow-step.current .flow-num { background: rgba(255,255,255,.25); }
.flow-arrow { color: var(--text-muted); font-weight: 900; }
.flow-actions { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }

/* Back to top */
.back-to-top {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--secondary-dark);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 900;
}
.back-to-top.show { opacity: .9; pointer-events: auto; transform: none; }
.back-to-top:hover { opacity: 1; background: var(--secondary); }

/* Keyboard focus that is easy to see */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--warning);
  outline-offset: 2px;
}

/* Navbar on phones: brand on top, links in one swipeable row */
@media (max-width: 720px) {
  .navbar { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem .8rem; }
  .navbar-brand { justify-content: center; font-size: 1rem; }
  .navbar-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .1rem;
  }
  .navbar-nav::-webkit-scrollbar { display: none; }
  .navbar-nav li { flex: 1 0 auto; }
  .navbar-nav a { display: block; text-align: center; padding: .4rem .6rem; font-size: .82rem; }
  .page-hero { padding: 1.6rem 1rem; }
  .stepper-label { display: none; }
  .lesson-stepper { width: 100%; }
  .lesson-stepper .lesson-select { max-width: none; font-size: .88rem; padding: .5rem .6rem; }
  .flow-arrow { display: none; }
  .flow-name { display: none; }
  .flow-step.current .flow-name { display: inline; }
  .flow-actions .btn { flex: 1 1 100%; text-align: center; justify-content: center; }
}

/* ============================================================
   Grade label (3級 / 5級) and switch link between the two courses
   ============================================================ */
.grade-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grade-badge, #facc15); color: #1e293b;
  font-weight: 900; font-family: var(--font-jp);
  font-size: 1rem; line-height: 1; padding: .3rem .6rem; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.grade-switch {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; font-weight: 700; color: #fff !important;
  border: 1.5px solid rgba(255,255,255,.6); border-radius: 999px;
  padding: .2rem .65rem; white-space: nowrap;
}
.grade-switch:hover { background: rgba(255,255,255,.15); }
.hero-grade {
  display: inline-block; margin-bottom: .5rem;
  background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.55);
  border-radius: 999px; padding: .2rem .9rem; font-weight: 800; letter-spacing: .05em;
}

/* ============================================================
   Grade 3 exercise components (e3-quiz.js)
   ============================================================ */
[hidden] { display: none !important; }
.mcq-stem { font-family: var(--font-en); font-size: 1.05rem; margin-bottom: .8rem; line-height: 1.8; }
.conv-box, .mcq-stem .conv-row { font-family: var(--font-en); }
.conv-box { background: var(--bg); border-radius: var(--radius-sm); padding: .7rem 1rem; margin-bottom: .8rem; border-left: 4px solid var(--secondary); }
.conv-row { display: flex; gap: .5rem; line-height: 1.8; }
.conv-sp { font-weight: 800; color: var(--secondary-dark); white-space: nowrap; }
.blank-slot { display: inline-block; color: var(--primary); font-weight: 800; letter-spacing: .1em; }
.mcq-card .quiz-option { display: flex; align-items: center; gap: .6rem; text-align: left; font-family: var(--font-en); }
.mcq-card .opt-num {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 900; font-size: .85rem;
}
.mcq-card .opt-text { flex: 1; }
.mcq-card .opt-play { margin-left: auto; opacity: .6; }
.quiz-options.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .quiz-options.three { grid-template-columns: 1fr; } }
.fb-jp { margin-top: .35rem; font-size: .88rem; font-weight: 600; opacity: .9; }

/* 大問3 語句整序 */
.p3-jp { font-weight: 700; margin-bottom: .4rem; }
.p3-chunks { font-family: var(--font-en); color: var(--text-muted); font-size: .95rem; margin-bottom: .7rem; line-height: 2; }
.p3-chip { white-space: nowrap; margin-right: .4rem; }
.p3-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-family: var(--font-en); font-size: 1.02rem; margin-bottom: .8rem; }
.p3-fixed { font-weight: 700; }
.p3-slot {
  min-width: 5.2rem; min-height: 2.3rem; padding: .3rem .6rem;
  border: 2px dashed var(--border); border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.p3-slot small { font-size: .68rem; color: var(--primary); font-weight: 800; font-family: var(--font-jp); }
.p3-slot.filled { border-style: solid; border-color: var(--primary); background: #f5f3ff; cursor: pointer; font-weight: 700; }
.p3-slot.filled:hover { background: #ede9fe; }
.p3-bank { margin-bottom: .5rem; }
.p3-bank .word-tile.used { opacity: .35; pointer-events: none; }

/* 大問4 長文 */
.p4-label { display: inline-block; background: var(--primary-dark); color: #fff; font-weight: 800; font-size: .85rem; padding: .25rem .8rem; border-radius: 999px; margin-bottom: .7rem; }
.notice-box, .email-box, .story-box { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 1.3rem 1.5rem; margin-bottom: 1rem; font-family: var(--font-en); line-height: 1.85; }
.notice-box { border: 3px double var(--primary); text-align: center; }
.notice-title { font-size: 1.25rem; font-weight: 900; color: var(--primary-dark); margin-bottom: .6rem; }
.notice-box p { margin: .3rem 0; }
.email-box { border-left: 5px solid var(--secondary); }
.email-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .1rem 1rem; font-size: .88rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: .6rem; }
.email-body p { margin: .4rem 0; }
.story-title { font-size: 1.2rem; font-weight: 900; text-align: center; margin-bottom: .6rem; color: var(--primary-dark); }
.story-box p { text-indent: 1.5em; margin: .4rem 0; }

/* listening scene card */
.scene-card { display: flex; align-items: center; gap: .8rem; background: var(--bg); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-bottom: .8rem; }
.scene-card .scene-emoji { font-size: 2.4rem; line-height: 1; }
.scene-card .scene-desc { font-size: .88rem; color: var(--text-muted); }

/* speaking: Grade 3 problem card */
.card-frame { border: 3px solid var(--text); border-radius: var(--radius-sm); padding: 1rem 1.2rem; background: #fff; margin-bottom: 1rem; }
.card-title { text-align: center; font-weight: 900; font-size: 1.15rem; font-family: var(--font-en); margin-bottom: .5rem; }
.card-frame .passage-text { margin-bottom: .8rem; }
.card-picture { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem 1.4rem; background: var(--bg); border-radius: var(--radius-sm); padding: .8rem; }
.pic-item { display: flex; flex-direction: column; align-items: center; min-width: 4.5rem; }
.pic-emoji { font-size: 2.4rem; line-height: 1.1; }
.pic-label { font-size: .75rem; color: var(--text-muted); font-weight: 700; }
.step-block { border-top: 1px dashed var(--border); padding-top: .9rem; margin-top: .9rem; }
.step-title { font-weight: 900; color: var(--accent-dark); margin-bottom: .5rem; }
.silent-count { margin-left: .6rem; font-weight: 800; color: var(--primary); }
.no-badge { display: inline-block; background: var(--primary-dark); color: #fff; font-family: var(--font-en); font-size: .8rem; font-weight: 900; padding: .1rem .55rem; border-radius: 6px; margin-right: .3rem; }
.follow-box { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.follow-box .qa-hint { width: 100%; margin: 0; }
.follow-q { width: 100%; }
button.pron-word { background: none; border: none; cursor: pointer; font: inherit; font-weight: 800; color: var(--primary-dark); text-align: left; }

/* Word-order buttons (same as Grade 5): green pill buttons for the words to choose and the words placed */
.word-bank { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.word-bank .word-tile,
.answer-display .placed-word {
  background: #2a9d8f; color: #fff; border: none;
  padding: .4rem .9rem; border-radius: 20px;
  font-weight: 700; font-family: var(--font-en); font-size: .9rem;
  cursor: pointer; user-select: none; transition: var(--transition);
}
.word-bank .word-tile:hover { background: #1b5e20; transform: translateY(-2px); }
.answer-display .placed-word:hover { background: #1b5e20; }
.word-bank .word-tile.used { background: var(--border); color: var(--text-muted); opacity: 1; cursor: not-allowed; pointer-events: none; transform: none; }

/* ---------- Business branding (HiMARCK) ---------- */
.biz-logo {
  height: 34px; width: auto;
  background: #fff; padding: 4px 8px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.footer-copy { margin-top: .8rem; font-size: .78rem; opacity: .7; }
@media (max-width: 600px) {
  .biz-logo { height: 26px; padding: 3px 6px; }
}
.biz-link { display: inline-flex; flex-shrink: 0; }
.biz-link:hover .biz-logo { box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
.footer-copy a { color: inherit; text-decoration: underline; }

/* ---------- HiMARCK trial CTAs ---------- */
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.3rem; border-radius: 999px; font-weight: 800;
  text-decoration: none; white-space: nowrap; transition: var(--transition);
}
.cta-btn-main { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.cta-btn-main:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.cta-btn-line { background: #06c755; color: #fff; }
.cta-btn-line:hover { background: #05a847; color: #fff; transform: translateY(-1px); }

.cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: linear-gradient(135deg, #fff7ef, #fff);
  border: 2px solid var(--accent); border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem; margin: 2rem 0; box-shadow: var(--shadow-sm);
}
.cta-box h2 { font-size: 1.35rem; margin: .2rem 0 .5rem; }
.cta-box p { color: var(--text-muted); margin: 0; }
.cta-box-kicker { font-size: .85rem; font-weight: 800; color: var(--accent-dark) !important; }
.cta-box-btns { display: flex; flex-direction: column; gap: .6rem; flex-shrink: 0; }

.cta-strip { background: #fff7ef; border-top: 3px solid var(--accent); margin-top: 3rem; }
.cta-strip + .site-footer { margin-top: 0; }
.cta-strip-inner {
  max-width: 1100px; margin: 0 auto; padding: 1.1rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.cta-strip-text { margin: 0; color: var(--text); }
.cta-strip-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.cta-strip .cta-btn { padding: .55rem 1.1rem; font-size: .9rem; }

.about-eiken {
  background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 1.8rem; margin: 2rem 0;
}
.about-eiken h2 { font-size: 1.35rem; margin-bottom: .8rem; }
.about-eiken h3 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.about-eiken p { line-height: 1.9; margin-bottom: .8rem; }
.faq-item { border-top: 1px solid var(--border); padding: .7rem 0; }
.faq-item summary { cursor: pointer; font-weight: 700; }
.faq-item p { margin: .6rem 0 0; color: var(--text-muted); }

/* After-quiz trial prompt */
.trial-pop {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 9990; max-width: 330px;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--accent); padding: 1.1rem 1.2rem 1.2rem;
  animation: fadeInUp .4s ease;
}
.trial-pop h3 { font-size: 1.05rem; margin: 0 1.5rem .4rem 0; }
.trial-pop p { font-size: .88rem; color: var(--text-muted); margin: 0 0 .8rem; }
.trial-pop .cta-btn { padding: .55rem 1rem; font-size: .88rem; }
.trial-pop-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.trial-pop-close {
  position: absolute; top: .4rem; right: .5rem; border: none; background: none;
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--text-muted); padding: .3rem;
}
@media (max-width: 700px) {
  .cta-box { flex-direction: column; align-items: stretch; text-align: center; padding: 1.3rem; }
  .cta-strip-inner { flex-direction: column; text-align: center; }
  .cta-strip-btns { justify-content: center; }
  .trial-pop { left: 1rem; right: 1rem; max-width: none; }
}

/* ---------- SeedWriter link (writing page) ---------- */
.seed-card {
  display: flex; align-items: center; gap: 1.2rem;
  background: linear-gradient(135deg, #effaf3, #fff);
  border: 2px solid #52b788; border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem; margin: 1.5rem 0; box-shadow: var(--shadow-sm);
}
.seed-card-icon { font-size: 2.4rem; flex-shrink: 0; }
.seed-card-text { flex: 1; }
.seed-card h2 { font-size: 1.15rem; margin: .1rem 0 .35rem; font-family: var(--font-en); }
.seed-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.seed-card-kicker { font-size: .8rem !important; font-weight: 800; color: #2d6a4f !important; }
.seed-btn { background: #2d6a4f; color: #fff; flex-shrink: 0; }
.seed-btn:hover { background: #1b4332; color: #fff; transform: translateY(-1px); }
.seed-note {
  margin-top: 1.5rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  background: #effaf3; border-left: 4px solid #52b788; font-size: .92rem;
}
.seed-note a { color: #2d6a4f; font-weight: 800; }
@media (max-width: 700px) {
  .seed-card { flex-direction: column; text-align: center; }
}
.footer-tm { margin-top: .5rem; font-size: .72rem; opacity: .6; max-width: 760px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ---------- Printable worksheet card ---------- */
.ws-card { display: flex; align-items: center; gap: 1.2rem; background: #fff; border: 2px dashed var(--primary);
  border-radius: var(--radius-md); padding: 1.2rem 1.5rem; margin: 1.5rem 0; box-shadow: var(--shadow-sm); }
.ws-card-icon { font-size: 2.4rem; flex-shrink: 0; }
.ws-card-text { flex: 1; }
.ws-card h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
.ws-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.ws-btn { background: var(--primary); color: #fff; flex-shrink: 0; }
.ws-btn:hover { filter: brightness(.92); color: #fff; transform: translateY(-1px); }
@media (max-width: 700px) { .ws-card { flex-direction: column; text-align: center; } }
