@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #F8BBD0;
  --primary-dark: #F06292;
  --secondary: #E91E63;
  --accent: #AD1457;
  --deep: #FFF0F5;
  --light: #F3E5F5;
  --bg: #FAF5F7;
  --surface: #FFFFFF;
  --text: #2D1B20;
  --text-secondary: #6B4F57;
  --text-muted: #9C8289;
  --border: #E8D5DB;
  --border-light: #F0E4E8;
  --success: #2E7D32;
  --error: #C62828;
  --warning: #F57F17;
  --shadow-sm: 0 1px 3px rgba(114, 47, 55, 0.08);
  --shadow-md: 0 4px 12px rgba(114, 47, 55, 0.1);
  --shadow-lg: 0 8px 30px rgba(114, 47, 55, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--accent);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 860px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--deep) 100%);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.header-icon {
  font-size: 1.75rem;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.02em;
}

.header-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  font-weight: 300;
  margin-left: 0.25rem;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 0.5rem;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover:not(:disabled) {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.tab-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Main */
.app-main {
  flex: 1;
  padding: 1.25rem;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

.subsection-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.125rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover:not(:disabled) {
  background: #a8154e;
  transform: translateY(-1px);
}

.btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background 0.15s ease;
  opacity: 0.65;
}

.icon-btn:hover {
  opacity: 1;
  background: var(--light);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

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

.form-input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Loading Skeleton */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, var(--border-light) 8%, var(--light) 18%, var(--border-light) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Deck Grid */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.deck-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 3px solid var(--accent);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

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

.deck-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.deck-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.deck-actions-mini {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.deck-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.deck-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.deck-stat {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-num {
  font-weight: 600;
  color: var(--primary);
}

.due-stat .stat-num {
  color: var(--accent);
}

.deck-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Card Manager */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flashcard-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeInUp 0.35s ease both;
}

.flashcard-preview {
  position: relative;
  min-height: 90px;
  cursor: pointer;
  overflow: hidden;
}

.flashcard-face {
  padding: 1rem 1.25rem;
  transition: opacity 0.3s ease;
}

.flashcard-front {
  background: linear-gradient(135deg, var(--surface) 0%, var(--light) 100%);
}

.flashcard-back {
  display: none;
  background: linear-gradient(135deg, var(--light) 0%, #EDE7F6 100%);
}

.flashcard-preview.flipped .flashcard-front {
  display: none;
}

.flashcard-preview.flipped .flashcard-back {
  display: block;
}

.face-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.face-content {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.flashcard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-light);
  background: rgba(243, 229, 245, 0.2);
}

.meta-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 500;
}

.review-tag {
  background: var(--light);
  color: var(--deep);
}

.correct-tag {
  background: #E8F5E9;
  color: var(--success);
}

.incorrect-tag {
  background: #FFEBEE;
  color: var(--error);
}

.ease-tag {
  background: #FFF3E0;
  color: var(--warning);
}

.flashcard-actions-row {
  display: flex;
  gap: 0.25rem;
}

/* Review Session */
.review-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.review-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--deep));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.session-mini-stats {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.mini-correct {
  color: var(--success);
}

.mini-incorrect {
  color: var(--error);
}

/* Review Card */
.review-card {
  width: 100%;
  max-width: 500px;
  perspective: 1000px;
  cursor: pointer;
}

.review-card-inner {
  position: relative;
  min-height: 260px;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

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

.review-card-front,
.review-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.review-card-front {
  background: linear-gradient(145deg, var(--surface) 0%, var(--light) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.review-card-back {
  background: linear-gradient(145deg, var(--light) 0%, #EDE7F6 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transform: rotateY(180deg);
}

.review-face-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.review-face-content {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.tap-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  opacity: 0.7;
}

/* Rating Buttons */
.rating-buttons {
  width: 100%;
  max-width: 500px;
  animation: fadeInUp 0.3s ease;
}

.rating-prompt {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

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

.rating-num {
  font-size: 1.1rem;
  font-weight: 700;
}

.rating-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
}

.rating-1 { border-color: #C62828; }
.rating-1:hover { background: #FFEBEE; }
.rating-1 .rating-num { color: #C62828; }

.rating-2 { border-color: #E65100; }
.rating-2:hover { background: #FFF3E0; }
.rating-2 .rating-num { color: #E65100; }

.rating-3 { border-color: #F9A825; }
.rating-3:hover { background: #FFFDE7; }
.rating-3 .rating-num { color: #F57F17; }

.rating-4 { border-color: #2E7D32; }
.rating-4:hover { background: #E8F5E9; }
.rating-4 .rating-num { color: #2E7D32; }

.rating-5 { border-color: #1565C0; }
.rating-5:hover { background: #E3F2FD; }
.rating-5 .rating-num { color: #1565C0; }

/* Review Complete */
.review-complete {
  text-align: center;
  padding: 2rem 1rem;
  animation: fadeInUp 0.4s ease;
}

.complete-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}

.complete-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.complete-stat {
  text-align: center;
}

.complete-stat-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.complete-stat.correct .complete-stat-num {
  color: var(--success);
}

.complete-stat.incorrect .complete-stat-num {
  color: var(--error);
}

.complete-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Stats */
.stats-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  animation: fadeInUp 0.35s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

.stat-card-primary {
  border-top: 3px solid var(--primary);
}

.stat-card-due {
  border-top: 3px solid var(--accent);
}

.stat-card-accuracy {
  border-top: 3px solid var(--deep);
}

.stat-card-today {
  border-top: 3px solid var(--secondary);
}

.stat-card-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Card Status Bars */
.card-status-section,
.activity-section,
.sessions-section,
.deck-breakdown-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.status-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 70px;
  flex-shrink: 0;
}

.status-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.status-new {
  background: var(--text-muted);
}

.status-learning {
  background: linear-gradient(90deg, var(--accent), var(--secondary));
}

.status-mastered {
  background: linear-gradient(90deg, var(--success), #43A047);
}

.status-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  width: 30px;
  text-align: right;
}

/* Week Chart */
.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
  padding-top: 0.5rem;
}

.week-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.week-bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.week-bar {
  width: 70%;
  max-width: 40px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.4s ease;
}

.week-bar-num {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
}

.week-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Sessions List */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
  animation: fadeInUp 0.3s ease both;
}

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

.session-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.session-deck {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.session-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.session-results {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-reviewed {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.session-accuracy {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.session-accuracy.good {
  background: #E8F5E9;
  color: var(--success);
}

.session-accuracy.ok {
  background: #FFF3E0;
  color: var(--warning);
}

.session-accuracy.poor {
  background: #FFEBEE;
  color: var(--error);
}

/* Deck Breakdown */
.deck-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.breakdown-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.breakdown-cards,
.breakdown-due {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.breakdown-accuracy {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.breakdown-accuracy.good {
  background: #E8F5E9;
  color: var(--success);
}

.breakdown-accuracy.ok {
  background: #FFF3E0;
  color: var(--warning);
}

.breakdown-accuracy.poor {
  background: #FFEBEE;
  color: var(--error);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 1.25rem 1rem 1rem;
  }

  .header-title {
    font-size: 1.25rem;
  }

  .header-subtitle {
    display: none;
  }

  .app-main {
    padding: 1rem;
  }

  .deck-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .rating-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
  }

  .rating-btn {
    padding: 0.6rem 0.15rem;
  }

  .rating-label {
    font-size: 0.58rem;
  }

  .review-face-content {
    font-size: 1.1rem;
  }

  .complete-stats {
    gap: 1rem;
  }

  .week-chart {
    height: 110px;
  }

  .breadcrumb {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .tab-btn {
    font-size: 0.78rem;
    padding: 0.75rem 0.25rem;
  }

  .deck-card-actions {
    flex-direction: column;
  }
}

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Vineyard — your spaced repetition flashcard app. Let's start by creating your first deck.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Click 'New Deck' to create a flashcard deck. Give it a name like 'Spanish Vocabulary'.", "view": "user", "highlight_selector": ".section-header .btn-primary", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Now tap 'Manage Cards' on your new deck to add flashcards with a front (question) and back (answer).", "view": "user", "highlight_selector": ".btn-outline", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Add a few cards using the '+ Add Card' button. Each card has a front side (the question) and a back side (the answer).", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Click on any card to flip between its front and back sides.", "view": "user", "highlight_selector": ".flashcard-preview", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Go back to Decks and click 'Review' to start a spaced repetition session. The SM-2 algorithm schedules cards based on how well you know them.", "view": "user", "highlight_selector": ".btn-accent", "wait_for": "user_interaction"},
  {"step": 7, "narration": "During review, tap the card to reveal the answer, then rate how well you knew it from 1 (Blackout) to 5 (Easy). This determines when you'll see the card again.", "view": "user", "highlight_selector": ".rating-grid", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Check the Stats tab to see your overall progress, accuracy, card status breakdown, and review activity over the past week.", "view": "user", "highlight_selector": ".tab-btn:last-child", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.auth-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.auth-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0.75rem 0 1.25rem;
}

.auth-btn {
  width: 100%;
}

.progress-visual-section,
.streak-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.progress-visual-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-card {
  background: linear-gradient(180deg, rgba(243, 229, 245, 0.25), rgba(255, 255, 255, 1));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  min-height: 240px;
}

.chart-card canvas {
  width: 100% !important;
  height: 220px !important;
  display: block;
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.streak-icon {
  font-size: 2rem;
  line-height: 1;
}

.streak-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
}

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

@media (max-width: 640px) {
  .chart-card {
    min-height: 200px;
  }

  .chart-card canvas {
    height: 180px !important;
  }

  .streak-card {
    align-items: flex-start;
  }
}

.deck-list-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: #E8F5E9;
  color: var(--success);
  font-size: 0.9rem;
  border: 1px solid rgba(46, 125, 50, 0.15);
}

.share-link-row {
  margin-bottom: 0.8rem;
}

.share-link-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg);
}

.shared-deck-card {
  max-width: 500px;
}

.shared-deck-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
