/* style.css — Soul Safety Design System & Components */

/* ===== DESIGN TOKENS ===== */
:root, [data-theme="light"] {
  --font-display: 'Sentient', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm cream/linen */
  --color-bg:               #f5f0e8;
  --color-surface:          #faf6ef;
  --color-surface-2:        #fdfbf7;
  --color-surface-offset:   #ede7dc;
  --color-surface-offset-2: #e5ded2;
  --color-surface-dynamic:  #ddd5c8;
  --color-divider:          #d4cab9;
  --color-border:           #c9bfad;

  /* Text */
  --color-text:           #2c2419;
  --color-text-muted:     #7a6f5e;
  --color-text-faint:     #b5a991;
  --color-text-inverse:   #faf6ef;

  /* Terracotta Primary */
  --color-primary:        #c2623a;
  --color-primary-hover:  #a84f2b;
  --color-primary-active: #8e3f20;
  --color-primary-highlight: #f0ddd2;

  /* Sage Green */
  --color-sage:           #6b7f5e;
  --color-sage-hover:     #5a6d4e;
  --color-sage-active:    #4a5c40;
  --color-sage-highlight: #dce5d5;

  /* Golden Amber */
  --color-amber:          #c9922a;
  --color-amber-hover:    #b07e1e;
  --color-amber-active:   #946915;
  --color-amber-highlight: #f0e4c8;

  /* Disco Violet */
  --color-disco:          #9b6db5;
  --color-disco-hover:    #855ba0;
  --color-disco-active:   #6f4a89;
  --color-disco-highlight: #e4d6ed;

  --color-error:          #a13544;
  --color-error-hover:    #882d3a;
  --color-error-highlight: #f0d5d5;
  --color-success:        #4a7a3a;
  --color-success-hover:  #3b6430;
  --color-success-highlight: #d5e5d0;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.25 0.02 60 / 0.08);
  --shadow-md: 0 4px 12px oklch(0.25 0.02 60 / 0.1);
  --shadow-lg: 0 12px 32px oklch(0.25 0.02 60 / 0.14);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* DARK MODE — warm dark, not cold */
[data-theme="dark"] {
  --color-bg:               #1a1612;
  --color-surface:          #211d17;
  --color-surface-2:        #28231c;
  --color-surface-offset:   #1e1a15;
  --color-surface-offset-2: #2e2821;
  --color-surface-dynamic:  #362f26;
  --color-divider:          #3a322a;
  --color-border:           #4a4138;

  --color-text:           #e0d8cc;
  --color-text-muted:     #9a8e7c;
  --color-text-faint:     #6a5f50;
  --color-text-inverse:   #1a1612;

  --color-primary:        #d98a64;
  --color-primary-hover:  #c67a54;
  --color-primary-active: #b06a44;
  --color-primary-highlight: #3a2a20;

  --color-sage:           #8da47e;
  --color-sage-hover:     #7d946e;
  --color-sage-active:    #6d845e;
  --color-sage-highlight: #2a3425;

  --color-amber:          #daa854;
  --color-amber-hover:    #c49744;
  --color-amber-active:   #ae8634;
  --color-amber-highlight: #3a3020;

  --color-disco:          #b88dd0;
  --color-disco-hover:    #a67cbe;
  --color-disco-active:   #946bac;
  --color-disco-highlight: #332840;

  --color-error:          #d06070;
  --color-error-hover:    #b85060;
  --color-error-highlight: #3a2025;
  --color-success:        #6daa55;
  --color-success-hover:  #5d9a45;
  --color-success-highlight: #253020;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #1a1612; --color-surface: #211d17; --color-surface-2: #28231c;
    --color-surface-offset: #1e1a15; --color-surface-offset-2: #2e2821;
    --color-surface-dynamic: #362f26; --color-divider: #3a322a; --color-border: #4a4138;
    --color-text: #e0d8cc; --color-text-muted: #9a8e7c; --color-text-faint: #6a5f50;
    --color-text-inverse: #1a1612;
    --color-primary: #d98a64; --color-primary-hover: #c67a54; --color-primary-active: #b06a44;
    --color-primary-highlight: #3a2a20;
    --color-sage: #8da47e; --color-sage-hover: #7d946e; --color-sage-active: #6d845e;
    --color-sage-highlight: #2a3425;
    --color-amber: #daa854; --color-amber-hover: #c49744; --color-amber-active: #ae8634;
    --color-amber-highlight: #3a3020;
    --color-disco: #b88dd0; --color-disco-hover: #a67cbe; --color-disco-active: #946bac;
    --color-disco-highlight: #332840;
    --color-error: #d06070; --color-error-hover: #b85060; --color-error-highlight: #3a2025;
    --color-success: #6daa55; --color-success-hover: #5d9a45; --color-success-highlight: #253020;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3); --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  }
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: var(--space-16) var(--space-4);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg--gradient {
  background: 
    radial-gradient(ellipse at 30% 50%, #c2623a 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, #8b7355 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, #6b8c6b 0%, transparent 55%),
    linear-gradient(135deg, #3d2314 0%, #1a0f09 40%, #0d1a0d 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    oklch(from var(--color-bg) l c h / 0.3) 0%,
    oklch(from var(--color-bg) l c h / 0.6) 60%,
    var(--color-bg) 100%
  );
  z-index: 1;
}

[data-theme="dark"] .hero-overlay {
  background: linear-gradient(
    to bottom,
    oklch(from var(--color-bg) l c h / 0.4) 0%,
    oklch(from var(--color-bg) l c h / 0.7) 60%,
    var(--color-bg) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-logo {
  margin-bottom: var(--space-4);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: var(--space-6);
}

/* Sparkle/shimmer effect */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--color-text) 0%,
    var(--color-amber) 25%,
    var(--color-disco) 50%,
    var(--color-amber) 75%,
    var(--color-text) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

/* Floating particles */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

.sparkle-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-amber);
  animation: float 3s ease-in-out infinite;
}

/* ===== TOP BAR / HEADER ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-surface) l c h / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.top-bar-logo svg {
  width: 28px;
  height: 28px;
}

.top-bar-logo span {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== USER SELECTOR ===== */
.user-selector {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1);
  position: relative;
}

.user-selector-indicator {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  width: calc(50% - var(--space-1));
  height: calc(100% - var(--space-1) * 2);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
  pointer-events: none;
}

.user-selector-indicator.taylor {
  transform: translateX(100%);
  background: var(--color-sage);
}

.user-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: color 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
}

.user-option:hover {
  color: var(--color-text);
}

.user-option.active {
  color: var(--color-text-inverse);
}

.user-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  transition: all var(--transition-interactive);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: var(--content-default);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  padding-bottom: 120px; /* space for input bar */
  min-height: 80vh;
}

/* ===== MOOD / VIBE CHECK ===== */
.mood-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.mood-card {
  background: oklch(from var(--color-surface) l c h / 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.mood-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    oklch(from var(--color-text-inverse) l c h / 0.06) 50%,
    transparent 100%
  );
  animation: moodShimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes moodShimmer {
  0%, 100% { transform: translateX(-30%); }
  50% { transform: translateX(30%); }
}

.mood-card:hover {
  box-shadow: 0 4px 20px oklch(from var(--color-text) l c h / 0.06);
  transform: translateY(-1px);
}

/* Read-only mood card for other user */
.mood-card.read-only .mood-emoji-picker,
.mood-card.read-only .mood-text-input {
  display: none;
}

.mood-card .mood-readonly-display {
  display: none;
}

.mood-card.read-only .mood-readonly-display {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  padding: var(--space-3) 0;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

.mood-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mood-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.mood-avatar.raphael {
  background: var(--color-primary-highlight);
}

.mood-avatar.taylor {
  background: var(--color-sage-highlight);
}

.mood-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.mood-status {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mood-emoji-picker {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.mood-emoji-btn {
  padding: var(--space-1);
  border-radius: var(--radius-md);
  font-size: 18px;
  line-height: 1;
  transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  background: transparent;
  border: none;
}

.mood-emoji-btn:hover {
  background: var(--color-surface-offset);
  transform: scale(1.25);
}

.mood-emoji-btn:active {
  transform: scale(0.85);
}

.mood-emoji-btn.selected {
  background: var(--color-primary-highlight);
  box-shadow: 0 0 0 2px oklch(from var(--color-primary) l c h / 0.3);
  animation: emojiPop 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.mood-text-input {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  width: 100%;
  transition: border-color var(--transition-interactive);
}

.mood-text-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===== FEED ===== */
.feed-section {
  margin-bottom: var(--space-8);
}

.feed-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-2);
}

.feed-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

/* Message cards */
.message-card {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  animation: slideInLeft 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-card:hover {
  transform: translateY(-1px);
}

.message-card.own {
  animation-name: slideInRight;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message-avatar.raphael {
  background: var(--color-primary-highlight);
}

.message-avatar.taylor {
  background: var(--color-sage-highlight);
}

.message-card[data-user="raphael"] .message-content {
  border-left: 2px solid oklch(from var(--color-primary) l c h / 0.25);
}

.message-card[data-user="taylor"] .message-content {
  border-left: 2px solid oklch(from var(--color-sage) l c h / 0.25);
}

.message-card.own[data-user="raphael"] .message-content,
.message-card.own[data-user="taylor"] .message-content {
  border-left: none;
  border-right: 2px solid oklch(from var(--color-primary) l c h / 0.25);
}

.message-card.own[data-user="taylor"] .message-content {
  border-right-color: oklch(from var(--color-sage) l c h / 0.25);
}

.message-body {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.message-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.message-name.raphael { color: var(--color-primary); }
.message-name.taylor { color: var(--color-sage); }

.message-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.message-content {
  background: var(--color-surface);
  border: none;
  box-shadow: 0 1px 4px oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-lg);
  border-top-left-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
  transition: box-shadow 250ms ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message-card:hover .message-content {
  box-shadow: 0 2px 8px oklch(from var(--color-text) l c h / 0.1);
}

.message-card.own {
  flex-direction: row-reverse;
}

.message-card.own .message-header {
  flex-direction: row-reverse;
}

.message-card.own .message-body {
  text-align: right;
}

.message-card.own .message-content {
  background: linear-gradient(135deg, var(--color-primary-highlight), oklch(from var(--color-primary) l c h / 0.12));
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-sm);
  text-align: left;
}

.message-card.own[data-user="taylor"] .message-content {
  background: linear-gradient(135deg, var(--color-sage-highlight), oklch(from var(--color-sage) l c h / 0.12));
}

/* Voice note card */
.voice-note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

.voice-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-interactive);
  flex-shrink: 0;
}

.voice-play-btn:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

.voice-play-btn:active {
  transform: scale(0.98);
}

.voice-waveform {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voice-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  opacity: 0.4;
  transition: opacity var(--transition-interactive);
}

.voice-bar.active {
  opacity: 1;
}

.voice-duration {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  flex-shrink: 0;
}

/* Media cards */
.media-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  max-width: 400px;
}

.media-card img {
  width: 100%;
  height: auto;
  display: block;
}

.media-card video {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== INPUT BAR (bottom docked) ===== */
.input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: oklch(from var(--color-surface) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
}

.input-bar-inner {
  max-width: var(--content-default);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.input-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.input-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  background: transparent;
  position: relative;
}

.input-action-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-primary);
  transform: scale(1.08);
}

.input-action-btn:active {
  transform: scale(0.9);
}

.input-action-btn.recording {
  background: var(--color-error);
  color: var(--color-text-inverse);
  animation: pulse 1.5s ease-in-out infinite;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 2px var(--color-error);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(from var(--color-error) l c h / 0.4); }
  50% { box-shadow: 0 0 0 8px oklch(from var(--color-error) l c h / 0); }
}

.input-text-wrapper {
  flex: 1;
  position: relative;
}

.input-text {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-right: var(--space-10);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  background: var(--color-surface);
  font-size: var(--text-sm);
  line-height: 1.5;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.input-text:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
  animation: focusGlow 2s ease-in-out infinite;
}

@keyframes focusGlow {
  0%, 100% { box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15); }
  50% { box-shadow: 0 0 0 5px oklch(from var(--color-primary) l c h / 0.08); }
}

.input-text::placeholder {
  color: var(--color-text-faint);
}

.send-btn {
  position: absolute;
  right: var(--space-1);
  bottom: var(--space-1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-interactive);
  border: none;
}

.send-btn:hover {
  background: var(--color-primary-hover);
  transform: scale(1.08);
}

.send-btn:active {
  transform: scale(0.85);
  transition: transform 100ms ease;
}

.send-btn {
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* File input hidden */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ===== DRAG & DROP ===== */
.drop-zone-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(from var(--color-primary) l c h / 0.1);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-zone-overlay.active {
  display: flex;
}

.drop-zone-content {
  background: var(--color-surface);
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-16);
  text-align: center;
}

.drop-zone-content svg {
  width: 48px;
  height: 48px;
  color: var(--color-primary);
  margin: 0 auto var(--space-4);
}

.drop-zone-content p {
  font-size: var(--text-lg);
  font-family: var(--font-display);
  color: var(--color-text);
}

/* ===== RECORDING INDICATOR ===== */
.recording-indicator {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-error-highlight);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-error);
}

.recording-indicator.active {
  display: inline-flex;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== DECORATIVE ELEMENTS ===== */
.leaf-decoration {
  position: absolute;
  pointer-events: none;
  opacity: 0.15;
  color: var(--color-sage);
}

/* Disco ball shimmer overlay */
.disco-shimmer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-amber),
    var(--color-disco),
    var(--color-primary),
    var(--color-amber),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
  z-index: 100;
  opacity: 0.6;
}

/* ===== EMPTY STATE ===== */
.empty-feed {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-text-faint);
}

.empty-feed svg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.4;
}

.empty-feed p {
  font-size: var(--text-sm);
  max-width: 40ch;
  margin: 0 auto;
}

/* ===== SCROLL ANIMATIONS ===== */
@supports (animation-timeline: scroll()) {
  .fade-in-scroll {
    opacity: 0;
    animation: revealFade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes revealFade {
  to { opacity: 1; }
}

/* ===== HERO BUTTON ===== */
.btn-enter:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-enter:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ===== DECORATIVE VINE BORDERS ===== */
.vine-border {
  position: relative;
}

.vine-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-sage),
    var(--color-amber),
    var(--color-sage),
    transparent
  );
  opacity: 0.3;
}

/* ===== OVERALL POLISH ===== */
html {
  scroll-behavior: smooth;
}

/* Spring transitions on all interactive elements */
button, .user-option, .mood-emoji-btn, .send-btn, .input-action-btn, .theme-toggle {
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Subtle parallax-like depth on mood section */
.mood-section {
  transform: translateZ(0);
  will-change: transform;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    min-height: 55vh;
    padding: var(--space-12) var(--space-4);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 50vh;
    padding: var(--space-10) var(--space-4);
  }

  .mood-section {
    grid-template-columns: 1fr;
  }

  .user-selector {
    font-size: var(--text-xs);
  }

  .top-bar-logo span {
    display: none;
  }

  .input-bar {
    padding: var(--space-2) var(--space-3);
  }

  .message-content {
    padding: var(--space-2) var(--space-3);
  }

  .media-card {
    max-width: 100%;
  }

  .mood-emoji-picker {
    gap: var(--space-2);
  }

  .mood-emoji-btn {
    font-size: 20px;
    padding: var(--space-2);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .input-action-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .main-content {
    padding: var(--space-4) var(--space-3);
    padding-bottom: 100px;
  }
}

@media (max-width: 380px) {
  .input-actions {
    gap: 0;
  }

  .user-option {
    padding: var(--space-1) var(--space-2);
    font-size: 11px;
  }
}

/* ===== CURIOSITY SHOP ENTRANCE ===== */
.curiosity-shop {
  position: relative;
  overflow: hidden;
  padding: 0 0 var(--space-12);
  /* Blue wall — like the actual storefront's blue facade */
  background:
    linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 2%, #1e3456 6%, #1a2f4e 50%, #162844 90%, var(--color-bg) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

[data-theme="dark"] .curiosity-shop {
  background:
    linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 2%, #0e1c32 6%, #0c1828 50%, #0a1420 90%, var(--color-bg) 100%);
}

/* === Roof / Top Edge === */
.cs-roof {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: min(94vw, 800px);
  height: 12px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 60%, #111 100%);
  border-radius: 2px 2px 0 0;
  box-shadow:
    0 2px 8px oklch(0 0 0 / 0.5);
}

/* === Blue Awning Lip — hangs down from roof === */
.cs-awning {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(94vw, 800px);
  /* The lip: thick blue band hanging from the roof */
  background: linear-gradient(180deg,
    #0d1b30 0%,
    #142644 20%,
    #18304e 50%,
    #142644 80%,
    #0d1b30 100%
  );
  padding: var(--space-6) var(--space-8);
  text-align: center;
  /* 3D depth — the awning casts a shadow below */
  box-shadow:
    0 8px 32px oklch(0 0 0 / 0.6),
    0 4px 12px oklch(0 0 0 / 0.4),
    inset 0 2px 0 oklch(1 0 0 / 0.04),
    inset 0 -2px 0 oklch(0 0 0 / 0.3);
  /* Bottom edge detail like a fascia lip */
  border-bottom: 3px solid #0a1525;
}

/* Subtle horizontal line detail on awning */
.cs-awning::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(180deg, transparent 0%, oklch(0 0 0 / 0.2) 100%);
  pointer-events: none;
}

.cs-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Bold gold 3D letters like the real sign */
  background: linear-gradient(
    180deg,
    #fce38a 0%,
    #f5d77a 15%,
    #d4a532 40%,
    #f5d77a 55%,
    #c99a2e 75%,
    #f5d77a 100%
  );
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 5s ease-in-out infinite;
  text-shadow: none;
  /* Strong gold drop shadow for 3D depth */
  filter: drop-shadow(0 2px 1px oklch(0.15 0.05 60 / 0.9))
          drop-shadow(0 4px 6px oklch(0.1 0.04 60 / 0.5));
  line-height: 1.1;
}

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

/* === Glass Storefront — below the awning === */
.cs-storefront {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  max-width: min(94vw, 800px);
  width: 100%;
  min-height: 220px;
  /* The storefront sits flush under the awning */
  margin-top: 0;
  padding: var(--space-4) var(--space-3) var(--space-6);
}

.cs-window {
  background: linear-gradient(170deg,
    oklch(0.18 0.02 220 / 0.5) 0%,
    oklch(0.14 0.02 220 / 0.65) 100%
  );
  /* Brown/bronze window frames like the real storefront */
  border: 3px solid #5c4a32;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 20px oklch(0 0 0 / 0.3),
    0 2px 8px oklch(0 0 0 / 0.3);
}

.cs-window::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, oklch(1 0 0 / 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* Warm amber glow from inside */
.cs-window::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 60%;
  background: radial-gradient(ellipse at center bottom, oklch(0.7 0.15 70 / 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Specimen jars */
.cs-specimen {
  position: relative;
}

.cs-jar {
  position: relative;
  color: #c9922a;
  width: 48px;
}

.cs-jar-svg {
  width: 100%;
  height: auto;
}

.cs-jar-glow {
  position: absolute;
  inset: 20% 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse, oklch(0.7 0.15 70 / 0.25) 0%, transparent 70%);
  animation: jarPulse 3s ease-in-out infinite;
}

@keyframes jarPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.cs-specimen-2 .cs-jar {
  width: 40px;
  color: #9b6db5;
}

.cs-specimen-2 .cs-jar-glow {
  background: radial-gradient(ellipse, oklch(0.6 0.15 300 / 0.2) 0%, transparent 70%);
  animation-delay: 1.5s;
}

/* Framed butterfly display */
.cs-frame {
  color: #c9922a;
  width: 56px;
}

.cs-frame svg {
  width: 100%;
  height: auto;
}

/* Skull display */
.cs-skull {
  color: #e0d8cc;
  width: 48px;
}

.cs-skull svg {
  width: 100%;
  height: auto;
}

/* === Center Door === */
.cs-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  z-index: 3;
}

.cs-door-glass {
  position: relative;
  width: 120px;
  height: 170px;
  background: linear-gradient(180deg,
    oklch(0.18 0.03 220 / 0.5) 0%,
    oklch(0.16 0.04 220 / 0.6) 40%,
    oklch(0.13 0.04 50 / 0.4) 100%
  );
  /* Brown frame matching the windows */
  border: 3px solid #5c4a32;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  box-shadow:
    inset 0 0 20px oklch(0 0 0 / 0.3),
    0 2px 8px oklch(0 0 0 / 0.3);
}

.cs-door-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 80%, oklch(0.7 0.15 70 / 0.2) 0%, transparent 60%);
  animation: doorGlow 3s ease-in-out infinite;
}

@keyframes doorGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.cs-door-text {
  position: absolute;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: oklch(0.8 0.1 70 / 0.6);
}

.cs-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 2px solid #c9922a;
  background: linear-gradient(135deg, oklch(0.3 0.06 70 / 0.8) 0%, oklch(0.2 0.05 70 / 0.9) 100%);
  color: #f5d77a;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition-interactive);
  box-shadow: 0 4px 16px oklch(0.3 0.1 70 / 0.3);
}

.cs-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px oklch(0.4 0.15 70 / 0.4);
  background: linear-gradient(135deg, oklch(0.35 0.08 70 / 0.9) 0%, oklch(0.25 0.06 70 / 1) 100%);
}

.cs-enter-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px oklch(0.3 0.1 70 / 0.3);
}

.cs-enter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Floating Butterflies === */
.cs-butterflies {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.cs-butterfly {
  position: absolute;
  width: 32px;
  height: auto;
  color: #c9922a;
}

.cs-butterfly-1 {
  top: 18%;
  left: 12%;
  animation: butterflyFloat1 8s ease-in-out infinite;
  color: #d4a532;
}

.cs-butterfly-2 {
  top: 25%;
  right: 15%;
  animation: butterflyFloat2 10s ease-in-out infinite;
  animation-delay: 2s;
  color: #9b6db5;
  width: 24px;
}

.cs-butterfly-3 {
  bottom: 30%;
  left: 30%;
  animation: butterflyFloat3 12s ease-in-out infinite;
  animation-delay: 4s;
  color: #6b7f5e;
  width: 20px;
}

@keyframes butterflyFloat1 {
  0% { transform: translate(0, 0) rotate(-5deg) scale(1); opacity: 0.7; }
  25% { transform: translate(40px, -30px) rotate(10deg) scale(1.05); opacity: 0.9; }
  50% { transform: translate(20px, -50px) rotate(-8deg) scale(0.95); opacity: 0.6; }
  75% { transform: translate(-20px, -20px) rotate(12deg) scale(1.02); opacity: 0.8; }
  100% { transform: translate(0, 0) rotate(-5deg) scale(1); opacity: 0.7; }
}

@keyframes butterflyFloat2 {
  0% { transform: translate(0, 0) rotate(5deg); opacity: 0.6; }
  33% { transform: translate(-50px, -40px) rotate(-15deg); opacity: 0.9; }
  66% { transform: translate(-20px, 20px) rotate(8deg); opacity: 0.5; }
  100% { transform: translate(0, 0) rotate(5deg); opacity: 0.6; }
}

@keyframes butterflyFloat3 {
  0% { transform: translate(0, 0) rotate(0deg) scaleX(1); opacity: 0.5; }
  20% { transform: translate(30px, -20px) rotate(10deg) scaleX(-1); opacity: 0.7; }
  40% { transform: translate(60px, -10px) rotate(-5deg) scaleX(1); opacity: 0.6; }
  60% { transform: translate(40px, 10px) rotate(15deg) scaleX(-1); opacity: 0.8; }
  80% { transform: translate(10px, 5px) rotate(-10deg) scaleX(1); opacity: 0.5; }
  100% { transform: translate(0, 0) rotate(0deg) scaleX(1); opacity: 0.5; }
}

/* === Sparkle Particles === */
.cs-sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cs-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f5d77a;
  animation: csTwinkle 3s ease-in-out infinite;
}

.cs-sparkle:nth-child(1) { top: 15%; left: 20%; animation-delay: 0s; }
.cs-sparkle:nth-child(2) { top: 30%; left: 80%; animation-delay: 0.5s; }
.cs-sparkle:nth-child(3) { top: 50%; left: 10%; animation-delay: 1s; }
.cs-sparkle:nth-child(4) { top: 20%; left: 60%; animation-delay: 1.5s; }
.cs-sparkle:nth-child(5) { top: 70%; left: 40%; animation-delay: 2s; }
.cs-sparkle:nth-child(6) { top: 40%; left: 90%; animation-delay: 2.5s; }
.cs-sparkle:nth-child(7) { top: 60%; left: 70%; animation-delay: 0.8s; }
.cs-sparkle:nth-child(8) { top: 80%; left: 25%; animation-delay: 1.8s; }

@keyframes csTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* === Trailing Plants === */
.cs-plants {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.cs-plant {
  position: absolute;
  top: 0;
  height: 120px;
  color: #6b7f5e;
}

.cs-plant-left {
  left: 5%;
}

.cs-plant-right {
  right: 5%;
}

/* === Curiosity Shop Responsive === */
@media (max-width: 640px) {
  .curiosity-shop {
    padding: 0 0 var(--space-8);
  }

  .cs-roof {
    height: 8px;
    max-width: 100%;
  }

  .cs-awning {
    padding: var(--space-4) var(--space-4);
    max-width: 100%;
  }

  .cs-title {
    font-size: var(--text-lg);
    letter-spacing: 0.04em;
  }

  .cs-storefront {
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-2);
    min-height: 160px;
  }

  .cs-door-glass {
    width: 90px;
    height: 130px;
  }

  .cs-window {
    padding: var(--space-2);
  }

  .cs-jar {
    width: 36px;
  }

  .cs-specimen-2 .cs-jar {
    width: 30px;
  }

  .cs-frame {
    width: 40px;
  }

  .cs-skull {
    width: 36px;
  }

  .cs-butterfly-1 { width: 24px; }
  .cs-butterfly-2 { width: 18px; }
  .cs-butterfly-3 { width: 16px; }

  .cs-enter-btn {
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-xs);
  }

  .cs-plant {
    height: 80px;
  }
}


/* ===== MILANOTE CREATIVE SPACE ===== */
.milanote-section {
  position: relative;
  padding: var(--space-12) var(--space-4) var(--space-16);
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    #1a3a3a 5%,
    #1a3a3a 95%,
    var(--color-bg) 100%
  );
  min-height: 80vh;
}

[data-theme="dark"] .milanote-section {
  background: linear-gradient(180deg,
    var(--color-bg) 0%,
    #0e2424 5%,
    #0e2424 95%,
    var(--color-bg) 100%
  );
}

.milanote-frame {
  max-width: var(--content-wide);
  margin: 0 auto;
  background: oklch(0.15 0.02 200 / 0.5);
  border-radius: var(--radius-xl);
  padding: 2px;
  box-shadow:
    0 8px 32px oklch(0 0 0 / 0.4),
    inset 0 1px 0 oklch(1 0 0 / 0.06);
  border: 1px solid oklch(0.5 0.04 180 / 0.15);
  overflow: hidden;
}

.milanote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: oklch(0.15 0.02 200 / 0.6);
  border-bottom: 1px solid oklch(0.5 0.02 200 / 0.1);
}

.milanote-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: #f5d77a;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.milanote-title svg {
  color: #c9922a;
}

.milanote-open-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid oklch(0.7 0.1 70 / 0.4);
  background: oklch(0.3 0.06 70 / 0.4);
  color: #f5d77a;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.milanote-open-btn:hover {
  background: oklch(0.35 0.08 70 / 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px oklch(0.3 0.1 70 / 0.3);
}

.milanote-embed-container {
  width: 100%;
  height: 75vh;
  min-height: 500px;
  max-height: 900px;
  background: #fff;
  border-radius: 0 0 calc(var(--radius-xl) - 2px) calc(var(--radius-xl) - 2px);
  overflow: hidden;
}

.milanote-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Milanote Responsive */
@media (max-width: 640px) {
  .milanote-section {
    padding: var(--space-8) var(--space-2) var(--space-12);
  }

  .milanote-frame {
    border-radius: var(--radius-lg);
  }

  .milanote-header {
    padding: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .milanote-title {
    font-size: var(--text-base);
  }

  .milanote-embed-container {
    height: 60vh;
    min-height: 400px;
    border-radius: 0 0 calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px);
  }
}

/* ===== AUDIO PLAYER ===== */
audio {
  width: 100%;
  max-width: 300px;
  height: 36px;
  border-radius: var(--radius-lg);
}

/* ===== TAP/ACTIVE STATES (mobile) ===== */
@media (hover: none) {
  .btn-primary:active,
  .btn-enter:active,
  .send-btn:active {
    opacity: 0.8;
    transform: scale(0.97);
  }

  .user-option:active {
    opacity: 0.8;
  }

  .mood-emoji-btn:active {
    transform: scale(1.3);
  }

  .input-action-btn:active {
    background: var(--color-surface-dynamic);
  }

  /* Always show react button on mobile */
  .react-btn {
    opacity: 0.5;
  }

  .reaction-picker-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ===== CONNECTION STATUS ===== */
.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  margin: 0 auto var(--space-4);
  width: fit-content;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  opacity: 0.7;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
}

/* ===== REACTIONS ===== */
.message-footer {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  position: relative;
}

.message-card.own .message-footer {
  justify-content: flex-end;
}

.reactions-bar {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 13px;
  background: var(--color-surface-offset);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.reaction-chip:hover {
  background: var(--color-surface-dynamic);
  transform: scale(1.05);
}

.reaction-chip.mine {
  background: var(--color-primary-highlight);
  border-color: oklch(from var(--color-primary) l c h / 0.25);
}

.reaction-count {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.react-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  transition: all var(--transition-interactive);
  opacity: 0;
}

.message-card:hover .react-btn {
  opacity: 1;
}

.react-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}

/* Reaction picker popup */
.reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-1);
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 2px;
  z-index: 60;
  opacity: 0;
  transform: translateY(4px) scale(0.95);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reaction-picker.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.message-card.own .reaction-picker {
  left: auto;
  right: 0;
}

.reaction-picker-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.reaction-picker-btn:hover {
  background: var(--color-surface-offset);
  transform: scale(1.25);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  opacity: 0;
  transform: translateY(4px);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.typing-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-faint);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ===== READ RECEIPTS ===== */
.read-receipt {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
  text-align: right;
}

/* ===== PWA INSTALL BANNER ===== */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--disco-violet) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: 0 2px 12px oklch(0 0 0 / 0.2);
  animation: bannerSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.install-btn {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--terracotta);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}

.install-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.15);
}

.install-dismiss {
  background: none;
  border: none;
  color: oklch(1 0 0 / 0.7);
  font-size: 1.4rem;
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  transition: color var(--transition-interactive);
}

.install-dismiss:hover {
  color: #fff;
}

/* ===== CHALLENGE CARDS (chat feed) ===== */
.challenge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--color-surface-offset), var(--color-surface));
  border: 1px solid var(--color-amber);
  border-radius: var(--radius-xl);
  text-align: center;
}

.challenge-icon {
  font-size: 2rem;
}

.challenge-text {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.challenge-accept {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--color-sage);
  color: var(--color-text-inverse);
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.challenge-accept:hover {
  background: var(--color-sage-hover);
  transform: scale(1.05);
}

.challenge-decline {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 200ms ease;
}

.challenge-decline:hover {
  background: var(--color-surface-offset);
}

.challenge-actions {
  display: flex;
  gap: var(--space-3);
}

.challenge-waiting {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
}

.challenge-play {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--color-amber);
  color: var(--color-text-inverse);
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.challenge-play:hover {
  background: var(--color-amber-hover);
  transform: scale(1.05);
}

.challenge-declined {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

/* ===== AUTH GATE ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ddd0 0%, #d4c8b8 30%, #c9b8a5 60%, #c2623a22 100%);
  font-family: var(--font-body, 'General Sans', sans-serif);
}

[data-theme="dark"] .auth-gate {
  background: linear-gradient(135deg, #1a1612 0%, #2a2318 30%, #1e1a15 60%, #c2623a15 100%);
}

.auth-card {
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 340px;
  width: 100%;
}

.auth-logo {
  color: var(--color-primary, #c2623a);
  margin-bottom: 1.5rem;
  display: inline-block;
}

.auth-title {
  font-family: var(--font-display, 'Sentient', serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text, #3a3028);
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .auth-title {
  color: #faf6ef;
}

.auth-subtitle {
  color: var(--color-text-muted, #9a8e7c);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.auth-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.auth-pin-input {
  width: 140px;
  padding: 0.75rem 1rem;
  font-size: 1.5rem;
  font-family: var(--font-body, sans-serif);
  text-align: center;
  letter-spacing: 0.3em;
  border: 2px solid var(--color-border, #d4c8b8);
  border-radius: 12px;
  background: var(--color-surface, #faf6ef);
  color: var(--color-text, #3a3028);
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}

.auth-pin-input:focus {
  border-color: var(--color-primary, #c2623a);
  box-shadow: 0 0 0 3px rgba(194, 98, 58, 0.15);
}

[data-theme="dark"] .auth-pin-input {
  background: #2a2318;
  border-color: #4a3f32;
  color: #faf6ef;
}

[data-theme="dark"] .auth-pin-input:focus {
  border-color: #c2623a;
  box-shadow: 0 0 0 3px rgba(194, 98, 58, 0.25);
}

.auth-submit {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--color-primary, #c2623a);
  color: #faf6ef;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms, background 200ms;
}

.auth-submit:hover {
  background: #a8502e;
  transform: scale(1.05);
}

.auth-submit:active {
  transform: scale(0.95);
}

.auth-error {
  color: #c2623a;
  font-size: 0.85rem;
  margin: 1rem 0 0;
  min-height: 1.2em;
}
