/* ============================================
   Three Wins — Daily Wins Journal  (v12)
   Visual overhaul: warm gradient system, CSS fire,
   progress ring, weekly dots, achievement badges,
   spring animations, glassmorphism, Inter
   v12: Seasonal themes, last-year wins, streak chime
   ============================================ */

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

:root {
  --bg: #0A0A0F;
  --bg-warm-1: rgba(255, 107, 53, 0.08);
  --bg-warm-2: rgba(255, 179, 71, 0.05);
  --bg-warm-3: rgba(255, 69, 0, 0.04);
  --bg-elevated: rgba(22, 22, 30, 0.65);
  --bg-input: rgba(22, 18, 16, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-primary: #F5F0EB;
  --text-secondary: #8A8078;
  --text-muted: #A89080;
  --orange: #FF6B35;
  --warm-gold: #FFB347;
  --gold: #FFD700;
  --red-fire: #FF4500;
  --white-hot: #FFF8E7;
  --ember: #CC4400;
  --deep-fire: #991100;
  --border: rgba(61, 43, 31, 0.6);
  --border-focus: #FF6B35;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring-heavy: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-fast: 150ms;
  --duration-med: 300ms;
  --duration-slow: 500ms;

  --glass-blur: 16px;
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow-orange: 0 4px 32px rgba(255, 107, 53, 0.12);
  --shadow-glow-gold: 0 4px 32px rgba(255, 215, 0, 0.08);
  --shadow-glow-warm: 0 4px 32px rgba(255, 179, 71, 0.1);

  /* Progress ring */
  --progress-ring-size: 72px;
  --progress-ring-stroke: 4px;
  --progress-ring-track: rgba(255, 255, 255, 0.06);
  --progress-ring-fill: url(#progressGradient);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, var(--bg-warm-1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 20% 100%, var(--bg-warm-2) 0%, transparent 45%),
    radial-gradient(ellipse 50% 40% at 85% 75%, var(--bg-warm-3) 0%, transparent 40%),
    radial-gradient(circle 400px at 50% 50%, rgba(255, 179, 71, 0.02) 0%, transparent 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 16px;
  line-height: 1.6;
}

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

/* === App container === */
.app {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================================
   FLAME — Pure CSS animated fire
   5 levels via data-level="1" through "5"
   ============================================ */

.flame-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 16px;
  min-height: 60px;
}

.flame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  filter: blur(0.5px);
  transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out);
}

.flame[data-level="0"] {
  display: none;
}

.flame__layer {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0;
  transition: all 0.6s var(--ease-out);
}

.flame__glow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.6s var(--ease-out);
}

/* --- Level 1: Ember (1-3 days) --- */
.flame[data-level="1"] {
  width: 40px;
  height: 50px;
}

.flame[data-level="1"] .flame__layer--1 {
  width: 24px;
  height: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 80%, #FF6B35 0%, #CC4400 60%, transparent 100%);
  opacity: 0.7;
  animation: ember-flicker 2s ease-in-out infinite;
}

.flame[data-level="1"] .flame__layer--2 {
  width: 16px;
  height: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 80%, #FF8C42 0%, #FF6B35 80%, transparent 100%);
  opacity: 0.5;
  animation: ember-flicker 1.8s ease-in-out infinite 0.3s;
}

.flame[data-level="1"] .flame__glow {
  width: 40px;
  height: 20px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.15) 0%, transparent 70%);
  opacity: 0.6;
}

/* --- Level 2: Growing flame (4-7 days) --- */
.flame[data-level="2"] {
  width: 60px;
  height: 80px;
}

.flame[data-level="2"] .flame__layer--1 {
  width: 36px;
  height: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FF4500 0%, #FF6B35 40%, #FFD700 80%, rgba(255, 248, 231, 0.4) 100%);
  opacity: 0.85;
  animation: flame-dance 1.5s ease-in-out infinite;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="2"] .flame__layer--2 {
  width: 24px;
  height: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FF6B35 0%, #FFD700 50%, #FFF8E7 100%);
  opacity: 0.7;
  animation: flame-dance 1.3s ease-in-out infinite 0.2s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="2"] .flame__glow {
  width: 60px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.2) 0%, transparent 70%);
  opacity: 0.8;
}

/* --- Level 3: Bonfire (8-14 days) --- */
.flame[data-level="3"] {
  width: 80px;
  height: 120px;
}

.flame[data-level="3"] .flame__layer--1 {
  width: 52px;
  height: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #CC2200 0%, #FF4500 25%, #FF6B35 50%, #FFD700 80%, rgba(255, 248, 231, 0.5) 100%);
  opacity: 0.9;
  animation: flame-dance 1.2s ease-in-out infinite;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="3"] .flame__layer--2 {
  width: 36px;
  height: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FF4500 0%, #FF6B35 30%, #FFD700 65%, #FFF8E7 100%);
  opacity: 0.8;
  animation: flame-dance 1s ease-in-out infinite 0.15s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="3"] .flame__layer--3 {
  width: 22px;
  height: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FFD700 0%, #FFF8E7 60%, #FFFFFF 100%);
  opacity: 0.7;
  animation: flame-dance 0.9s ease-in-out infinite 0.3s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="3"] .flame__glow {
  width: 90px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.25) 0%, transparent 70%);
  opacity: 1;
}

/* --- Level 4: Torch (15-30 days) --- */
.flame[data-level="4"] {
  width: 100px;
  height: 160px;
}

.flame[data-level="4"] .flame__layer--1 {
  width: 64px;
  height: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #991100 0%, #CC2200 15%, #FF4500 35%, #FF6B35 55%, #FFD700 80%, rgba(255, 248, 231, 0.6) 100%);
  opacity: 0.95;
  animation: flame-dance-intense 1s ease-in-out infinite;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="4"] .flame__layer--2 {
  width: 44px;
  height: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FF4500 0%, #FF6B35 30%, #FFD700 65%, #FFF8E7 100%);
  opacity: 0.85;
  animation: flame-dance-intense 0.9s ease-in-out infinite 0.1s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="4"] .flame__layer--3 {
  width: 28px;
  height: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FFD700 0%, #FFF8E7 50%, #FFFFFF 100%);
  opacity: 0.75;
  animation: flame-dance-intense 0.8s ease-in-out infinite 0.2s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="4"] .flame__layer--4 {
  width: 14px;
  height: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FFFFFF 0%, rgba(255, 255, 255, 0.8) 100%);
  opacity: 0.5;
  animation: flame-dance-intense 0.7s ease-in-out infinite 0.3s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="4"] .flame__glow {
  width: 120px;
  height: 50px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.3) 0%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
  opacity: 1;
}

/* --- Level 5: Epic flame (30+ days) --- */
.flame[data-level="5"] {
  width: 120px;
  height: 200px;
}

.flame[data-level="5"] .flame__layer--1 {
  width: 80px;
  height: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #661100 0%, #991100 10%, #CC2200 25%, #FF4500 40%, #FF6B35 55%, #FFD700 75%, rgba(255, 248, 231, 0.7) 100%);
  opacity: 1;
  animation: flame-dance-epic 0.8s ease-in-out infinite;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="5"] .flame__layer--2 {
  width: 56px;
  height: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FF4500 0%, #FF6B35 25%, #FFD700 60%, #FFF8E7 100%);
  opacity: 0.9;
  animation: flame-dance-epic 0.7s ease-in-out infinite 0.1s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="5"] .flame__layer--3 {
  width: 36px;
  height: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FFD700 0%, #FFF8E7 50%, #FFFFFF 100%);
  opacity: 0.8;
  animation: flame-dance-epic 0.65s ease-in-out infinite 0.2s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="5"] .flame__layer--4 {
  width: 18px;
  height: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, #FFFFFF 0%, rgba(255, 255, 255, 0.9) 100%);
  opacity: 0.6;
  animation: flame-dance-epic 0.55s ease-in-out infinite 0.3s;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.flame[data-level="5"] .flame__glow {
  width: 160px;
  height: 70px;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.4) 0%, rgba(255, 215, 0, 0.15) 40%, transparent 70%);
  opacity: 1;
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Level 5 particles via pseudo-elements */
.flame[data-level="5"]::before,
.flame[data-level="5"]::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: particle-rise 1.5s ease-out infinite;
}

.flame[data-level="5"]::before {
  width: 6px;
  height: 6px;
  background: var(--gold);
  bottom: 60%;
  left: 20%;
  animation-delay: 0s;
  opacity: 0;
}

.flame[data-level="5"]::after {
  width: 4px;
  height: 4px;
  background: var(--orange);
  bottom: 50%;
  right: 20%;
  animation-delay: 0.7s;
  opacity: 0;
}

/* === Flame burst on save === */
.flame--burst {
  animation: burst-flash 0.8s ease-out;
}

/* ============================================
   Flame Animations
   ============================================ */

@keyframes ember-flicker {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.8; transform: translateX(-50%) scale(1.05); }
}

@keyframes flame-dance {
  0%, 100% {
    transform: translateX(-50%) scaleX(1) scaleY(1);
  }
  25% {
    transform: translateX(-52%) scaleX(0.95) scaleY(1.04);
  }
  50% {
    transform: translateX(-50%) scaleX(1.02) scaleY(0.97);
  }
  75% {
    transform: translateX(-48%) scaleX(0.97) scaleY(1.02);
  }
}

@keyframes flame-dance-intense {
  0%, 100% {
    transform: translateX(-50%) scaleX(1) scaleY(1) rotate(0deg);
  }
  20% {
    transform: translateX(-53%) scaleX(0.94) scaleY(1.06) rotate(-1deg);
  }
  40% {
    transform: translateX(-49%) scaleX(1.04) scaleY(0.96) rotate(1deg);
  }
  60% {
    transform: translateX(-52%) scaleX(0.96) scaleY(1.03) rotate(-0.5deg);
  }
  80% {
    transform: translateX(-48%) scaleX(1.02) scaleY(0.98) rotate(0.5deg);
  }
}

@keyframes flame-dance-epic {
  0%, 100% {
    transform: translateX(-50%) scaleX(1) scaleY(1) rotate(0deg);
  }
  15% {
    transform: translateX(-54%) scaleX(0.92) scaleY(1.08) rotate(-2deg);
  }
  30% {
    transform: translateX(-48%) scaleX(1.06) scaleY(0.95) rotate(1.5deg);
  }
  50% {
    transform: translateX(-52%) scaleX(0.95) scaleY(1.05) rotate(-1deg);
  }
  70% {
    transform: translateX(-47%) scaleX(1.04) scaleY(0.97) rotate(2deg);
  }
  85% {
    transform: translateX(-51%) scaleX(0.98) scaleY(1.02) rotate(-0.5deg);
  }
}

@keyframes particle-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
  20% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.3);
  }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

@keyframes burst-flash {
  0% {
    filter: blur(0.5px) brightness(1);
    transform: scale(1);
  }
  30% {
    filter: blur(1px) brightness(1.8);
    transform: scale(1.2);
  }
  100% {
    filter: blur(0.5px) brightness(1);
    transform: scale(1);
  }
}

/* ============================================
   Streak Counter
   ============================================ */
.streak {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 10, 10, 0.6);
  transition: box-shadow 0.3s ease;
}
.streak:hover {
  box-shadow: 0 0 24px rgba(255, 107, 53, 0.4), 0 0 48px rgba(255, 215, 0, 0.15);
}

.streak__count {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--warm-gold) 10%, var(--orange) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 2px 12px rgba(255, 179, 71, 0.3));
}

.streak__label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.streak__badge {
  font-size: 24px;
  line-height: 1;
  margin-left: 4px;
  animation: milestone-bounce 0.6s ease-out;
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.3));
}

.streak[data-streak="0"] {
  display: none;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px 28px;
  position: relative;
}

.empty-state::before {
  content: '';
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.15) 0%, rgba(255, 215, 0, 0.05) 60%, transparent 100%);
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.1);
  animation: empty-pulse 3s ease-in-out infinite;
}

.empty-state__text {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
}

@keyframes empty-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.1); opacity: 1; }
}

/* ============================================
   Date
   ============================================ */
.date {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 28px;
  display: block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   Wins Form (Note Editor)
   ============================================ */
.wins {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wins__field {
  width: 100%;
  position: relative;
}

.wins__input {
  width: 100%;
  background: var(--bg-input);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  padding: 16px 18px;
  outline: none;
  transition: border-color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out),
              background var(--duration-med) var(--ease-out);
  min-height: 52px;
}

.wins__input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.wins__input:focus {
  border-color: var(--border-focus);
  background: rgba(30, 22, 18, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12),
              0 0 24px rgba(255, 107, 53, 0.08),
              0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.wins__input:read-only {
  opacity: 0.8;
  cursor: default;
  border-color: var(--border);
  box-shadow: none;
}

.wins__input:read-only:focus {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

/* ============================================
   Category Pills / Chips
   ============================================ */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 0 2px;
}

.category-pills--readonly {
  opacity: 0.6;
  pointer-events: none;
}

.cat-pill {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.3;
}

.cat-pill:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.cat-pill--active {
  background: color-mix(in srgb, var(--pill-color, var(--orange)) 15%, transparent);
  border-color: var(--pill-color, var(--orange));
  color: var(--pill-color, var(--orange));
  box-shadow: 0 0 8px color-mix(in srgb, var(--pill-color, var(--orange)) 25%, transparent);
}

.cat-pill:disabled {
  cursor: default;
}

/* ============================================
   Feed Category Tags
   ============================================ */
.feed__cat-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  background: color-mix(in srgb, var(--cat-color, var(--orange)) 15%, transparent);
  color: var(--cat-color, var(--orange));
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--orange)) 30%, transparent);
  vertical-align: middle;
  line-height: 1.4;
}

/* === Buttons === */
.wins__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.96);
}

.btn--done {
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #0A0A0A;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.25),
              0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn--done:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(255, 107, 53, 0.35),
              0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn--done:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--edit {
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  border: 1.5px solid var(--glass-border);
}

.btn--edit:hover,
.btn--edit:focus-visible {
  border-color: var(--orange);
  box-shadow: var(--shadow-glow-orange);
  transform: translateY(-1px);
}

/* Save error message */
.wins__error {
  color: #FF6B35;
  font-size: 14px;
  text-align: center;
  padding: 8px 0;
  animation: feed-fade-in 300ms ease-out;
}

/* ============================================
   Export Button
   ============================================ */
.export-wrap {
  width: 100%;
  margin-top: 12px;
}

.export-wrap[hidden] { display: none !important; }

.btn--export {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-med) var(--ease-out),
              color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn--export:hover,
.btn--export:focus-visible {
  border-color: var(--gold);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-1px);
}

/* ============================================
   Feed — Past Entries (Note Cards)
   ============================================ */
.feed {
  width: 100%;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed__entry {
  padding: 20px 22px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  border-left: none;
  animation: feed-fade-in var(--duration-slow) var(--ease-out) both;
  transition: transform var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.feed__entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--cat-color, var(--warm-gold)), color-mix(in srgb, var(--cat-color, var(--orange)) 80%, transparent));
}

.feed__entry:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-soft),
              0 4px 32px rgba(255, 107, 53, 0.22),
              0 0 48px rgba(255, 107, 53, 0.10);
  border-color: rgba(255, 255, 255, 0.15);
}

/* v9: feed__date moved to bottom of file with enhanced styling */

.feed__wins {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* v9: feed__win moved to bottom of file with enhanced styling */

.feed__win::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
  transition: transform var(--duration-med) var(--ease-spring);
}

.feed__entry:hover .feed__win::before {
  transform: scale(1.3);
}

@keyframes feed-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Feed entry staggered animation */
.feed__entry:nth-child(1)  { animation-delay: 0ms; }
.feed__entry:nth-child(2)  { animation-delay: 60ms; }
.feed__entry:nth-child(3)  { animation-delay: 120ms; }
.feed__entry:nth-child(4)  { animation-delay: 180ms; }
.feed__entry:nth-child(5)  { animation-delay: 240ms; }
.feed__entry:nth-child(6)  { animation-delay: 300ms; }
.feed__entry:nth-child(7)  { animation-delay: 360ms; }
.feed__entry:nth-child(8)  { animation-delay: 420ms; }
.feed__entry:nth-child(9)  { animation-delay: 480ms; }
.feed__entry:nth-child(10) { animation-delay: 540ms; }
.feed__entry:nth-child(11) { animation-delay: 600ms; }
.feed__entry:nth-child(12) { animation-delay: 660ms; }
.feed__entry:nth-child(13) { animation-delay: 720ms; }
.feed__entry:nth-child(14) { animation-delay: 780ms; }
.feed__entry:nth-child(15) { animation-delay: 840ms; }
.feed__entry:nth-child(16) { animation-delay: 900ms; }
.feed__entry:nth-child(17) { animation-delay: 960ms; }
.feed__entry:nth-child(18) { animation-delay: 1020ms; }
.feed__entry:nth-child(19) { animation-delay: 1080ms; }
.feed__entry:nth-child(20) { animation-delay: 1140ms; }

/* ============================================
   Level 5 JS Particles
   ============================================ */
.flame__particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  filter: blur(1px);
  opacity: 0;
  animation: particle-rise-js 2s ease-out infinite;
  pointer-events: none;
}

@keyframes particle-rise-js {
  0% {
    opacity: 0.8;
    transform: translateY(0) translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) translateX(var(--drift, 5px));
  }
}

/* ============================================
   Input micro-delight: has-text scale
   ============================================ */
.wins__input.has-text {
  transform: scale(1.012);
  border-color: rgba(255, 107, 53, 0.25);
  transition: border-color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out);
}

/* ============================================
   Milestone Celebration Overlay
   ============================================ */
.milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  animation: milestone-fade-in 0.5s ease-out;
}

.milestone-overlay__card {
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 32px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft),
              0 0 60px rgba(255, 107, 53, 0.1);
  position: relative;
  overflow: hidden;
}

.milestone-overlay__emoji {
  font-size: 72px;
  line-height: 1;
  animation: milestone-bounce 0.6s ease-out;
  z-index: 2;
}

.milestone-overlay__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #FFD700, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  z-index: 2;
}

.milestone-overlay__subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  z-index: 2;
}

.milestone-overlay__btn {
  min-height: 52px;
  padding: 14px 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #0A0A0A;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.25);
  z-index: 2;
}

.milestone-overlay__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 107, 53, 0.35);
}

.milestone-overlay__btn:active {
  transform: scale(0.97);
}

@keyframes milestone-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes milestone-bounce {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Confetti CSS Animation
   ============================================ */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  opacity: 0;
  animation: confetti-fall var(--fall-duration, 3s) ease-out var(--fall-delay, 0s) forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(400px) translateX(var(--drift, 0px)) rotate(var(--spin, 360deg));
  }
}

/* ============================================
   Weekly Wins Digest Overlay
   ============================================ */
.digest-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 12, 0.94);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
  animation: milestone-fade-in 0.5s ease-out;
}

.digest-overlay__card {
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.digest-overlay__title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #FFD700, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.digest-overlay__stats {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.digest-overlay__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  min-width: 100px;
}

.digest-overlay__stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.digest-overlay__stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* v13: Win Word Cloud */
.digest-word-cloud {
  text-align: center;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}
.digest-word-cloud__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.digest-word-cloud__words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: baseline;
}
.digest-word-cloud__word {
  font-weight: 700;
  background: linear-gradient(135deg, #FFD700, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 2px 6px;
}

#digest-days {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.digest-overlay__day {
  padding: 18px 20px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--warm-gold);
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out);
}

.digest-overlay__day:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft), var(--shadow-glow-orange);
}

.digest-overlay__day-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.digest-overlay__day-wins {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.digest-overlay__day-win {
  font-size: 15px;
  color: var(--text-primary);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.digest-overlay__day-win::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 107, 53, 0.4);
}

.digest-overlay__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.digest-overlay__btn {
  flex: 1;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out),
              border-color var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.digest-overlay__btn:active {
  transform: scale(0.97);
}

.digest-overlay__btn--share {
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  border: 1.5px solid var(--glass-border);
}

.digest-overlay__btn--share:hover,
.digest-overlay__btn--share:focus-visible {
  border-color: var(--orange);
  box-shadow: var(--shadow-glow-orange);
  transform: translateY(-1px);
}

.digest-overlay__btn--done {
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #0A0A0A;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.25);
}

.digest-overlay__btn--done:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 107, 53, 0.35);
}

/* P3-8: Defensive hidden for overlay dialogs */
.milestone-overlay[hidden] { display: none !important; }
.digest-overlay[hidden] { display: none !important; }

/* ============================================
   v6: Win Save Animation — card pulse + toast
   ============================================ */
@keyframes card-pulse {
  0%   { transform: scale(1);    box-shadow: var(--shadow-soft); }
  40%  { transform: scale(1.02); box-shadow: var(--shadow-soft), 0 0 28px rgba(255, 107, 53, 0.25); }
  100% { transform: scale(1);    box-shadow: var(--shadow-soft); }
}

.wins--saved {
  animation: card-pulse 0.6s var(--ease-spring);
}

.save-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(22, 22, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 107, 53, 0.25);
  border-radius: 14px;
  padding: 12px 24px;
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-spring),
              opacity 0.3s var(--ease-out);
  box-shadow: 0 4px 24px rgba(255, 107, 53, 0.15),
              0 0 40px rgba(255, 215, 0, 0.08);
  text-align: center;
}

.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   v6: Enhanced Flame Glow (streak > 7)
   ============================================ */
.flame[data-level="3"] .flame__glow,
.flame[data-level="4"] .flame__glow,
.flame[data-level="5"] .flame__glow {
  animation: glow-pulse-bright 1.5s ease-in-out infinite;
}

@keyframes glow-pulse-bright {
  0%, 100% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.2);
    filter: brightness(1.5);
  }
}

.flame[data-level="3"]::before,
.flame[data-level="4"]::before {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.12) 0%, transparent 70%);
  animation: glow-pulse-bright 2s ease-in-out infinite 0.3s;
  pointer-events: none;
}

/* ============================================
   v6: Monthly Summary Staggered Animation
   ============================================ */
@keyframes stat-count-in {
  0%   { opacity: 0; transform: translateY(12px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.monthly-summary__card {
  animation: feed-fade-in 0.5s var(--ease-out) both;
}

.monthly-stat {
  opacity: 0;
  animation: stat-count-in 0.5s var(--ease-spring) both;
}

.monthly-stat:nth-child(1) { animation-delay: 0.15s; }
.monthly-stat:nth-child(2) { animation-delay: 0.3s; }
.monthly-stat:nth-child(3) { animation-delay: 0.45s; }

.monthly-summary__title {
  opacity: 0;
  animation: stat-count-in 0.4s var(--ease-out) 0.05s both;
}

.btn--monthly-dismiss {
  opacity: 0;
  animation: stat-count-in 0.4s var(--ease-out) 0.55s both;
}

/* ============================================
   Focus visible
   ============================================ */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

input:focus-visible {
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.cat-pill:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

.btn--done:focus-visible,
.btn--edit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

.btn--share:focus-visible,
.btn--export:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.onboarding__cta:focus-visible {
  outline: 2px solid #FFF;
  outline-offset: 3px;
}

.milestone-overlay__btn:focus-visible,
.btn--monthly-dismiss:focus-visible,
.digest-overlay__btn:focus-visible {
  outline: 2px solid #FFF;
  outline-offset: 3px;
}

.reflection-textarea:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12),
              0 0 20px rgba(255, 215, 0, 0.08);
}

.btn--reflection-save:focus-visible,
.btn--reflection-skip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================
   Accessibility — Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Accessibility — High Contrast (forced-colors)
   ============================================ */
@media (forced-colors: active) {
  .streak__count {
    -webkit-text-fill-color: CanvasText;
    background: none;
  }
}

/* ============================================
   Responsive
   ============================================ */

/* Small phones */
@media (max-width: 360px) {
  .wins__input {
    font-size: 16px;
    padding: 13px 14px;
  }

  .streak__count {
    font-size: 36px;
  }

  .feed__entry {
    padding: 16px 18px;
    border-radius: 14px;
  }

  .empty-state::before {
    width: 48px;
    height: 48px;
  }

  .cat-pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .digest-overlay__stats {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================
   Onboarding Overlay
   ============================================ */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 107, 53, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.onboarding__card {
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 32px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft),
              0 0 80px rgba(255, 107, 53, 0.06);
}

.onboarding__flame {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 4px 16px rgba(255, 107, 53, 0.3));
  display: none; /* v9: replaced by CSS fire */
}

.onboarding__title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--warm-gold) 0%, var(--orange) 50%, var(--gold) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

.onboarding__text {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 400;
}

.onboarding__cta {
  min-height: 52px;
  padding: 14px 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #0A0A0A;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 24px rgba(255, 107, 53, 0.3);
  letter-spacing: 0.01em;
}

.onboarding__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
}

.onboarding__cta:active {
  transform: scale(0.97);
}

/* ============================================
   Share Button
   ============================================ */
.share-wrap {
  width: 100%;
  margin-top: 20px;
}

.btn--share {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-med) var(--ease-out),
              color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out),
              transform var(--duration-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn--share:hover,
.btn--share:focus-visible {
  border-color: var(--orange);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow-orange);
  transform: translateY(-1px);
}

/* ============================================
   Reflection Prompt
   ============================================ */
.reflection-wrap {
  width: 100%;
  margin-top: 16px;
  animation: feed-fade-in var(--duration-slow) var(--ease-out) both;
}

.reflection-wrap[hidden] { display: none !important; }

.reflection-card {
  padding: 20px 22px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--gold);
  box-shadow: var(--shadow-soft);
}

.reflection-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
  letter-spacing: 0.01em;
}

.reflection-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg-input);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 16px;
  outline: none;
  resize: vertical;
  transition: border-color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-med) var(--ease-out);
}

.reflection-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12),
              0 0 20px rgba(255, 215, 0, 0.08);
}

.reflection-textarea::placeholder {
  color: var(--text-muted);
}

.reflection-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.reflection-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.btn--reflection-save {
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  color: #0A0A0A;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}

.btn--reflection-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.3);
}

.btn--reflection-save:active {
  transform: scale(0.96);
}

.btn--reflection-skip {
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid var(--glass-border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-med) var(--ease-out),
              color var(--duration-med) var(--ease-out);
}

.btn--reflection-skip:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ============================================
   Monthly Summary
   ============================================ */
.monthly-summary {
  width: 100%;
  margin-top: 20px;
  animation: feed-fade-in var(--duration-slow) var(--ease-out) both;
}

.monthly-summary[hidden] { display: none !important; }

.monthly-summary__card {
  padding: 24px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft),
              0 0 40px rgba(255, 215, 0, 0.06);
  text-align: center;
}

.monthly-summary__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #FFD700, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.monthly-summary__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.monthly-stat {
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}

.monthly-stat__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.monthly-stat__value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.btn--monthly-dismiss {
  min-height: 44px;
  padding: 10px 32px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #0A0A0A;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
}

.btn--monthly-dismiss:hover {
  transform: translateY(-1px);
}

.btn--monthly-dismiss:active {
  transform: scale(0.96);
}

/* Reflection in feed entry */
.feed__reflection {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 10px;
  border-left: 2px solid var(--gold);
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.55;
}

/* Desktop */
@media (min-width: 600px) {
  body {
    padding: 40px 24px;
  }

  .app {
    padding-top: 60px;
  }

  .wins__input {
    font-size: 18px;
    padding: 18px 20px;
  }

  .feed__entry {
    padding: 24px 26px;
  }

  .onboarding__card,
  .milestone-overlay__card {
    padding: 48px 40px;
  }
}
/* === v7: PWA Install Banner === */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-sans);
  animation: pwaSlideUp 0.35s var(--ease-out) both;
}
.pwa-install-banner.visible { display: flex; }
.pwa-install-banner__text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
.pwa-install-banner__text strong { font-weight: 700; color: var(--orange); }
.pwa-install-banner__actions { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-install-banner__btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: opacity var(--duration-fast);
}
.pwa-install-banner__btn--install {
  background: linear-gradient(135deg, var(--orange), var(--red-fire));
  color: #fff;
}
.pwa-install-banner__btn--dismiss {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
@keyframes pwaSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   v8: Light Mode (toggle-based)
   ============================================ */
[data-theme="light"] {
  --bg: #FBF8F4;
  --bg-warm-1: rgba(232, 90, 42, 0.05);
  --bg-warm-2: rgba(212, 162, 0, 0.04);
  --bg-warm-3: rgba(208, 58, 0, 0.03);
  --bg-elevated: rgba(255, 255, 255, 0.75);
  --bg-input: rgba(245, 240, 235, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.25);
  --text-primary: #2C2520;
  --text-secondary: #8A7E74;
  --text-muted: #A09080;
  --orange: #E85A2A;
  --warm-gold: #D4960A;
  --gold: #D4A200;
  --red-fire: #D03A00;
  --white-hot: #FFF8E7;
  --ember: #B03800;
  --deep-fire: #801000;
  --border: rgba(180, 160, 140, 0.4);
  --border-focus: #E85A2A;
  --glass-border: rgba(180, 160, 140, 0.25);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow-orange: 0 4px 32px rgba(232, 90, 42, 0.1);
  --shadow-glow-gold: 0 4px 32px rgba(212, 162, 0, 0.06);
  --shadow-glow-warm: 0 4px 32px rgba(212, 150, 10, 0.08);
  --progress-ring-track: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 90, 42, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 30% 100%, rgba(212, 162, 0, 0.03) 0%, transparent 50%);
}

[data-theme="light"] .streak {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .streak__count {
  background: linear-gradient(180deg, #D4A200 10%, #E85A2A 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme="light"] .btn--done {
  background: linear-gradient(135deg, var(--orange) 0%, var(--gold) 100%);
  color: #FFF;
}

[data-theme="light"] .feed__entry {
  background: var(--bg-elevated);
  border-color: var(--glass-border);
}

[data-theme="light"] .onboarding {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(232, 90, 42, 0.06) 0%, transparent 60%);
}

[data-theme="light"] .milestone-overlay {
  background: rgba(251, 248, 244, 0.92);
}

[data-theme="light"] .digest-overlay {
  background: rgba(251, 248, 244, 0.94);
}

[data-theme="light"] .save-toast {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(232, 90, 42, 0.25);
  color: var(--orange);
}

/* ============================================
   v8: Dark Mode Toggle Button
   ============================================ */
.dark-mode-toggle {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border);
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-med) var(--ease-out),
              border-color var(--duration-med) var(--ease-out);
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  border-color: var(--orange);
  box-shadow: var(--shadow-glow-orange);
}

.dark-mode-toggle:active {
  transform: scale(0.95);
}

.dark-mode-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.dark-mode-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.3s var(--ease-spring);
}

.dark-mode-toggle:hover .dark-mode-icon {
  transform: rotate(30deg);
}

/* ============================================
   v8: Win Template Chips
   ============================================ */
.win-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  width: 100%;
}

.win-template-chip {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
  white-space: nowrap;
}

.win-template-chip:hover {
  border-color: var(--orange);
  color: var(--text-primary);
  background: rgba(255, 107, 53, 0.08);
  transform: translateY(-1px);
}

.win-template-chip:active {
  transform: scale(0.96);
}

.win-template-chip:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.win-templates[hidden] { display: none !important; }

/* ============================================
   v8: Streak Calendar
   ============================================ */
.streak-calendar-wrap {
  width: 100%;
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}

.streak-calendar-wrap[hidden] { display: none !important; }

.streak-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.streak-cal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.streak-cal-nav {
  font-family: var(--font-sans);
  font-size: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.streak-cal-nav:hover {
  color: var(--text-primary);
  background: rgba(255, 107, 53, 0.08);
}

.streak-cal-nav:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.streak-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.streak-cal-day-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0;
}

.streak-cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast);
  position: relative;
}

.streak-cal-cell--empty {
  visibility: hidden;
}

.streak-cal-cell--has-entry {
  background: rgba(52, 211, 153, 0.2);
  color: #34D399;
  font-weight: 700;
}

.streak-cal-cell--today {
  border: 1.5px solid var(--orange);
}

.streak-cal-cell--today.streak-cal-cell--has-entry {
  background: rgba(52, 211, 153, 0.25);
  border-color: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.streak-cal-cell--future {
  opacity: 0.3;
}

/* ============================================
   v9: Win Entry Slide-in Animation
   ============================================ */
@keyframes win-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-24px) scale(0.96);
  }
  60% {
    transform: translateX(4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.feed__entry--new {
  animation: win-slide-in 0.6s var(--ease-spring-heavy) both;
}

/* v9: Celebration pulse on streak milestones */
@keyframes celebration-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.4); }
  40%  { box-shadow: 0 0 0 12px rgba(255, 179, 71, 0.15); }
  70%  { box-shadow: 0 0 0 20px rgba(255, 179, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
}

.streak--celebrate {
  animation: celebration-pulse 1s var(--ease-out);
}

/* v14: Streak Freeze button */
.btn-streak-freeze {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #87CEEB;
  background: rgba(135, 206, 235, 0.1);
  border: 1.5px solid rgba(135, 206, 235, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 8px;
  transition: background var(--duration-fast), transform var(--duration-fast);
}
.btn-streak-freeze:hover {
  background: rgba(135, 206, 235, 0.2);
  transform: scale(1.05);
}
.btn-streak-freeze:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* ============================================
   v9: Streak Progress Ring (SVG)
   ============================================ */
.progress-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.progress-ring {
  width: var(--progress-ring-size);
  height: var(--progress-ring-size);
  transform: rotate(-90deg);
}

.progress-ring__track {
  fill: none;
  stroke: var(--progress-ring-track);
  stroke-width: var(--progress-ring-stroke);
}

.progress-ring__fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: var(--progress-ring-stroke);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.progress-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.progress-ring__value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--warm-gold) 0%, var(--orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.progress-ring__sublabel {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ============================================
   v9: Weekly Progress Dots (Mon-Sun)
   ============================================ */
.weekly-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.weekly-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s var(--ease-spring);
  position: relative;
}

.weekly-dot--filled {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
}

.weekly-dot--today {
  border-color: var(--warm-gold);
  box-shadow: 0 0 6px rgba(255, 179, 71, 0.3);
}

.weekly-dot--today.weekly-dot--filled {
  background: linear-gradient(135deg, var(--orange), var(--warm-gold));
  border-color: var(--warm-gold);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.5);
}

.weekly-dot__label {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ============================================
   v9: Achievement Badges (visual upgrade)
   ============================================ */
.achievement-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.achievement-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}

.achievement-badge--earned {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 179, 71, 0.1));
  border: 1.5px solid rgba(255, 179, 71, 0.3);
  box-shadow: 0 2px 12px rgba(255, 107, 53, 0.15);
}

.achievement-badge--earned:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.achievement-badge--locked {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  opacity: 0.4;
}

.achievement-badge__icon {
  width: 20px;
  height: 20px;
}

.achievement-badge__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(20, 18, 16, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s var(--ease-spring);
  z-index: 10;
}

.achievement-badge:hover .achievement-badge__tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ============================================
   v9: Gradient Hero Text
   ============================================ */
.greeting-hero {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--warm-gold) 0%, var(--orange) 50%, var(--gold) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

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

/* ============================================
   v9: Onboarding CSS Fire (replaces emoji)
   ============================================ */
.onboarding__fire-icon {
  width: 80px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 6px 28px rgba(255, 107, 53, 0.55)) drop-shadow(0 0 40px rgba(255, 69, 0, 0.3));
}

.onboarding__fire-icon .ob-flame {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.onboarding__fire-icon .ob-flame--outer {
  width: 60px;
  height: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, var(--deep-fire) 0%, var(--red-fire) 25%, var(--orange) 50%, var(--warm-gold) 80%, rgba(255, 248, 231, 0.6) 100%);
  opacity: 0.95;
  animation: flame-dance 1.2s ease-in-out infinite;
}

.onboarding__fire-icon .ob-flame--mid {
  width: 40px;
  height: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, var(--orange) 0%, var(--warm-gold) 50%, var(--white-hot) 100%);
  opacity: 0.8;
  animation: flame-dance 1s ease-in-out infinite 0.15s;
}

.onboarding__fire-icon .ob-flame--inner {
  width: 22px;
  height: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, var(--gold) 0%, var(--white-hot) 60%, #FFFFFF 100%);
  opacity: 0.7;
  animation: flame-dance 0.9s ease-in-out infinite 0.3s;
}

.onboarding__fire-icon .ob-flame--glow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.45) 0%, rgba(255, 69, 0, 0.15) 50%, transparent 70%);
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ============================================
   v9: Enhanced Feed Date Headers
   ============================================ */
.feed__date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  position: relative;
  padding-bottom: 8px;
}

.feed__date::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
  border-radius: 1px;
}

/* v9: Feed win text refinements */
.feed__win {
  font-size: 15px;
  color: var(--text-primary);
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.005em;
}

/* ============================================
   v12: Seasonal Theme Accent Override
   ============================================ */
[data-season="spring"] .streak__count,
[data-season="spring"] .feed__date::after {
  color: var(--seasonal-accent, #34D399);
  background: var(--seasonal-accent, #34D399);
}
[data-season="spring"] .btn--done {
  border-color: var(--seasonal-accent, #34D399);
}
[data-season="summer"] .streak__count,
[data-season="summer"] .feed__date::after {
  color: var(--seasonal-accent, #FBBF24);
  background: var(--seasonal-accent, #FBBF24);
}
[data-season="summer"] .btn--done {
  border-color: var(--seasonal-accent, #FBBF24);
}
[data-season="autumn"] .streak__count,
[data-season="autumn"] .feed__date::after {
  color: var(--seasonal-accent, #FB923C);
  background: var(--seasonal-accent, #FB923C);
}
[data-season="autumn"] .btn--done {
  border-color: var(--seasonal-accent, #FB923C);
}
[data-season="winter"] .streak__count,
[data-season="winter"] .feed__date::after {
  color: var(--seasonal-accent, #60A5FA);
  background: var(--seasonal-accent, #60A5FA);
}
[data-season="winter"] .btn--done {
  border-color: var(--seasonal-accent, #60A5FA);
}

/* ============================================
   v12: "This Time Last Year" card
   ============================================ */
.last-year-wins {
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--bg-elevated, rgba(22, 22, 30, 0.65));
  border: 1px solid var(--border);
  border-left: 3px solid var(--seasonal-accent, var(--warm-gold, #FFB347));
  border-radius: 12px;
  animation: win-slide-in var(--duration-slow, 500ms) var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.last-year-wins__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
  opacity: 0.8;
}
.last-year-wins__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.last-year-wins__item {
  font-size: 14px;
  color: var(--text-primary);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.6;
  opacity: 0.85;
}
.last-year-wins__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seasonal-accent, var(--warm-gold, #FFB347));
  opacity: 0.6;
}

[data-theme="light"] .last-year-wins {
  background: rgba(255, 255, 255, 0.7);
}

/* v16: Streak record flash */
@keyframes streakRecordFlash{0%{opacity:0;transform:translateX(-50%) scale(0.7) translateY(10px)}15%{opacity:1;transform:translateX(-50%) scale(1.1) translateY(0)}30%{transform:translateX(-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translateX(-50%) translateY(-20px)}}

.oc-footer{text-align:center;padding:20px 16px 24px;margin-top:24px}
.oc-footer a{font-size:.78rem;color:var(--text-muted,var(--text-secondary,#888));text-decoration:none;opacity:.6;transition:opacity .2s}
.oc-footer a:hover{opacity:1}

/* === Print Styles === */
@media print{
  .onboarding,.skip-link,.pwa-banner,.oc-footer,.toast,
  .flame-container,.progress-ring-wrap,.weekly-dots,
  .win-templates,.category-pills,.btn-streak-freeze,
  .achievement-badges,.empty-state,.cat-pill,
  .reflection-footer,.theme-toggle,
  button{display:none!important}
  body{background:#fff!important;color:#000!important;font-size:12pt}
  .app{max-width:100%;padding:0;margin:0;background:#fff!important}
  .greeting-hero{color:#000!important}
  .streak{color:#000!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .streak__count{color:#000!important}
  .date{color:#333!important}
  .wins{background:#fff!important}
  .wins__input{border:1px solid #ccc!important;background:#fff!important;color:#000!important;padding:8px}
  .wins__field{break-inside:avoid;margin-bottom:8px}
  .reflection{break-inside:avoid;border:1px solid #ccc;background:#fff!important;color:#000!important;box-shadow:none;padding:12px;margin-top:12px}
  @page{margin:1.5cm;size:auto}
}
