:root {
  --bg: #fdf8f3;
  --surface: #ffffff;
  --border: #e8ddd0;
  --text: #2d2520;
  --text-sub: #9a8878;
  --accent: #e07a40;
  --accent2: #d95f8a;
  --correct: #4caf50;
  --wrong: #e05050;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(180, 130, 90, 0.13);
  --shadow-lg: 0 6px 28px rgba(180, 130, 90, 0.18);
  --font-base: 14px;
  --font-label: 12px;
  --font-choice: 28px;
  --font-consonant: clamp(56px, 14vw, 72px);
  --font-banner: 32px;
  --font-result: 28px;
}

body.font-large {
  --font-base: 16px;
  --font-label: 13px;
  --font-choice: 36px;
  --font-consonant: clamp(64px, 16vw, 84px);
  --font-banner: 40px;
  --font-result: 34px;
}

body.font-xlarge {
  --font-base: 19px;
  --font-label: 15px;
  --font-choice: 46px;
  --font-consonant: clamp(72px, 18vw, 96px);
  --font-banner: 50px;
  --font-result: 40px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: "M PLUS Rounded 1c", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 60px;
  animation: screenIn 0.3s ease;
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.btn-primary {
  background: linear-gradient(135deg, #e07a40, #d95f8a);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(224, 122, 64, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  touch-action: manipulation;
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-primary:active {
  transform: translateY(1px);
  filter: brightness(0.96);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-primary {
  padding: 15px 36px;
  font-size: 15px;
}
.btn-primary:hover {
  box-shadow: 0 7px 20px rgba(224, 122, 64, 0.4);
}
.btn-primary:active {
  box-shadow: 0 2px 8px rgba(224, 122, 64, 0.3);
}

.btn-secondary {
  background: none;
  border: 1.5px solid #e8ddd0;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
  background: var(--surface);
  color: var(--text-sub);
  padding: 14px 28px;
  font-size: 14px;
}
.btn-secondary:hover {
  background: #f5ede4;
  border-color: #e07a40;
  color: #e07a40;
}
.btn-secondary:active {
  background: #f0e0d0;
  transition: background 0.08s;
}

.btn-back-home {
  background: none;
  border: 1.5px solid #e8ddd0;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-sub);
}
.btn-back-home:hover {
  background: var(--surface);
  border-color: #9a8878;
  color: #2d2520;
}
.btn-back-home:active {
  background: #f0ece8;
  transition: background 0.08s;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.vcolor-a {
  background-color: #FFADAD;
  color: #5a1a1a;
}

.vcolor-ya {
  background-color: #FFB1C1;
  color: #5a1a2a;
}

.vcolor-eo {
  background-color: #B5EAD7;
  color: #1a4a38;
}

.vcolor-yeo {
  background-color: #C8E6DA;
  color: #1a4a38;
}

.vcolor-o {
  background-color: #AEE6F8;
  color: #1a3a4a;
}

.vcolor-yo {
  background-color: #C4D8EB;
  color: #1a2a3a;
}

.vcolor-u {
  background-color: #FFF0A0;
  color: #4a3a00;
}

.vcolor-yu {
  background-color: #FFE4BF;
  color: #4a2a00;
}

.vcolor-eu {
  background-color: #D4F0CB;
  color: #1a3a1a;
}

.vcolor-i {
  background-color: #FFB3D9;
  color: #5a1a40;
}

.vcolor-ae {
  background-color: #FADADD;
  color: #5a2020;
}

.vcolor-yae {
  background-color: #F7C5CF;
  color: #5a1a2a;
}

.vcolor-e {
  background-color: #C8F0D0;
  color: #1a4a2a;
}

.vcolor-ye {
  background-color: #A8E6CF;
  color: #1a3a28;
}

.vcolor-wa {
  background-color: #FFE0B0;
  color: #4a2a00;
}

.vcolor-wae {
  background-color: #FFD0A0;
  color: #4a2000;
}

.vcolor-oe {
  background-color: #D0E8FF;
  color: #1a2a5a;
}

.vcolor-wo {
  background-color: #B8D8F8;
  color: #1a2a4a;
}

.vcolor-we {
  background-color: #C0D0F0;
  color: #1a2040;
}

.vcolor-wi {
  background-color: #E0D0FF;
  color: #2a1a5a;
}

.vcolor-ui {
  background-color: #D8D0F8;
  color: #2a2050;
}

.home-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-top: 40px;
}

.home-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.home-badge {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 52px;
  font-weight: 900;
  background: linear-gradient(135deg, #e07a40, #d95f8a 60%, #9b7fe8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(224, 122, 64, 0.22));
  line-height: 1;
}

.home-title {
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 800;
  line-height: 1.25;
}

.home-sub {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}

.home-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.summary-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  box-shadow: var(--shadow);
}
.summary-chip strong {
  color: var(--accent);
}

.home-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-card {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s;
  touch-action: manipulation;
}
.nav-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
  transition: transform 0.08s;
}

.nav-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 16px;
  font-weight: 800;
  display: block;
}

.nav-desc {
  font-size: 12px;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}

.nav-study {
  border-left: 4px solid #74b9ff;
}
.nav-study:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #74b9ff;
}

.nav-quiz {
  border-left: 4px solid var(--accent);
}
.nav-quiz:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.nav-mypage {
  border-left: 4px solid #a29bfe;
}
.nav-mypage:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #a29bfe;
}

.study-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.study-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.study-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.study-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #74b9ff, #0984e3);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.study-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}

.study-content {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  min-height: 360px;
  animation: screenIn 0.3s ease;
}
.study-content h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #0984e3;
}
.study-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text-sub);
}
.study-content p {
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 10px;
}

.hangul-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
}
.hangul-table th, .hangul-table td {
  border: 1px solid #fff;
  padding: 8px 10px;
  text-align: center;
}
.hangul-table th {
  font-weight: 700;
  font-size: 12px;
}
.hangul-table .row-label {
  font-weight: 700;
  font-size: 12px;
  background: #f0f2f4;
  color: #5a6370;
  white-space: nowrap;
}
.hangul-table .hg {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.hangul-table .rom {
  font-size: 11px;
  color: var(--text-sub);
}
@media (max-width: 480px) {
  .hangul-table .hg {
    font-size: 15px;
  }
}

.compose-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  margin: 10px 0;
  background: #fdf0e8;
  border-radius: var(--radius-sm);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 40px;
  font-weight: 900;
}
.compose-demo .op {
  font-size: 20px;
  color: var(--text-sub);
}

.study-nav {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.btn-study-prev,
.btn-study-next {
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  touch-action: manipulation;
}

.btn-study-prev {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-study-prev:hover {
  background: #f5ede4;
  border-color: #9a8878;
  color: #2d2520;
}
.btn-study-prev:active {
  background: #f0e0d0;
  transition: background 0.08s;
}
.btn-study-prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-study-next {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(9, 132, 227, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  touch-action: manipulation;
}
.btn-study-next:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-study-next:active {
  transform: translateY(1px);
  filter: brightness(0.96);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-study-next:hover {
  box-shadow: 0 5px 16px rgba(9, 132, 227, 0.4);
}
.btn-study-next:active {
  box-shadow: 0 1px 6px rgba(9, 132, 227, 0.3);
}

.btn-to-quiz {
  background: linear-gradient(135deg, #e07a40, #d95f8a);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(224, 122, 64, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  touch-action: manipulation;
}
.btn-to-quiz:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-to-quiz:active {
  transform: translateY(1px);
  filter: brightness(0.96);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-to-quiz {
  border: none;
  padding: 15px 36px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.btn-to-quiz:hover {
  box-shadow: 0 7px 20px rgba(224, 122, 64, 0.4);
}
.btn-to-quiz:active {
  box-shadow: 0 2px 8px rgba(224, 122, 64, 0.3);
}

.level-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.level-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.level-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.quiz-settings {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

.setting-options {
  display: flex;
  gap: 6px;
}

.setting-btn {
  background: none;
  border: 1.5px solid #e8ddd0;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
  background: var(--bg);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
}
.setting-btn:hover:not(.active) {
  background: #f5ede4;
  border-color: #e07a40;
  color: #e07a40;
}
.setting-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.level-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s;
  cursor: pointer;
  touch-action: manipulation;
}
.level-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.level-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
  transition: transform 0.08s;
}

.level-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.level-name {
  font-size: 17px;
  font-weight: 800;
}

.level-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
}

.quiz-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  font-size: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.quiz-progress-wrap {
  flex: 1;
}

.quiz-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-counters {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.correct-counter {
  color: var(--correct);
}

.total-counter {
  color: var(--text-sub);
}

.progress-map {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.map-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-sub);
  transition: 0.2s;
}
.map-dot.current {
  background: var(--accent);
  color: #fff;
}
.map-dot.correct {
  background: var(--correct);
  color: #fff;
}
.map-dot.wrong {
  background: var(--wrong);
  color: #fff;
}
.map-dot.skipped {
  background: #ffd166;
  color: #5a4000;
}

.question-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: screenIn 0.25s ease;
}

.q-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.q-consonant {
  font-family: "Noto Sans KR", sans-serif;
  font-size: var(--font-consonant);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 12px;
  color: var(--text);
}

.q-text {
  font-size: var(--font-base);
  color: var(--text-sub);
  line-height: 1.8;
}
.q-text strong {
  color: var(--accent);
  font-size: calc(var(--font-base) * 1.15);
  font-weight: 800;
}

.q-timer {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
  min-height: 18px;
}

.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  font-size: var(--font-choice);
  font-weight: 900;
  font-family: "Noto Sans KR", sans-serif;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.choice-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.choice-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s, box-shadow 0.08s;
}
.choice-btn:disabled {
  cursor: not-allowed;
}
.choice-btn.correct {
  border-color: var(--correct);
  outline: 3px solid rgba(76, 175, 80, 0.3);
  animation: popIn 0.2s ease, correctPulse 0.5s ease 0.2s;
}
.choice-btn.wrong {
  border-color: var(--wrong);
  outline: 3px solid rgba(224, 80, 80, 0.25);
  animation: shake 0.3s ease;
}

.choice-hint {
  font-size: calc(var(--font-base) * 0.78);
  font-weight: 700;
  opacity: 0.7;
}

.choice-word {
  font-size: calc(var(--font-choice) * 0.65);
}

@keyframes popIn {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes correctPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
.result-banner {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: screenIn 0.25s ease;
  text-align: center;
}
.result-banner.banner-ok {
  background: #e8f5e9;
  border: 1.5px solid #a5d6a7;
}
.result-banner.banner-ng {
  background: #fdecea;
  border: 1.5px solid #ef9a9a;
}
.result-banner.banner-skip {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
}

.banner-msg {
  font-size: var(--font-label);
  font-weight: 700;
  color: var(--text-sub);
}

.banner-eq {
  font-family: "Noto Sans KR", sans-serif;
  font-size: var(--font-banner);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.banner-read {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--accent);
}

.quiz-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-nav-end {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.btn-quiz-nav {
  background: none;
  border: 1.5px solid #e8ddd0;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
  background: var(--surface);
  padding: 13px 22px;
  font-size: 13px;
  color: var(--text-sub);
}
.btn-quiz-nav:hover {
  background: #f5ede4;
  border-color: #9a8878;
  color: #2d2520;
}
.btn-quiz-nav:active {
  background: #f0e0d0;
  transition: background 0.08s;
}
.btn-quiz-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-quiz-nav.hidden {
  display: none;
}

.btn-skip {
  border-color: #ffd166;
  color: #5a4000;
}

.btn-end {
  border-color: #e0d0d0;
  color: #aa7070;
  font-size: 12px;
  padding: 8px 18px;
}
.btn-end:hover {
  background: #fff5f5;
  border-color: #ffb3b3;
  color: #8b2020;
}

.ref-btn-wrap {
  display: flex;
  justify-content: center;
}

.btn-ref-table {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ref-table:hover {
  background: #f5ede4;
  color: var(--text);
}

.modal-overlay {
  width: 100%;
  animation: panelSlideUp 0.25s ease;
}
@media (min-width: 900px) {
  .modal-overlay {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    z-index: 100;
    animation: panelSlideInRight 0.25s ease;
  }
}

@keyframes panelSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes panelSlideInRight {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}
.modal-box {
  border-radius: var(--radius);
  width: 100%;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  overflow: hidden;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  background: var(--surface);
}
@media (min-width: 900px) {
  .modal-box {
    overflow: visible;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-sub);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
}
.modal-close:hover {
  background: #f0f0f0;
  color: var(--text);
}

.modal-body {
  padding: 12px 16px;
  overflow-y: auto;
}
@media (min-width: 900px) {
  .modal-body {
    overflow-y: visible;
  }
}
.modal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.modal-body table th {
  background: #f0f2f4;
  padding: 5px 6px;
  border: 1px solid #fff;
  font-size: 11px;
  font-weight: 700;
}
.modal-body table td {
  border: 1px solid #fff;
  padding: 5px 6px;
  text-align: center;
}

.result-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 16px;
}

.result-title {
  font-size: calc(var(--font-result) * 0.78);
  font-weight: 800;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.result-title-ja {
  font-size: calc(var(--font-result) * 0.78);
}

.result-title-ko {
  font-family: "Noto Sans KR", sans-serif;
  font-size: calc(var(--font-result) * 0.6);
  color: var(--accent);
  font-weight: 700;
}

.result-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.result-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-score {
  font-size: var(--font-result);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.ring-denom {
  font-size: 12px;
  color: var(--text-sub);
}

.result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-item {
  font-size: var(--font-base);
  color: var(--text-sub);
  font-weight: 700;
}
.stat-item strong {
  color: var(--accent);
}

.result-filter {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.filter-btn {
  background: none;
  border: 1.5px solid #e8ddd0;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  touch-action: manipulation;
  background: var(--bg);
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
}
.filter-btn:hover:not(.active) {
  background: #f5ede4;
  border-color: #e07a40;
  color: #e07a40;
}
.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.result-list::-webkit-scrollbar {
  width: 4px;
}
.result-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.result-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--font-base);
}
.result-item.item-correct {
  border-color: #a5d6a7;
  background: #f1f8f1;
}
.result-item.item-wrong {
  border-color: #ef9a9a;
  background: #fdf3f3;
}
.result-item.item-skip {
  border-color: #ffe082;
  background: #fffde7;
}

.item-icon {
  flex-shrink: 0;
  font-size: var(--font-base);
  margin-top: 1px;
}

.item-body {
  flex: 1;
}

.item-label {
  color: var(--text-sub);
  margin-bottom: 2px;
}

.item-answer {
  font-weight: 700;
}

.result-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.mypage-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mypage-topbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.mypage-title {
  font-size: 18px;
  font-weight: 800;
  flex: 1;
  text-align: center;
}

.mypage-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-sub);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.summary-key {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 700;
}

.weak-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weak-item {
  background: var(--surface);
  border: 1.5px solid #ef9a9a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.weak-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--wrong);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.weak-char {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 28px;
  font-weight: 900;
  flex-shrink: 0;
}

.weak-info {
  flex: 1;
}

.weak-combo {
  font-size: 13px;
  font-weight: 700;
}

.weak-count {
  font-size: 11px;
  color: var(--text-sub);
}

.weak-empty {
  font-size: 14px;
  color: var(--text-sub);
  text-align: center;
  padding: 16px;
}

.btn-review {
  background: linear-gradient(135deg, #e05050, #c0392b);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(224, 80, 80, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  touch-action: manipulation;
}
.btn-review:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-review:active {
  transform: translateY(1px);
  filter: brightness(0.96);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-review {
  align-self: flex-start;
  padding: 14px 24px;
  font-size: 13px;
}
.btn-review:hover {
  box-shadow: 0 5px 16px rgba(224, 80, 80, 0.38);
}
.btn-review:active {
  box-shadow: 0 1px 6px rgba(224, 80, 80, 0.2);
}
.btn-review:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  filter: none;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.history-list::-webkit-scrollbar {
  width: 4px;
}
.history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.history-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.history-date {
  color: var(--text-sub);
  font-weight: 700;
  min-width: 60px;
}

.history-detail {
  flex: 1;
  color: var(--text);
}

.history-rate {
  font-weight: 700;
  font-size: 13px;
}
.history-rate.high {
  color: var(--correct);
}
.history-rate.mid {
  color: var(--accent);
}
.history-rate.low {
  color: var(--wrong);
}

.cheer-bubble {
  position: relative;
  margin-left: auto;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 12px 12px 12px 2px;
  padding: 8px 12px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(224, 122, 64, 0.15);
}

.cheer-msg {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.cheer-read {
  font-size: 10px;
  color: var(--text-sub);
  font-weight: 700;
  line-height: 1.4;
}

.bg-hangul-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-hangul {
  position: absolute;
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 900;
  line-height: 1;
  animation: bgHangulFloat linear infinite;
}

@keyframes bgHangulFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-18px) rotate(1deg);
  }
  75% {
    transform: translateY(12px) rotate(-1deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}
.bh-1 {
  left: 1%;
  top: 8%;
  font-size: 110px;
  color: #FFADAD;
  opacity: 0.48;
  animation-duration: 7.2s;
  animation-delay: 0s;
}

.bh-2 {
  left: 16%;
  top: 40%;
  font-size: 80px;
  color: #AEE6F8;
  opacity: 0.44;
  animation-duration: 9s;
  animation-delay: -2s;
}

.bh-3 {
  left: 3%;
  top: 68%;
  font-size: 130px;
  color: #D4F0CB;
  opacity: 0.42;
  animation-duration: 8.1s;
  animation-delay: -4s;
}

.bh-4 {
  left: 11%;
  top: 23%;
  font-size: 70px;
  color: #FFE4BF;
  opacity: 0.5;
  animation-duration: 6.5s;
  animation-delay: -1s;
}

.bh-5 {
  left: 20%;
  top: 82%;
  font-size: 95px;
  color: #FFB3D9;
  opacity: 0.46;
  animation-duration: 10s;
  animation-delay: -3s;
}

.bh-6 {
  right: 2%;
  top: 14%;
  font-size: 100px;
  color: #B5EAD7;
  opacity: 0.46;
  animation-duration: 8.5s;
  animation-delay: -1.5s;
}

.bh-7 {
  right: 15%;
  top: 50%;
  font-size: 85px;
  color: #FFF0A0;
  opacity: 0.5;
  animation-duration: 7.8s;
  animation-delay: -3.5s;
}

.bh-8 {
  right: 4%;
  top: 74%;
  font-size: 120px;
  color: #C4D8EB;
  opacity: 0.42;
  animation-duration: 9.5s;
  animation-delay: -0.5s;
}

.bh-9 {
  right: 10%;
  top: 33%;
  font-size: 75px;
  color: #FADADD;
  opacity: 0.48;
  animation-duration: 6.8s;
  animation-delay: -2.5s;
}

.bh-10 {
  right: 19%;
  top: 87%;
  font-size: 90px;
  color: #C8F0D0;
  opacity: 0.44;
  animation-duration: 8.8s;
  animation-delay: -4.5s;
}

@media (max-width: 480px) {
  .bh-1 {
    opacity: 0.22;
    left: -6%;
  }
  .bh-2 {
    opacity: 0.2;
    left: -4%;
  }
  .bh-3 {
    opacity: 0.18;
    left: -8%;
  }
  .bh-4 {
    opacity: 0.22;
    left: -3%;
  }
  .bh-5 {
    opacity: 0.2;
    left: -6%;
  }
  .bh-6 {
    opacity: 0.22;
    right: -6%;
  }
  .bh-7 {
    opacity: 0.2;
    right: -4%;
  }
  .bh-8 {
    opacity: 0.18;
    right: -8%;
  }
  .bh-9 {
    opacity: 0.22;
    right: -3%;
  }
  .bh-10 {
    opacity: 0.2;
    right: -6%;
  }
}/*# sourceMappingURL=style.css.map */