/* Dongsa Korean Verb Conjugator - Modern Mobile-First Design */

/* CSS Custom Properties */
:root {
  /* Colors - Warm, inviting palette inspired by Korean aesthetics */
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #4285f4;
  --secondary: #ff6b35;
  --secondary-dark: #e55a2b;
  --accent: #00c896;

  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --text-inverse: #ffffff;

  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e8eaed;
  --bg-dark: #202124;

  --border-light: #dadce0;
  --border-medium: #c4c7c5;

  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.1), 0 1px 3px 1px rgba(60,64,67,0.08);
  --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.15), 0 4px 8px 3px rgba(60,64,67,0.1);
  --shadow-lg: 0 4px 8px 0 rgba(60,64,67,0.2), 0 6px 20px 4px rgba(60,64,67,0.15);
  --shadow-xl: 0 8px 16px 0 rgba(60,64,67,0.2), 0 12px 28px 8px rgba(60,64,67,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-korean: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-korean);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

main {
  flex: 1;
}

/* ==================== HEADER ==================== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

@media (min-width: 640px) {
  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-nav {
  display: flex;
  gap: var(--space-md);
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.external-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9em;
  height: 0.9em;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.72em;
  line-height: 1;
}

.header-nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--primary-dark);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-korean);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--primary);
}

.logo-korean {
  color: var(--primary);
}

.logo-english {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Search Section */
.search-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

@media (min-width: 640px) {
  .search-section {
    max-width: 500px;
  }
}

/* Search Tabs */
.search-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.search-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.search-tab:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.search-tab--active {
  background: var(--primary);
  color: var(--text-inverse);
}

.search-tab--active:hover {
  background: var(--primary-dark);
  color: var(--text-inverse);
}

.search-form {
  display: flex;
  gap: var(--space-sm);
}

.search-input {
  flex: 1;
  height: 48px;
  padding: 0 var(--space-md);
  font-family: var(--font-korean);
  font-size: 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  height: 48px;
  padding: 0 var(--space-lg);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-inverse);
  background: var(--primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.search-btn--secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-btn--secondary:hover {
  background: var(--border-light);
}

/* Quick links under search */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.875rem;
}

.quick-link {
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.quick-link:hover {
  background: var(--primary);
  color: var(--text-inverse);
  text-decoration: none;
}

/* ==================== APP PROMO BANNER ==================== */
.app-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-inverse);
  padding: var(--space-lg) 0;
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.4, 0, 0.8, 0.2),
              filter 650ms ease, max-height 700ms ease, padding 700ms ease;
}

.app-banner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.app-banner h2 {
  color: var(--text-inverse);
  font-size: 1.25rem;
  margin: 0;
}

.app-banner p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.9375rem;
}

.app-badges {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.app-badge {
  display: block;
  transition: transform var(--transition-fast);
}

.app-badge:hover {
  transform: translateY(-2px);
}

.app-badge img {
  height: 40px;
  width: auto;
}

/* Google Play badge has built-in padding, so we crop it */
.app-badge--google img {
  height: 59px;
  margin: -9px -10px;
}

.app-banner.banner--dismissing {
  opacity: 0;
  transform: translateY(90px) scale(0.96);
  filter: blur(10px) saturate(0.4);
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* ==================== ANNOUNCEMENT BANNER ==================== */
.announcement-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  transition: opacity 420ms ease, transform 420ms cubic-bezier(0.65, 0, 0.35, 1),
              clip-path 420ms ease, filter 420ms ease, max-height 500ms ease,
              padding 500ms ease;
}

.announcement-banner .container {
  position: relative;
}

.announcement-banner p {
  margin: 0;
  font-size: var(--font-sm);
  font-weight: 500;
}

.announcement-banner a {
  color: #fef08a;
  text-decoration: underline;
  font-weight: 600;
}

.announcement-banner a:hover {
  color: #fef9c3;
}

.announcement-banner.banner--dismissing {
  opacity: 0;
  transform: translateY(-18px);
  clip-path: inset(0 50% 0 50%);
  filter: brightness(1.8) blur(4px);
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.banner-close {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-full);
  color: white;
  background: rgba(0, 0, 0, 0.14);
  font: 400 1.4rem/1 var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.banner-close:hover,
.banner-close:focus-visible {
  background: rgba(0, 0, 0, 0.3);
  border-color: white;
  transform: rotate(8deg) scale(1.08);
  outline: none;
}

.banner-close--support {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.banner-close--support:hover,
.banner-close--support:focus-visible {
  transform: translateY(-50%) rotate(8deg) scale(1.08);
}

.banner-close--app {
  top: var(--space-sm);
  right: var(--space-md);
}

.banner-particle {
  position: fixed;
  z-index: 1000;
  border-radius: 2px;
  pointer-events: none;
  animation: banner-particle-fall 700ms cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

@keyframes banner-particle-fall {
  0% { opacity: 0.9; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) rotate(240deg) scale(0.25); }
}

.app-banner-acknowledged .app-banner,
.support-banner-acknowledged .announcement-banner {
  display: none;
}

@media (max-width: 639px) {
  .announcement-banner p {
    padding-right: 32px;
  }

  .banner-close--support {
    right: var(--space-xs);
  }

  .app-banner-content {
    padding-right: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-banner,
  .announcement-banner {
    transition-duration: 1ms;
  }

  .banner-particle {
    display: none;
  }

  .acknowledged-promo-face {
    transition: none;
  }
}

/* Compact reminders shown after the large banners have been acknowledged */
.acknowledged-promos {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 900;
  max-width: min(520px, calc(100vw - (2 * var(--space-md))));
  padding: 10px 14px;
  border: 1px solid rgba(147, 197, 253, 0.45);
  border-radius: var(--radius-md);
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  backdrop-filter: blur(10px);
  perspective: 700px;
}

.acknowledged-promos[hidden] {
  display: none;
}

.acknowledged-promo-face {
  transform: rotateX(0deg) scale(1);
  transform-origin: center center -18px;
  opacity: 1;
  transition: transform 240ms cubic-bezier(0.55, 0, 0.8, 0.2), opacity 180ms ease;
  backface-visibility: hidden;
}

.acknowledged-promo-face--swapping {
  transform: rotateX(90deg) scale(0.94);
  opacity: 0;
}

.acknowledged-promo-actions {
  margin-left: 10px;
  white-space: nowrap;
}

.acknowledged-promo-actions:empty {
  display: none;
}

.acknowledged-promo-actions a {
  color: #fef08a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.acknowledged-promo-actions a:hover,
.acknowledged-promo-actions a:focus-visible {
  color: white;
}

@media (max-width: 639px) {
  .acknowledged-promos {
    right: var(--space-sm);
    bottom: var(--space-sm);
    max-width: calc(100vw - (2 * var(--space-sm)));
  }
}

/* ==================== MAIN CONTENT ==================== */
.content-section {
  padding: var(--space-lg) 0;
}

/* Verb Info Card */
.verb-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.verb-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-inverse);
  padding: var(--space-lg);
}

.verb-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.verb-title {
  display: inline-block;
  font-family: var(--font-korean);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
}

.verb-audio-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.verb-audio-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.1);
}

.verb-type {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.verb-type-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-inverse);
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.verb-type-help:hover {
  background: rgba(255,255,255,0.5);
  text-decoration: none;
  transform: scale(1.1);
}

.verb-body {
  padding: var(--space-lg);
}

.verb-definition {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.verb-definition:last-child {
  margin-bottom: 0;
}

.verb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.verb-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
}

.verb-tag--warning {
  background: #fef3cd;
  color: #856404;
}

/* Conjugation Table */
.conjugation-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.conjugation-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.conjugation-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.conjugation-table {
  width: 100%;
  border-collapse: collapse;
}

.conjugation-table th {
  padding: var(--space-md);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-light);
}

.conjugation-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.conjugation-row:hover {
  background: var(--bg-secondary);
}

.conjugation-row td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.conjugation-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.conjugation-value {
  font-family: var(--font-korean);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
}


/* Explanation (hidden by default) */
.explanation-row {
  background: var(--bg-secondary);
}

.explanation-row td {
  padding: var(--space-lg);
}

.explanation-content {
  font-size: 0.9375rem;
}

.explanation-content dt {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.explanation-content dd {
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.explanation-content ol {
  margin: 0;
  padding-left: var(--space-lg);
}

.explanation-content li {
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

/* ==================== CONTEXT FILTER ==================== */
.context-filter {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.context-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
  .context-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.context-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.politeness-link {
  font-size: 0.875rem;
  color: var(--primary);
}

/* Dropdown-style context selector */
.context-select-wrapper {
  position: relative;
  max-width: 400px;
  margin-top: var(--space-sm);
}

.context-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.context-select-trigger:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}

.context-select-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.context-select-value {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.context-select-arrow {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-left: var(--space-md);
}

.context-select-trigger[aria-expanded="true"] .context-select-arrow {
  transform: rotate(180deg);
}

.context-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 2px solid var(--primary);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}

.context-select-dropdown--open {
  display: block;
}

.context-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: var(--space-md);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.context-option:last-child {
  border-bottom: none;
}

.context-option:hover {
  background: var(--bg-secondary);
}

.context-option--selected {
  background: rgba(26, 115, 232, 0.1);
}

.context-option--selected:hover {
  background: rgba(26, 115, 232, 0.15);
}

.context-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.context-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==================== CONJUGATION GRID ==================== */
.conjugation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.tense-title {
  font-size: 1.125rem;
  margin: 0;
  color: var(--text-primary);
}

.tense-korean {
  font-family: var(--font-korean);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.conjugation-grid {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg);
  grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
  .conjugation-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.conjugation-card {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-light);
}

.conjugation-audio-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.conjugation-audio-btn:hover {
  background: var(--primary);
  opacity: 1;
  transform: scale(1.1);
}

.conjugation-card:hover .conjugation-audio-btn {
  opacity: 1;
}

.conjugation-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.conjugation-level {
  margin-bottom: var(--space-sm);
}

.level-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
}

.level-badge--formal-high {
  background: #4f46e5;
  color: white;
}

.level-badge--formal-low {
  background: #7c3aed;
  color: white;
}

.level-badge--informal-high {
  background: #059669;
  color: white;
}

.level-badge--informal-low {
  background: #d97706;
  color: white;
}

.conjugation-main {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.conjugation-card .conjugation-value {
  font-family: var(--font-korean);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}


.conjugation-card .conjugation-name {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.expand-indicator {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.1em;
  line-height: 1;
}

.conjugation-card:hover .expand-indicator {
  opacity: 0.8;
}

.conjugation-card:has(.conjugation-explanation:not(.hidden)) .expand-indicator {
  display: none;
}

.conjugation-explanation {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.conjugation-explanation dt {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.conjugation-explanation dd {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.conjugation-reasons {
  margin: 0;
  padding-left: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.conjugation-reasons li {
  margin-bottom: var(--space-xs);
}

/* ==================== PRONUNCIATION PAGE ==================== */
.pronunciation-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--text-inverse);
  padding: var(--space-2xl) 0;
  text-align: center;
}

.pronunciation-hero h1 {
  color: var(--text-inverse);
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
}

.pronunciation-word {
  font-family: var(--font-korean);
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.pronunciation-play {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--text-inverse);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pronunciation-play:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Pronunciation breakdown */
.pronunciation-breakdown {
  padding: var(--space-xl) 0;
}

.breakdown-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 80px;
}

.breakdown-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.breakdown-char {
  font-family: var(--font-korean);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.breakdown-icon {
  font-size: 1.25rem;
  margin-top: var(--space-xs);
}

/* Alphabet grid */
.alphabet-section {
  padding: var(--space-xl) 0;
  background: var(--bg-primary);
}

.alphabet-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: var(--space-sm);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.alphabet-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-family: var(--font-korean);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.alphabet-item:hover {
  background: var(--primary);
  color: var(--text-inverse);
  text-decoration: none;
  transform: scale(1.1);
}

.alphabet-item:active {
  transform: scale(0.95);
}

/* ==================== SEARCH RESULTS ==================== */
.results-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.results-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.results-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.results-list {
  list-style: none;
}

.result-item {
  display: block;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.result-verb {
  font-family: var(--font-korean);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: var(--space-xs);
}

.result-definition {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.footer-main {
  display: grid;
  gap: var(--space-xl);
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-family: var(--font-korean);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  margin: 0;
}

.footer-apps h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--text-inverse);
}

.footer-badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
}

.footer-badge {
  display: block;
  transition: transform var(--transition-fast);
}

.footer-badge:hover {
  transform: scale(1.05);
}

.footer-badge img {
  height: 40px;
  width: auto;
}

.footer-badge--google img {
  height: 59px;
  margin: -9px -10px;
}

.footer-links h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--text-inverse);
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  display: block;
  padding: var(--space-xs) 0;
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-inverse);
}

.footer-bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

.footer-bottom a {
  color: rgba(255,255,255,0.7);
}

/* ==================== ABOUT PAGE ==================== */
.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.about-header {
  margin-bottom: var(--space-xl);
}

.about-header h1 {
  font-size: 2rem;
}

.about-section {
  margin-bottom: var(--space-xl);
}

.about-section h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--primary);
}

.about-section p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.about-section ul {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
  list-style: disc;
}

.about-section li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.about-app-badges {
  margin-top: var(--space-md);
}

.about-timeline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-lg);
  margin: 0;
}

.about-timeline dt {
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.about-timeline dd {
  margin: 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}

.about-timeline dd:last-of-type {
  border-bottom: none;
}

/* ==================== TOP 100 VERBS ==================== */
.verb-list-section {
  margin-top: var(--space-xl);
}

.verb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .verb-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.verb-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-light);
}

.verb-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.verb-number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
}

.verb-korean {
  font-family: var(--font-korean);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 80px;
}

.verb-meaning {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex: 1;
}

/* ==================== PRONUNCIATION RULES ==================== */
.pronunciation-rule {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.pronunciation-rule:last-of-type {
  border-bottom: none;
}

.rule-title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.rule-name {
  font-size: 1.25rem;
  color: var(--primary);
}

.rule-korean {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.rule-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.sub-rule {
  margin-top: var(--space-lg);
  margin-left: var(--space-md);
  padding-left: var(--space-md);
  border-left: 3px solid var(--border-light);
}

.sub-rule-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-korean);
  margin-bottom: var(--space-sm);
}

.pronunciation-examples {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pronunciation-example {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.example-written,
.example-pronounced {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.example-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.example-value {
  font-family: var(--font-korean);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.example-written .example-value {
  color: var(--text-secondary);
}

.example-pronounced .example-value {
  color: var(--primary);
}

.example-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 0 var(--space-xs);
}

.example-meaning {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-left: auto;
  font-style: italic;
}

.example-audio-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.example-audio-btn:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}

@media (max-width: 639px) {
  .pronunciation-example {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .example-arrow {
    display: none;
  }

  .example-meaning {
    margin-left: 0;
    margin-top: var(--space-xs);
  }
}

/* ==================== GUIDE PAGES ==================== */
.library {
  padding: var(--space-lg) 0 var(--space-3xl);
}

.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-xl);
  align-items: center;
  min-height: 330px;
  padding: clamp(28px, 6vw, 72px);
  overflow: hidden;
  color: #f8fbff;
  background: #102a43;
  border-radius: var(--radius-xl);
}

.library-hero::before {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  right: -130px;
  top: -190px;
  border: 70px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
}

.library-hero-copy { position: relative; z-index: 1; max-width: 720px; }
.library-eyebrow,
.library-section-kicker {
  margin: 0 0 var(--space-sm);
  color: #ef8354;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.library-hero h1 {
  max-width: 650px;
  margin-bottom: var(--space-md);
  color: #fff;
  font-size: clamp(2.3rem, 6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.library-intro {
  max-width: 620px;
  color: #c9d8e7;
  font-size: 1.075rem;
  line-height: 1.7;
}

.library-stats { display: flex; flex-wrap: wrap; gap: var(--space-lg); color: #a8bfd2; font-size: 0.875rem; }
.library-stats strong { color: #fff; font-size: 1.1rem; }
.library-hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(130px, 18vw, 210px);
  aspect-ratio: 1;
  color: #102a43;
  background: #f1c75b;
  border-radius: 42% 58% 55% 45%;
  transform: rotate(5deg);
  box-shadow: 18px 18px 0 rgba(239, 131, 84, 0.9);
}
.library-hero-mark span { font-family: var(--font-korean); font-size: clamp(4rem, 10vw, 7rem); font-weight: 800; line-height: 1; transform: rotate(-5deg); }
.library-hero-mark small { position: absolute; right: 20%; bottom: 11%; font-size: 1rem; font-weight: 800; }

.library-toolbar { margin: var(--space-xl) 0 var(--space-2xl); }
.library-search-label { display: block; margin-bottom: var(--space-sm); font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.library-search-wrap { position: relative; }
.library-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.5rem; }
.library-search {
  width: 100%;
  height: 58px;
  padding: 0 20px 0 52px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font: 500 1rem var(--font-sans);
}
.library-search:focus { outline: 3px solid rgba(26, 115, 232, 0.16); border-color: var(--primary); }
.library-filters { display: flex; gap: var(--space-sm); margin-top: var(--space-md); overflow-x: auto; padding-bottom: 2px; }
.library-filter {
  padding: 9px 15px;
  white-space: nowrap;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font: 700 0.8rem var(--font-sans);
  cursor: pointer;
}
.library-filter:hover, .library-filter--active { color: #fff; background: #102a43; border-color: #102a43; }
.library-featured, .library-catalog { margin-top: var(--space-2xl); }
.library-section-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); }
.library-section-heading h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
.library-section-link { font-size: 0.875rem; font-weight: 700; }
.library-result-count { color: var(--text-muted); font-size: 0.875rem; }
.library-feature-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-md); }
.library-feature-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: var(--space-lg);
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.library-feature-card--primary { color: #fff; background: #1a5f55; border-color: #1a5f55; }
.library-feature-card:hover, .guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); text-decoration: none; }
.library-card-number { align-self: end; color: var(--text-muted); font-size: 0.75rem; font-weight: 800; }
.library-feature-card--primary .library-card-number { color: #9cc8bf; }
.library-card-tag { color: #c4572d; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.library-feature-card--primary .library-card-tag { color: #f1c75b; }
.library-feature-card h3 { margin: var(--space-sm) 0; font-size: 1.35rem; }
.library-feature-card--primary h3 { color: #fff; font-size: 1.8rem; }
.library-feature-card p { color: var(--text-secondary); line-height: 1.6; }
.library-feature-card--primary p { color: #c5ded8; }
.library-card-action { margin-top: auto; font-size: 0.875rem; font-weight: 800; }
.library-feature-card--primary .library-card-action { color: #fff; }
.guide-card-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); }
.guide-card-arrow { color: var(--text-muted); font-size: 1.1rem; }
.library-empty { padding: var(--space-2xl); text-align: center; color: var(--text-secondary); background: #fff; border-radius: var(--radius-lg); }
[data-library-card][hidden] { display: none !important; }

@media (max-width: 800px) {
  .library-hero { grid-template-columns: 1fr; min-height: auto; }
  .library-hero-mark { display: none; }
  .library-feature-grid { grid-template-columns: 1fr; }
  .library-feature-card { min-height: 230px; }
}

.guide-section {
  padding: var(--space-xl) 0;
}

.guide-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.guide-header h1 {
  margin-bottom: var(--space-md);
}

.guide-intro {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.guide-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
  .guide-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.guide-card {
  display: block;
  padding: var(--space-lg);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-top: 3px solid #ef8354;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.guide-card-title {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.guide-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.guide-card-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.guide-example {
  font-family: var(--font-korean);
  font-size: 0.875rem;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  color: var(--text-primary);
}

/* Individual Guide Article */
.guide-article {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.guide-article-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-inverse);
  padding: var(--space-xl);
}

.guide-article-header h1 {
  color: var(--text-inverse);
  margin-bottom: var(--space-sm);
}

.guide-article-desc {
  opacity: 0.9;
  margin: 0;
}

.guide-article-body {
  padding: var(--space-lg);
}

.guide-content-section {
  margin-bottom: var(--space-xl);
}

.guide-content-section:last-child {
  margin-bottom: 0;
}

.guide-content-section h2 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--space-md);
}

.guide-content-section p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-list li {
  font-family: var(--font-korean);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.guide-list li:last-child {
  margin-bottom: 0;
}


.guide-nav {
  background: var(--bg-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.guide-nav h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.guide-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.guide-nav-link {
  font-size: 0.875rem;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.guide-nav-link:hover {
  background: var(--primary);
  color: var(--text-inverse);
  text-decoration: none;
}

.guide-internal-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--primary);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.guide-internal-link:hover {
  background: var(--primary-dark);
  color: var(--text-inverse);
  text-decoration: none;
  transform: translateX(4px);
}

.guide-verb-link {
  display: inline;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-korean);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.guide-verb-link:hover {
  background: var(--primary);
  color: var(--text-inverse);
  text-decoration: none;
}

/* ==================== VOWEL CHART ==================== */
.vowel-chart-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.vowel-chart-title {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.vowel-chart-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.vowel-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.vowel-row-single {
  justify-content: flex-start;
}

.vowel-arrow {
  font-family: var(--font-korean);
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0 var(--space-xs);
}

.vowel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 70px;
}

.vowel-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.vowel-btn:active {
  transform: scale(0.95);
}

.vowel-char {
  font-family: var(--font-korean);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.vowel-sound {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Vowel type colors */
.vowel-bright {
  border-color: #f59e0b;
}

.vowel-bright:hover {
  background: #fef3c7;
  border-color: #d97706;
}

.vowel-bright .vowel-char {
  color: #d97706;
}

.vowel-dark {
  border-color: #6366f1;
}

.vowel-dark:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}

.vowel-dark .vowel-char {
  color: #4f46e5;
}

.vowel-neutral {
  border-color: #10b981;
}

.vowel-neutral:hover {
  background: #ecfdf5;
  border-color: #059669;
}

.vowel-neutral .vowel-char {
  color: #059669;
}

.vowel-compound {
  border-color: #ec4899;
}

.vowel-compound:hover {
  background: #fdf2f8;
  border-color: #db2777;
}

.vowel-compound .vowel-char {
  color: #db2777;
}

/* ==================== UTILITY CLASSES ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Warning/Info boxes */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.alert--warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.alert a {
  font-weight: 600;
}

/* Label styles */
.label-danger {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: #dc3545;
  color: white;
  border-radius: var(--radius-full);
}

.micro {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */

/* Tablet (640px+) */
@media (min-width: 640px) {
  :root {
    font-size: 17px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }

  .app-banner-content {
    flex-direction: row;
    text-align: left;
  }

  .app-banner-content > div:first-child {
    flex: 1;
  }

  .footer-main {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .pronunciation-word {
    font-size: 5rem;
  }

  .verb-title {
    font-size: 3rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  :root {
    font-size: 18px;
  }

  h1 { font-size: 2.25rem; }

  .container {
    padding: 0 var(--space-xl);
  }

  .content-section {
    padding: var(--space-xl) 0;
  }

  .pronunciation-word {
    font-size: 6rem;
  }

  .verb-title {
    font-size: 3.5rem;
  }

  .conjugation-value {
    font-size: 1.5rem;
  }

  .breakdown-item {
    min-width: 100px;
    padding: var(--space-lg);
  }

  .breakdown-char {
    font-size: 2.5rem;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .container {
    max-width: 1400px;
  }
}

/* ==================== GAMES ==================== */

/* Games Index Page */
.games-page {
  padding: var(--space-lg) 0;
}

.games-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.games-header h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.games-header p {
  color: var(--text-secondary);
  margin: 0;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.game-card {
  display: block;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  text-align: center;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.game-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--primary);
}

.game-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.game-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.game-play {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Choseong Game */
.choseong-game {
  padding: var(--space-lg) 0;
  max-width: 600px;
  margin: 0 auto;
}

.game-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.game-header h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.game-instructions {
  color: var(--text-secondary);
  margin: 0;
}

/* Language Toggle */
.language-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.toggle-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.toggle-buttons {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-full);
}

.toggle-btn {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn--active {
  background: var(--bg-primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Mode Toggle (Korean/Hanja) */
.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.mode-btn {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn--active {
  background: var(--bg-primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Hanja Display in Choseong Game */
.hanja-row {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.hanja-char {
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 70px;
  text-align: center;
}

.korean-row {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Game Area */
.game-area {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.score-display {
  text-align: center;
  margin-bottom: var(--space-lg);
  font-size: 1.1rem;
}

.score-label {
  color: var(--text-secondary);
  margin-right: var(--space-xs);
}

.score-value {
  font-weight: 700;
  color: var(--primary);
}

.score-separator {
  color: var(--text-muted);
  margin: 0 var(--space-xs);
}

.score-total {
  font-weight: 600;
}

/* Question Card */
.question-card {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.choseong-display {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.choseong-char {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-secondary);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-family: var(--font-korean);
}

.definition-display {
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.definition-english {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.definition-korean {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  font-family: var(--font-korean);
}

/* Choices Grid */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.choice-btn {
  padding: var(--space-lg);
  border: 2px solid var(--border-light);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.5rem;
  font-family: var(--font-korean);
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(26, 115, 232, 0.05);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn--correct {
  border-color: var(--accent) !important;
  background: rgba(0, 200, 150, 0.1) !important;
  color: #00a67e;
}

.choice-btn--wrong {
  border-color: #dc3545 !important;
  background: rgba(220, 53, 69, 0.1) !important;
  color: #dc3545;
}

/* Feedback */
.feedback {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  min-height: 50px;
}

.feedback--correct {
  background: rgba(0, 200, 150, 0.1);
  color: #00a67e;
}

.feedback--wrong {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.feedback-correct {
  font-weight: 600;
}

.feedback-wrong {
  font-weight: 600;
}

/* Next Button */
.next-btn {
  display: block;
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.next-btn:hover {
  background: var(--primary-dark);
}

/* Game Over */
.game-over {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.game-over h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.final-score {
  font-size: 1.25rem;
  margin-bottom: var(--space-xl);
}

.play-again-btn {
  padding: var(--space-md) var(--space-2xl);
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.play-again-btn:hover {
  background: var(--secondary-dark);
}

/* Answer Slots */
.answer-slots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.answer-slot {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-secondary);
  min-width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-family: var(--font-korean);
  border: 3px solid transparent;
  transition: all var(--transition-fast);
}

.answer-slot--active {
  border-color: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { border-color: var(--primary); }
  50% { border-color: transparent; }
}

.answer-slot--filled {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.answer-slot--correct {
  border-color: var(--accent) !important;
  background: rgba(0, 200, 150, 0.15) !important;
  color: #00a67e;
}

.answer-slot--wrong {
  border-color: #dc3545 !important;
  background: rgba(220, 53, 69, 0.15) !important;
  color: #dc3545;
}

/* Leftover Syllables */
.leftover-syllables {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.leftover-btn {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-family: var(--font-korean);
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.leftover-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(26, 115, 232, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.leftover-btn:active:not(:disabled) {
  transform: translateY(0);
}

.leftover-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Game Buttons Container */
.game-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* Reset Button */
.reset-btn {
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reset-btn:hover {
  border-color: var(--text-secondary);
  background: var(--bg-tertiary);
}

/* Skip Button */
.skip-btn {
  padding: var(--space-md) var(--space-xl);
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.skip-btn:hover {
  background: #d97706;
}

/* Mobile adjustments for games */
@media (max-width: 480px) {
  .choseong-char {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
  }

  .answer-slot {
    font-size: 2rem;
    min-width: 55px;
    height: 55px;
  }

  .hanja-char {
    font-size: 1.8rem;
    min-width: 55px;
  }

  .leftover-btn {
    font-size: 1.5rem;
    min-width: 50px;
    height: 50px;
  }

  .choice-btn {
    padding: var(--space-md);
    font-size: 1.25rem;
  }

  .game-area {
    padding: var(--space-lg);
  }

  .game-buttons {
    flex-direction: column;
  }

  .reset-btn, .skip-btn, .next-btn {
    width: 100%;
  }
}

/* ==================== PRINT ==================== */
@media print {
  .header, .app-banner, .footer, .search-section {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .verb-card, .conjugation-section, .results-section {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .hidden {
    display: table-row !important;
  }
}
