/* ===== CSS Variables & Reset ===== */
:root {
  --pink: #FFE5EC;
  --peach: #FFF3E0;
  --mint: #E8F5E9;
  --baby-blue: #E3F2FD;
  --lavender: #F3E5F5;
  --hot-pink: #FF6B9D;
  --teal: #4ECDC4;
  --yellow: #FFD93D;
  --coral: #FF8A80;
  --deep-purple: #2D1B69;
  --soft-purple: #6C5CE7;
  --bg: #FFF9FB;
  --card-shadow: 0 4px 20px rgba(109, 92, 231, 0.1);
  --card-shadow-hover: 0 8px 30px rgba(109, 92, 231, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Varela Round', 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--deep-purple);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

/* ===== Floating Background Elements ===== */
.floating-elements {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float-el {
  position: absolute;
  font-size: clamp(1rem, 3vw, 1.8rem);
  opacity: 0.15;
  left: var(--x);
  animation: floatUp var(--duration) ease-in-out var(--delay) infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1);
    opacity: 0;
  }
}

/* ===== Header ===== */
.main-header {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, var(--lavender) 0%, var(--pink) 50%, var(--peach) 100%);
  padding: 1.5rem 1rem 2rem;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 32px rgba(109, 92, 231, 0.12);
  overflow: hidden;
}

.main-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  animation: headerGlow 8s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, -5%) scale(1.1); }
}

.header-content {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* Baby Scene */
.baby-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.baby-character {
  position: relative;
  font-size: 3rem;
  animation: babyBounce 2s ease-in-out infinite;
}

.baby-body {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.baby-hand {
  position: absolute;
  top: -0.3em;
  right: -0.5em;
  font-size: 0.5em;
  transform-origin: bottom center;
}

.baby-hand.wave {
  animation: wave 1.5s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(20deg); }
}

@keyframes babyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.baby-blocks {
  display: flex;
  gap: 0.4rem;
}

.block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  font-family: 'Secular One', sans-serif;
  font-size: 1.1rem;
  color: white;
  animation: blockPop 3s ease-in-out infinite;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.block-a {
  background: var(--hot-pink);
  animation-delay: 0s;
}

.block-b {
  background: var(--teal);
  animation-delay: 0.3s;
}

.block-c {
  background: var(--yellow);
  color: var(--deep-purple);
  animation-delay: 0.6s;
}

@keyframes blockPop {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  75% { transform: scale(0.95) rotate(3deg); }
}

.site-title {
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--deep-purple);
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 4px rgba(109, 92, 231, 0.1);
}


/* ===== Input Section ===== */
.input-section {
  position: relative;
  z-index: 10;
  max-width: 600px;
  margin: -1rem auto 0;
  padding: 2rem 1.2rem;
}

.input-container {
  position: relative;
}

.marker-area {
  background: white;
  border-radius: 24px;
  padding: 1.5rem 1.8rem 1rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.marker-area:focus-within {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.marker-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hot-pink), var(--coral));
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.marker-input {
  flex: 1;
  font-family: 'Karantina', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 400;
  color: var(--deep-purple);
  outline: none;
  min-height: 2.5rem;
  line-height: 1.2;
  caret-color: var(--hot-pink);
  background: transparent;
  border: none;
  width: 100%;
  direction: rtl;
}

.marker-input::placeholder {
  color: #C4B5D9;
}

.marker-underline {
  height: 3px;
  margin-top: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--hot-pink), var(--yellow), var(--teal), var(--soft-purple));
  background-size: 300% 100%;
  animation: rainbowSlide 4s ease-in-out infinite;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.marker-area:focus-within .marker-underline {
  opacity: 1;
}

@keyframes rainbowSlide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Add Button */
.add-btn {
  width: 100%;
  margin-top: 0.8rem;
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  background-size: 150% 150%;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 2rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-position 0.4s ease;
}

.add-btn:hover {
  background-position: 100% 50%;
  box-shadow: 0 6px 24px rgba(255, 107, 157, 0.5);
}

.add-btn:active {
  transform: scale(0.95);
  transition-duration: 0.1s;
}

.add-btn-icon {
  font-size: 1.3rem;
  font-weight: bold;
}

/* When input is focused on mobile */
.input-focused .input-section {
  z-index: 50;
}

/* ===== Age Section ===== */
.age-section {
  position: relative;
  z-index: 10;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
}

.age-container {
  background: white;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.age-question {
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  color: var(--deep-purple);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Age Wheel Picker */
.age-wheel-wrapper {
  position: relative;
  height: 200px;
  margin-bottom: 1.2rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}

.age-wheel-highlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 48px;
  border-radius: 14px;
  background: var(--lavender);
  border: 2px solid rgba(109, 92, 231, 0.15);
  pointer-events: none;
  z-index: 1;
}

.age-wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  height: 100%;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 76px 0;
}

.age-wheel::-webkit-scrollbar {
  display: none;
}

.age-option {
  scroll-snap-align: center;
  flex-shrink: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 85%;
  border-radius: 14px;
  font-family: 'Secular One', sans-serif;
  font-size: 1.15rem;
  color: var(--deep-purple);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  opacity: 0.4;
  background: none;
  border: none;
  padding: 0;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.age-option.wheel-center {
  opacity: 1;
  transform: scale(1.08);
  color: var(--deep-purple);
  font-size: 1.25rem;
}

.age-option.wheel-near {
  opacity: 0.65;
  transform: scale(0.95);
}

.age-option.selected {
  color: var(--hot-pink);
  font-weight: bold;
}

.age-confirm-btn {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 2.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
  transition: all 0.3s ease;
  margin-bottom: 0.6rem;
}

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

.just-now-btn {
  background: linear-gradient(135deg, var(--teal), #45B7AA);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 2.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.4);
  transition: all 0.3s ease;
}

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

/* ===== Notes Section ===== */
.notes-section {
  position: relative;
  z-index: 10;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
}

.notes-container {
  background: white;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.notes-title {
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--deep-purple);
  margin-bottom: 1rem;
}

.notes-input {
  font-family: 'Varela Round', sans-serif;
  font-size: 1rem;
  color: var(--deep-purple);
  background: var(--lavender);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  min-height: 80px;
  outline: none;
  text-align: right;
  line-height: 1.6;
  transition: background 0.3s ease;
  caret-color: var(--soft-purple);
}

.notes-input:focus {
  background: #EDE7F6;
}

.notes-input:empty::before {
  content: attr(data-placeholder);
  color: #B39DDB;
  pointer-events: none;
}

.notes-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.notes-skip-btn {
  background: var(--lavender);
  color: var(--soft-purple);
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.8rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.notes-save-btn {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.8rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
  transition: all 0.3s ease;
}

/* ===== Success Toast ===== */
.success-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  background: white;
  border-radius: 2rem;
  border-right: 4px solid var(--hot-pink);
  box-shadow: 0 8px 32px rgba(109, 92, 231, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  animation: toastSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.success-toast.toast-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(0.5rem);
}

.success-toast .success-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
  animation: toastEmojiBounce 0.5s ease-out;
}

.success-toast .success-text {
  font-family: 'Secular One', sans-serif;
  font-size: 1rem;
  color: var(--deep-purple);
  white-space: nowrap;
}

@keyframes toastSlideUp {
  0% { transform: translateX(-50%) translateY(1rem); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastEmojiBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== Search ===== */
.search-container {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: white;
  border-radius: 50px;
  padding: 0.6rem 1.2rem;
  box-shadow: 0 2px 12px rgba(109, 92, 231, 0.08);
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-container:focus-within {
  border-color: rgba(109, 92, 231, 0.2);
  box-shadow: var(--card-shadow);
}

.search-icon {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.search-container:focus-within .search-icon {
  opacity: 1;
}

.search-input {
  flex: 1;
  font-family: 'Varela Round', sans-serif;
  font-size: 1rem;
  color: var(--deep-purple);
  background: transparent;
  border: none;
  outline: none;
  direction: rtl;
  min-width: 0;
}

.search-input::placeholder {
  color: #C4B5D9;
}

.search-clear {
  background: var(--lavender);
  border: none;
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--soft-purple);
  flex-shrink: 0;
  transition: background 0.2s;
}

.search-clear:hover {
  background: var(--pink);
}

.search-results-info {
  text-align: center;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.85rem;
  color: var(--soft-purple);
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.search-results-info.visible {
  opacity: 1;
}

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters-toggles {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  border: 1.5px solid var(--lavender);
  background: white;
  color: var(--soft-purple);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-toggle-btn:hover {
  background: var(--lavender);
}

.filter-toggle-btn.active {
  background: var(--lavender);
  border-color: var(--soft-purple);
}

.filter-toggle-btn.has-active-filter {
  background: color-mix(in srgb, var(--soft-purple) 12%, white);
  border-color: var(--soft-purple);
}

.filter-toggle-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

.filter-toggle-btn.active .filter-toggle-arrow {
  transform: rotate(180deg);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow: hidden;
  max-height: 200px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}

.filter-group.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  border: 1.5px solid var(--pill-color, var(--soft-purple));
  background: white;
  color: var(--pill-color, var(--soft-purple));
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: color-mix(in srgb, var(--pill-color, var(--soft-purple)) 10%, white);
}

.filter-pill.active {
  background: var(--pill-color, var(--soft-purple));
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--pill-color, var(--soft-purple)) 30%, transparent);
}

/* ===== Words Section ===== */
.words-section {
  position: relative;
  z-index: 10;
  max-width: 700px;
  margin: 1rem auto 0;
  padding: 2rem 1.2rem 4rem;
}

.words-title {
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--deep-purple);
  text-align: center;
  margin-bottom: 0.3rem;
}

.words-counter {
  text-align: center;
  font-size: 0.9rem;
  color: var(--soft-purple);
  margin-bottom: 1.5rem;
}

.words-counter span {
  font-family: 'Secular One', sans-serif;
  font-size: 1.2rem;
  color: var(--hot-pink);
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.words-counter span.count-bump {
  transform: scale(1.3);
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

/* Scroll reveal system */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Word Card */
.word-card {
  background: white;
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.word-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  transition: height 0.3s ease;
}

/* Category-based accent color (set via JS --card-accent variable) */
.word-card-categorized::before { background: var(--card-accent) !important; }

/* Fallback rotation for uncategorized words */
.word-card:nth-child(5n+1)::before { background: var(--hot-pink); }
.word-card:nth-child(5n+2)::before { background: var(--teal); }
.word-card:nth-child(5n+3)::before { background: var(--yellow); }
.word-card:nth-child(5n+4)::before { background: var(--soft-purple); }
.word-card:nth-child(5n+5)::before { background: var(--coral); }

.word-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--card-shadow-hover);
}

.word-card:hover::before {
  height: 6px;
}

.word-card:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.word-card-word {
  font-family: 'Karantina', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--deep-purple);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.word-card-age {
  font-size: 0.8rem;
  color: var(--soft-purple);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.word-card-age::before {
  content: '🕐';
  font-size: 0.75rem;
}

.word-card-notes {
  font-size: 0.75rem;
  color: #9E9E9E;
  margin-top: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.word-card-notes::before {
  content: '📝 ';
}

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

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state p {
  font-family: 'Varela Round', sans-serif;
  color: var(--soft-purple);
  font-size: 1.1rem;
}

.empty-sub {
  font-size: 0.9rem !important;
  opacity: 0.6;
  margin-top: 0.3rem;
}

/* ===== Edit Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(45, 27, 105, 0.3);
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 28px 28px 16px 16px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modalSlideUp {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--lavender);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--soft-purple);
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--pink);
}

.modal-title {
  font-family: 'Secular One', sans-serif;
  font-size: 1.3rem;
  color: var(--deep-purple);
  margin-bottom: 1.5rem;
}

.modal-field {
  margin-bottom: 1.2rem;
}

.modal-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--soft-purple);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.modal-input {
  background: var(--lavender);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-family: 'Karantina', sans-serif;
  font-size: 1.5rem;
  color: var(--deep-purple);
  outline: none;
  min-height: 2.5rem;
  transition: background 0.3s;
  caret-color: var(--soft-purple);
}

.modal-input:focus {
  background: #EDE7F6;
}

.modal-notes {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  min-height: 60px;
  line-height: 1.5;
}

.modal-notes:empty::before {
  content: attr(data-placeholder);
  color: #B39DDB;
  pointer-events: none;
}

.modal-age-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
  padding: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: var(--lavender) transparent;
}

.modal-age-picker .age-option {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  background: var(--lavender);
  border: 2px solid transparent;
  border-radius: 50px;
  opacity: 1;
  transform: none;
  height: auto;
  width: auto;
  scroll-snap-align: unset;
  transition: all 0.3s ease;
}

.modal-age-picker .age-option:hover {
  background: var(--pink);
  border-color: var(--hot-pink);
  transform: scale(1.05);
}

.modal-age-picker .age-option.selected {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(255, 107, 157, 0.3);
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.modal-delete-btn {
  background: #FFEBEE;
  color: #E53935;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
}

.modal-delete-btn:hover {
  background: #FFCDD2;
}

.delete-confirm-content {
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 340px;
}

.delete-confirm-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.delete-confirm-text {
  font-family: 'Secular One', sans-serif;
  font-size: 1.2rem;
  color: var(--deep-purple);
  margin-bottom: 0.3rem;
}

.delete-confirm-sub {
  font-family: 'Karantina', sans-serif;
  font-size: 1.6rem;
  color: var(--soft-purple);
  margin-bottom: 1.2rem;
}

.delete-confirm-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.delete-confirm-actions .modal-cancel-btn,
.delete-confirm-actions .modal-delete-btn {
  flex: 1;
  max-width: 140px;
}

.modal-save-btn {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 2rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
  transition: all 0.3s;
}

/* ===== Word View Mode ===== */
.view-word-display {
  font-family: 'Karantina', sans-serif;
  font-size: 3rem;
  font-weight: 400;
  color: var(--deep-purple);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.view-age-display {
  text-align: center;
  font-size: 0.9rem;
  color: var(--soft-purple);
  margin-bottom: 1rem;
}

.view-age-display::before {
  content: '🕐 ';
}

.view-category-display {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.view-cat-badge {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  background: color-mix(in srgb, var(--cat-color) 15%, white);
  color: var(--cat-color);
  border: 1.5px solid var(--cat-color);
}

.view-subcat-badge {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: var(--lavender);
  color: var(--soft-purple);
}

.view-notes-display {
  background: var(--lavender);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-purple);
  line-height: 1.6;
  margin-bottom: 1rem;
  text-align: right;
}

.view-notes-display::before {
  content: '📝 ';
}

.view-evo-section {
  margin-bottom: 1rem;
}

.view-evo-label {
  font-family: 'Secular One', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-purple);
  margin-bottom: 0.6rem;
}

.view-evo-chain {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

/* Evolution mini-timeline */
.evo-mini-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  direction: rtl;
}

.evo-mini-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 0 0.3rem;
  min-width: 0;
}

.evo-mini-col:hover {
  transform: scale(1.06);
}

.evo-mini-word {
  font-family: 'Karantina', sans-serif;
  font-size: 1.25rem;
  color: var(--deep-purple);
  line-height: 1.2;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  direction: rtl;
}

.evo-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soft-purple);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(108,92,231,0.25);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.evo-mini-col.evo-active .evo-mini-dot {
  background: var(--hot-pink);
  width: 12px;
  height: 12px;
  box-shadow: 0 1px 6px rgba(255,107,157,0.4);
}

.evo-mini-col.evo-active .evo-mini-word {
  color: var(--hot-pink);
  font-weight: 700;
}

.evo-mini-age {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.65rem;
  color: var(--soft-purple);
  margin-top: 0.35rem;
  white-space: nowrap;
  direction: rtl;
}

.evo-mini-arrow {
  display: flex;
  align-items: center;
  color: var(--soft-purple);
  font-size: 0.85rem;
  opacity: 0.5;
  padding: 0 0.15rem;
  margin-top: -1.2rem;
  position: relative;
}

/* Horizontal connecting line behind dots - drawn via JS-positioned absolute,
   but we use a simple border approach on the arrow instead */
.evo-mini-arrow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -2px;
  right: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--soft-purple), var(--hot-pink));
  opacity: 0.2;
  z-index: 0;
}

.modal-edit-btn {
  background: linear-gradient(135deg, var(--soft-purple), var(--hot-pink));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
  transition: all 0.3s;
}

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

.modal-add-evo-btn {
  background: linear-gradient(135deg, var(--teal), #81C784);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
  transition: all 0.3s;
}

.modal-add-evo-btn:active {
  transform: scale(0.95);
}

.modal-cancel-btn {
  background: var(--lavender);
  color: var(--soft-purple);
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
}

/* ===== Word Link UI ===== */
.link-section {
  position: relative;
}

.link-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--baby-blue), var(--lavender));
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-family: 'Secular One', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-purple);
}

.link-badge::before {
  content: '🔗';
  font-size: 0.8rem;
}

.link-remove-btn {
  background: var(--lavender);
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--soft-purple);
  transition: background 0.2s;
}

.link-remove-btn:hover {
  background: #FFCDD2;
  color: #E53935;
}

.link-search-wrap {
  position: relative;
}

.link-search-input {
  width: 100%;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.9rem;
  color: var(--deep-purple);
  background: var(--lavender);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0.6rem 1rem;
  outline: none;
  direction: rtl;
  transition: border-color 0.3s, background 0.3s;
}

.link-search-input:focus {
  background: #EDE7F6;
  border-color: rgba(109, 92, 231, 0.3);
}

.link-results {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(45, 27, 105, 0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  margin-bottom: 0.3rem;
}

.link-result-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.9rem;
  color: var(--deep-purple);
  border-bottom: 1px solid var(--lavender);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.link-result-item:hover {
  background: var(--lavender);
}

.link-result-item .link-result-age {
  font-size: 0.75rem;
  color: var(--soft-purple);
}

/* Timeline linked word items - slightly offset and tinted */
.timeline-item-linked {
  --link-offset: 8px;
}

.timeline-item-linked:nth-child(odd) {
  padding-left: calc(55% + var(--link-offset));
}

.timeline-item-linked:nth-child(even) {
  padding-right: calc(55% + var(--link-offset));
}

.timeline-item-linked .timeline-card {
  background: linear-gradient(135deg, #F3E5F5 0%, #FCE4EC 100%);
  border: 1.5px solid rgba(108, 92, 231, 0.12);
}

.timeline-item-linked .timeline-card-link {
  cursor: pointer;
  opacity: 1;
  color: var(--hot-pink);
  font-weight: 600;
}

/* Highlight animation when scrolled-to */
.timeline-item-highlight .timeline-card {
  animation: cardHighlight 1.5s ease;
}

@keyframes cardHighlight {
  0% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4); }
  30% { box-shadow: 0 0 0 8px rgba(108, 92, 231, 0.2); transform: scale(1.03); }
  100% { box-shadow: var(--card-shadow); transform: scale(1); }
}

/* Timeline evolution dashed connector */
.timeline-evolution {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  height: 22px;
}

.timeline-evo-line {
  position: absolute;
  right: calc(50% - 1px);
  top: 0;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(
    180deg,
    var(--soft-purple) 0px,
    var(--soft-purple) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.45;
  border-radius: 1px;
}

.timeline-evo-arrow {
  position: absolute;
  bottom: 0;
  right: calc(50% - 6px);
  font-size: 0.65rem;
  color: var(--soft-purple);
  opacity: 0.55;
  line-height: 1;
}

/* Word card link indicator */
.word-card-link {
  font-size: 0.7rem;
  color: var(--soft-purple);
  margin-top: 0.3rem;
  opacity: 0.7;
}

.word-card-link::before {
  content: '🔗 ';
}

/* Timeline card link indicator */
.timeline-card-link {
  font-size: 0.65rem;
  color: var(--soft-purple);
  margin-top: 0.2rem;
  opacity: 0.7;
}

.timeline-card-link::before {
  content: '🔗 ';
}

/* ===== Evolution Chain Modal ===== */
.evo-modal-content {
  max-height: 80vh;
}

.evo-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1rem 0;
}

.evo-chain-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  background: var(--lavender);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  position: relative;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.evo-chain-item:hover {
  background: var(--pink);
  transform: scale(1.02);
}

.evo-chain-item.evo-current {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(108, 92, 231, 0.15));
  border: 2px solid var(--hot-pink);
}

.evo-chain-number {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Secular One', sans-serif;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.evo-chain-info {
  flex: 1;
  min-width: 0;
}

.evo-chain-word {
  font-family: 'Karantina', sans-serif;
  font-size: 1.6rem;
  color: var(--deep-purple);
  line-height: 1.2;
}

.evo-chain-age {
  font-size: 0.75rem;
  color: var(--soft-purple);
}

.evo-chain-arrows {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.evo-arrow-btn {
  background: white;
  border: 1px solid var(--lavender);
  border-radius: 8px;
  width: 1.8rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--soft-purple);
  transition: background 0.2s;
}

.evo-arrow-btn:hover {
  background: var(--lavender);
}

.evo-arrow-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.evo-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.2rem 0;
}

.evo-connector-line {
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--hot-pink), var(--soft-purple));
  border-radius: 1px;
}

.evo-connector-arrow {
  color: var(--soft-purple);
  font-size: 0.7rem;
  line-height: 1;
}

.evo-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.evo-done-btn {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 2rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
  transition: all 0.3s;
}

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

/* ===== View Toggle ===== */
.view-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.words-section > .view-toggle {
  margin-bottom: 1.5rem;
}

.view-toggle-btn {
  background: var(--lavender);
  border: 2px solid transparent;
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.9rem;
  color: var(--deep-purple);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.view-toggle-btn:hover:not(.active) {
  background: var(--pink);
  transform: translateY(-1px);
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  box-shadow: 0 3px 12px rgba(255, 107, 157, 0.3);
  transform: scale(1.05);
}

/* ===== Timeline View ===== */
.timeline-wrapper {
  position: relative;
  max-height: 70vh;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.timeline-age-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding-top: 0.5rem;
}

.timeline-age-text {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--deep-purple);
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  padding: 0.5rem 1.6rem;
  border-radius: 50px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(109, 92, 231, 0.12);
  border: 1px solid rgba(109, 92, 231, 0.08);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.timeline-scroll {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  scroll-behavior: auto;
  padding: 3rem 0 2rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 3rem, black calc(100% - 2rem), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 3rem, black calc(100% - 2rem), transparent 100%);
}

.timeline-scroll::-webkit-scrollbar {
  display: none;
}

.timeline-scroll {
  scrollbar-width: none;
}

.timeline-track {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding: 0.5rem 0;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 50%;
  width: 3px;
  background: linear-gradient(180deg, var(--hot-pink) 0%, var(--soft-purple) 30%, var(--teal) 60%, var(--lavender) 100%);
  border-radius: 2px;
  transform: translateX(50%);
  opacity: 0.7;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
  padding-left: 55%;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
  padding-right: 55%;
}

.timeline-dot {
  position: absolute;
  right: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item.revealed .timeline-dot {
  animation: dotAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) var(--reveal-delay, 0s) backwards;
}

.timeline-item:first-child .timeline-dot {
  animation: dotPulseTimeline 2s ease-in-out infinite;
}

@keyframes dotAppear {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes dotPulseTimeline {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  50% { transform: scale(1.3); box-shadow: 0 2px 16px rgba(109, 92, 231, 0.35); }
}

/* Category-based accent for timeline cards */
.timeline-card-categorized {
  border-color: color-mix(in srgb, var(--card-accent) 25%, transparent);
}
.timeline-card-categorized:hover {
  border-color: color-mix(in srgb, var(--card-accent) 45%, transparent);
}

/* Fallback dot rotation for uncategorized words */
.timeline-item:nth-child(5n+1) .timeline-dot { background: var(--hot-pink); }
.timeline-item:nth-child(5n+2) .timeline-dot { background: var(--teal); }
.timeline-item:nth-child(5n+3) .timeline-dot { background: var(--yellow); }
.timeline-item:nth-child(5n+4) .timeline-dot { background: var(--soft-purple); }
.timeline-item:nth-child(5n+5) .timeline-dot { background: var(--coral); }

.timeline-card {
  background: white;
  border-radius: 16px;
  padding: 0.7rem 1rem;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  flex: 1;
  min-width: 0;
  border: 2px solid transparent;
}

.timeline-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(109, 92, 231, 0.1);
}

.timeline-card:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.timeline-card-word {
  font-family: 'Karantina', sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--deep-purple);
  line-height: 1.2;
}

.timeline-card-age {
  font-size: 0.75rem;
  color: var(--soft-purple);
  margin-top: 0.3rem;
}

.timeline-card-notes {
  font-size: 0.7rem;
  color: #9E9E9E;
  margin-top: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-center-indicator {
  display: none;
}

/* ===== Section Dividers ===== */
.section-divider {
  position: relative;
  width: 100%;
  height: 2px;
  margin: 1.5rem 0;
  overflow: visible;
}

.divider-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--hot-pink) 15%,
    var(--soft-purple) 40%,
    var(--teal) 60%,
    var(--hot-pink) 85%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: dividerShimmer 6s ease-in-out infinite;
  border-radius: 2px;
  opacity: 0.5;
}

.divider-glow {
  position: absolute;
  top: -4px;
  left: 10%;
  right: 10%;
  height: 10px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(108, 92, 231, 0.15) 20%,
    rgba(255, 107, 157, 0.2) 50%,
    rgba(78, 205, 196, 0.15) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: dividerShimmer 6s ease-in-out infinite reverse;
  filter: blur(4px);
  border-radius: 50%;
}

@keyframes dividerShimmer {
  0% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

/* ===== Trends Section ===== */
.trends-section {
  position: relative;
  z-index: 10;
  max-width: 700px;
  margin: 0 auto 2rem;
  padding: 0 1.2rem 2rem;
}

.trends-title {
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  color: var(--deep-purple);
  text-align: center;
  margin-bottom: 1.2rem;
}

.trends-chart-container {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 1.2rem 0.8rem 1rem 0.5rem;
  box-shadow: var(--card-shadow);
  overflow: visible;
}

.trends-chart-container + .trends-chart-container {
  margin-top: 1.2rem;
}

.trends-svg {
  width: 100%;
  height: 260px;
  display: block;
  overflow: visible;
}

.trends-tooltip {
  position: absolute;
  background: rgba(45, 27, 105, 0.92);
  backdrop-filter: blur(8px);
  color: white;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 20;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(45, 27, 105, 0.25);
  direction: rtl;
}

.trends-tooltip.hidden {
  opacity: 0;
  transform: translateY(4px);
}

/* Chart axis labels */
.trends-svg text.axis-label {
  font-family: 'Varela Round', sans-serif;
  font-size: 10px;
  fill: var(--soft-purple);
}

.trends-svg text.axis-title {
  font-family: 'Secular One', sans-serif;
  font-size: 11px;
  fill: var(--deep-purple);
}

/* ===== Trends Stat Card ===== */
.trends-stat-card {
  background: white;
  border-radius: 20px;
  padding: 1.4rem 1.6rem;
  margin-top: 1rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  border: 1.5px solid rgba(108, 92, 231, 0.08);
  transition: box-shadow 0.3s ease;
}

.trends-stat-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.trends-stat-text {
  font-family: 'Varela Round', sans-serif;
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  color: var(--deep-purple);
  line-height: 1.9;
  margin: 0;
}

.trends-stat-text .stat-highlight {
  display: inline-block;
  font-family: 'Secular One', sans-serif;
  color: var(--soft-purple);
  font-size: 1.15em;
  position: relative;
}

/* Stat highlight: always visible, shimmer loop only */
.trends-stat-card.revealed .stat-highlight {
  animation: statShimmer 4s ease-in-out infinite;
}

.trends-stat-card.revealed .stat-highlight:nth-of-type(1) { animation-delay: 0.5s; }
.trends-stat-card.revealed .stat-highlight:nth-of-type(2) { animation-delay: 2s; }

@keyframes statShimmer {
  0%, 100% { background-position: -200% center; }
  50% { background-position: 200% center; }
}

.trends-stat-card.revealed .stat-highlight {
  background: linear-gradient(
    120deg,
    var(--soft-purple) 0%,
    var(--soft-purple) 40%,
    #a78bfa 50%,
    var(--soft-purple) 60%,
    var(--soft-purple) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Lucide stat icon */
.stat-icon {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: middle;
  color: var(--hot-pink);
  stroke: var(--hot-pink);
  margin-left: 0.2rem;
}

/* Acquisition stat card inherits from .trends-stat-card */
.acq-stat-card {
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
}

.acq-stat-card.revealed .stat-highlight {
  animation: statShimmer 4s ease-in-out infinite;
  background: linear-gradient(
    120deg,
    var(--soft-purple) 0%,
    var(--soft-purple) 40%,
    #a78bfa 50%,
    var(--soft-purple) 60%,
    var(--soft-purple) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.acq-stat-card.revealed .stat-highlight:nth-of-type(1) { animation-delay: 0.3s; }
.acq-stat-card.revealed .stat-highlight:nth-of-type(2) { animation-delay: 1.5s; }
.acq-stat-card.revealed .stat-highlight:nth-of-type(3) { animation-delay: 2.5s; }

/* ===== Footer ===== */
.main-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--deep-purple);
  font-family: 'Secular One', sans-serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  opacity: 0.7;
  line-height: 1.8;
}

/* ===== Section Navigation (Sticky) ===== */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 1rem 0.6rem;
  margin: 0 -1.2rem;
  background: rgba(255, 249, 251, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(109, 92, 231, 0.08);
  box-shadow: 0 2px 12px rgba(109, 92, 231, 0.06);
}

/* Top row: section tabs + add button */
.section-nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Section tabs: large, equal width, prominent */
.section-nav-btn {
  font-family: 'Secular One', sans-serif;
  font-size: 1.05rem;
  min-width: 120px;
  padding: 0.6rem 1.2rem;
  border: 2px solid transparent;
  border-radius: 50px;
  background: var(--lavender);
  color: var(--deep-purple);
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.section-nav-btn.active {
  background: linear-gradient(135deg, var(--soft-purple), var(--hot-pink));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(108, 92, 231, 0.3);
}

.section-nav-btn:not(.active):hover {
  background: var(--pink);
}

.section-nav-add {
  background: transparent;
  color: var(--hot-pink);
  border: 2px solid var(--hot-pink);
  font-size: 0.8rem;
  min-width: auto;
  padding: 0.45rem 0.9rem;
}

.section-nav-add:hover {
  background: var(--pink);
}

/* Bottom row: view toggle - smaller, subtler, visually secondary */
.section-nav .view-toggle {
  margin-bottom: 0;
  gap: 0.4rem;
  padding-top: 0.2rem;
  border-top: 1px solid rgba(109, 92, 231, 0.06);
}

.section-nav .view-toggle-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.9rem;
  background: rgba(243, 229, 245, 0.5);
}

.section-nav .view-toggle-btn.active {
  background: linear-gradient(135deg, var(--hot-pink), var(--soft-purple));
  color: white;
  box-shadow: 0 3px 12px rgba(255, 107, 157, 0.3);
}

/* ===== Timeline Load More ===== */
.timeline-load-more-wrap {
  position: relative;
  text-align: center;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.timeline-blur-fade {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}

.timeline-load-more-btn {
  position: relative;
  z-index: 2;
  font-family: 'Secular One', sans-serif;
  font-size: 0.9rem;
  padding: 0.5rem 1.8rem;
  border: 2px solid var(--soft-purple);
  border-radius: 50px;
  background: white;
  color: var(--soft-purple);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.1);
}

.timeline-load-more-btn:hover {
  background: var(--lavender);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.2);
}

.timeline-load-more-wrap.hidden {
  display: none !important;
}

/* ===== Vocabulary Analysis Cards ===== */
.vocab-card {
  background: white;
  border-radius: 24px;
  padding: 1.4rem 1.2rem;
  margin-top: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease;
}

.vocab-card-title {
  font-family: 'Secular One', sans-serif;
  font-size: 1.1rem;
  color: var(--deep-purple);
  text-align: center;
  margin-bottom: 0.8rem;
}

.vocab-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.vocab-chart-wrap canvas {
  display: block;
  margin: 0 auto;
}

.vocab-slider-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  direction: ltr;
}

.vocab-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lavender), var(--hot-pink));
  outline: none;
  transition: opacity 0.2s;
}

.vocab-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--soft-purple), var(--hot-pink));
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.35);
  border: 2px solid white;
}

.vocab-slider-label {
  font-family: 'Secular One', sans-serif;
  font-size: 0.95rem;
  color: var(--soft-purple);
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  direction: rtl;
}

/* Tooltip area */
.vocab-tooltip-area {
  min-height: 0;
  transition: all 0.3s ease;
}

.vocab-tip-card {
  background: var(--lavender);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  margin-top: 0.8rem;
  animation: tipFadeIn 0.3s ease;
}

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

.vocab-tip-title {
  font-family: 'Secular One', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-purple);
  margin-bottom: 0.4rem;
}

.vocab-tip-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--deep-purple);
  margin-top: 0.2rem;
  line-height: 1.5;
}

.vocab-tip-ex {
  color: var(--soft-purple);
  font-size: 0.75rem;
}

/* Legend */
.vocab-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 0.8rem;
}

.vocab-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--deep-purple);
}

.vocab-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}

/* Section transitions */
.swish-out {
  animation: swishOut 0.4s ease-in forwards;
}

.swish-in {
  animation: swishIn 0.4s ease-out forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes swishOut {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(-80px) scale(0.95); opacity: 0; }
}

@keyframes swishIn {
  0% { transform: translateX(80px) scale(0.95); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Card removal animation */
.card-removing {
  animation: cardOut 0.4s ease-in forwards;
}

@keyframes cardOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8) translateY(20px); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .main-header {
    padding: 1.2rem 0.8rem 1.5rem;
    border-radius: 0 0 30px 30px;
  }

  .baby-character {
    font-size: 2.5rem;
  }

  .block {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.9rem;
  }

  .marker-area {
    padding: 1.2rem 1.2rem 0.8rem;
  }

  .words-section {
    margin-top: 0.3rem;
    padding-top: 1rem;
  }

  .words-title {
    margin-bottom: 0.1rem;
  }

  .words-counter {
    margin-bottom: 0.8rem;
  }

  .timeline-item:nth-child(odd) {
    padding-left: 0;
    padding-right: calc(50% + 1.2rem);
  }

  .timeline-item:nth-child(even) {
    padding-right: 0;
    padding-left: calc(50% + 1.2rem);
  }

  .timeline-item-linked:nth-child(odd) {
    padding-right: calc(50% + 1.2rem + var(--link-offset));
    padding-left: 0;
  }

  .timeline-item-linked:nth-child(even) {
    padding-left: calc(50% + 1.2rem + var(--link-offset));
    padding-right: 0;
  }

  .words-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
  }

  .trends-svg {
    height: 200px;
  }

  .trends-chart-container {
    padding: 0.8rem 0.4rem 0.8rem 0.2rem;
  }

  .trends-stat-card {
    padding: 1.1rem 1.2rem;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    border-radius: 28px 28px 0 0;
    max-height: 90vh;
  }
}

@media (min-width: 768px) {
  .words-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ===== Scrollbar ===== */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: var(--lavender);
  border-radius: 4px;
}

/* ===== Touch optimizations ===== */
@media (hover: none) {
  .word-card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
  }

  .word-card:hover::before {
    height: 4px;
  }

  .word-card:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
  }

  .timeline-card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
    border-color: transparent;
  }

  .timeline-card:active {
    transform: scale(0.96);
    transition-duration: 0.1s;
  }

  .add-btn:active {
    transform: scale(0.93);
  }
}

/* Loading state */
.loading-shimmer {
  background: linear-gradient(90deg, var(--lavender) 25%, var(--pink) 50%, var(--lavender) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 20px;
  height: 120px;
}

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

/* ===== Exact Match Pink Glow ===== */
.word-card-exact-match {
  animation: exactMatchGlow 2s ease-in-out infinite alternate;
}

@keyframes exactMatchGlow {
  0% {
    box-shadow: 0 0 8px rgba(255, 107, 157, 0.3), 0 0 20px rgba(255, 107, 157, 0.15);
  }
  100% {
    box-shadow: 0 0 16px rgba(255, 107, 157, 0.5), 0 0 40px rgba(255, 107, 157, 0.25);
  }
}

.word-card-exact-match::before {
  background: var(--hot-pink) !important;
  height: 6px !important;
}

/* ===== Duplicate Detection Modal ===== */
.duplicate-modal-content {
  max-width: 360px;
  text-align: center;
}

.duplicate-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.duplicate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--lavender);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Varela Round', sans-serif;
}

.duplicate-item:hover {
  background: var(--pink);
  transform: scale(1.02);
}

.duplicate-word {
  font-family: 'Karantina', sans-serif;
  font-size: 1.5rem;
  color: var(--deep-purple);
}

.duplicate-age {
  font-size: 0.8rem;
  color: var(--soft-purple);
}

.duplicate-continue-btn {
  background: linear-gradient(135deg, var(--soft-purple), var(--hot-pink));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 2rem;
  font-family: 'Secular One', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

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

/* ===== Add Flow Word Linking ===== */
.add-flow-link-wrap {
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
}

.add-flow-link-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.85rem;
  color: var(--deep-purple);
  cursor: pointer;
}

.add-flow-link-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--soft-purple);
  cursor: pointer;
}

.add-flow-link-search {
  margin-top: 0.5rem;
  position: relative;
}

.add-flow-link-search .link-search-wrap {
  position: relative;
}

.add-flow-link-search .link-results {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(45, 27, 105, 0.15);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  margin-bottom: 0.3rem;
}

.add-flow-link-search .link-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

/* ===== Wave Chart Styles ===== */
.wave-toggle-btn {
  display: block;
  margin: 1rem auto 0;
  background: linear-gradient(135deg, var(--soft-purple), var(--teal));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.55rem 1.5rem;
  font-family: 'Secular One', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(108, 92, 231, 0.25);
}

.wave-toggle-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 18px rgba(108, 92, 231, 0.35);
}

.wave-toggle-btn:active {
  transform: scale(0.97);
}

.wave-info-box {
  background: var(--lavender);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  margin-top: 0.8rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  color: var(--deep-purple);
  text-align: center;
  animation: tipFadeIn 0.3s ease;
}

/* =============================================
   Category Picker
   ============================================= */
.cat-picker-section {
  margin-top: 1rem;
  border-top: 1px solid rgba(108,92,231,0.1);
  padding-top: 0.8rem;
}
.cat-picker-label {
  display: block;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.85rem;
  color: var(--soft-purple);
  margin-bottom: 0.5rem;
}
.cat-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.subcat-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cat-pill {
  border: 2px solid var(--cat-color, #ccc);
  background: transparent;
  color: var(--deep-purple);
  border-radius: 50px;
  padding: 0.3rem 0.8rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cat-pill:hover {
  background: color-mix(in srgb, var(--cat-color) 15%, transparent);
}
.cat-pill.active {
  background: var(--cat-color);
  color: #fff;
  border-color: var(--cat-color);
}
.subcat-pill {
  border: 1px solid rgba(108,92,231,0.2);
  background: var(--lavender);
  color: var(--deep-purple);
  border-radius: 50px;
  padding: 0.2rem 0.7rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.subcat-pill:hover {
  background: rgba(108,92,231,0.15);
}
.subcat-pill.active {
  background: var(--soft-purple);
  color: #fff;
  border-color: var(--soft-purple);
}

/* =============================================
   Trends Tabs
   ============================================= */
.trends-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.trends-tab {
  border: none;
  background: var(--lavender);
  color: var(--deep-purple);
  border-radius: 50px;
  padding: 0.5rem 1.4rem;
  font-family: 'Secular One', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.trends-tab:hover {
  background: rgba(108,92,231,0.2);
}
.trends-tab.active {
  background: linear-gradient(135deg, #6C5CE7, #FF6B9D);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108,92,231,0.3);
}
.trends-tab-content {
  display: none;
}
.trends-tab-content.active {
  display: block;
}

/* =============================================
   Acquisition Analysis Cards
   ============================================= */
.acq-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.acq-card:hover {
  box-shadow: var(--card-shadow-hover);
}
.acq-card-title {
  font-family: 'Secular One', sans-serif;
  font-size: 1.05rem;
  color: var(--deep-purple);
  margin: 0 0 0.3rem;
}
.acq-card-subtitle {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.78rem;
  color: rgba(108,92,231,0.55);
  margin: 0 0 1rem;
}
.acq-chart-wrap {
  width: 100%;
  position: relative;
}
.acq-chart-wrap canvas {
  width: 100%;
  display: block;
}

/* Slider row */
.acq-slider-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.8rem;
}
.acq-slider-label {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.82rem;
  color: var(--soft-purple);
}
.acq-window-btns {
  display: flex;
  gap: 4px;
}
.acq-window-btn {
  border: 1px solid rgba(108,92,231,0.2);
  background: var(--lavender);
  color: var(--deep-purple);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 32px;
  text-align: center;
}
.acq-window-btn:hover {
  background: rgba(108,92,231,0.18);
}
.acq-window-btn.active {
  background: var(--soft-purple);
  color: #fff;
  border-color: var(--soft-purple);
}

/* Tooltip */
.acq-tooltip {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  color: var(--deep-purple);
  margin-top: 0.6rem;
  min-height: 1rem;
}
.acq-tip-card {
  background: var(--lavender);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  animation: tipFadeIn 0.3s ease;
  line-height: 1.7;
}

/* Legend */
.acq-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.8rem;
  justify-content: center;
}
.acq-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.75rem;
  color: var(--deep-purple);
}
.acq-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Insights */
.acq-insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acq-insight-card {
  background: linear-gradient(135deg, var(--lavender), rgba(108,92,231,0.08));
  border-radius: 14px;
  padding: 1rem 1.2rem;
  border-right: 4px solid var(--soft-purple);
  transition: transform 0.2s ease;
}
.acq-insight-card:hover {
  transform: translateX(-3px);
}
.acq-insight-text {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.88rem;
  color: var(--deep-purple);
  line-height: 1.7;
}
.acq-insight-empty {
  text-align: center;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.85rem;
  color: rgba(108,92,231,0.4);
  padding: 2rem;
}

/* Static + Dynamic Titles */
.acq-card-static-title {
  font-family: 'Secular One', sans-serif;
  font-size: 1.05rem;
  color: var(--deep-purple);
  margin: 0 0 0.15rem;
}
.acq-card-dynamic-title {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.85rem;
  color: var(--soft-purple);
  margin: 0 0 0.3rem;
  line-height: 1.5;
}

/* Streak Cards */
.streak-item {
  margin-bottom: 1rem;
}
.streak-item:last-child {
  margin-bottom: 0;
}
.acq-streak-stat {
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding: 0.9rem 1.2rem;
}
.streak-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0.3rem;
}
.streak-word-tag {
  display: inline-block;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.8rem;
  color: var(--deep-purple);
  background: var(--lavender);
  border-radius: 10px;
  padding: 0.2rem 0.6rem;
  border-right: 3px solid;
  transition: transform 0.15s ease;
}
.streak-word-tag:hover {
  transform: scale(1.06);
}
.streak-load-more {
  display: inline-block;
  font-family: 'Varela Round', sans-serif;
  font-size: 0.78rem;
  color: var(--soft-purple);
  background: none;
  border: 1px dashed rgba(108,92,231,0.3);
  border-radius: 10px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.streak-load-more:hover {
  background: var(--lavender);
  border-color: var(--soft-purple);
}

/* Mobile responsiveness for acquisition */
@media (max-width: 600px) {
  .acq-card {
    padding: 1rem;
    border-radius: 16px;
  }
  .acq-card-static-title {
    font-size: 0.95rem;
  }
  .acq-card-dynamic-title {
    font-size: 0.8rem;
  }
  .trends-tabs {
    gap: 4px;
  }
  .trends-tab {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
  }
  .cat-picker-row {
    gap: 4px;
  }
  .cat-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
  }
  .acq-window-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: 28px;
  }
}

/* ===== PWA: Install Banner ===== */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: white;
  box-shadow: 0 -4px 30px rgba(108, 92, 231, 0.15);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  animation: pwaSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-install-banner.hidden {
  transform: translateY(110%);
  pointer-events: none;
  opacity: 0;
}

@keyframes pwaSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

.pwa-install-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-text strong {
  display: block;
  font-family: 'Secular One', sans-serif;
  font-size: 0.95rem;
  color: var(--deep-purple);
  margin-bottom: 0.15rem;
}

.pwa-install-text span {
  font-size: 0.8rem;
  color: var(--soft-purple);
  opacity: 0.8;
}

.pwa-install-btn {
  flex-shrink: 0;
  padding: 0.6rem 1.3rem;
  font-family: 'Secular One', sans-serif;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--soft-purple), var(--hot-pink));
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

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

.pwa-install-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--deep-purple);
  opacity: 0.4;
  cursor: pointer;
  padding: 0.3rem;
}

/* ===== PWA: Realtime Notification Toast ===== */
.realtime-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(108, 92, 231, 0.2);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 90vw;
  animation: toastSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid var(--lavender);
}

.realtime-toast.hidden {
  display: none;
}

@keyframes toastSlideDown {
  from { transform: translateX(-50%) translateY(-120%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.realtime-toast-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.realtime-toast-text {
  font-family: 'Varela Round', sans-serif;
  font-size: 0.9rem;
  color: var(--deep-purple);
}

.realtime-toast-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--deep-purple);
  opacity: 0.4;
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
}

/* ===== PWA: Standalone Mode Adjustments ===== */
@media all and (display-mode: standalone) {
  body {
    /* Account for status bar / notch */
    padding-top: env(safe-area-inset-top, 0);
  }

  .main-header {
    padding-top: calc(1.5rem + env(safe-area-inset-top, 0));
  }

  /* Hide "open full app" links in standalone */
  .qa-link[href="index.html"] {
    display: none;
  }

  /* Adjust sticky nav for standalone */
  .section-nav {
    top: env(safe-area-inset-top, 0);
  }
}
