/* Learn Hangul — AI Proto Lab shell + in-app UI */
:root {
  --bg-deep: #0a0a1a;
  --bg-card: #111128;
  --border: #1e1e3a;
  --text-primary: #e8e8f0;
  --text-secondary: #9090b0;
  --text-muted: #606090;
  --neon-cyan: #00f0ff;
  --neon-pink: #ff2d78;
  --neon-purple: #b388ff;
  --neon-gold: #ffc857;
  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hangul: 'Noto Sans KR', sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --bg: var(--bg-deep);
  --bg2: rgba(255, 255, 255, 0.06);
  --ink: var(--text-primary);
  --ink2: var(--text-secondary);
  --accent: var(--neon-cyan);
  --accent2: var(--neon-pink);
  --gold: var(--neon-gold);
  --green: #5cdb95;
  --card: var(--bg-card);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.6rem 1.25rem;
  background: rgba(10, 10, 26, 0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
}
.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}
.back-link:hover { color: var(--neon-cyan); }

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  width: 100%;
}

.vote-widget-wrap {
  display: flex;
  justify-content: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
  width: 100%;
}

@media (min-width: 960px) {
  body:has(#level-view.active) .vote-widget-wrap {
    max-width: 1200px;
    padding-left: calc(320px + 1.25rem);
  }
}
.vote-widget {
  font: inherit;
  background: transparent;
  padding: 0.75rem 0;
  text-align: center;
}
.vote-widget .vote-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.vote-widget .vote-nums {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.vote-widget .vote-num {
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  min-width: 1.2em;
  text-align: center;
}
.vote-widget .vote-num:hover { color: var(--neon-cyan); }
.vote-widget .vote-num.vote-selected { color: var(--neon-cyan); }
.vote-widget .vote-num.vote-grey { color: var(--text-muted); }
.vote-widget .vote-thanks {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(17, 17, 40, 0.5);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--neon-cyan); }

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

  /* ── SCREENS ── */
  .screen { display:none; min-height:100vh; }
  .screen.active { display:flex; flex-direction:column; }

  /* ── HOME ── */
  #home {
    padding: 36px 20px 72px;
    align-items: center;
  }

  .home-header {
    text-align: center;
    margin-bottom: 40px;
  }

  @media (min-width: 960px) {
    .home-header { margin-bottom: 64px; }
  }

  .home-eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink2);
    margin-bottom: 12px;
  }

  .home-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: clamp(52px, 12vw, 88px);
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 8px;
  }

  .home-title .hangul-accent {
    color: var(--neon-cyan);
    font-style: normal;
    text-shadow: 0 0 24px rgba(0, 240, 255, 0.35), 0 0 48px rgba(0, 240, 255, 0.15);
  }

  .home-sub {
    font-size: 14px;
    color: var(--ink2);
    margin-top: 20px;
    line-height: 1.55;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
  }

  .levels-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 480px;
  }

  /* Desktop roadmap: 4 steps in a row, connected by a progress line */
  .roadmap { position: relative; }
  .roadmap-step { display: flex; flex-direction: column; }
  .roadmap-step .level-card { flex: 1; }

  .roadmap-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--neon-cyan);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
  }
  .roadmap-step:has(.level-card.locked) .roadmap-dot {
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: none;
  }
  .roadmap-step:has(.level-card.visited) .roadmap-dot {
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 24px rgba(92, 219, 149, 0.18);
  }

  /* Mobile: vertical stepper with a rail connecting the dots */
  @media (max-width: 959px) {
    .roadmap {
      max-width: 480px;
      gap: 20px;
      position: relative;
    }

    .roadmap::before {
      content: '';
      position: absolute;
      top: 22px;
      bottom: 22px;
      left: 21px;
      width: 2px;
      background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple), var(--ink2));
      opacity: 0.35;
      z-index: 0;
    }

    .roadmap-step {
      display: grid;
      grid-template-columns: 44px 1fr;
      gap: 14px;
      align-items: flex-start;
      position: relative;
      z-index: 1;
    }

    .roadmap-dot {
      width: 44px; height: 44px;
      font-size: 14px;
      background: var(--bg-deep);
    }

    .roadmap-step .level-card {
      padding: 16px 18px 14px;
    }
    .roadmap-step .level-card .level-num {
      font-size: 10px;
      margin-bottom: 6px;
    }
    .roadmap-step .level-card .level-name {
      font-size: 18px;
      margin-bottom: 6px;
    }
    .roadmap-step .level-card .level-desc {
      font-size: 13px;
      line-height: 1.5;
      margin-bottom: 12px;
    }
    .roadmap-step .level-card .level-chars {
      gap: 5px;
      margin-bottom: 12px;
    }
    .roadmap-step .level-card .level-char {
      width: 28px; height: 28px;
      font-size: 14px;
      border-radius: 7px;
    }
    .roadmap-step .level-card .level-status {
      position: static;
      display: inline-block;
      margin-top: 2px;
    }
  }

  /* Desktop: 4-column stepper with a connector line through the dots */
  @media (min-width: 960px) {
    #home { padding: 48px 32px 96px; }
    .home-sub {
      max-width: 640px;
      font-size: 17px;
      line-height: 1.55;
      margin-top: 24px;
    }

    .roadmap {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 28px;
      max-width: 1200px;
    }

    .roadmap::before {
      content: '';
      position: absolute;
      left: 0; right: 0;
      top: 26px;
      height: 2px;
      background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--ink2));
      opacity: 0.45;
      z-index: 0;
    }

    .roadmap-dot {
      width: 52px; height: 52px;
      font-size: 17px;
    }

    .roadmap-step {
      position: relative;
      z-index: 1;
      align-items: center;
      gap: 24px;
    }

    .roadmap-step .level-card {
      width: 100%;
      padding: 32px 28px 28px;
      text-align: center;
      display: flex;
      flex-direction: column;
    }
    .roadmap-step .level-card::before { display: none; }

    .roadmap-step .level-card .level-num {
      font-size: 11px;
      margin-bottom: 12px;
    }
    .roadmap-step .level-card .level-name {
      font-size: 26px;
      margin-bottom: 14px;
      min-height: 2.4em;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .roadmap-step .level-card .level-desc {
      font-size: 15px;
      line-height: 1.55;
      margin-bottom: 28px;
      min-height: 2.8em;
      color: var(--ink);
      opacity: 0.78;
    }
    .roadmap-step .level-card .level-chars {
      justify-content: center;
      gap: 8px;
      margin: 0 auto 28px;
      max-width: 260px;
    }
    .roadmap-step .level-card .level-char {
      width: 40px; height: 40px;
      font-size: 19px;
      border-radius: 9px;
    }
    .roadmap-step .level-card .level-status {
      position: static;
      margin: auto auto 0;
      align-self: center;
      display: inline-block;
      font-size: 12px;
      padding: 6px 14px;
    }

    /* Visited / current accent underline on the card */
    .roadmap-step .level-card {
      border-top: 2px solid transparent;
    }
    .roadmap-step:has(.level-card:not(.locked):not(.visited)) .level-card {
      border-top-color: var(--neon-cyan);
    }
    .roadmap-step:has(.level-card.visited) .level-card {
      border-top-color: var(--green);
    }
  }

  .level-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
  }

  .level-card:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }

  .level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .level-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--accent);
  }

  .level-card.locked::before { background: var(--ink2); }
  .level-card.visited::before { background: var(--green); }

  .level-num {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink2);
    margin-bottom: 10px;
  }

  .level-name {
    font-family: var(--font);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .level-desc {
    font-size: 12.5px;
    color: var(--ink2);
    line-height: 1.55;
    margin-bottom: 20px;
  }

  .level-chars {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .level-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--bg2);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink);
  }

  .level-status {
    position: absolute;
    top: 24px; right: 24px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg2);
    color: var(--ink2);
  }

  .level-status.locked-tag { background: var(--bg2); color: var(--ink2); }

  /* ── LEVEL VIEW ── */
  #level-view { padding: 0; }

  .nav-title {
    font-family: var(--font);
    font-size: 20px;
  }

  /* Back button used on intro screen */
  .back-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s;
  }
  .back-btn:hover { background: var(--bg2); }

  /* Level view grid layout: sidebar + main on desktop, single column on mobile */
  .level-view-grid {
    display: block;
    padding-top: 8px;
  }

  .level-sidebar {
    display: none;
  }

  .level-main {
    min-width: 0;
  }

  /* Mobile: chip switcher on top */
  .level-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
  }

  .level-home-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 0;
    font-family: var(--font);
    transition: color 0.2s var(--ease);
  }
  .level-home-link:hover { color: var(--neon-cyan); }

  .level-chips {
    display: flex;
    gap: 6px;
  }

  .nav-chip {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  }

  .nav-chip:hover:not(.is-active):not(.is-locked) {
    border-color: var(--neon-cyan);
  }

  .nav-chip.is-active {
    background: var(--neon-cyan);
    color: var(--bg-deep);
    border-color: var(--neon-cyan);
  }

  .nav-chip.is-locked,
  .nav-chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
  }

  /* Desktop: sidebar visible, chips hidden, content widens */
  @media (min-width: 960px) {
    .page:has(#level-view.active),
    .page:has(#home.active) {
      max-width: 1200px;
    }

    .level-view-grid {
      display: grid;
      grid-template-columns: 280px 1fr;
      gap: 40px;
      align-items: start;
      padding-top: 16px;
    }

    .level-sidebar {
      display: flex;
      flex-direction: column;
      gap: 12px;
      position: sticky;
      top: 24px;
    }

    .level-switcher {
      display: none;
    }
  }

  .level-sidebar-title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 4px 4px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    transition: color 0.2s var(--ease);
  }
  .level-sidebar-title:hover { color: var(--neon-cyan); }

  .level-sidebar-title .hangul-accent {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--neon-cyan);
    font-size: 22px;
    text-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
  }

  .level-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nav-level-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    color: var(--text-primary);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  }

  .nav-level-card:hover:not(.is-active):not(.is-locked) {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.04);
  }

  .nav-level-card.is-active {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
  }

  .nav-level-card.is-locked,
  .nav-level-card:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }

  .nav-level-num {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--neon-cyan);
  }

  .nav-level-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
  }

  .nav-level-status {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }
  .nav-level-card.nav-level-visited .nav-level-num { color: var(--green); }

  .section-tabs {
    display: flex;
    gap: 0;
    padding: 20px 16px 0;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .section-tabs::-webkit-scrollbar { display: none; }

  @media (min-width: 960px) {
    .section-tabs {
      padding: 0;
      background: transparent;
      overflow-x: visible;
    }
    .section-content {
      max-width: none;
      padding: 32px 0;
    }
  }

  .tab {
    padding: 10px 16px 12px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--ink2);
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
  }

  @media (min-width: 960px) {
    .tab { padding: 10px 20px 12px; }
  }

  .tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .tab.locked-tab { opacity: 0.4; cursor: not-allowed; }

  .section-content { flex: 1; padding: 32px 24px; max-width: 600px; margin: 0 auto; width: 100%; }

  /* ── INTRO SCREEN ── */
  #intro-screen { padding: 0; max-width: none; margin: 0; }

  .intro-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
  }

  .intro-card h2 {
    font-family: var(--font);
    font-size: 28px;
    margin-bottom: 16px;
  }

  .intro-card p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink2);
    margin-bottom: 14px;
  }

  /* ── NARRATIVE LAYOUT (intro-screen, level 4 intro) ── */
  .narrative {
    width: 100%;
    padding-bottom: 28px;
  }
  .narrative-intro {
    padding: 28px 20px 8px;
  }
  .narrative-kicker {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    margin-bottom: 10px;
    font-weight: 600;
  }
  .narrative-h1 {
    font-family: var(--font);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 4px;
    color: var(--ink);
  }
  .narrative-p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink);
    margin: 0 20px 20px;
  }
  .narrative-p em,
  .narrative .accent {
    font-style: normal;
    color: var(--neon-cyan);
    font-weight: 600;
  }
  .narrative .kbd {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--accent);
    font-weight: 600;
  }
  .narrative-section {
    padding: 24px 16px;
    margin: 0 0 4px;
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.04), transparent 75%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .narrative-section + .narrative-section { margin-top: -1px; }
  .narrative-section + .narrative-p,
  .narrative-p + .narrative-section { margin-top: 8px; }
  .narrative-section-label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink2);
    text-align: center;
    margin-bottom: 18px;
  }
  .narrative-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .narrative-col { text-align: center; }
  .narrative-col .block-parts { margin-top: 0; margin-bottom: 10px; }
  .narrative-arrow {
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
  }
  .narrative-tag {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink2);
    margin-top: 10px;
  }
  .narrative-rom {
    font-size: 14px;
    color: var(--accent);
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .narrative-big {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 64px;
    line-height: 1;
    color: var(--ink);
    text-shadow: 0 0 28px rgba(0, 240, 255, 0.22);
  }
  .narrative-big.mid { font-size: 52px; }
  .narrative-big.small { font-size: 40px; }
  .narrative-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 18px 16px 0;
    font-size: 11px;
    color: var(--ink2);
    letter-spacing: 0.04em;
  }
  .narrative-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .narrative-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
  }
  .narrative-note {
    font-size: 14px;
    color: var(--ink2);
    line-height: 1.65;
    margin: 0 20px 24px;
  }
  .narrative-cta {
    padding: 8px 20px 0;
  }
  .narrative-cta .primary-btn {
    width: 100%;
    justify-content: center;
  }

  /* When narrative is used inside section-content (batchim), negate its padding
     so sections go edge-to-edge on mobile. */
  .section-content > .narrative {
    margin-left: -24px;
    margin-right: -24px;
  }

  @media (min-width: 768px) {
    .narrative,
    .section-content > .narrative {
      max-width: 760px;
      margin: 0 auto;
    }
    .narrative-intro { padding: 44px 32px 12px; }
    .narrative-p,
    .narrative-note { margin-left: 32px; margin-right: 32px; }
    .narrative-section { padding: 32px 24px; }
    .narrative-cta { padding: 20px 32px 0; }
    .narrative-h1 { font-size: 36px; }
    .narrative-big { font-size: 80px; }
    .narrative-big.mid { font-size: 64px; }
    .narrative-big.small { font-size: 48px; }
  }

  .block-demo {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
  }

  .block-demo-item {
    text-align: center;
  }

  .hangul-big {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 56px;
    line-height: 1;
    color: var(--ink);
  }

  .block-parts {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    justify-content: center;
  }

  .block-part {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 20px;
    width: 32px; height: 32px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(179, 136, 255, 0.2));
    color: var(--text-primary);
    border: 1px solid var(--neon-cyan);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
  }

  .block-part.vowel { background: var(--gold); }
  .block-part.final { background: var(--ink2); }

  .arrow-right { font-size: 24px; color: var(--ink2); align-self: center; }

  .primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(179, 136, 255, 0.2));
    color: var(--text-primary);
    border: 1px solid var(--neon-cyan);
    padding: 14px 28px;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 13px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-transform: uppercase;
  }

  .primary-btn:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(0, 240, 255, 0.25); transform: translateY(-1px); }

  /* ── LEARN LETTERS ── */
  .letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
  }

  .letter-tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
  }

  .letter-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

  .tile-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 40px;
    line-height: 1;
    margin-bottom: 8px;
  }

  .tile-roman {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink2);
    margin-bottom: 4px;
  }

  .tile-tap-hint {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 16px;
    color: var(--accent2);
    line-height: 1;
  }

  .letter-tile.seen {
    background: rgba(92, 219, 149, 0.12);
    border-color: var(--green);
  }

  .letter-tile.seen .tile-hangul { color: var(--ink); }
  .letter-tile.seen .tile-roman { color: #7ae8b3; }

  /* Letter detail popover */
  .hangul-letter-overlay {
    backdrop-filter: blur(4px);
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none; align-items: center; justify-content: center;
    z-index: 100;
    padding: 24px;
  }

  .hangul-letter-overlay.is-open { display: flex; }

  .hangul-letter-panel {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 20px;
    padding: 40px 32px 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(20px); opacity:0; }
    to { transform: translateY(0); opacity:1; }
  }

  .hangul-letter-big {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 96px;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 8px;
  }

  .hangul-letter-roman {
    font-size: 28px;
    font-family: var(--font);
    color: var(--accent);
    margin-bottom: 8px;
  }

  .hangul-letter-sound {
    font-size: 13px;
    color: var(--ink2);
    margin-bottom: 8px;
  }

  .hangul-letter-example {
    margin: 20px 0;
    padding: 20px 16px;
    background: var(--bg2);
    border-radius: 10px;
    text-align: center;
    line-height: 1.5;
  }

  .hangul-letter-example .ex-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 32px;
    color: var(--ink);
    margin-bottom: 8px;
  }

  .hangul-letter-example .ex-meaning {
    font-size: 14px;
    color: var(--ink2);
  }

  .hangul-letter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink2);
    margin-bottom: 4px;
  }

  .hangul-letter-close {
    margin-top: 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.15s, border-color 0.15s;
  }
  .hangul-letter-close:hover { background: rgba(0, 240, 255, 0.08); border-color: var(--neon-cyan); }

  /* ── WORD BUILDER ── */
  .word-builder {
    margin-top: 16px;
  }

  .builder-word-display {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
  }

  .word-target-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink2);
    margin-bottom: 12px;
  }

  .word-target-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 48px;
    color: var(--ink);
    margin-bottom: 4px;
  }

  .word-target-roman {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 2px;
  }

  .word-target-meaning {
    font-size: 12px;
    color: var(--ink2);
  }

  .drop-zone {
    display: flex;
    gap: 8px;
    min-height: 64px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 10px;
    border: 2px dashed var(--border);
    margin: 16px 0;
    flex-wrap: wrap;
    align-items: center;
    transition: border-color 0.2s;
  }

  .drop-zone.drag-over { border-color: var(--accent); }

  .dropped-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 32px;
    width: 52px; height: 52px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    animation: popIn 0.15s ease;
  }

  @keyframes popIn {
    from { transform: scale(0.7); opacity:0; }
    to { transform: scale(1); opacity:1; }
  }

  .drop-hint {
    font-size: 12px;
    color: var(--ink2);
    opacity: 0.5;
  }

  .char-bank {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .char-option {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 28px;
    width: 52px; height: 52px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
  }

  .char-option:hover { transform: scale(1.05); box-shadow: var(--shadow); }
  .char-option.used { opacity: 0.3; pointer-events: none; }

  .word-feedback {
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
  }

  .word-feedback.correct { background: rgba(92, 219, 149, 0.15); color: var(--green); display:block; }
  .word-feedback.wrong { background: rgba(255, 45, 120, 0.12); color: var(--neon-pink); display:block; animation: shake 0.3s; }

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

  .word-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
  }

  .ghost-btn {
    display: inline-flex;
    align-items: center;
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  }
  .ghost-btn:hover { background: var(--border); border-color: var(--text-secondary); }
  .ghost-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
  }

  .word-counter {
    font-size: 12px;
    color: var(--ink2);
  }

  /* ── FLASHCARDS ── */
  .flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .flashcard-progress {
    font-size: 12px;
    color: var(--ink2);
    letter-spacing: 0.08em;
  }

  .flashcard-wrap {
    width: 100%;
    max-width: 340px;
    height: 220px;
    perspective: 1000px;
    cursor: pointer;
  }

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

  .flashcard-wrap.flipped .flashcard-inner { transform: rotateY(180deg); }

  .flashcard-face {
    position: absolute; inset: 0;
    border-radius: 20px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    backface-visibility: hidden;
    border: 1px solid var(--border);
  }

  .flashcard-front { background: var(--card); }
  .flashcard-back { background: #15152a; transform: rotateY(180deg); }

  .fc-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 72px;
    line-height: 1;
    color: var(--ink);
  }

  .fc-hint {
    font-size: 11px;
    color: var(--ink2);
    margin-top: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .fc-roman {
    font-family: var(--font);
    font-size: 40px;
    color: var(--neon-cyan);
    margin-bottom: 4px;
  }

  .fc-sound {
    font-size: 13px;
    color: var(--text-secondary);
  }

  .fc-complete {
    text-align: center;
    padding: 40px 20px;
  }

  .fc-complete .complete-mark {
    margin-bottom: 12px;
  }

  .fc-complete h3 {
    font-family: var(--font);
    font-size: 28px;
    margin-bottom: 8px;
  }

  .fc-complete p {
    font-size: 13px;
    color: var(--ink2);
    margin-bottom: 24px;
  }

  /* ── LEVEL 4: WORD FLIP CARDS ── */
  .l4-instruction {
    font-size: 13px;
    color: var(--ink2);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
  }

  .word-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  @media (min-width: 560px) {
    .word-grid { grid-template-columns: repeat(2, 1fr); }
  }

  .word-flip {
    height: 210px;
    perspective: 1000px;
    cursor: pointer;
  }

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

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

  .word-flip-face {
    position: absolute; inset: 0;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    backface-visibility: hidden;
    padding: 16px;
    text-align: center;
  }

  .word-flip-front { background: var(--card); }
  .word-flip-back  { background: #15152a; transform: rotateY(180deg); }

  .word-flip-roman {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--accent);
    margin-bottom: 6px;
    line-height: 1.1;
  }

  .word-flip-meaning {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.35;
  }

  .word-flip-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 40px;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 14px;
  }

  .word-flip-syllables {
    font-family: 'Space Grotesk', 'Noto Sans KR', sans-serif;
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.85;
  }

  .syl-row {
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .syl-char {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--ink);
    font-weight: 500;
  }

  .syl-row em {
    font-style: normal;
    color: var(--accent);
    font-weight: 500;
  }

  /* ── MATCH GAME ── */
  .match-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 16px;
  }

  .match-score {
    font-size: 12px;
    color: var(--ink2);
    letter-spacing: 0.08em;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .match-instruction {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.5;
  }

  .match-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }

  .match-col { display: flex; flex-direction: column; gap: 8px; }

  .match-hangul-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0 10px;
    text-align: center;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.3s;
    height: 64px;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
  }

  .match-hangul-card.matched {
    background: rgba(92, 219, 149, 0.12);
    border-color: var(--green);
    opacity: 0.5;
  }

  .match-hangul-card.selected {
    border-color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18);
  }

  .match-hangul-card.wrong {
    border-color: var(--neon-pink);
    background: rgba(255, 45, 120, 0.12);
    animation: shake 0.3s;
  }

  .match-hangul-card.correct-flash,
  .match-roman-card.correct-flash {
    border-color: var(--green);
    background: rgba(92, 219, 149, 0.22);
    color: var(--green);
    transform: scale(1.03);
  }

  .match-roman-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0 10px;
    text-align: center;
    font-family: var(--font);
    font-size: 20px;
    line-height: 1;
    color: var(--accent);
    cursor: grab;
    transition: border-color 0.2s, background 0.15s, transform 0.15s, opacity 0.3s;
    height: 64px;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    user-select: none;
  }

  .match-roman-card:hover { transform: scale(1.03); box-shadow: var(--shadow); }
  .match-roman-card.dragging { opacity: 0.4; cursor: grabbing; }

  .match-roman-card.matched {
    background: rgba(92, 219, 149, 0.12);
    border-color: var(--green);
    color: var(--green);
    opacity: 0.5;
    cursor: default;
  }

  .match-roman-card.wrong {
    border-color: var(--neon-pink);
    background: rgba(255, 45, 120, 0.12);
    color: var(--neon-pink);
    animation: shake 0.3s;
  }

  .match-roman-card.selected {
    border-color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18);
    transform: scale(1.02);
  }

  .match-drop-target {
    min-height: 64px;
    border-radius: 12px;
    border: 2px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    font-size: 12px;
    color: var(--ink2);
    letter-spacing: 0.06em;
  }

  .match-drop-target.over { border-color: var(--neon-cyan); background: rgba(0, 240, 255, 0.06); }
  .match-drop-target.matched {
    border-style: solid;
    border-color: var(--green);
    background: rgba(92, 219, 149, 0.1);
    font-family: var(--font);
    font-size: 20px;
    color: var(--green);
    opacity: 0.5;
  }

  .memory-complete {
    text-align: center;
    padding: 48px 24px;
    animation: slideUp 0.4s ease;
  }

  .complete-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--neon-cyan);
  }

  .complete-mark-svg {
    display: block;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.25));
  }

  .memory-complete h3 {
    font-family: var(--font);
    font-size: 32px;
    margin-bottom: 8px;
  }

  .memory-complete p {
    font-size: 13px;
    color: var(--ink2);
    margin-bottom: 28px;
  }

  .l4-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 16px;
  }

  .memory-complete--l4 h3 {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .memory-complete--l4 p {
    margin-bottom: 32px;
  }

  /* ── LEVEL 4 COMPLETE — FULL SCREEN CELEBRATION ── */
  /* Let the celebration break out of the normal .page max-width/padding */
  .page:has(#level4-complete.active) {
    max-width: none;
    padding: 0;
  }
  #level4-complete { padding: 0; }
  .celebrate {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 60px 24px;
    overflow: hidden;
    background:
      radial-gradient(ellipse at 50% 25%, rgba(0, 240, 255, 0.18), transparent 55%),
      radial-gradient(ellipse at 80% 80%, rgba(179, 136, 255, 0.12), transparent 50%),
      radial-gradient(ellipse at 15% 75%, rgba(255, 45, 120, 0.08), transparent 50%),
      var(--bg-deep);
  }
  .celebrate::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
      radial-gradient(circle at 1px 1px, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
    pointer-events: none;
  }
  .celebrate-glyphs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 1fr;
    gap: 2vw;
    padding: 4vh 6vw;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    color: var(--neon-cyan);
    opacity: 0.07;
    font-size: clamp(48px, 9vw, 140px);
    line-height: 1;
  }
  .celebrate-glyphs span {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .celebrate-glyphs span:nth-child(2n) { color: var(--neon-purple); opacity: 0.9; }
  .celebrate-glyphs span:nth-child(3n) { color: var(--neon-pink); opacity: 0.7; }
  .celebrate-glyphs span:nth-child(5n) { transform: translateY(8%); }
  .celebrate-glyphs span:nth-child(7n) { transform: translateY(-6%); }

  .celebrate-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 860px;
    width: 100%;
    animation: celebrateIn 0.7s var(--ease) both;
  }
  @keyframes celebrateIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .celebrate-badge {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--neon-cyan);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
    margin-bottom: 32px;
    font-weight: 600;
  }

  .celebrate-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: clamp(44px, 9vw, 112px);
    letter-spacing: -0.03em;
    line-height: 0.98;
    margin: 0 0 24px;
    color: var(--ink);
    text-shadow: 0 0 60px rgba(0, 240, 255, 0.18);
  }

  .celebrate-hangul {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(90px, 18vw, 220px);
    line-height: 1;
    letter-spacing: -0.04em;
    margin: 0 auto 32px;
    background: linear-gradient(180deg, var(--neon-cyan) 0%, var(--neon-purple) 70%, rgba(255, 45, 120, 0.8) 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(0, 240, 255, 0.35));
  }

  .celebrate-sub {
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.55;
    color: var(--ink);
    margin: 0 auto 40px;
    max-width: 560px;
  }
  .celebrate-sub strong {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--neon-cyan);
    font-weight: 500;
  }

  .celebrate-cta {
    font-size: 14px;
    padding: 16px 44px;
    letter-spacing: 0.06em;
  }

  @media (max-width: 640px) {
    .celebrate { padding: 44px 20px; }
    .celebrate-badge { margin-bottom: 24px; }
    .celebrate-title { margin-bottom: 18px; }
    .celebrate-hangul { margin-bottom: 26px; }
    .celebrate-sub { margin-bottom: 32px; }
    .celebrate-glyphs {
      grid-template-columns: repeat(4, 1fr);
      gap: 3vw;
      padding: 3vh 3vw;
      opacity: 0.06;
    }
  }

  .btn-outline {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.2s var(--ease);
    white-space: nowrap;
  }

  .btn-outline:hover {
    background: rgba(0, 240, 255, 0.08);
  }

  .btn-outline:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
  }

  .cta-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .cta-row .primary-btn,
  .cta-row .btn-outline,
  .cta-row .ghost-btn {
    flex: 1 1 0;
    min-width: 140px;
    max-width: 220px;
    justify-content: center;
    white-space: nowrap;
  }

  .l4-review-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
  }

  .l4-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  .l4-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    text-align: left;
    width: 100%;
  }

  .l4-shortcut:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.04);
  }

  .l4-sc-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 0.05em;
    min-width: 24px;
  }

  .l4-sc-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
  }



  /* ── PROGRESS BAR ── */
  .progress-bar-wrap {
    background: var(--bg2);
    border-radius: 4px;
    height: 4px;
    margin-bottom: 24px;
    overflow: hidden;
  }

  .progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.4s ease;
  }

  /* ── SECTION LOCKED ── */
  .section-locked {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink2);
  }

  .section-locked .lock-icon { font-size: 40px; margin-bottom: 16px; }
  .section-locked p { font-size: 13px; line-height: 1.6; }

  /* ── RESPONSIVE ── */
  @media (max-width: 400px) {
    .memory-grid { grid-template-columns: repeat(4,1fr); gap: 6px; }
    .mem-front-face .mf-hangul { font-size: 20px; }
  }