

html {
  background-color: #02101d !important;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #02101d !important;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


* {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-sizing: border-box;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}


#root {
  min-height: 100vh;
  background-color: #02101d;
}

.app {
  min-height: 100vh;
  background-color: #02101d;
}



html {
  background-color: #02101d !important;
}

body {
  background-color: #02101d !important;
}


* {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}


:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #141922;
  --bg-tertiary: #1c2430;
  --bg-card: #161d29;
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-tertiary: #a5b4fc;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #a5b4fc 100%);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --border-subtle: #1e293b;
  --border-focus: #475569;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-intense: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 0.15s ease-out;
  --transition-smooth: 0.2s ease-out;
  --transition-bounce: 0.3s ease-out;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
}


.theme-bright {
  --bg-primary: #fafbfc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: #ffffff;
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-tertiary: #a5b4fc;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #a5b4fc 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --border-subtle: #e2e8f0;
  --border-focus: #cbd5e1;
  --shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-elevated: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-intense: 0 16px 48px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: #0a0e14;
  background: var(--bg-primary);
  color: #f8fafc;
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.app-header {
  background: #141922;
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  padding: 24px 0 20px 0;
  display: flex;
  justify-content: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

.theme-bright .app-header {
  background: #161d29;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding-right: 32px;
}

@media (max-width: 768px) {
  .header-content {
    padding-right: 12px;
  }
}

.app-logo {
  height: 52px;
  width: 52px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
  background: #161d29;
  background: var(--bg-card);
  object-fit: cover;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  color: #6366f1;
  color: var(--accent-primary);
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 1;
}

.theme-toggle {
  background: #1c2430;
  background: var(--bg-tertiary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #818cf8;
  color: var(--accent-secondary);
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
}

.theme-toggle:hover {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.theme-toggle span {
  display: block;
}

.app {
  min-height: 100vh;
  background: #0a0e14;
  background: var(--bg-primary);
  position: relative;
}


.flashcard,
.view-button,
.nav-button {
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

.sticky-top-panel {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0e14;
  background: var(--bg-primary);
  padding-bottom: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-controls {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 24px 16px;
}

.view-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
  margin-top: 8px;
}

.view-button {
  flex: 1 1;
  padding: 15px 0;
  background: #161d29;
  background: var(--bg-card);
  color: #cbd5e1;
  color: var(--text-secondary);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
          user-select: none;
}

.view-button.active {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.view-button:hover:not(.active) {
  background: #1c2430;
  background: var(--bg-tertiary);
  color: #f8fafc;
  color: var(--text-primary);
  border-color: #475569;
  border-color: var(--border-focus);
}

.view-button:active {
  transform: scale(0.98);
}

.vocabulary-title-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 8px;
  min-height: 56px;
}

.vocabulary-title {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0;
  margin-right: 0;
  white-space: nowrap;
  text-align: center;
}

.level-selector {
  background: #1c2430;
  background: var(--bg-tertiary);
  color: #f8fafc;
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 10px 22px;
  border-radius: 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
  height: 42px;
  min-width: 120px;
  margin: 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
}

.level-selector:hover {
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.level-selector:focus {
  border-color: #6366f1;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.scroll-top-toggle {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border: 1px solid #6366f1;
  border: 1px solid var(--accent-primary);
  padding: 10px 22px;
  border-radius: 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
}

.scroll-top-toggle:hover {
  background: #818cf8;
  background: var(--accent-secondary);
  transform: translateY(-1px);
}


.app-main {
  position: relative;
  z-index: 1;
  padding-top: 0;
}


.app-header {
  padding: 16px 24px;
  padding: var(--spacing-md) var(--spacing-lg);
  transition: all 0.2s ease-out;
  transition: all var(--transition-smooth);
  
}

.header-content {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
  gap: var(--spacing-md);
}

.app-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.app-title {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: 1 1;
}

.theme-toggle {
  background: #1c2430;
  background: var(--bg-tertiary);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 16px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-out;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: #161d29;
  background: var(--bg-card);
  border-color: #475569;
  border-color: var(--border-focus);
  transform: translateY(-1px);
}


.app-controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  padding: var(--spacing-lg);
  padding-top: 0;
  padding-bottom: 0;
}


.view-toggle {
  display: flex;
  gap: 4px;
  gap: var(--spacing-xs);
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  margin-bottom: var(--spacing-lg);
}

.view-button {
  flex: 1 1;
  padding: 16px 24px;
  padding: var(--spacing-md) var(--spacing-lg);
  background: #161d29;
  background: var(--bg-card);
  color: #cbd5e1;
  color: var(--text-secondary);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease-out;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.view-button:hover {
  background: #1c2430;
  background: var(--bg-tertiary);
  border-color: #475569;
  border-color: var(--border-focus);
  color: #f8fafc;
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow-elevated);
}

.view-button.active {
  background: linear-gradient(135deg,
      #6366f1,
      #818cf8);
  background: linear-gradient(135deg,
      var(--accent-primary),
      var(--accent-secondary));
  color: white;
  border-color: #6366f1;
  border-color: var(--accent-primary);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  box-shadow: var(--shadow-intense);
}


.flashcard-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  padding: var(--spacing-lg);
  position: relative;
  z-index: 1;
}


.settings-panel {
  background: #161d29;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 18px;
  border-radius: var(--radius-lg);
  padding: 32px;
  padding: var(--spacing-xl);
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  max-width: none;
  width: 100%;
  transition: max-height 0.25s ease-out, padding 0.25s ease-out;
  max-height: 500px;
  overflow: hidden;
  position: relative;
}

.settings-panel.collapsed {
  max-height: 72px;
  padding: 16px 32px;
  padding: var(--spacing-md) var(--spacing-xl);
  margin-top: 0;
}

.theme-bright .settings-panel {
  background: #161d29;
  background: var(--bg-card);
  border-color: rgba(99, 102, 241, 0.12);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 24px;
  margin-bottom: var(--spacing-lg);
  padding: 0 8px;
  padding: 0 var(--spacing-sm);
  
  transition: margin-bottom 0.2s ease-out;
  
  transition: margin-bottom var(--transition-smooth);
}

.settings-panel.collapsed .settings-header {
  margin-bottom: 0;
}

.settings-title-text {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  color: var(--text-primary);
  margin: 0;
}

.settings-toggle-button {
  background: none;
  border: none;
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: transform 0.15s ease-out;
  transition: transform var(--transition-fast);
}

.settings-header:hover .settings-toggle-button {
  color: #f8fafc;
  color: var(--text-primary);
  transform: scale(1.1);
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  gap: var(--spacing-lg);
  
  transition: opacity 0.2s ease-out;
}

.settings-panel.collapsed .settings-content {
  opacity: 0;
  pointer-events: none;
  
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 24px;
  gap: var(--spacing-lg);
  margin-bottom: 16px;
  margin-bottom: var(--spacing-md);
}

.top-row {
  justify-content: space-between;
}

.action-row {
  justify-content: flex-start;
  gap: 16px;
  gap: var(--spacing-md);
}

.jlpt-right {
  margin-left: auto;
}

.level-dropdown {
  background: #1c2430;
  background: var(--bg-tertiary);
  color: #f8fafc;
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 8px 16px;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
  width: auto;
  min-width: 120px;
}

.level-dropdown:focus {
  border-color: #6366f1;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 16px;
  gap: var(--spacing-md);
  cursor: pointer;
  -webkit-user-select: none;
          user-select: none;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  width: 48px;
  height: 26px;
  background: #1c2430;
  background: var(--bg-tertiary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #cbd5e1;
  background: var(--text-secondary);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-switch {
  background: #6366f1;
  background: var(--accent-primary);
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.toggle-input:checked+.toggle-switch::before {
  transform: translateX(22px);
  background: #fff;
}

.toggle-text {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.shuffle-button,
.reset-button {
  background: #141922;
  background: var(--bg-secondary);
  color: #f8fafc;
  color: var(--text-primary);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
  padding: 8px 24px;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-out;
  transition: all var(--transition-smooth);
  position: static;
  flex: 1 1;
}

.shuffle-button:hover,
.reset-button:hover {
  background: #1c2430;
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.shuffle-button.active {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.settings-row:last-child {
  margin-bottom: 0;
}


.flashcard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  gap: var(--spacing-2xl);
  padding-top: 24px;
  padding-top: var(--spacing-lg);
  perspective: 1000px;
}

.flashcard {
  background: #161d29;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 24px;
  border-radius: var(--radius-xl);
  padding: 52px 36px;
  width: 100%;
  max-width: 720px;
  min-height: 420px;
  height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow-elevated);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

@media (max-width: 768px) {
  .flashcard {
    padding: 24px 16px;
    min-height: 280px;
    height: 280px;
    max-width: 100%;
  }
}

.theme-bright .flashcard {
  background: #161d29;
  background: var(--bg-card);
  border-color: rgba(99, 102, 241, 0.12);
}

.flashcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  box-shadow: var(--shadow-intense);
}

.theme-bright .flashcard:hover {
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

.flashcard-animate {
  animation: flashcardFadeIn 0.3s ease-out;
}

@keyframes flashcardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-number {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #6366f1;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 700;
  background: #1c2430;
  background: var(--bg-tertiary);
  padding: 8px 18px;
  border-radius: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  letter-spacing: 0.02em;
}

.card-number:hover {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  transform: scale(1.05);
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.card-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  text-align: center;
  z-index: 1;
  flex-grow: 1;
  width: 100%;
}



.kanji-display {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: clamp(1.5rem, 8vw, 4.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-align: center;
  overflow: visible;
  text-overflow: initial;
  max-width: 100%;
  display: inline-block;
  transform-origin: center;
}

.hiragana-display {
  color: #a5b4fc;
  color: var(--accent-tertiary);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0.9;
}

.card-details {
  width: 100%;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1.5px solid #1e293b;
  border-top: 1.5px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 24px;
}

.meaning-display,
.romaji-display {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
  margin-top: 0;
  flex: 1 1;
  text-align: center;
}

.level-display {
  position: absolute;
  bottom: 24px;
  color: #6366f1;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.navigation {
  display: flex;
  gap: 24px;
  gap: var(--spacing-lg);
}

.nav-button {
  width: 60px;
  height: 60px;
  background: #1c2430;
  background: var(--bg-tertiary);
  color: #818cf8;
  color: var(--accent-secondary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
          user-select: none;
}

.nav-button:hover:not(:disabled) {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border-color: #6366f1;
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.nav-button:active:not(:disabled) {
  transform: scale(0.98);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.progress-display {
  text-align: center;
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  margin-top: 24px;
  margin-top: var(--spacing-lg);
}

.progress-display em {
  color: #6366f1;
  color: var(--accent-primary);
  font-style: italic;
  font-weight: 600;
}


.vocabulary-list-container {
  max-width: 1200px;
  margin: 20px auto 0 auto;
  padding: 36px 20px 52px 20px;
  position: relative;
  z-index: 1;
  max-height: 70vh;
  overflow-y: auto;
  background: #161d29;
  background: var(--bg-card);
  border-radius: 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(99, 102, 241, 0.15);
}




.vocabulary-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.vocabulary-title-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 8px;
  min-height: 56px;
}

.vocabulary-title {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  display: flex;
  align-items: center;
}

.level-selector,
.scroll-top-toggle {
  margin: 0;
  align-self: center;
}

.vocabulary-cards {
  display: grid;
  grid-gap: 18px;
  gap: 18px;
  align-items: start;
}


.vocabulary-item {
  background: #161d29;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 18px;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: grid;
  grid-template-columns: auto 1.2fr 1.5fr auto;
  align-items: center;
  grid-gap: 20px;
  gap: 20px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  align-items: start;
  border-left: 3px solid transparent;
}

.vocabulary-item:hover {
  background: #1c2430;
  background: var(--bg-tertiary);
  border-color: rgba(99, 102, 241, 0.3);
  border-left-color: #6366f1;
  border-left-color: var(--accent-primary);
  transform: translateY(-2px);
}

.vocabulary-item.highlighted {
  border-color: #6366f1;
  border-color: var(--accent-primary);
  border-left-color: #6366f1;
  border-left-color: var(--accent-primary);
  background: #1c2430;
  background: var(--bg-tertiary);
}

.item-number {
  color: #6366f1;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.japanese-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kanji-text {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.hiragana-text {
  color: #818cf8;
  color: var(--accent-secondary);
  font-size: 15px;
  font-weight: 500;
  min-height: 1.2em;
}

.details-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meaning-text {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
}

.romaji-text {
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}

.level-badge {
  color: #6366f1;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  justify-self: end;
}

.no-cards {
  text-align: center;
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 40px;
}


*:focus {
  outline: 2px solid #6366f1;
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}


.ad-container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

.ad-placeholder {
  background: #1c2430;
  background: var(--bg-tertiary);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: 18px;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  max-width: 728px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.6;
  transition: all 0.2s ease-out;
  transition: all var(--transition-smooth);
}

.ad-placeholder:hover {
  opacity: 0.8;
  border-color: rgba(99, 102, 241, 0.3);
}


@media (max-width: 768px) {
  .app-title {
    font-size: clamp(14px, 4vw, 18px);
  }

  .app-header {
    padding: 16px 0 12px 0;
  }

  .header-content {
    gap: 12px;
    padding: 0 12px;
  }

  .app-logo {
    height: 40px;
    width: 40px;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .view-toggle {
    gap: 8px;
    margin-bottom: 20px;
  }

  .view-button {
    padding: 12px 8px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  
  .vocabulary-item {
    display: flex;
    grid-template-columns: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 14px;
  }

  
  .level-badge {
    margin-left: auto;
    justify-self: auto;
  }

  .japanese-section {
    min-width: auto;
    width: 100%;
  }

  .kanji-text {
    font-size: 22px;
  }

  .hiragana-text {
    font-size: 14px;
  }

  .meaning-text {
    font-size: 16px;
  }

  .flashcard {
    padding: 20px 16px;
    min-height: 320px;
    height: auto;
    max-width: 100%;
  }

  .card-number {
    top: 16px;
    right: 16px;
    font-size: 13px;
    padding: 5px 12px;
  }

  .card-main {
    gap: 32px;
  }

  .kanji-display {
    font-size: clamp(2rem, 12vw, 3.5rem);
  }

  .hiragana-display {
    font-size: 24px;
  }

  .card-details {
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
  }

  .meaning-display,
  .romaji-display {
    font-size: 16px;
  }

  .level-display {
    bottom: 16px;
    font-size: 12px;
  }

  .nav-button {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .app-controls,
  .vocabulary-list-container,
  .flashcard-view {
    padding-left: 12px;
    padding-right: 12px;
  }

  .settings-row {
    flex-direction: column;
    gap: 12px;
  }

  .settings-panel {
    max-width: 100%;
    padding: 20px 16px;
  }

  .settings-panel.collapsed {
    padding: 12px 16px;
  }

  .vocabulary-list-container {
    max-height: 60vh;
    padding: 20px 12px 32px 12px;
    margin-top: 16px;
  }

  .vocabulary-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .vocabulary-title-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 0;
    min-height: initial;
    padding: 0;
  }

  .vocabulary-title {
    font-size: 22px;
    margin-right: 0;
    margin-bottom: 0;
  }

  .level-selector,
  .scroll-top-toggle {
    width: 100%;
    min-width: 0;
    height: 44px;
    font-size: 15px;
    padding: 8px 12px;
  }

  .ad-container {
    margin: 16px auto;
    padding: 0 12px;
  }

  .ad-placeholder {
    max-width: 320px;
    min-height: 50px;
    padding: 12px;
    font-size: 11px;
  }
}


@media (min-width: 769px) and (max-width: 1024px) {
  .flashcard {
    max-width: 600px;
  }

  .vocabulary-list-container {
    padding: 28px 20px 40px 20px;
  }
}

.context-menu {
  position: fixed;
  z-index: 1000;
  background: #1c2430;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow-elevated);
  padding: 8px;
  padding: var(--spacing-sm);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
}

.context-menu-option {
  background: none;
  border: none;
  color: #f8fafc;
  color: var(--text-primary);
  padding: 8px 16px;
  padding: var(--spacing-sm) var(--spacing-md);
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.context-menu-option:hover {
  background: #6366f1;
  background: var(--accent-primary);
  color: white;
}

.helper-text {
  text-align: center;
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
  margin-bottom: var(--spacing-md);
  margin-top: -8px;
  letter-spacing: 0.01em;
  transition: color 0.2s ease-out;
  transition: color var(--transition-smooth);
}

.helper-text.left-align {
  text-align: center;
  margin: 12px auto 0 auto;
  max-width: 480px;
  font-size: 12px;
  color: #cbd5e1;
  color: var(--text-secondary);
  background: none;
  box-shadow: none;
  line-height: 1.4;
}

.theme-bright .helper-text {
  color: #94a3b8;
  color: var(--text-tertiary);
}

.scroll-top-toggle {
  background: #141922;
  background: var(--bg-secondary);
  color: #f8fafc;
  color: var(--text-primary);
  border: 1px solid #1e293b;
  border: 1px solid var(--border-subtle);
  padding: 8px 20px;
  border-radius: 14px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
  transition: all var(--transition-fast);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  margin: 0;
}

.scroll-top-toggle.active {
  background: #6366f1;
  background: var(--accent-primary);
  color: #fff;
  border-color: #6366f1;
  border-color: var(--accent-primary);
}

.scroll-top-toggle:hover {
  background: #1c2430;
  background: var(--bg-tertiary);
  color: #f8fafc;
  color: var(--text-primary);
  border-color: #475569;
  border-color: var(--border-focus);
}

@media (max-width: 768px) {
  .helper-text.left-align {
    max-width: 100%;
    font-size: 14px;
  }
}

.settings-row-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  justify-content: space-between;
  flex-wrap: wrap;
}

.settings-row-flex .toggle-label {
  flex: 1 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .settings-row-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .settings-row-flex .toggle-label {
    flex: initial;
    min-width: 0;
    justify-content: flex-start;
  }
}

.header-spacer {
  flex: 1 1;
}


.app-footer {
  background: #141922;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  padding: 40px 20px;
  margin-top: 64px;
  text-align: center;
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #a5b4fc 100%);
  background: var(--accent-gradient);
  opacity: 0.3;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #cbd5e1;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease-out;
  transition: all var(--transition-smooth);
  padding: 4px 8px;
  border-radius: 6px;
}

.footer-links a:hover {
  color: #6366f1;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.footer-separator {
  color: #94a3b8;
  color: var(--text-tertiary);
  font-size: 14px;
  opacity: 0.5;
}

.footer-copyright {
  color: #94a3b8;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 400;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .app-footer {
    padding: 24px 16px;
    margin-top: 32px;
  }

  .footer-links {
    gap: 8px;
  }

  .footer-links a {
    font-size: 13px;
  }

  .footer-copyright {
    font-size: 12px;
  }
}


* SEO Content Styles */ .seo-content {
  max-width: 1200px;
  margin: 48px auto;
  padding: 0 20px;
}

.seo-content-wrapper {
  background: #161d29;
  background: var(--bg-card);
  border-radius: 18px;
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.seo-article h1 {
  color: #6366f1;
  color: var(--accent-primary);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.3;
}

.seo-article h2 {
  color: #f8fafc;
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.seo-article p {
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.seo-article ul,
.seo-article ol {
  color: #cbd5e1;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 20px 0;
  padding-left: 32px;
}

.seo-article li {
  margin-bottom: 12px;
}

.seo-article strong {
  color: #f8fafc;
  color: var(--text-primary);
  font-weight: 600;
}

.seo-keywords {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  border-top: 1px solid var(--border-subtle);
  opacity: 0.7;
}

.seo-keywords p {
  font-size: 0.9rem;
  color: #94a3b8;
  color: var(--text-tertiary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .seo-content {
    margin: 32px auto;
    padding: 0 12px;
  }

  .seo-content-wrapper {
    padding: 28px 20px;
  }

  .seo-article h1 {
    font-size: 1.6rem;
  }

  .seo-article h2 {
    font-size: 1.3rem;
    margin-top: 32px;
  }

  .seo-article p,
  .seo-article ul,
  .seo-article ol {
    font-size: 1rem;
  }
}

