:root {
  /* ===== KOREAN, PLEASE! 브랜드 컬러 (2026 리브랜딩) ===== */
  --color-bg: #FEFBF2;         /* Warm Ivory — 기본 배경 (가장 넓게) */
  --color-primary: #3B5490;    /* Navy Blue (남색) — 메인 강조, 눈에 편하게 */
  --color-secondary: #F8D152;  /* Sunny Yellow — 기본 CTA / 핵심 박스 */
  --color-accent: #F7AB3E;     /* Warm Orange — 작은 강조 (좁게) */
  --color-text: #1C1E2A;       /* 거의 검정 (어두운 잉크) — 본문/제목 전용 */
  --color-white: #FFFFFF;

  --color-primary-hover: #2E4372;
  --color-secondary-hover: #F2C63D;
  --color-accent-hover: #EB9525;

  /* 레거시 변수 → 새 팔레트로 매핑 (기존 규칙이 새 색을 자동 승계) */
  --burgundy: var(--color-primary);   /* 메인 강조 = Periwinkle */
  --cream: var(--color-bg);           /* 배경 = Warm Ivory */
  --charcoal: var(--color-text);      /* 텍스트 = Deep Navy */
  --rose: #C3C9E6;                    /* 연한 Periwinkle — 테두리/점선 안내선 */
  --taupe: #565B82;                   /* 보조 텍스트 — 가독성 유지되는 짙은 톤 */
  --white: #FFFFFF;
  /* 이중모음 분해용 두 색 (double-vowel two parts) */
  /* 역할 구분용 색 — 모두 어둡고 채도 낮게 (글씨/배지 겸용) */
  --vowel-a: #274A70; /* 첫 모음 First — dark blue */
  --vowel-b: #E8590C; /* 둘째 모음 Second — dark amber */
  /* 받침 대표음 4분류 색 — 서로 확실히 다른 어두운 브랜드 톤 */
  --cat-asis: #2C5A3E; /* 유지음 ㄴ·ㄹ·ㅁ·ㅇ — dark green */
  --cat-k: #3B5490;    /* k군 — navy */
  --cat-p: #EAB308;    /* p군 — 노란 골드 (글자는 남색) */
  --cat-t: #9A3B2E;    /* t군 — dark brick red */
  --radius: 16px;
  --shadow: 0 4px 16px rgba(37, 43, 82, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; word-break: keep-all; overflow-wrap: break-word; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
}

@media (max-width: 680px) {
  .wrap { padding: 0 20px; }
}

/* --- Header / Nav --- */
header.site {
  background: var(--cream);
  border-bottom: 1px solid rgba(37,37,37,0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand { flex: none; margin-right: 8px; }

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--color-text);   /* Korean = Deep Navy */
  text-decoration: none;      /* 링크로 바뀌어도 밑줄 없이 */
  cursor: pointer;
  display: inline-block;
}
.brand .b-comma { color: var(--color-accent); }    /* 쉼표 = Warm Orange */
.brand .b-please { color: var(--color-primary); }  /* please = Periwinkle */

.brand small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--taupe);
  letter-spacing: 0.03em;
}

nav.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  transition: background 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover { background: rgba(59,84,144,0.08); }
nav.main-nav a.active { background: var(--burgundy); color: var(--white); }

/* --- Home: 귀여운 커리큘럼 사다리 (cute curriculum ladder) --- */
/* --- 홈 히어로: 아이보리 바탕 + 페리윙클·옐로우 기하 도형 --- */
.home-hero {
  position: relative; text-align: center; overflow: hidden;
  padding: 64px 0 56px;
  background: transparent;           /* 홈 전체 바탕(아이보리)과 통일 */
}
.home-hero .wrap { position: relative; z-index: 2; }

/* 브랜드 시그니처 기하 도형 — 옐로우 사분원(주도) + 페리윙클 원(포인트) */
.hero-deco { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.hero-deco .hs { position: absolute; display: block; }
.hs-q { right: 0; bottom: 0; width: 220px; height: 220px;
  background: var(--color-secondary); border-top-left-radius: 100%; }
.hs-c { right: 150px; bottom: 24px; width: 118px; height: 118px;
  background: var(--color-primary); border-radius: 50%; }
@media (max-width: 820px) {
  .hs-q { width: 158px; height: 158px; }
  .hs-c { width: 92px; height: 92px; right: 100px; bottom: 16px; }
}
@media (max-width: 520px) {
  .hs-q { width: 118px; height: 118px; }
  .hs-c { width: 64px; height: 64px; right: 70px; bottom: 10px; }
}

.hero-eyebrow {
  display: inline-block;
  background: var(--color-secondary);   /* 옐로우 알약 뱃지 */
  color: var(--color-text);
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 20px;
}
/* 브랜드 네임 — Korean(네이비) · 쉼표(오렌지) · please(페리윙클) */
.hero-brand {
  margin: 0; font-size: clamp(44px, 9vw, 92px); font-weight: 900;
  letter-spacing: -0.02em; line-height: 0.98;
  color: var(--color-text);
}
.hero-brand .comma { color: var(--color-accent); }
.hero-brand .accent { color: var(--color-primary); }
.hero-signature { margin: 16px 0 20px; font-size: clamp(17px, 2.4vw, 22px); font-weight: 600; font-style: italic; color: var(--taupe); }
.hero-signature b { color: var(--color-primary); font-style: normal; font-weight: 800; }
.hero-lead { margin: 0 0 10px; font-size: clamp(19px, 2.6vw, 26px); font-weight: 800; color: var(--charcoal); }
.hero-lead b { color: var(--color-primary); }
.hero-desc { color: var(--charcoal); opacity: 0.82; font-size: 15px; max-width: 560px; margin: 0 auto; line-height: 1.65; }

/* 오늘의 표현 (새로고침마다 랜덤 초급 표현) */
.expr-card {
  position: relative; text-align: center;
  background: var(--white); border: 2px solid rgba(59,84,144,0.14); border-radius: 24px;
  padding: 26px 24px 28px; margin: 10px 0 40px;
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--burgundy) 10%, var(--cream)), 0 12px 26px rgba(37,37,37,0.08);
}
.expr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.expr-eyebrow { display: inline-block; background: var(--color-secondary); color: var(--color-text); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.expr-refresh {
  border: 1px solid rgba(59,84,144,0.3); background: var(--white); color: var(--color-text);
  font-family: var(--font); font-weight: 800; font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease;
}
.expr-refresh:hover { background: rgba(59,84,144,0.06); }
.expr-ko {
  font-size: clamp(30px, 6vw, 46px); font-weight: 900; color: var(--charcoal); line-height: 1.18;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.expr-en { font-size: 17px; font-weight: 700; color: var(--color-text); margin-top: 12px; }
.expr-roman { color: var(--taupe); font-weight: 600; font-style: italic; }
.expr-note { font-size: 14.5px; color: var(--charcoal); opacity: 0.85; line-height: 1.6; max-width: 52ch; margin: 12px auto 0; }
.expr-note .en { display: block; color: var(--taupe); font-style: italic; font-weight: 500; font-size: 0.92em; margin-top: 4px; opacity: 1; }
.round-speak.big { width: 46px; height: 46px; font-size: 19px; }

/* 떠다니는 손그림 (floating hand-drawn doodles) */
.hero-doodles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.doodle { position: absolute; }
.doodle svg { display: block; width: 100%; height: 100%; }
.doodle.d1 { top: 14%; left: 6%;   width: 48px; height: 48px; color: #F7AB3E; --r: -8deg;  animation: floaty 5.6s ease-in-out infinite; }
.doodle.d2 { top: 16%; right: 7%;  width: 42px; height: 42px; color: #274A70; --r: 10deg;  animation: floaty 6.6s ease-in-out .4s infinite; }
.doodle.d3 { top: 58%; left: 9%;   width: 40px; height: 40px; color: #252B52; --r: 6deg;   animation: floaty 6s ease-in-out .8s infinite; }
.doodle.d4 { top: 60%; right: 9%;  width: 46px; height: 46px; color: #2C5A3E; --r: -10deg; animation: floaty 5s ease-in-out .2s infinite; }
.doodle.d5 { top: 6%;  right: 30%; width: 30px; height: 30px; color: #1F5F57; --r: 0deg;   animation: floaty 7s ease-in-out 1s infinite; }
.doodle.d6 { bottom: 6%; left: 28%; width: 32px; height: 32px; color: #3B5490; --r: -6deg;  animation: floaty 6.2s ease-in-out .6s infinite; }
@media (max-width: 700px) { .doodle.d5, .doodle.d6 { display: none; } .doodle.d1, .doodle.d3 { left: 2%; } .doodle.d2, .doodle.d4 { right: 2%; } }
@media (max-width: 470px) { .doodle.d3, .doodle.d4 { display: none; } }

.steps-intro { margin: 2px 0 24px; text-align: center; font-size: 15px; line-height: 1.6; color: var(--charcoal); opacity: 0.92; }
.steps-intro b { color: var(--color-text); }

/* 사다리 (curriculum ladder) */
.ladder { position: relative; max-width: 700px; margin: 4px auto 0; padding: 10px 0 56px 72px; }
.ladder::before { content: ""; position: absolute; left: 34px; top: 22px; bottom: 46px; border-left: 3px dashed var(--rose); }

.module-card {
  --accent: var(--burgundy);
  position: relative; display: block;
  background: var(--white);
  border: 2px solid color-mix(in srgb, var(--accent) 32%, var(--white));
  border-radius: 24px;
  padding: 15px 54px 15px 18px;
  margin-bottom: 22px;
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--accent) 15%, var(--cream)), 0 10px 20px rgba(37,37,37,0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.module-card:last-child { margin-bottom: 0; }
.module-card::before { content: ""; position: absolute; left: -14px; top: 38px; width: 14px; border-top: 3px dashed var(--rose); }
.module-card:hover {
  transform: translateY(-3px) rotate(-0.6deg);
  box-shadow: 0 8px 0 -1px color-mix(in srgb, var(--accent) 22%, var(--cream)), 0 16px 28px rgba(37,37,37,0.14);
}

/* 계단 번호 (사다리 발판) */
.mc-num {
  position: absolute; left: -64px; top: 12px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 21px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--cream);
  box-shadow: 0 4px 0 -1px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 12px rgba(37,37,37,.16);
  z-index: 2;
}
.mc-step { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.module-card h2 { margin: 3px 0 4px; font-size: 20px; line-height: 1.2; }
.module-card h2 .card-en { font-size: 13px; font-weight: 700; color: var(--taupe); margin-left: 4px; }
.module-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--charcoal); opacity: .85; }
.module-card p .en { color: var(--taupe); font-size: 0.86em; margin-top: 3px; opacity: 1; font-weight: 500; font-style: italic; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; }
.module-card .progress-pill { font-size: 12px; font-weight: 800; color: var(--taupe); }
.mc-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 800; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  padding: 7px 15px; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, gap 0.15s ease;
}
.module-card:hover .mc-go { background: var(--accent); color: #fff; gap: 10px; }
.module-card.done .progress-pill { color: var(--accent); }
.module-card.done .progress-pill::before { content: "✓ "; }

/* 계단별 손그림 (per-step doodle) */
.rung-doodle { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; color: var(--accent); opacity: .9; animation: bob 3s ease-in-out infinite; }
.rung-doodle svg { display: block; width: 100%; height: 100%; }
.module-card:hover .rung-doodle { animation: wiggle .6s ease-in-out; }

/* 단계별 색 */
.module-card[data-key="jamo"]          { --accent: #2E3B6B; }
.module-card[data-key="writing"]       { --accent: #E8590C; }
.module-card[data-key="syllable"]      { --accent: #274A70; }
.module-card[data-key="batchim"]       { --accent: #2C5A3E; }
.module-card[data-key="pronunciation"] { --accent: #1F5F57; }
.module-card[data-key="sentence"]      { --accent: #3A3F66; }
.module-card[data-key="grammar"]       { --accent: #1F5F57; }
.module-card[data-key="conversation"]  { --accent: #1F5F57; }

@keyframes floaty { 0%,100% { transform: translateY(0) rotate(var(--r,0deg)); } 50% { transform: translateY(-12px) rotate(calc(var(--r,0deg) + 5deg)); } }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(5deg); } }
@keyframes wiggle { 0%,100% { transform: rotate(-9deg); } 25% { transform: rotate(9deg); } 50% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) {
  .doodle, .rung-doodle, .module-card:hover .rung-doodle { animation: none !important; }
}

/* --- Page header (non-home pages) --- */
.page-head {
  padding: 40px 0 24px;
}

.page-head .eyebrow {
  display: inline-block;
  background: var(--color-secondary);   /* Sunny Yellow 뱃지 */
  color: var(--color-text);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
}

.page-head p {
  margin: 0;
  opacity: 0.92;
  max-width: 560px;
  line-height: 1.6;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(59,84,144,0.25);
  background: var(--white);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.active { background: var(--burgundy); color: var(--white); }

/* --- 자모 카드: 모두 뒤집기 버튼 --- */
.card-tools {
  display: flex;
  justify-content: flex-end;
  margin: -12px 0 16px;
}
.flip-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(59,84,144,0.25);
  background: var(--white);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.flip-all-btn:hover { background: var(--burgundy); color: var(--white); }
.flip-all-btn .fa-icon { font-size: 16px; line-height: 1; }
.flip-all-btn .en-inline {
  display: inline;
  font-size: 12px;
  margin-top: 0;
  opacity: 0.8;
}

/* --- Bilingual English sub-text --- */
.en {
  display: block;
  font-size: 0.86em;
  opacity: 1;
  font-weight: 500;
  margin-top: 2px;
  font-style: italic;
}

.en-inline {
  display: block;
  font-size: 14px;
  font-weight: 600;
  opacity: 1;
  font-style: italic;
  margin-top: 2px;
}

/* --- Section label (Korean big + English small) --- */
.section-label {
  margin: 8px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  border-left: 6px solid var(--color-secondary);   /* Sunny Yellow 액센트 바 */
  padding-left: 12px;
}

.section-label .ko {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
}

.section-label .en {
  display: inline;
  font-size: 13px;
  font-weight: 600;
  color: var(--taupe);
  font-style: normal;
  opacity: 1;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Vowel pairs (ㅏ / ㅑ grouped together) --- */
.vowel-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.vowel-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(59,84,144, 0.14);
  border: 1px solid rgba(59, 84, 144, 0.12);
  border-radius: var(--radius);
  padding: 10px;
}

.vowel-pair:has(.jamo-card:only-child) {
  grid-template-columns: 1fr;
}

.vowel-pair .jamo-card {
  box-shadow: none;
  background: transparent;
}

/* 이중모음 카드 앞면은 요소가 많아 살짝 작게 맞춤 */
.dv-card .jamo-face .glyph { font-size: 40px; margin-bottom: 2px; }
.dv-card .dv-formula { margin-bottom: 8px; padding-bottom: 6px; }
.jamo-back .card-speak { margin-top: 12px; }

/* --- Double-vowel decomposition cards --- */
.dv-legend {
  font-size: 14px;
  font-weight: 700;
  margin: -4px 0 14px;
  padding-left: 12px;
}

.dv-legend .v-a { color: var(--vowel-a); }
.dv-legend .v-b { color: var(--vowel-b); }
.dv-legend .v-plus { color: var(--taupe); margin: 0 4px; }

.dv-card .dv-formula {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(37, 37, 37, 0.15);
}

.dv-formula .v-a { color: var(--vowel-a); }
.dv-formula .v-b { color: var(--vowel-b); }
.dv-formula .v-op { color: var(--taupe); margin: 0 5px; font-weight: 600; }

.dv-card .glyph {
  font-size: 40px;
  /* 결과 글자: 두 색을 그라데이션으로 이어 합쳐짐을 표현 */
  background: linear-gradient(100deg, var(--vowel-a) 45%, var(--vowel-b) 55%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--vowel-a);
}

/* --- Flashcard grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

/* --- Flip flashcards (앞: 자모 / 뒤: 예시 단어) --- */
.jamo-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
  height: 210px;
  perspective: 900px;
}

.jamo-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}
.jamo-card.flipped .jamo-inner { transform: rotateY(180deg); }

.jamo-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.jamo-card:hover .jamo-face { border-color: var(--rose); }
.jamo-back { transform: rotateY(180deg); }

.jamo-face .glyph {
  font-size: 50px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 8px;
}
.jamo-face .roman {
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: 0.01em;
}
.jamo-face .card-speak { margin-top: 12px; }
.flip-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 11px;
  color: var(--taupe);
  opacity: 0.75;
}

/* 뒷면 — 예시 단어 (그림 살짝 작게 + 넉넉한 간격, 빽빽하지 않게) */
.back-emoji { font-size: 40px; line-height: 1; margin-bottom: 18px; }
.back-emoji svg { display: block; }
.back-word { font-size: 24px; font-weight: 800; color: var(--charcoal); }
.back-roman { font-size: 14px; font-weight: 700; color: var(--vowel-a); margin-top: 4px; }
.back-mean { font-size: 12px; color: var(--taupe); margin-top: 3px; }

/* --- Batchim: 7-sound summary + systematic cards --- */
.cat-asis { --cat: var(--cat-asis); }
.cat-k { --cat: var(--cat-k); }
.cat-p { --cat: var(--cat-p); }
.cat-t { --cat: var(--cat-t); }
/* p군은 노란 계열이라 배지/배경 위 글자는 남색으로 (가독성).
   단, 겹받침의 발음되는 자음(gb-part.kept)은 'ㅂ 소리' 배지 색(노랑)과 맞춘다. */
.sum-badge.cat-p, .cat-p .bsound-badge, .cat-p .bsound-letter,
.cat-p .bex-pron { color: #252B52; }

.batchim-summary {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.sum-text { font-size: 15px; line-height: 1.55; }
.sum-text b { color: var(--color-text); font-size: 1.15em; }
.sum-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.sum-break { flex-basis: 100%; height: 0; }
.sum-badge {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--cat);
  border-radius: 999px;
  padding: 5px 12px;
}

.bsection-note {
  margin: -8px 0 16px;
  padding-left: 12px;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.92;
}

.bsound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.bsound {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  text-align: center;
  border-top: 5px solid var(--cat);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bsound-letters { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.bsound-break { flex-basis: 100%; height: 0; }
.bsound-letter {
  font-size: 19px;
  font-weight: 800;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 12%, var(--white));
  border-radius: 8px;
  padding: 3px 7px;
  min-width: 26px;
}

.bsound-arrow { color: var(--taupe); font-size: 13px; margin: 8px 0 6px; }

.bsound-badge {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: var(--cat);
  border-radius: 999px;
  padding: 4px 20px;
  margin-bottom: 16px;
}

.bsound-ex {
  width: 100%;
  border-top: 1px dashed rgba(37,37,37,0.15);
  padding-top: 14px;
}
.bex-emoji { font-size: 46px; line-height: 1; }
.bex-word {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
}
/* 발음 결과(/꼳/)는 카테고리 색 하이라이트로 확실히 표시 */
.bex-pron { color: var(--cat); font-weight: 800; margin-top: 5px; display: inline-block;
  background: color-mix(in srgb, var(--cat) 15%, #fff); padding: 3px 12px; border-radius: 999px; }
.bex-mean { font-size: 13px; opacity: 0.65; margin-top: 2px; }

/* 겹받침 — 두 자음 중 발음되는 쪽 강조 */
.gb-batchim { display: flex; justify-content: center; align-items: baseline; gap: 2px; }
.gb-part { font-size: 34px; font-weight: 800; line-height: 1; }
/* 발음되는 자음 — 카테고리 색 + 색 밑줄로 확실히 강조 */
.gb-part.kept { color: var(--cat); }
/* 발음 안 되는 자음 — 흐리게 + 취소선 */
.gb-part.silent { color: rgba(37, 37, 37, 0.25); }
.bsound-badge { white-space: nowrap; }

/* --- Syllable block (puzzle) --- */
.syl-block {
  --blk: 190px;
  width: var(--blk);
  height: var(--blk);
  border: 2px solid var(--charcoal);
  border-radius: 12px;
  background: var(--white);
  display: grid;
  overflow: hidden;
  flex: none;
}

.syl-block.mini { --blk: 118px; }

.syl-block .slot {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
  font-size: calc(var(--blk) * 0.46);
}

.syl-block[data-batchim="1"] .slot { font-size: calc(var(--blk) * 0.30); }

.slot.cho { grid-area: cho; color: #3B5490; }
.slot.jung { grid-area: jung; color: #E8590C; }
.slot.jong { grid-area: jong; color: var(--cat-asis); }
.slot.vpart { grid-area: vpart; color: #E8590C; }
.slot.hpart { grid-area: hpart; color: #E8590C; }

/* 세로 모음 → 좌우 (vertical vowel: side by side) */
.syl-block[data-layout="v"][data-batchim="0"] { grid-template: "cho jung" 1fr / 1fr 1fr; }
.syl-block[data-layout="v"][data-batchim="1"] { grid-template: "cho jung" 1fr "jong jong" 1fr / 1fr 1fr; }
/* 가로 모음 → 위아래 (horizontal vowel: stacked) */
.syl-block[data-layout="h"][data-batchim="0"] { grid-template: "cho" 1fr "jung" 1fr / 1fr; }
.syl-block[data-layout="h"][data-batchim="1"] { grid-template: "cho" 1fr "jung" 1fr "jong" 1fr / 1fr; }
/* 이중모음 → 자음(왼쪽위) + 세로획(오른쪽 전체높이) + 가로획(왼쪽아래), 실제 음절 '과'와 동일 */
.syl-block[data-layout="c"][data-batchim="0"] { grid-template: "cho vpart" 1fr "hpart vpart" 1fr / 1fr 1fr; }
.syl-block[data-layout="c"][data-batchim="1"] { grid-template: "cho vpart" 1fr "hpart vpart" 1fr "jong jong" 0.85fr / 1fr 1fr; }
.syl-block[data-layout="c"] .slot { font-size: calc(var(--blk) * 0.32); }
.syl-block[data-layout="c"][data-batchim="1"] .slot { font-size: calc(var(--blk) * 0.26); }

/* 퍼즐 안내선 (dashed guide lines) */
.syl-block[data-layout="v"] .cho { border-right: 2px dashed rgba(37,37,37,0.16); }
.syl-block[data-layout="h"] .cho { border-bottom: 2px dashed rgba(37,37,37,0.16); }
.syl-block[data-layout="h"][data-batchim="1"] .jung { border-bottom: 2px dashed rgba(37,37,37,0.16); }
.syl-block[data-layout="c"] .cho { border-right: 2px dashed rgba(37,37,37,0.16); border-bottom: 2px dashed rgba(37,37,37,0.16); }
.syl-block[data-layout="c"] .hpart { border-right: 2px dashed rgba(37,37,37,0.16); }
.syl-block[data-batchim="1"] .jong { border-top: 2px dashed rgba(37,37,37,0.16); }

/* Pattern examples */
.pattern-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding-bottom: 36px;
}

.pattern-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.pattern-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}

.syl-eq { font-size: 28px; color: var(--taupe); font-weight: 700; }

.pattern-result { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.pr-glyph { font-size: 60px; font-weight: 800; color: var(--charcoal); line-height: 1; }

/* 둥근 스피커 버튼 — 글자와 확실히 떨어뜨려 받침처럼 안 보이게 */
.round-speak {
  border: none;
  background: rgba(59,84,144,0.10);
  color: var(--color-text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  flex: none;
}
.round-speak:hover { background: rgba(59,84,144,0.20); }
.round-speak.sm { width: 26px; height: 26px; font-size: 12px; }
.round-speak:disabled { opacity: 0.3; cursor: default; }

/* 넓은 '들어보기' 알약 버튼 (letter처럼 안 보이게) */
.listen-btn {
  border: none;
  background: var(--color-secondary);   /* 기본 CTA = Sunny Yellow */
  color: var(--color-text);             /* 글자 = Deep Navy */
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.listen-btn:hover { background: var(--color-secondary-hover); }
.listen-btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.listen-btn:disabled { opacity: 0.4; cursor: default; }

.pattern-label b { display: block; font-size: 15px; margin-bottom: 2px; }
.pattern-label span { display: block; font-size: 12px; color: var(--taupe); }
.pattern-label .pattern-note { color: var(--color-text); font-weight: 600; margin-top: 4px; }

/* Builder */
.builder {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 40px;
}

.picker { margin-bottom: 16px; }

.picker-label {
  font-size: 13px;
  color: var(--charcoal);
  opacity: 0.75;
  margin-bottom: 8px;
}
.picker-label b { color: var(--color-text); opacity: 1; margin-right: 4px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-break { flex-basis: 100%; height: 0; }
.chip-sublabel {
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 700;
  color: var(--vowel-a);
  margin: 6px 0 2px;
}

.chip {
  min-width: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid rgba(59,84,144,0.18);
  background: var(--white);
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--charcoal);
  line-height: 1.1;
  white-space: pre-line;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.chip:hover { border-color: var(--color-text); }
.chip-cho.active { background: #3B5490; color: #fff; border-color: #3B5490; }
.chip-jung.active { background: #E8590C; color: #fff; border-color: #E8590C; }
.chip-jong.active { background: var(--cat-asis); color: #fff; border-color: var(--cat-asis); }
.chip-jong { font-size: 15px; }
.chip-jong:not(.active) { color: var(--charcoal); }
/* 실제 글자가 안 되는(뜻없는) 조합의 칩 — 흐리게, 클릭 불가 */
.chip.disabled {
  opacity: 0.28;
  pointer-events: none;
  border-color: rgba(59,84,144,0.10);
  background: transparent;
  font-weight: 500;
}

.builder-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed rgba(37,37,37,0.15);
}

.syl-result { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.syl-result-glyph { font-size: 92px; font-weight: 800; color: var(--charcoal); line-height: 1; }
.syl-result-roman { font-size: 20px; font-weight: 700; color: #E8590C; }

.speak-btn.big { width: 44px; height: 44px; font-size: 18px; margin-top: 6px; }

/* Quiz pieces */
.q-piece { font-weight: 800; }
.q-piece.cho { color: #3B5490; }
.q-piece.jung { color: #E8590C; }
.q-piece.jong { color: var(--cat-asis); }

/* --- Build your name --- */
.name-help {
  margin: -6px 0 18px;
  padding-left: 12px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.95;
}
.name-help b { color: var(--color-text); }

.name-builder {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 48px;
}

.name-blocks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.name-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* ＋ 칸 추가 버튼 (블록 오른쪽) */
.name-add-cell { align-self: center; justify-content: center; }
.name-add {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px dashed rgba(59, 84, 144, 0.45);
  background: var(--white);
  color: var(--color-text);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.name-add:hover { background: rgba(59, 84, 144, 0.08); border-color: var(--color-text); }
.name-add-label { font-size: 11px; color: var(--taupe); text-align: center; line-height: 1.3; }

.syl-block.name-block { --blk: 104px; position: relative; cursor: pointer; }
.syl-block.name-block.drag-over { border-color: var(--vowel-a); background: rgba(42,111,176,0.08); }

/* 이름 블록은 항상 4등분 안내선(십자 점선)을 보여준다 */
.syl-block.name-block .slot { border: none !important; position: relative; z-index: 1; }
.syl-block.name-block::before,
.syl-block.name-block::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}
.syl-block.name-block::before { top: 6px; bottom: 6px; left: 50%; border-left: 2px dashed rgba(37,37,37,0.20); }
.syl-block.name-block::after { left: 6px; right: 6px; top: 50%; border-top: 2px dashed rgba(37,37,37,0.20); }

.syl-block.name-block .slot.empty {
  color: rgba(37,37,37,0.25);
  font-size: calc(var(--blk) * 0.26);
  font-weight: 400;
}

.name-tools { display: flex; gap: 6px; }
.clear-cell {
  border: none;
  background: rgba(37,37,37,0.08);
  color: var(--charcoal);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.clear-cell:hover { background: rgba(37,43,82,0.18); color: var(--cat-p); }

.name-output-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px dashed rgba(37,37,37,0.15);
  border-bottom: 1px dashed rgba(37,37,37,0.15);
}
.name-output {
  font-size: 40px;
  font-weight: 800;
  color: var(--color-text);
  min-width: 60px;
  letter-spacing: 0.04em;
}
.reset-btn {
  border: 1px solid rgba(59,84,144,0.3);
  background: var(--white);
  color: var(--color-text);
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.reset-btn:hover { background: rgba(59,84,144,0.06); }

.palette-group { margin-top: 14px; }
.palette-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--taupe);
  margin-bottom: 8px;
}
.pal-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pal-chip {
  min-width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 2px solid transparent;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  cursor: grab;
  line-height: 1;
  color: #fff;
  user-select: none;
}
.pal-chip:active { cursor: grabbing; }
.pal-c { background: #3B5490; }   /* 자음 = 남색 */
.pal-v { background: #E8590C; }   /* 모음 = 주황 */
.pal-chip.selected {
  border-color: var(--charcoal);
  box-shadow: 0 0 0 3px rgba(37,37,37,0.15);
  transform: translateY(-2px);
}

/* --- Pronunciation rules --- */
.learn-tip {
  margin-top: 16px;
  background: color-mix(in srgb, var(--color-secondary) 30%, var(--white));
  border-left: 4px solid var(--color-accent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.55;
}
.learn-tip .en { font-weight: 500; opacity: 0.8; font-size: 0.9em; }

.pc-1 { --accent: #2E3B6B; }
.pc-2 { --accent: #274A70; }
.pc-3 { --accent: #1F5F57; }
.pc-4 { --accent: #2C5A3E; }
.pc-5 { --accent: #E8590C; }
.pc-6 { --accent: #1F5F57; }
.pc-7 { --accent: #1F5F57; }

.intro-words {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding-bottom: 32px;
}
.pkey {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.pkey-emoji { font-size: 34px; line-height: 1; margin-bottom: 18px; }
.pkey-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; font-size: 21px; font-weight: 800; }
.pkey-w { color: var(--charcoal); white-space: nowrap; }
.pkey-arrow { color: var(--taupe); font-weight: 600; }
.pkey-p { color: #1C7ED6; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pkey-mean { font-size: 12px; color: var(--taupe); font-weight: 600; }

.rules { display: flex; flex-direction: column; gap: 16px; padding-bottom: 36px; }

.prule {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  border-left: 6px solid var(--accent);
}
.prule-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.prule-num {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.prule-ko { font-size: 21px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.prule-en { font-size: 13px; font-weight: 600; color: var(--taupe); }

.prule-when {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.92;
  margin-bottom: 12px;
}
.prule-when .en { font-size: 0.95em; }

.prule-simple {
  background: color-mix(in srgb, var(--accent) 9%, var(--white));
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.prule-simple b { color: var(--accent); }
.prule-simple .en { font-size: 0.9em; }

.prule-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.pex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--cream);
  border-radius: 10px;
  padding: 16px 10px 14px;
  text-align: center;
}
.pex-emoji { font-size: 30px; line-height: 1; margin-bottom: 18px; }
.pex-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; font-size: 17px; font-weight: 700; }
.pex-w { color: var(--charcoal); white-space: nowrap; }
.pex-arrow { color: var(--taupe); font-size: 14px; }
.pex-p { color: #1C7ED6; white-space: nowrap; }
.pex-mean { font-size: 12px; color: var(--taupe); font-weight: 600; }

.extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}
.pextra {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 4px solid var(--taupe);
}
.pextra-ko { font-size: 16px; font-weight: 800; color: var(--color-text); }
.pextra-rows { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.pextra-ex {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  flex-wrap: wrap;
}
.pextra-emoji { font-size: 20px; }
.pextra-p { color: #1C7ED6; white-space: nowrap; }
.pextra-mean { font-size: 12px; color: var(--taupe); font-weight: 600; margin-left: 4px; }
.pextra-en { font-size: 12px; color: var(--taupe); margin-top: 4px; }

/* --- Grammar lesson --- */
.lesson-tabs { flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lesson-name { font-size: 22px; font-weight: 800; color: var(--color-text); text-align: center; margin: 0 0 4px; }
.lesson-sub { text-align: center; font-size: 14px; opacity: 0.92; line-height: 1.5; margin-bottom: 8px; text-wrap: balance; }
.lesson-sub .en, .lesson-rule .en { text-wrap: balance; }
.lesson-sub .en { display: block; font-size: 0.9em; font-style: italic; opacity: 0.75; }
.example-item .result { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.lesson-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 48px;
}

.lesson-pattern {
  text-align: center;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 800;
  color: var(--color-text);
  padding: 24px 0;
  border-bottom: 1px dashed rgba(59,84,144,0.25);
  margin-bottom: 8px;
  text-wrap: balance;
}
.lesson-pattern .pt-base, .lesson-pattern .pt-end, .lesson-pattern .vs { white-space: nowrap; }

.lesson-pattern .vs {
  color: var(--taupe);
  font-weight: 500;
  font-size: 0.6em;
  margin: 0 8px;
}

.lesson-rule {
  text-align: center;
  font-size: 15px;
  opacity: 0.92;
  padding: 16px 0 24px;
  text-wrap: balance;
}

.lesson-rule b { color: #E64980; }

.example-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 상단 2개 · 하단 2개 */
  gap: 14px;
}

.example-item {
  position: relative;
  background: var(--cream);
  border-radius: 12px;
  padding: 16px 18px 16px 46px;
  border: 1px solid rgba(59,84,144,0.08);
}
/* 예시 카드 작은 번호 */
.example-item .ex-num {
  position: absolute;
  top: 14px; left: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--burgundy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.example-item .word { font-size: 14px; font-weight: 700; opacity: 0.9; }
.example-item .word .ex-gloss { color: var(--taupe); font-weight: 600; }
.example-item .result { font-size: 22px; font-weight: 800; color: var(--color-text); margin: 4px 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.example-item .meaning { font-size: 13px; opacity: 0.8; }

/* 앞부분(명사·동사) + 붙는 패턴을 서로 다른 색으로 — 뒤에 붙는 게 보이게 (전 레슨 공통) */
.example-item .ex-base { color: #1C7ED6; }   /* 명사(앞부분) = 밝은 파랑 */
.example-item .ex-end  { color: #E64980; }  /* 붙는 문법(어미) = 밝은 핑크 */

/* 큰 패턴 문구(lesson-pattern)도 앞부분/어미 색을 동일하게 구분 */
.lesson-pattern .pt-base { color: #1C7ED6; }
.lesson-pattern .pt-end { color: #E64980; }

/* 레슨 탭 번호 배지 */
.lesson-tabs .tab-btn .lesson-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(59,84,144,0.12); color: var(--color-text);
  font-size: 12px; font-weight: 800; margin-right: 7px; vertical-align: middle;
}
.lesson-tabs .tab-btn.active .lesson-no { background: rgba(255,255,255,0.28); color: #fff; }

/* --- Quiz --- */
.quiz-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 520px;
  margin: 0 auto 64px;
  text-align: center;
}

.quiz-box .quiz-progress {
  font-size: 13px;
  font-weight: 700;
  color: var(--taupe);
  margin-bottom: 16px;
}

.quiz-prompt {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.quiz-word {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 28px;
}

/* 빈칸 — 그냥 일자 밑줄 */
.quiz-word .blank {
  display: inline-block;
  min-width: 1.6em;
  color: transparent;
  border-bottom: 3px solid var(--charcoal);
  vertical-align: bottom;
  margin: 0 3px;
}

/* 영어 단서(뜻)만 주는 퀴즈 — 문제를 크게 */
.quiz-word .quiz-en-clue {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0,..): 긴 보기가 칸을 밀어내지 않게 */
  gap: 12px;
  margin-bottom: 20px;
}

/* 보기 번호 배지 */
.opt-num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--burgundy) 12%, #fff);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.quiz-opt.correct .opt-num,
.quiz-opt.wrong .opt-num { background: rgba(255,255,255,0.3); color: #fff; }

.quiz-opt {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px; /* 번호 | 글자 | 스피커 */
  align-items: center;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid rgba(59,84,144,0.2);
  background: var(--white);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--charcoal);
  transition: all 0.15s ease;
}

.quiz-opt:hover { border-color: var(--color-text); }
/* 글자를 셀 정중앙에 (번호·스피커는 양 끝 고정이라 흐름에서 빠짐).
   min-width:0 + overflow:hidden → 긴 보기가 셀 밖으로 안 밀려나고, JS가 폰트를 줄여 한 줄에 맞춘다. */
.quiz-opt .opt-label { pointer-events: none; min-width: 0; text-align: center; overflow: hidden; }
.quiz-opt.correct { background: var(--burgundy); color: var(--white); border-color: var(--color-text); }
.quiz-opt.wrong { background: #C0392B; color: var(--white); border-color: #C0392B; }
.quiz-opt.locked { cursor: default; }
.quiz-opt.locked:not(.correct):not(.wrong) { opacity: 0.5; }

.opt-speak {
  border: none;
  background: rgba(59,84,144,0.10);
  color: var(--color-text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.opt-speak:hover { background: rgba(59,84,144,0.22); }
.quiz-opt.correct .opt-speak,
.quiz-opt.wrong .opt-speak { background: rgba(255,255,255,0.28); color: #fff; }
/* 좁은 화면(폰): 보기를 1열로 → 각 보기가 넓어져 구절도 한 줄, 발음도 넉넉히 들어감 */
@media (max-width: 480px) {
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-opt { padding: 12px 14px; }
}

.quiz-feedback {
  min-height: 24px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.quiz-feedback.ok { color: var(--color-text); }
.quiz-feedback.no { color: #C0392B; }

/* 정답 시 예문 */
.quiz-example {
  background: color-mix(in srgb, var(--vowel-a) 8%, var(--white));
  border: 1px solid color-mix(in srgb, var(--vowel-a) 22%, transparent);
  border-radius: 12px; padding: 12px 14px; margin: 0 auto 14px; max-width: 420px;
}
.qex-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--vowel-a); margin-bottom: 4px; }
.qex-line { display: inline-flex; align-items: center; gap: 8px; }
.qex-ko { font-size: 20px; font-weight: 800; color: var(--charcoal); }
.qex-en { display: block; font-size: 13px; color: var(--taupe); font-weight: 600; margin-top: 2px; }

/* 앞/뒤 자유 이동 내비게이션 */
.quiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.quiz-prev, .quiz-next {
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid rgba(59,84,144,0.3);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.quiz-next { background: var(--burgundy); color: var(--white); border-color: var(--color-text); }
.quiz-next:hover { background: #4F5EA5; }
.quiz-prev { background: var(--white); color: var(--color-text); }
.quiz-prev:hover:not(:disabled) { background: rgba(59,84,144,0.06); }
.quiz-prev:disabled { opacity: 0.35; cursor: default; }

.quiz-done {
  display: none;
}

.quiz-done.show {
  display: block;
}

.quiz-done .score {
  font-size: 40px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}

.speak-btn {
  border: none;
  background: var(--burgundy);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
  line-height: 1;
}

.speak-btn:hover { background: #4F5EA5; }

footer.site {
  text-align: center;
  padding: 32px 0 48px;
  font-size: 12px;
  opacity: 0.5;
}

/* =================== 학습 서비스 확장 =================== */

/* Step X / N — 컴팩트 한 줄 (배지 + 단원명 + 진행 바) */
.step-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 6px; font-size: 13px;
}
.step-badge {
  background: var(--burgundy); color: #fff; border-radius: 999px;
  padding: 4px 12px; font-weight: 800; font-size: 12px; white-space: nowrap; flex: none;
}
.step-name { font-weight: 800; color: var(--color-text); white-space: nowrap; }
.step-name em { font-style: normal; color: var(--taupe); font-weight: 600; font-size: 0.85em; }
.step-track { flex: 1; min-width: 60px; height: 6px; background: rgba(59,84,144,0.12); border-radius: 999px; overflow: hidden; }
.step-fill { display: block; height: 100%; background: var(--burgundy); border-radius: 999px; }

/* 모달 공통 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(37,37,37,0.5);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
}
.modal-card {
  background: var(--cream); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent;
  font-size: 18px; cursor: pointer; color: var(--charcoal); opacity: 0.6;
}
.modal-close:hover { opacity: 1; }

/* 진단 */
.diag-eyebrow { display: inline-block; background: var(--color-secondary); color: var(--color-text); font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.diag-title { font-size: 22px; margin: 6px 0 8px; }
.diag-lead { font-size: 14px; line-height: 1.6; opacity: 0.95; }
.diag-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.diag-progress { font-size: 13px; font-weight: 700; color: var(--taupe); }
.diag-q { font-size: 17px; line-height: 1.6; margin: 8px 0 16px; }
.dq-big { font-size: 30px; font-weight: 800; color: var(--color-text); }
.diag-options { display: grid; gap: 10px; }
.diag-opt {
  padding: 14px; border-radius: 12px; border: 2px solid rgba(59,84,144,0.2);
  background: var(--white); font-family: var(--font); font-size: 17px; font-weight: 700; cursor: pointer; color: var(--charcoal);
}
.diag-opt:hover:not(:disabled) { border-color: var(--color-text); }
.diag-opt.correct { background: var(--burgundy); color: #fff; border-color: var(--color-text); }
.diag-opt.wrong { background: #C0392B; color: #fff; border-color: #C0392B; }
.diag-score { font-size: 40px; font-weight: 800; color: var(--color-text); margin: 8px 0; }
.diag-reason { font-size: 15px; line-height: 1.6; }
.diag-rec { margin-top: 12px; font-size: 16px; background: color-mix(in srgb, var(--burgundy) 9%, var(--white)); border-radius: 10px; padding: 12px 14px; }

/* 오늘의 10분 — 밝고 컬러풀하게 */
.today-box {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--white));
  color: var(--charcoal);
  border: 1px solid rgba(59,84,144,0.20);
  border-radius: var(--radius);
  padding: 24px; margin: 8px 0 40px; box-shadow: var(--shadow);
}
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.today-eyebrow { display: inline-block; background: var(--color-secondary); color: var(--color-text); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.today-title { font-size: 23px; font-weight: 800; margin-top: 4px; color: var(--color-text); }
.today-cta-btn {
  background: var(--color-accent);      /* 강조 CTA = Warm Orange */
  color: var(--color-text);             /* 글자 = Deep Navy */
  border: none; border-radius: 999px;
  padding: 14px 24px; font-family: var(--font); font-weight: 800; font-size: 16px; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; text-align: center;
  box-shadow: 0 4px 12px rgba(247,171,62,0.30); transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.today-cta-btn span { font-size: 11px; font-weight: 700; opacity: 0.75; margin-top: 2px; }
.today-cta-btn:hover { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(247,171,62,0.38); }
.today-cta-btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.today-card {
  background: #fff; border-radius: 14px; padding: 18px; color: var(--charcoal);
  border-top: 5px solid var(--tc); box-shadow: 0 4px 14px rgba(37,37,37,0.08);
}
.today-card:nth-child(1) { --tc: #E8590C; }  /* 주황 */
.today-card:nth-child(2) { --tc: #274A70; }  /* 파랑 */
.today-card:nth-child(3) { --tc: #2C5A3E; }  /* 초록 */
.tc-num { width: 28px; height: 28px; border-radius: 50%; background: var(--tc); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tc-title { font-weight: 800; margin: 10px 0 6px; font-size: 15px; color: var(--charcoal); }
.tc-title .en { font-weight: 600; color: var(--taupe); font-size: 0.82em; font-style: italic; }
.tc-body { font-size: 14px; }
.tc-rec-mod { font-size: 19px; font-weight: 800; margin-bottom: 8px; color: var(--tc); }
.tc-rec-mod .en { font-size: 0.62em; font-weight: 600; color: var(--taupe); }
.tc-link { color: var(--tc); font-weight: 800; text-decoration: none; display: inline-block; margin-top: 4px; }
.tc-link:hover { text-decoration: underline; }
.tc-link.btn { background: var(--tc); color: #fff; border: none; border-radius: 999px; padding: 9px 16px; text-decoration: none; cursor: pointer; font-family: var(--font); font-weight: 800; font-size: 13px; margin-top: 6px; box-shadow: 0 3px 8px rgba(37,37,37,0.12); }
.tc-rev-count { margin-bottom: 8px; }
.tc-rev-count b { color: #E8590C; }
.tc-rev-none { margin-bottom: 8px; }
.tc-expr-ko { font-size: 23px; font-weight: 800; color: var(--charcoal); }
.tc-expr-en { font-size: 13px; color: var(--taupe); margin: 4px 0 10px; }
.tc-roman { opacity: 0.8; }
.today-card .round-speak { background: color-mix(in srgb, var(--tc) 14%, #fff); color: var(--tc); }
.today-card .round-speak:hover { background: color-mix(in srgb, var(--tc) 24%, #fff); }

/* 모듈 상태 배지 */
.module-card.st-review .progress-pill { color: var(--cat-t); }
.module-card.st-review .progress-pill::before { content: "⚑ "; }
.module-card.st-recommended .progress-pill { color: var(--accent); }
.module-card.st-recommended .progress-pill::before { content: "★ "; }
.module-card.st-inProgress .progress-pill { color: var(--vowel-a); }
/* 추천 단원은 accent 색 링으로 강조 (accent 테두리색을 덮지 않음) */
.module-card.st-recommended { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.module-card.st-recommended:hover { box-shadow: 0 0 0 2px var(--accent), 0 14px 30px rgba(37,37,37,0.15); }

/* 퀴즈 완료 버튼 */
.quiz-done-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.qd-btn {
  padding: 10px 18px; border-radius: 999px; font-family: var(--font); font-weight: 700; font-size: 14px;
  cursor: pointer; border: none; text-decoration: none; display: inline-block;
}
.qd-next { background: var(--burgundy); color: #fff; }
.qd-review { background: var(--cat-t); color: #fff; }
.qd-home { background: var(--white); color: var(--color-text); border: 1px solid rgba(59,84,144,0.3); }
.qd-restart { background: var(--white); color: var(--color-text); border: 1px solid rgba(59,84,144,0.3); }
.qd-btn:hover { opacity: 0.9; }

/* 회화 */
.conv-tabs { flex-wrap: wrap; }
.conv-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 44px; }
.conv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.conv-emoji { font-size: 40px; }
.conv-name { font-size: 22px; font-weight: 800; color: var(--color-text); }
.conv-name-en { font-size: 13px; color: var(--taupe); font-weight: 600; }
.conv-sub { font-size: 13px; font-weight: 800; color: var(--color-text); border-left: 4px solid var(--burgundy); padding-left: 10px; margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.conv-phrase { background: var(--cream); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.cp-ko { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-en { font-size: 13px; opacity: 0.92; margin-top: 2px; }
.cp-roman { color: var(--taupe); }
.conv-vars { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.build-prompt { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.build-prompt .en { font-weight: 500; opacity: 0.7; font-size: 0.85em; }
.build-answer {
  min-height: 52px; border: 2px dashed rgba(59,84,144,0.3); border-radius: 12px;
  padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; background: var(--cream);
}
.build-placeholder { color: var(--taupe); font-size: 14px; }
.build-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.build-chip {
  padding: 8px 14px; border-radius: 10px; border: 2px solid rgba(59,84,144,0.25);
  background: var(--white); font-family: var(--font); font-size: 17px; font-weight: 700; cursor: pointer; color: var(--charcoal);
}
.build-chip:hover { border-color: var(--color-text); }
.build-chip.in { background: var(--burgundy); color: #fff; border-color: var(--color-text); }
.build-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.build-feedback { font-size: 14px; font-weight: 700; }
.build-feedback.ok { color: var(--color-text); }
.build-feedback.no { color: #C0392B; }

/* 바꿔 말하기 — 빈칸에 직접 타이핑 */
.drill-box { background: var(--cream); border-radius: 12px; padding: 20px 16px; text-align: center; }
.drill-hint { font-size: 14px; line-height: 1.5; margin: 0 0 14px; font-weight: 700; }
.drill-hint .en { color: var(--taupe); font-weight: 600; }
.drill-frame { font-size: 28px; font-weight: 800; color: var(--charcoal); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.drill-input {
  font-family: var(--font); font-size: 26px; font-weight: 800;
  color: var(--color-text); text-align: center;
  border: none; border-bottom: 3px solid var(--vowel-a); background: transparent;
  min-width: 4em; max-width: 90%; padding: 2px 8px;
}
.drill-input:focus { outline: none; border-bottom-color: var(--color-text); }
.drill-input::placeholder { color: rgba(37,37,37,0.35); font-weight: 700; letter-spacing: -2px; }
.drill-examples { font-size: 13px; color: var(--taupe); margin-top: 16px; line-height: 1.5; }
.drill-examples .en { font-style: italic; }

/* 문장 만들기 — 5문제 한 번에 */
.build-intro { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.build-intro b { color: var(--color-text); }
.build-intro .en { color: var(--taupe); }
.build-item { background: var(--cream); border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid rgba(59,84,144,0.08); }
.build-item.solved { border-color: rgba(59,122,87,0.5); background: color-mix(in srgb, #2C5A3E 8%, var(--white)); }
.build-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.build-qnum {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--burgundy); color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.build-item .build-prompt { margin: 0; }

/* 모바일 내비 가로 스크롤 */
@media (max-width: 680px) {
  header.site .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  nav.main-nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  nav.main-nav a { white-space: nowrap; flex: 0 0 auto; }
  .today-head { flex-direction: column; align-items: stretch; }
  .today-cta-btn { width: 100%; }
}

/* =================== 쓰기 Writing =================== */
.flow-steps {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--taupe);
  margin-bottom: 28px;
}
.fs-step {
  --fs: var(--burgundy);
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15;
  background: color-mix(in srgb, var(--fs) 12%, #fff);
  color: var(--fs);
  border: 1.5px solid color-mix(in srgb, var(--fs) 30%, transparent);
  border-radius: 14px; padding: 6px 13px;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--fs) 14%, transparent);
}
.fs-step small { font-size: 10.5px; font-weight: 600; font-style: italic; opacity: 0.85; margin-top: 1px; letter-spacing: 0.01em; }
.fs-arrow { color: var(--taupe); font-weight: 800; }

.practice-note {
  background: color-mix(in srgb, var(--color-secondary) 28%, var(--white));
  border-left: 4px solid var(--color-accent);
  border-radius: 10px; padding: 12px 16px; margin: 4px 0 16px;
  font-size: 14px; line-height: 1.55;
}
.practice-note b { color: var(--color-text); }
.practice-note .en { color: var(--taupe); font-size: 0.9em; }

.w-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.w-chip {
  min-width: 44px; height: 44px; padding: 0 10px;
  border-radius: 10px; border: 2px solid rgba(59,84,144,0.2);
  background: var(--white); font-family: var(--font);
  font-size: 22px; font-weight: 700; color: var(--charcoal); cursor: pointer;
  line-height: 1; display: inline-flex; align-items: center; gap: 6px;
}
.w-chip:hover { border-color: var(--color-text); }
.w-chip.active { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
/* 자음 칩 = 남색 / 모음 칩 = 주황 (음절 섹션과 통일) */
.w-chip.wc-cons { border-color: rgba(59,84,144,0.40); }
.w-chip.wc-vow  { border-color: rgba(232,89,12,0.40); }
.w-chip.wc-cons:hover { border-color: #3B5490; }
.w-chip.wc-vow:hover  { border-color: #E8590C; }
.w-chip.wc-cons.active { background: #3B5490; border-color: #3B5490; }
.w-chip.wc-vow.active  { background: #E8590C; border-color: #E8590C; }
.w-chip.word { font-size: 17px; }
.w-chip-en { font-size: 11px; font-weight: 600; opacity: 0.7; }

/* 획순 카드 */
.stroke-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 44px;
  display: flex; gap: 28px; flex-wrap: wrap; align-items: center; justify-content: center;
}
.stroke-view { flex: none; }
#stroke-svg { width: 240px; height: 240px; background: var(--cream); border-radius: 14px; }
.stroke-info { flex: 1; min-width: 220px; }
.stroke-glyph { font-size: 60px; font-weight: 800; color: var(--color-text); line-height: 1; }
.stroke-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.stroke-name .en { color: var(--taupe); font-style: normal; font-size: 0.85em; }
.stroke-count { font-size: 14px; margin-top: 6px; }
.stroke-count b { color: var(--color-text); }
.stroke-guide { font-size: 13px; line-height: 1.5; opacity: 0.92; margin: 12px 0 16px; }
.stroke-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.w-stroke { stroke: var(--taupe); opacity: 0; }
.w-stroke.active { stroke: var(--color-text); opacity: 1; }
.w-stroke.done { stroke: var(--color-text); opacity: 1; }
.w-num { transition: opacity 0.2s ease; }

/* 펜 도구 */
.pen-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 16px;
}
.pen-label { font-size: 13px; font-weight: 700; color: var(--taupe); margin-right: 2px; }
.pen-size {
  width: 40px; height: 40px; border-radius: 10px; border: 2px solid rgba(59,84,144,0.2);
  background: var(--white); color: var(--charcoal); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.pen-size.active { background: var(--burgundy); color: #fff; border-color: var(--color-text); }
.tool-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(59,84,144,0.3);
  background: var(--white); color: var(--color-text); font-family: var(--font);
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.tool-btn:hover { background: rgba(59,84,144,0.06); }
.tool-btn.active { background: var(--burgundy); color: #fff; border-color: var(--color-text); }

/* 캔버스 */
.canvas-area { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding-bottom: 44px; }
.write-cell {
  position: relative; background: var(--white); border-radius: 12px;
  border: 2px solid rgba(37,37,37,0.15); overflow: hidden; flex: none;
}
.write-guide { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.write-guide::before { content: ""; position: absolute; left: 50%; top: 6%; bottom: 6%; border-left: 2px dashed rgba(37,37,37,0.16); }
.write-guide::after { content: ""; position: absolute; top: 50%; left: 6%; right: 6%; border-top: 2px dashed rgba(37,37,37,0.16); }
.guide-char {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(37,37,37,0.14); font-weight: 700; line-height: 1;
}
.write-guide.no-char .guide-char { display: none; }
.write-cell canvas { position: relative; z-index: 1; display: block; touch-action: none; cursor: crosshair; }

/* 단어 연습 */
.word-custom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 14px;
}
.word-custom label { font-weight: 700; color: var(--taupe); }
.word-custom input {
  padding: 8px 12px; border-radius: 10px; border: 2px solid rgba(59,84,144,0.2);
  font-family: var(--font); font-size: 16px; width: 160px;
}
.word-multi-note {
  background: color-mix(in srgb, var(--burgundy) 7%, var(--white));
  border-left: 4px solid var(--burgundy); border-radius: 10px;
  padding: 10px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.5;
}
.word-multi-note b { color: var(--color-text); }
.word-multi-note .en { color: var(--taupe); font-size: 0.9em; }
.word-group { margin-bottom: 26px; }
.word-glabel { text-align: center; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.wt-word { font-size: 30px; font-weight: 800; color: var(--color-text); }
.wt-mean { font-size: 14px; color: var(--taupe); }
.word-empty { text-align: center; color: var(--taupe); padding: 20px; }
.p-wordrow { align-items: center; }
.p-rowlabel { min-width: 62px; font-weight: 800; font-size: 18px; color: #3B5490; margin-right: 8px; display: flex; align-items: center; }

/* 발음 크게 강조 */
.stroke-pron {
  display: inline-block; font-size: 30px; font-weight: 800; color: var(--color-text);
  background: color-mix(in srgb, var(--burgundy) 10%, #fff);
  padding: 3px 16px; border-radius: 999px; margin: 6px 0;
}
/* 획순 완성 후 남는 글자 */
.w-stroke.final { stroke: var(--color-text); opacity: 1; }

/* PDF 카드 */
.print-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 48px; }
.sheet-type-tabs { flex-wrap: wrap; margin: 14px 0 10px; }
#sheet-config { background: var(--cream); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.pick-label { font-size: 13px; font-weight: 700; color: var(--taupe); margin-bottom: 8px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; }
/* 직접 단어 입력 줄 */
.pick-custom { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick-custom-input {
  padding: 8px 12px; border-radius: 10px; border: 2px solid rgba(59,84,144,0.2);
  font-family: var(--font); font-size: 16px; width: 180px; color: var(--charcoal); background: var(--white);
}
.pick-custom-input:focus { outline: none; border-color: var(--color-text); }
.pick-custom-add {
  padding: 8px 16px; border-radius: 999px; border: none;
  background: var(--burgundy); color: #fff; font-family: var(--font);
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.pick-custom-add:hover { background: #4F5EA5; }
.preview-label { font-size: 13px; font-weight: 800; color: var(--taupe); margin: 6px 0 8px; }
.print-preview { overflow: auto; max-height: 640px; background: rgba(37,37,37,0.05); padding: 14px; border-radius: 12px; }
.print-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pdf-hint { margin-top: 14px; font-size: 13px; line-height: 1.5; background: color-mix(in srgb, var(--burgundy) 8%, var(--white)); border-radius: 10px; padding: 12px 14px; }

/* 연습지 (화면 미리보기 = 인쇄본, px 기준) */
#print-sheet { background: #fff; color: #000; width: 720px; max-width: 100%; margin: 0 auto; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
/* 표가 넓으면 가로(landscape) 용지 비율로 미리보기 */
/* 가로(landscape)일 때 흰 종이가 화면에 맞춰 줄지 않고 제 폭(1040px)을 유지 →
   블록이 종이 밖(회색)으로 넘치지 않고 한 장의 흰 종이 위에 끝까지 보이게 */
#print-sheet.landscape { width: 1040px; max-width: none; }
#print-sheet.landscape .p-cell.sm { width: 26px; height: 26px; }
#print-sheet.landscape .p-cell.sm .p-faint, #print-sheet.landscape .p-cell.sm .p-ref { font-size: 17px; }
#print-sheet.landscape .p-vhead, #print-sheet.landscape .p-chead { font-size: 19px; }
.p-head { text-align: center; margin-bottom: 14px; }
.p-brand { font-size: 14px; font-weight: 800; color: #3B5490; }
.p-target { margin-top: 8px; }
.p-big { font-size: 34px; font-weight: 800; }
.p-mean { font-size: 14px; color: #555; }
.p-summary { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.p-summary-label { font-size: 11px; color: #666; }
.p-row { display: flex; gap: 6px; margin-bottom: 6px; break-inside: avoid; page-break-inside: avoid; }
.p-subtitle { font-weight: 800; color: #3B5490; font-size: 15px; margin: 16px 0 8px; break-after: avoid; }
.p-cell { width: 46px; height: 46px; border: 1px solid #333; position: relative; flex: none; }
.p-cell.sm { width: 30px; height: 30px; }
.p-cell::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed #ddd; }
.p-cell::after { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px dashed #ddd; }
.p-faint, .p-ref { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 30px; }
.p-faint { color: #e9e9e9; }
.p-ref { color: #333; font-weight: 800; }
.p-cell.sm .p-faint, .p-cell.sm .p-ref { font-size: 20px; }
.p-vhead, .p-chead, .p-corner { border: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #3B5490; font-size: 23px; }
.p-vhead::before, .p-vhead::after, .p-chead::before, .p-chead::after, .p-corner::before, .p-corner::after { display: none; }
.p-empty { padding: 24px; text-align: center; color: #888; }
.p-namebar { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.p-foot { margin-top: 10px; text-align: center; font-size: 10px; color: #999; }

/* =================== 인쇄 전용 =================== */
@media print {
  /* 인쇄 시 #print-sheet 만 남기고 본문 숨김 → 빈 페이지 방지 (JS가 sheet를 body로 이동) */
  body.printing > *:not(#print-sheet) { display: none !important; }
  #print-sheet { box-shadow: none; padding: 0; width: 100%; margin: 0; }
  @page { size: A4 portrait; margin: 14mm; }
  .p-big { font-size: 26pt; }
  .p-row { gap: 3mm; margin-bottom: 3mm; break-inside: avoid; page-break-inside: avoid; }
  .p-subtitle { break-before: avoid; break-after: avoid; }
  .p-cell { width: 17mm; height: 17mm; border: 0.4mm solid #333; }
  .p-cell.sm { width: 12mm; height: 12mm; }
  .p-faint, .p-ref { font-size: 12mm; }
  /* 화면 미리보기(#e9e9e9)보다 인쇄본은 프린터에서 더 흐려 보여, 인쇄 때만 조금 더 진하게 */
  .p-faint { color: #c2c2c2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-cell.sm .p-faint, .p-cell.sm .p-ref { font-size: 9mm; }
  .p-vhead, .p-chead, .p-corner { font-size: 8mm; }
  .p-rowlabel { min-width: 20mm; font-size: 12pt; margin-right: 3mm; }

  /* 가로 용지: 넓은 표(모음 전체 등)가 한 페이지에 들어가도록 칸을 줄임 */
  #print-sheet.landscape .p-row { gap: 2mm; margin-bottom: 2mm; }
  #print-sheet.landscape .p-cell.sm { width: 10mm; height: 10mm; }
  #print-sheet.landscape .p-cell.sm .p-faint, #print-sheet.landscape .p-cell.sm .p-ref { font-size: 7mm; }
  #print-sheet.landscape .p-vhead, #print-sheet.landscape .p-chead { font-size: 6.5mm; }
}

@media (max-width: 560px) {
  #stroke-svg { width: 200px; height: 200px; }
  .stroke-card { gap: 16px; padding: 18px; }
  nav.main-nav { gap: 4px; }
  nav.main-nav a { padding: 6px 10px; font-size: 13px; }
  .batchim-summary { flex-direction: column; align-items: flex-start; }
}

/* =================== 문장 구조 Sentence Structure =================== */
/* 역할 색: 주어=파랑 · 목적어=주황 · 장소=초록 · 서술어=버건디 */
.wo-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 24px; }
.wo-lang { font-size: 13px; font-weight: 800; color: var(--charcoal); margin: 8px 0 6px; }
.wo-lang .en { color: var(--taupe); font-weight: 600; }
.wo-lang b { color: #252B52; }
.wo-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; font-size: 26px; font-weight: 800; }
.wo-row.en-row { font-size: 21px; opacity: 0.85; }
.wo-part { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.wo-part small { font-size: 11px; font-weight: 700; opacity: 0.75; margin-top: 3px; }
.wo-part.subj { color: #1C7ED6; }
.wo-part.obj { color: #D6336C; }
.wo-part.verb { color: #E8590C; }  /* 서술어 강조색 */
.wo-note { text-align: center; font-size: 14px; font-weight: 700; color: var(--color-text);
  background: color-mix(in srgb, var(--burgundy) 8%, var(--white)); border-radius: 10px; padding: 11px; margin: 16px 0; }
.wo-note .en { color: var(--taupe); font-weight: 600; display: block; font-size: 0.9em; }
/* 어순 상단 설명은 왼쪽정렬 */
.wo-note-top { text-align: left; border-left: 4px solid var(--burgundy); margin: 0 0 14px; }

.pc-grouplabel { font-size: 13px; font-weight: 800; color: var(--charcoal); margin: 6px 0 10px; }
.pc-grouplabel .en { color: var(--taupe); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.particle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.particle-card { --pc: var(--vowel-a); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-left: 5px solid var(--pc); }
.pc-title { font-size: 24px; font-weight: 800; color: var(--pc); }
.pc-role { font-size: 13px; font-weight: 700; color: var(--charcoal); margin: 2px 0 10px; }
.pc-role .en { color: var(--taupe); font-weight: 600; }
.pc-rule { font-size: 14px; background: var(--cream); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.pc-rule b { color: var(--color-text); }
.pc-exs { display: flex; flex-direction: column; gap: 10px; }
.pc-ex { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 17px; font-weight: 700; }
.pc-w { color: var(--charcoal); }
.pc-p { color: var(--pc); }
.pc-arrow { color: var(--taupe); font-size: 13px; }
.pc-full { color: var(--pc); font-weight: 800; }
.pc-en { font-size: 12px; color: var(--taupe); font-weight: 600; width: 100%; margin-top: -2px; }

.ss-legend { display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 8px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ss-ex { background: var(--white); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 10px; }
.ss-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; }
.ss { padding: 3px 11px; border-radius: 8px; font-weight: 800; color: #fff; white-space: nowrap; }
/* 조사는 흰색 인셋 알약으로 감싸 '명사 + [조사]'처럼 확실히 분리 */
.ss .ss-josa {
  display: inline-block;
  background: #FFFFFF;
  color: #16181F;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 6px;
  margin-left: 4px;
}
.ss.subj { background: #1C7ED6; }
.ss.obj { background: #D6336C; }
.ss.loc { background: #2F9E44; }
.ss.verb { background: #E8590C; }  /* 서술어 강조색 */
.ss-legend .ss { font-size: 16px; padding: 6px 14px; flex: 0 0 auto; }
/* 모바일: 영어 라벨 숨기고 한글만 → 한 줄에 안 잘리게 */
@media (max-width: 640px) {
  .ss-legend .lg-en { display: none; }
  .ss-legend .ss { font-size: 14px; padding: 5px 12px; }
}
.ss-en { font-size: 14px; color: var(--charcoal); opacity: 0.82; margin-top: 8px; }

/* ===== 핸드폰 화면 보정 (모바일 전용 — PC 사이즈는 그대로) ===== */
@media (max-width: 640px) {
  /* 탭 줄이 화면 밖으로 넘치지 않게 줄바꿈 */
  .tabs { flex-wrap: wrap; }
  /* 긴 버튼(예: PDF 저장/다운로드)이 카드 밖으로 안 나가게 */
  .listen-btn { white-space: normal; }
  /* 오늘의 표현 헤더: 라벨과 버튼을 세로로 깔끔하게 */
  .expr-head { flex-direction: column; align-items: center; gap: 10px; }
  /* 문법 예시: 오른쪽 잘림 방지 — 한 줄에 하나씩 */
  .example-list { grid-template-columns: 1fr; }
  /* 내 이름 만들기: 블록을 줄여 한 줄에 3개 */
  .syl-block.name-block { --blk: 82px; }
  .name-blocks { gap: 8px; }
  /* 발음 퀴즈: 발음(/숟까락/)이 한 줄에 들어가도록 보기를 1열로 */
  .pron-quiz .quiz-options { grid-template-columns: 1fr; }
  /* 쓰기 진행 흐름: 윗줄 3개 · 아랫줄 2개 */
  .flow-steps { gap: 6px; }
  .flow-steps .fs-arrow { display: none; }
  .fs-step { flex: 0 0 calc(33.333% - 4px); padding: 6px 8px; font-size: 12px; }
  .fs-step small { font-size: 10px; }
}

/* =================== 게임: 소리 듣고 글자 만들기 =================== */
.game-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid rgba(37,43,82,0.10);
  padding: 24px;
  max-width: 560px;
  margin: 0 auto 56px;
}
.game-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.game-title { font-size: 18px; font-weight: 800; color: var(--color-text); }
.game-progress { font-size: 13px; font-weight: 800; color: var(--color-primary); white-space: nowrap; }

/* 소리 듣기 — 강조 CTA (Warm Orange + Navy) */
.listen-big {
  display: block; width: 100%; border: none;
  background: var(--color-accent); color: var(--color-text);
  font-family: var(--font); font-weight: 900; font-size: 19px;
  padding: 16px; border-radius: 14px; cursor: pointer; margin-bottom: 18px;
  box-shadow: 0 4px 0 -1px var(--color-accent-hover);
  transition: background 0.15s ease, transform 0.1s ease;
}
.listen-big:hover { background: var(--color-accent-hover); }
.listen-big:active { transform: translateY(2px); box-shadow: 0 2px 0 -1px var(--color-accent-hover); }

/* 놓는 영역 */
.drop-zone {
  border: 2px dashed rgba(37,43,82,0.30);
  border-radius: 16px; padding: 18px 14px 20px; text-align: center; margin-bottom: 18px;
  background: color-mix(in srgb, var(--color-primary) 4%, var(--white));
}
.dz-label { font-size: 14px; font-weight: 800; color: var(--color-text); margin-bottom: 12px; }
.game-block { --blk: 150px; margin: 0 auto; }
.game-block .slot.empty { color: rgba(37,43,82,0.28); font-weight: 500; }
.g-reading { margin-top: 10px; font-size: 18px; font-weight: 800; color: var(--color-primary); min-height: 22px; letter-spacing: 0.02em; }

.g-order-label { text-align: center; font-size: 14px; font-weight: 800; color: var(--color-text); margin-bottom: 12px; }
.g-order-label .en-inline { display: inline; font-size: 12px; margin-left: 4px; }

/* 자모 칩 — 키보드 키 느낌 */
.g-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 8px; }
.g-chip {
  min-width: 54px; height: 56px; padding: 0 12px;
  border-radius: 12px; border: 2px solid rgba(37,43,82,0.18);
  background: var(--white); font-family: var(--font);
  font-size: 26px; font-weight: 800; color: var(--color-text); cursor: pointer;
  box-shadow: 0 3px 0 -1px rgba(37,43,82,0.14);
  transition: transform 0.1s ease, border-color 0.12s ease, background 0.12s ease;
}
.g-chip:hover { border-color: var(--color-primary); }
.g-chip:active { transform: translateY(2px); box-shadow: none; }
.g-chip.used { opacity: 0.3; box-shadow: none; pointer-events: none; }
.g-chip.hint { border-color: var(--color-secondary); box-shadow: 0 0 0 4px rgba(248,209,82,0.55); }
.g-chip.shake { animation: g-shake 0.4s; border-color: #C0392B; }
@keyframes g-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes g-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
.game-block .slot.pop { animation: g-pop 0.25s ease; }

.g-feedback { min-height: 22px; text-align: center; font-size: 14px; font-weight: 800; margin: 10px 0; }
.g-feedback.ok { color: #2C5A3E; }
.g-feedback.no { color: #C0392B; }

.g-actions { display: flex; gap: 10px; justify-content: center; }
.g-btn { padding: 11px 18px; border-radius: 999px; border: none; font-family: var(--font); font-weight: 800; font-size: 14px; cursor: pointer; }
.g-hint { background: var(--color-secondary); color: var(--color-text); }
.g-hint:hover { background: var(--color-secondary-hover); }
.g-hint:disabled { opacity: 0.4; cursor: default; }
.g-redo { background: var(--color-primary); color: #fff; }
.g-redo:hover { background: var(--color-primary-hover); }

/* 정답 완성 */
.g-win { margin-top: 16px; text-align: center; }
.g-win-word { font-size: 24px; font-weight: 900; color: var(--color-text); margin-bottom: 12px; }
.g-win-word b { color: var(--color-primary); font-size: 30px; }
.g-win-word span { color: var(--taupe); font-weight: 700; font-size: 15px; }
.g-next {
  border: none; background: #2C5A3E; color: #fff;
  font-family: var(--font); font-weight: 800; font-size: 16px;
  padding: 13px 26px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 4px 0 -1px rgba(20,50,35,0.5); transition: transform 0.1s ease;
}
.g-next:hover { filter: brightness(1.05); }
.g-next:active { transform: translateY(2px); box-shadow: 0 2px 0 -1px rgba(20,50,35,0.5); }

/* 홈 게임 프로모 카드 */
.game-promo {
  display: flex; align-items: center; gap: 16px;
  background: color-mix(in srgb, var(--color-secondary) 22%, var(--white));
  border: 2px solid rgba(247,171,62,0.45);
  border-radius: 20px; padding: 18px 22px; margin: 4px 0 48px;
  text-decoration: none; color: var(--color-text);
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--color-secondary) 40%, var(--white)), 0 12px 26px rgba(37,43,82,0.08);
  transition: transform 0.15s ease;
}
.game-promo:hover { transform: translateY(-3px); }
.gp-emoji { font-size: 40px; line-height: 1; flex: none; }
.gp-text { flex: 1; min-width: 0; }
.gp-text b { display: block; font-size: 18px; font-weight: 900; color: var(--color-text); }
.gp-text > span { display: block; font-size: 13.5px; color: var(--color-text); opacity: 0.85; line-height: 1.5; margin-top: 3px; }
.gp-text .en { opacity: 1; color: var(--taupe); font-style: italic; font-size: 0.92em; }
.gp-go {
  flex: none; background: var(--color-accent); color: var(--color-text);
  font-weight: 800; font-size: 14px; padding: 10px 18px; border-radius: 999px; white-space: nowrap;
}
.game-promo:hover .gp-go { background: var(--color-accent-hover); }
@media (max-width: 560px) {
  .game-promo { flex-wrap: wrap; }
  .gp-go { width: 100%; text-align: center; }
}
