/* Hangul Hub — playful study dashboard & session vibes */

.hangul-hero {
  position: relative;
  overflow: hidden;
  padding: 36px 28px 32px;
  margin: 0 0 24px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 70% at 20% 0%, rgba(255, 101, 132, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 30%, rgba(0, 245, 212, 0.12), transparent 50%),
    linear-gradient(155deg, var(--bg) 0%, var(--bg2, #111) 50%, var(--bg) 100%);
  border: 1px solid rgba(255, 101, 132, 0.22);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.hangul-hero-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hangul-hero-floats span {
  position: absolute;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 6%, transparent);
  animation: hangulFloat 12s ease-in-out infinite;
}

.hangul-hero-floats span:nth-child(1) { left: 8%; top: 15%; font-size: 3.2rem; animation-delay: 0s; }
.hangul-hero-floats span:nth-child(2) { left: 72%; top: 8%; font-size: 2.4rem; animation-delay: -2s; }
.hangul-hero-floats span:nth-child(3) { left: 88%; top: 55%; font-size: 4rem; animation-delay: -4s; }
.hangul-hero-floats span:nth-child(4) { left: 18%; top: 62%; font-size: 2rem; animation-delay: -6s; }
.hangul-hero-floats span:nth-child(5) { left: 48%; top: 78%; font-size: 2.8rem; animation-delay: -8s; }
.hangul-hero-floats span:nth-child(6) { left: 58%; top: 22%; font-size: 3.6rem; animation-delay: -1s; }

@keyframes hangulFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); opacity: 0.5; }
  50% { transform: translateY(-14px) rotate(6deg); opacity: 0.9; }
}

.hangul-hero-content { position: relative; z-index: 1; max-width: 720px; }

.hangul-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mint, #00f5d4);
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.28);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 14px;
}

.hangul-hero-title {
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  line-height: 1.1;
}

.hangul-hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--sakura, #ff6584), var(--text) 40%, var(--mint, #00f5d4));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hangul-hero-sub {
  font-size: 0.92rem;
  color: var(--text3);
  line-height: 1.65;
  margin: 0;
  max-width: 560px;
}

/* Dashboard */
.hangul-dash {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
}

.hangul-dash-rings {
  display: flex;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

.hangul-ring-card {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.hangul-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
}

.hangul-ring-svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.hangul-ring-track {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 8%, transparent);
  stroke-width: 6;
}

.hangul-ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 201;
  stroke-dashoffset: 201;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.hangul-ring-fill--consonant { stroke: var(--mint, #2fbfa1); }
.hangul-ring-fill--vowel { stroke: var(--gold, #d4a820); }
.hangul-ring-fill--hira { stroke: var(--mint, #2fbfa1); }
.hangul-ring-fill--kata { stroke: var(--gold, #d4a820); }

.hangul-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.hangul-ring-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  color: #666;
  margin-top: 2px;
}

.hangul-ring-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hangul-dash-quest {
  padding: 18px 20px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 80% at 100% 0%, rgba(255, 101, 132, 0.12), transparent 55%),
    color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid rgba(255, 101, 132, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hangul-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hangul-quest-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sakura, #ff6584);
}

.hangul-quest-reward {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--mint, #00f5d4);
}

.hangul-quest-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hangul-quest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hangul-quest-chip small {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: #666;
}

.hangul-quest-chip:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(255, 101, 132, 0.45);
}

.hangul-quest-chip.done {
  border-color: rgba(0, 245, 212, 0.55);
  background: rgba(0, 245, 212, 0.1);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.2);
}

.hangul-quest-chip.done::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--mint, #00f5d4);
  border-radius: 1px;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.45);
}

.hangul-quest-status {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.45;
}

.hangul-dash-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hangul-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.hangul-quick-btn:hover {
  color: var(--text);
  border-color: rgba(230, 57, 70, 0.4);
  background: rgba(230, 57, 70, 0.12);
  transform: translateY(-2px);
}

.hangul-quick-btn--hot {
  border-color: rgba(255, 101, 132, 0.45);
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(255, 101, 132, 0.1));
  color: var(--text);
}

/* Session vibe bar */
.hangul-session-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 7%, transparent);
}

.hangul-session-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  white-space: nowrap;
}

.hangul-session-track {
  flex: 1;
  height: 8px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 99px;
  overflow: hidden;
}

.hangul-session-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sakura, #ff6584), var(--mint, #00f5d4));
  transition: width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.35);
}

.hangul-session-msg {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  min-width: 140px;
  text-align: right;
  transition: color 0.3s;
}

.hangul-session-bar.vibing .hangul-session-msg { color: var(--mint, #00f5d4); }

/* Tab badges */
.hangul-tab {
  position: relative;
}

.hangul-tab-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(0, 245, 212, 0.15);
  color: var(--mint, #00f5d4);
  vertical-align: middle;
}

.hangul-tab[data-tab="games"] .hangul-tab-badge {
  background: rgba(255, 101, 132, 0.15);
  color: var(--sakura, #ff6584);
}

/* Spotlight on chart cells */
.hangul-cell.hangul-spotlight .hangul-face--front {
  animation: hangulSpotlight 1.2s ease-in-out infinite;
  border-color: rgba(255, 101, 132, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.35), 0 0 30px rgba(255, 101, 132, 0.4) !important;
}

@keyframes hangulSpotlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.hangul-cell.flip-pop .hangul-cell-inner {
  animation: hangulFlipPop 0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes hangulFlipPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08) rotateY(180deg); }
  100% { transform: scale(1) rotateY(180deg); }
}

/* Quiz HUD */
.hangul-quiz-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.hangul-quiz-combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(230, 57, 70, 0.12);
  border: 1px solid rgba(230, 57, 70, 0.3);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text2);
  opacity: 0.5;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.hangul-quiz-combo.hot {
  opacity: 1;
  transform: scale(1);
  color: #fff;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.35), rgba(255, 101, 132, 0.2));
  box-shadow: 0 0 24px rgba(230, 57, 70, 0.35);
  animation: hangulComboPulse 1.5s ease-in-out infinite;
}

@keyframes hangulComboPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(230, 57, 70, 0.25); }
  50% { box-shadow: 0 0 28px rgba(255, 101, 132, 0.45); }
}

.hangul-quiz-progress-wrap {
  flex: 1;
  min-width: 120px;
}

.hangul-quiz-progress-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #666;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.hangul-quiz-progress-bar {
  height: 8px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 99px;
  overflow: hidden;
}

.hangul-quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red, #e63946), var(--mint, #00f5d4));
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.hangul-quiz-section {
  position: relative;
}

.hangul-quiz-section::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 101, 132, 0.15), transparent 40%, rgba(0, 245, 212, 0.1));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.hangul-quiz-section.quiz-active::before { opacity: 1; }

.hangul-toast {
  position: fixed;
  /* Cleared above .flk-coach-chip (flk-coach.css), which also sits
     fixed-bottom-center on this page — otherwise the two overlap. */
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 8000;
  padding: 12px 22px;
  border-radius: 100px;
  background: var(--bg2);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s;
}

.hangul-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .hangul-dash { grid-template-columns: 1fr; }
  .hangul-dash-rings { justify-content: center; }
  .hangul-session-bar { flex-wrap: wrap; }
  .hangul-session-msg { text-align: left; min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  /* .flk-coach-chip switches to a taller two-row layout below this
     breakpoint (flk-coach.css) — clear it by a wider margin here. */
  .hangul-toast { bottom: 178px; }
}

/* ═══════════════════════════════════════════════════════════════
   Premium hangul page shell
   ═══════════════════════════════════════════════════════════════ */

.site-main.hangul-main {
  padding-top: 56px !important;
  overflow-x: clip;
}

.hangul-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.hangul-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 12% 18%, rgba(255, 101, 132, 0.07), transparent 55%),
    radial-gradient(ellipse 45% 40% at 88% 72%, rgba(0, 245, 212, 0.06), transparent 50%);
}

.hangul-page > *:not(.hangul-ambient) {
  position: relative;
  z-index: 1;
}

/* Hero upgrade */
.hangul-hero {
  padding: 40px 32px 36px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(255, 101, 132, 0.22), transparent 50%),
    radial-gradient(ellipse 70% 60% at 100% 50%, rgba(0, 245, 212, 0.1), transparent 45%),
    linear-gradient(165deg, var(--bg2) 0%, var(--bg2) 45%, var(--bg) 100%);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
}

.hangul-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, color-mix(in srgb, var(--text) 3%, transparent) 50%, transparent 60%);
  pointer-events: none;
}

.hangul-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hangul-stat-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--bg3);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  backdrop-filter: blur(8px);
}

.hangul-stat-chip--mint {
  border-color: rgba(0, 245, 212, 0.25);
  background: rgba(0, 245, 212, 0.06);
}

.hangul-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.hangul-stat-chip--mint .hangul-stat-val {
  color: var(--mint, #00f5d4);
}

.hangul-stat-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

/* Dashboard glass */
.hangul-dash-rings,
.hangul-dash-quest {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.hangul-quick-btn {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hangul-quick-btn--hot {
  box-shadow: 0 8px 28px rgba(230, 57, 70, 0.25);
}

.hangul-quick-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Workspace shell */
.hangul-workspace {
  margin-top: 8px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--text) 4%, transparent) 0%, color-mix(in srgb, var(--text) 3%, transparent) 100%),
    color-mix(in srgb, var(--bg) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
  overflow: hidden;
}

/* Dock navigation */
.hangul-dock {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg3);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}

.hangul-dock-glider {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 80px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.35), rgba(255, 101, 132, 0.2));
  border: 1px solid rgba(255, 101, 132, 0.35);
  box-shadow: 0 8px 28px rgba(230, 57, 70, 0.25);
  transition: transform 0.38s cubic-bezier(0.34, 1.35, 0.64, 1), width 0.38s cubic-bezier(0.34, 1.35, 0.64, 1), height 0.38s;
  pointer-events: none;
  z-index: 0;
}

.hangul-dock-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border: none;
  border-radius: 14px;
  background: transparent !important;
  color: #666 !important;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  transition: color 0.25s;
}

.hangul-dock-tab:hover {
  color: var(--text2) !important;
}

.hangul-dock-tab.active {
  color: var(--text) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.hangul-dock-icon {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.hangul-dock-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hangul-dock-tab .hangul-tab-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  margin: 0;
  font-size: 0.5rem;
  padding: 1px 5px;
}

/* Panels */
.hangul-panels {
  padding: 28px 24px 36px;
}

.hangul-panel {
  display: none;
  animation: none;
}

.hangul-panel.active {
  display: block;
}

.hangul-panel.hangul-panel-enter {
  animation: hangulPanelIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes hangulPanelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hangul-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hangul-panel-head--center {
  text-align: center;
  flex-direction: column;
  align-items: center;
}

.hangul-panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.hangul-panel-sub {
  font-size: 0.82rem;
  color: #777;
  margin: 0;
  line-height: 1.5;
  max-width: 480px;
}

.hangul-chart-hint {
  font-size: 0.78rem;
  color: #777;
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.55;
}

.hangul-chart-hint strong {
  color: var(--text2);
  font-weight: 600;
}

.hangul-hint-mint {
  color: var(--mint, #00f5d4);
  font-weight: 700;
}

.hangul-reset-btn {
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.hangul-reset-btn:hover {
  border-color: rgba(255, 101, 132, 0.45);
  color: var(--text);
  background: rgba(255, 101, 132, 0.1);
}

/* Chart grid premium */
.hangul-chart-wrap {
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--text) 3%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg3) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}

.hangul-page .hangul-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.hangul-row-block {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.hangul-row-label {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 101, 132, 0.75);
  text-align: right;
  padding-right: 4px;
  letter-spacing: 0.04em;
}

.hangul-page .hangul-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

/* Chart + left practice box */
.hangul-chart-layout {
  display: grid;
  grid-template-columns: minmax(168px, 200px) 1fr;
  gap: 18px;
  align-items: start;
}

.hangul-detail-box {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 14px 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--bg2), var(--bg2));
  border: 1px solid rgba(255, 210, 63, 0.22);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.hangul-detail-box.mastered-hangul {
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(0, 245, 212, 0.12);
}

.hangul-detail-tile {
  width: 100%;
  max-width: 132px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffe566 0%, #ffd23f 55%, #f5b800 100%);
  box-shadow:
    0 8px 24px rgba(255, 196, 40, 0.38),
    inset 0 1px 0 color-mix(in srgb, var(--text) 45%, transparent);
}

.hangul-detail-char {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: clamp(3rem, 10vw, 4.2rem);
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1;
}

.hangul-detail-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
}

.hangul-detail-prompt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #666;
}

.hangul-detail-quiz-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.hangul-detail-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--bg3);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hangul-detail-input:focus {
  outline: none;
  border-color: rgba(255, 101, 132, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 101, 132, 0.12);
}

.hangul-detail-input.correct {
  border-color: rgba(0, 245, 212, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(0, 245, 212, 0.15) !important;
}

.hangul-detail-input.wrong {
  border-color: rgba(230, 57, 70, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15) !important;
}

.hangul-detail-check {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--red, #e63946), #ff6584);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hangul-detail-check:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(230, 57, 70, 0.45);
}

.hangul-detail-feedback {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.hangul-detail-feedback.ok { color: var(--mint, #00f5d4); }
.hangul-detail-feedback.miss { color: var(--text2); }

.hangul-detail-reveal {
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.3;
}

.hangul-detail-reveal[hidden] {
  display: none;
}

.hangul-page .hangul-rom {
  display: none !important;
}

.hangul-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.hangul-detail-hear {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.hangul-detail-hear:hover {
  border-color: rgba(255, 101, 132, 0.45);
  background: rgba(255, 101, 132, 0.1);
  color: var(--text);
}

.hangul-detail-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--red, #e63946), #ff6584);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hangul-detail-write:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(230, 57, 70, 0.45);
}

.hangul-page .hangul-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px !important;
  background: var(--bg2, #14162b) !important;
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent) !important;
  border-radius: 14px !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent) !important;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, border-color 0.2s, background 0.2s !important;
}

.hangul-page .hangul-cell:hover {
  transform: translateY(-4px) scale(1.03) !important;
  border-color: rgba(255, 101, 132, 0.45) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 101, 132, 0.15) !important;
}

.hangul-page .hangul-cell.hangul-selected {
  border-color: rgba(255, 101, 132, 0.75) !important;
  background: color-mix(in srgb, var(--bg2, #14162b) 84%, #ff6584 16%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 101, 132, 0.65),
    0 8px 24px rgba(255, 101, 132, 0.25) !important;
}

.hangul-page .hangul-cell.mastered-hangul {
  border-color: rgba(0, 245, 212, 0.55) !important;
  background: color-mix(in srgb, var(--bg2, #14162b) 88%, #00f5d4 12%) !important;
  box-shadow:
    0 0 0 1px rgba(0, 245, 212, 0.45),
    0 4px 20px rgba(0, 245, 212, 0.15) !important;
}

.hangul-page .hangul-cell.mastered-hangul.hangul-selected {
  border-color: rgba(0, 245, 212, 0.85) !important;
  box-shadow:
    0 0 0 2px rgba(0, 245, 212, 0.75),
    0 8px 28px rgba(0, 245, 212, 0.25) !important;
}

.hangul-page .hangul-cell.hangul-empty {
  visibility: hidden;
  pointer-events: none;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hangul-page .hangul-char {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  color: var(--text, #fff);
  line-height: 1;
  pointer-events: none;
}

.hangul-page .hangul-cell .flk-say {
  position: relative;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 107, 157, 0.35);
  background: rgba(255, 107, 157, 0.12);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.hangul-page .hangul-cell .flk-say::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 48px;
  min-height: 48px;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.hangul-page .hangul-cell .flk-say:hover {
  transform: scale(1.15);
  background: rgba(255, 107, 157, 0.25);
}

/* Quiz arena */
.hangul-quiz-set {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 5px;
  border-radius: 100px;
  background: var(--bg3);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.hangul-quiz-set-btn {
  padding: 9px 20px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: #666;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.hangul-quiz-set-btn:hover {
  color: var(--text);
}

.hangul-quiz-set-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.4), rgba(255, 101, 132, 0.25));
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.25);
}

.hangul-quiz-arena {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 28px 28px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(230, 57, 70, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(0, 245, 212, 0.08), transparent 50%),
    color-mix(in srgb, var(--bg3) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.hangul-quiz-stage {
  text-align: center;
}

.hangul-quiz-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.hangul-quiz-prompt {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #666;
  margin: 0;
}

.hangul-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255, 210, 63, 0.4);
  background: rgba(255, 210, 63, 0.1);
  color: #ffe566;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(255, 210, 63, 0.15);
}

.hangul-hint-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 210, 63, 0.22);
  border-color: rgba(255, 210, 63, 0.65);
  box-shadow: 0 6px 20px rgba(255, 210, 63, 0.3);
}

.hangul-hint-btn.active {
  background: linear-gradient(135deg, #ffe566, #ffd23f);
  color: #1a1a2e;
  border-color: transparent;
}

/* Dynamic Hint Box */
.hangul-quiz-hint-box {
  max-width: 400px;
  margin: 0 auto 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 210, 63, 0.14), rgba(0, 245, 212, 0.08));
  border: 1px solid rgba(255, 210, 63, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 210, 63, 0.15);
  animation: hintSlideIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  text-align: left;
}

.hangul-quiz-hint-box[hidden] {
  display: none !important;
}

@keyframes hintSlideIn {
  0% { transform: translateY(-8px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.hangul-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hangul-hint-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hangul-hint-sound {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffe566;
}

.hangul-hint-word {
  font-size: 0.75rem;
  color: #aaa;
  font-family: 'Noto Sans KR', sans-serif;
}

.hangul-hint-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 212, 0.4);
  background: rgba(0, 245, 212, 0.1);
  color: var(--mint, #00f5d4);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.hangul-hint-audio-btn:hover {
  transform: scale(1.05);
  background: rgba(0, 245, 212, 0.22);
}

.hangul-quiz-char-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 101, 132, 0.12) 0%, transparent 70%);
}

.hangul-quiz-char-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 101, 132, 0.25);
  box-shadow: 0 0 40px rgba(255, 101, 132, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.hangul-quiz-char-ring.pulse {
  animation: hangulQuizPulse 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes hangulQuizPulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

.hangul-page .hangul-quiz-char {
  position: relative;
  z-index: 1;
  font-size: 5.5rem !important;
  margin: 0 !important;
  text-shadow: 0 0 40px color-mix(in srgb, var(--text) 15%, transparent);
}

.hangul-quiz-input-row {
  display: flex;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto 12px;
}

.hangul-page .hangul-quiz-input {
  flex: 1;
  padding: 14px 18px !important;
  font-size: 1.05rem !important;
  border-radius: 14px !important;
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
  background: var(--bg3) !important;
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s !important;
}

.hangul-page .hangul-quiz-input:focus {
  border-color: rgba(255, 101, 132, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(255, 101, 132, 0.12) !important;
  outline: none;
}

.hangul-quiz-submit {
  padding: 14px 22px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--red, #e63946), #ff6584);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hangul-quiz-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(230, 57, 70, 0.45);
}

.hangul-quiz-submit:active {
  transform: translateY(0);
}

.hangul-page .hangul-quiz-result {
  min-height: 24px;
  font-weight: 700;
  font-size: 0.95rem;
}

.hangul-page .hangul-quiz-score {
  font-size: 0.78rem;
  color: #666;
  margin-top: 8px;
  font-weight: 600;
}

/* Dedicated Round Complete Card */
.hangul-quiz-complete-stage {
  padding: 16px 8px;
  animation: quizCompletePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes quizCompletePop {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.hangul-quiz-complete-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.25), rgba(255, 101, 132, 0.2));
  border: 1px solid rgba(255, 210, 63, 0.5);
  color: #ffe566;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(255, 210, 63, 0.2);
}

.hangul-quiz-complete-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hangul-quiz-complete-sub {
  font-size: 1.1rem;
  color: var(--text2, #a0aec0);
  margin: 0 0 16px;
}

.hangul-quiz-complete-sub strong {
  color: var(--mint, #00f5d4);
  font-size: 1.25rem;
}

.hangul-quiz-complete-xp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 100px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--mint, #00f5d4);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.hangul-quiz-complete-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hangul-quiz-btn-lg {
  padding: 16px 32px !important;
  font-size: 1rem !important;
  border-radius: 16px !important;
}

.hangul-quiz-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.hangul-ghost-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text3);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.hangul-ghost-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.kg-arena.kg-arena-enter {
  animation: hangulPanelIn 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Toast upgrade */
.hangul-toast {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 14px 26px;
  font-size: 0.9rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 245, 212, 0.2);
}

/* ==========================================================================
   SYLLABLE BLOCKS COMBINATION MATRIX & BUILDER
   ========================================================================== */
.hangul-dock {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  position: relative;
  margin-bottom: 24px;
}

.syllable-panel-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.syllable-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg3) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

.syllable-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.syllable-filter-btn {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text2, #aaa);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.syllable-filter-btn:hover {
  color: var(--text, #fff);
  border-color: rgba(255, 101, 132, 0.45);
  background: rgba(255, 101, 132, 0.08);
}

.syllable-filter-btn.active {
  color: #fff;
  border-color: var(--red, #e63946);
  background: linear-gradient(135deg, var(--red, #e63946), #ff6584);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
}

.syllable-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 220px;
}

.syllable-search-input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: 100px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: var(--bg2, #14162b);
  color: var(--text, #fff);
  font-family: 'Space Grotesk', 'Noto Sans KR', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.syllable-search-input:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.syllable-search-icon {
  position: absolute;
  left: 12px;
  color: #777;
  font-size: 0.85rem;
  pointer-events: none;
}

/* Syllable Inspector & Sandbox */
.syllable-inspector {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 20px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--bg2) 80%, #ff6584 8%), var(--bg2));
  border: 1px solid rgba(255, 101, 132, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  align-items: center;
}

.syllable-inspector-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.syllable-big-tile {
  width: 88px;
  height: 88px;
  min-width: 88px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ffe566 0%, #ffd23f 55%, #f5b800 100%);
  color: #1a1a2e;
  box-shadow: 0 8px 24px rgba(255, 196, 40, 0.38);
}

.syllable-big-char {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
}

.syllable-big-rom {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.syllable-equation {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.syllable-eq-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sakura, #ff6b9d);
}

.syllable-eq-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', 'Noto Sans KR', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #fff);
}

.syllable-chip {
  padding: 4px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  font-size: 0.95rem;
}

.syllable-chip--gold {
  border-color: rgba(255, 210, 63, 0.5);
  background: rgba(255, 210, 63, 0.15);
  color: #ffe566;
}

.syllable-inspector-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.syllable-vocab-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mint, #00f5d4);
}

.syllable-vocab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.syllable-vocab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--bg3);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.syllable-vocab-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 245, 212, 0.5);
}

.syllable-vocab-ko {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 800;
  color: var(--text, #fff);
}

.syllable-vocab-en {
  color: #666;
  font-size: 0.72rem;
}

.syllable-inspector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.syllable-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.syllable-act-btn--hear {
  background: linear-gradient(135deg, var(--red, #e63946), #ff6584);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
}

.syllable-act-btn--hear:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.45);
}

.syllable-act-btn--write {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  color: var(--text, #fff);
}

.syllable-act-btn--write:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 245, 212, 0.5);
  color: var(--mint, #00f5d4);
}

/* Syllable Combination Table */
.syllable-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg3) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  padding: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.syllable-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
  min-width: 720px;
}

.syllable-th,
.syllable-td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 4px;
  border-radius: 10px;
  transition: all 0.15s ease-out;
}

.syllable-th-corner {
  background: var(--bg2, #14162b);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 0.68rem;
  font-weight: 800;
  color: #666;
  padding: 8px;
  line-height: 1.3;
}

.syllable-th-vowel {
  background: var(--bg2, #14162b);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  cursor: pointer;
  user-select: none;
}

.syllable-th-vowel:hover,
.syllable-th-vowel.active-col {
  background: color-mix(in srgb, var(--bg2) 80%, #38bdf8 20%);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.syllable-th-consonant {
  background: var(--bg2, #14162b);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  cursor: pointer;
  user-select: none;
  width: 64px;
  min-width: 64px;
}

.syllable-th-consonant:hover,
.syllable-th-consonant.active-row {
  background: color-mix(in srgb, var(--bg2) 80%, #ff6584 20%);
  border-color: rgba(255, 101, 132, 0.6);
  box-shadow: 0 0 12px rgba(255, 101, 132, 0.2);
}

.syllable-th-char {
  display: block;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text, #fff);
  line-height: 1.1;
}

.syllable-th-rom {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #666;
}

/* Syllable Cell */
.syllable-td {
  background: var(--bg2, #14162b);
  border: 1px solid color-mix(in srgb, var(--text) 4%, transparent);
  cursor: pointer;
  user-select: none;
  height: 52px;
}

.syllable-td:hover {
  transform: scale(1.08);
  z-index: 10;
  background: color-mix(in srgb, var(--bg2) 82%, #ff6584 18%) !important;
  border-color: rgba(255, 101, 132, 0.55) !important;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(255, 101, 132, 0.2) !important;
}

.syllable-td.active-crosshair {
  background: color-mix(in srgb, var(--bg2) 90%, #ff6584 10%);
  border-color: rgba(255, 101, 132, 0.25);
}

.syllable-td.selected {
  background: color-mix(in srgb, var(--bg2) 75%, #00f5d4 25%) !important;
  border-color: rgba(0, 245, 212, 0.8) !important;
  box-shadow:
    0 0 0 2px rgba(0, 245, 212, 0.7),
    0 8px 24px rgba(0, 245, 212, 0.25) !important;
  transform: scale(1.06);
  z-index: 12;
}

.syllable-td-char {
  display: block;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #fff);
  line-height: 1.15;
}

.syllable-td-rom {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: #777;
  letter-spacing: 0.01em;
}

.syllable-td.selected .syllable-td-char {
  color: #fff;
}

.syllable-td.selected .syllable-td-rom {
  color: var(--mint, #00f5d4);
  font-weight: 800;
}

.syllable-write-hint-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--accent, #a78bfa) 12%, var(--bg2, #1f1f2e));
  border: 1px solid color-mix(in srgb, var(--accent, #a78bfa) 35%, transparent);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.syllable-write-hint-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.syllable-write-hint-text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text, #fff);
}

.syllable-write-hint-text strong {
  color: var(--accent, #c4b5fd);
  font-weight: 700;
}

.hangul-chart-hint--syllable {
  border-left: 3px solid var(--accent, #a78bfa);
}

/* Authentic Letter Sound & IPA typography (hangul.fun style) */
.hangul-detail-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
}

.hangul-detail-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mint, #00f5d4);
  letter-spacing: 0.02em;
}

.hangul-detail-ipa {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sakura, #ff6584);
  background: rgba(255, 101, 132, 0.12);
  border: 1px solid rgba(255, 101, 132, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.05em;
  display: inline-block;
}

.hangul-cell-rom {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text2, #cbd5e1);
  margin-top: 2px;
  line-height: 1.1;
  pointer-events: none;
}

.hangul-cell-ipa {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--sakura, #ff8da1);
  opacity: 0.9;
  letter-spacing: 0.03em;
  margin-top: 1px;
  line-height: 1.1;
  pointer-events: none;
}

.hangul-cell:hover .hangul-cell-ipa {
  opacity: 1;
  color: #ff9ebb;
}

@media (max-width: 900px) {
  .syllable-inspector {
    grid-template-columns: 1fr;
  }
  .hangul-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
  }
}

@media (max-width: 768px) {
  .hangul-page { padding: 0 14px 56px; }
  .hangul-hero { padding: 28px 20px; border-radius: 20px; }
  .hangul-dock { grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 6px; }
  .hangul-dock-label { font-size: 0.52rem; }
  .hangul-dock-icon { font-size: 0.95rem; }
  .hangul-panels { padding: 20px 14px 28px; }
  .hangul-chart-layout { grid-template-columns: 1fr; }
  .hangul-detail-box { position: static; }
  .hangul-row-block { grid-template-columns: 40px 1fr; gap: 6px; }
  .hangul-row-label { font-size: 0.62rem; }
  .hangul-quiz-input-row { flex-direction: column; }
  .hangul-quiz-submit { width: 100%; }
  .hangul-panel-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .hangul-hero-floats span,
  .hangul-panel.hangul-panel-enter,
  .hangul-quiz-char-ring.pulse,
  .hangul-cell.hangul-spotlight .hangul-face--front,
  .hangul-quiz-combo.hot {
    animation: none !important;
  }
  .hangul-dock-glider { transition: none; }
}
