/* ══════════════════════════════════════════════════════════════════════════
   VOCABULARY TRACKER — ZEN PASTEL & MATTE CHARCOAL DESIGN SYSTEM
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Light Mode: Light grey with a serene purplish / lavender hue */
  --bg-main: #f3f2f7;
  --bg-surface: #ffffff;
  --bg-subtle: #eae8f1;
  --bg-hover: #e0ddeb;
  --border-color: #dedbe8;
  --border-focus: #887d9f;
  
  --text-primary: #211e29;
  --text-secondary: #585366;
  --text-muted: #8d879d;

  /* Zen Lavender & Muted Slate Accents */
  --accent-zen: #756c88;
  --accent-zen-light: #ece8f4;
  --accent-slate: #6b788c;
  --accent-slate-light: #ebf0f5;
  --accent-rose: #a86c65;
  --accent-rose-light: #f7ebe9;

  --primary: #685e7d;
  --primary-hover: #564c6a;

  --shadow-sm: 0 1px 3px rgba(33, 30, 41, 0.04);
  --shadow-md: 0 4px 16px rgba(33, 30, 41, 0.05);
  --shadow-lg: 0 12px 30px rgba(33, 30, 41, 0.06);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode: Soft matte dark charcoal background with soothing light grey text */
  --bg-main: #141318;
  --bg-surface: #1e1d26;
  --bg-subtle: #262430;
  --bg-hover: #2f2d3b;
  --border-color: #2b2937;
  --border-focus: #827599;

  --text-primary: #cfcbd6;
  --text-secondary: #9c97a8;
  --text-muted: #6e697a;

  --accent-zen: #978aa9;
  --accent-zen-light: #23202c;
  --accent-slate: #8893a5;
  --accent-slate-light: #1b1e25;
  --accent-rose: #bc827b;
  --accent-rose-light: #261c1b;

  --primary: #82759a;
  --primary-hover: #9689af;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: rgba(243, 242, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

[data-theme="dark"] .navbar {
  background-color: rgba(19, 18, 23, 0.94);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 36px;
  transition: all var(--transition-fast);
}

.nav-back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-brand-logo {
  font-size: 1.15rem;
  opacity: 0.9;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.base-lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 170px;
}

.base-lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1.75rem 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  min-height: 36px;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d879d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-signout {
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-signout:hover {
  background: var(--accent-rose-light);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.main-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  min-height: calc(100vh - 65px);
  width: 100%;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.screen-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-break: break-word;
}

.screen-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.screen-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 40px;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

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

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  min-height: 48px;
  border-radius: var(--radius-lg);
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════════════════ */
.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 55vh;
  padding: 2rem 0.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.85rem;
  max-width: 620px;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 460px;
  margin-bottom: 2rem;
  line-height: 1.55;
}

.hero-preview-cards {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-card-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 120px;
}

/* ══════════════════════════════════════════════════════════════════════════
   TILES GRID
   ══════════════════════════════════════════════════════════════════════════ */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.tile {
  text-decoration: none;
  color: inherit;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.tile:hover {
  border-color: var(--accent-zen);
}

.tile.is-hidden-item {
  opacity: 0.45;
  background: var(--bg-subtle);
  border-style: dashed;
}

.tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.tile-flag {
  font-size: 1.85rem;
  line-height: 1;
}

.tile-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: var(--accent-zen-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-zen);
}

[data-theme="dark"] .tile-badge {
  color: var(--text-primary);
}

.tile-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tile-action-btn {
  background: var(--bg-subtle);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.tile-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tile-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tile-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tile-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tile-drag-handle {
  cursor: grab;
  user-select: none;
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.3;
}

.tile-add {
  border: 1px dashed var(--border-color);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 130px;
  transition: all var(--transition-fast);
}

.tile-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent-zen-light);
}

.tile-add-icon {
  font-size: 1.4rem;
  color: var(--primary);
}

.tile-add-text {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════
   WORD LIST
   ══════════════════════════════════════════════════════════════════════════ */
.word-list-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.word-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sort-select {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
}

.word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.word-row:last-child {
  border-bottom: none;
}

.word-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.word-study-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.word-study {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: pre-line;
  word-break: break-word;
}

.word-pronunciation {
  font-size: 0.8rem;
  color: var(--accent-zen);
  font-style: italic;
  background: var(--accent-zen-light);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.word-base {
  font-size: 0.88rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.word-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.move-select {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  max-width: 130px;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1.25rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   FLASHCARDS (MOBILE-READY)
   ══════════════════════════════════════════════════════════════════════════ */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.flashcards-controls-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.5rem;
}

.lang-toggle-pill {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.2rem;
}

.lang-toggle-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.card-stage {
  width: 100%;
  height: clamp(260px, 46vh, 340px);
  perspective: 1200px;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

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

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.card-face-back {
  transform: rotateY(180deg);
  background: var(--bg-surface);
}

.card-lang-indicator {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-deck-badge {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 0.72rem;
  color: var(--accent-zen);
  background: var(--accent-zen-light);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.card-text-main {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.4rem;
  white-space: pre-line;
  word-break: break-word;
}

.card-pronunciation-sub {
  font-size: 0.95rem;
  color: var(--accent-zen);
  font-style: italic;
  white-space: pre-line;
  max-width: 90%;
}

.card-hint {
  position: absolute;
  bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.flashcards-nav-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.progress-bar-wrapper {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  margin-top: 1.25rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width var(--transition-normal);
}

.keyboard-shortcut-hint {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 23, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform var(--transition-normal);
}

.modal-overlay.is-active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  resize: vertical;
}

.form-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.lang-search-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
}

.lang-search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

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

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE BREAKPOINTS
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .navbar {
    padding: 0.65rem 0.85rem;
  }

  .nav-brand span:last-child {
    display: none;
  }

  .base-lang-wrapper {
    max-width: 130px;
  }

  .main-content {
    padding: 1.25rem 0.85rem 3rem;
  }

  .screen-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .screen-actions {
    width: 100%;
    justify-content: stretch;
  }

  .screen-actions .btn {
    flex: 1;
  }

  .tiles-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .word-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
  }

  .word-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-color);
  }

  .word-actions .move-select {
    flex: 1;
    max-width: none;
  }

  .flashcards-nav-actions {
    flex-direction: column;
    gap: 0.65rem;
  }

  .flashcards-nav-actions > div {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .flashcards-nav-actions > div > .btn,
  .flashcards-nav-actions > div > .move-select {
    flex: 1;
  }

  .flashcards-nav-actions > .btn {
    width: 100%;
  }

  .card-stage {
    height: clamp(280px, 48vh, 340px);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-box {
    padding: 1.35rem 1.15rem;
  }
}

.screen-lang-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-zen);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME SCREEN INTERACTIVE FLASHCARDS
   ══════════════════════════════════════════════════════════════════════════ */
.home-card-stage {
  width: 200px;
  height: 160px;
  perspective: 900px;
  cursor: pointer;
  user-select: none;
}

.home-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.home-card-stage.is-flipped .home-card-inner {
  transform: rotateY(180deg);
}

.home-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.85rem;
  text-align: center;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.home-card-stage:hover .home-card-face {
  border-color: var(--accent-zen);
}

.home-card-back {
  transform: rotateY(180deg);
  background: var(--bg-surface);
}

.home-card-top-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-zen);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.home-card-word {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  margin-top: 0.5rem;
}

.home-card-pronunciation {
  font-size: 0.78rem;
  color: var(--accent-zen);
  font-style: italic;
}

.home-card-hint {
  position: absolute;
  bottom: 0.55rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.nav-home-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  display: block;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-brand:hover .nav-home-icon {
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-brand-text {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1;
}

.edit-word-trigger {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
}

.edit-word-trigger:hover {
  opacity: 0.85;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIGN IN SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.signin-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
  padding: 1.5rem 1rem;
}

.signin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2.25rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}

.signin-logo {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  display: inline-block;
  line-height: 1;
}

.signin-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: lowercase;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.signin-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.signin-btn-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
  min-height: 44px;
}

.signin-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}
