/* ============================================
   PLANET: TEMPORARILY INCONVENIENT
   Mobile-first CSS — 360px–430px
   ============================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Mood palette */
  --cool:     #4fc3f7;
  --warm:     #ffb74d;
  --sweaty:   #ff8a65;
  --toasty:   #ef5350;
  --spicy:    #d32f2f;
  --barbecue: #b71c1c;

  /* UI palette */
  --bg:          #0f0f1a;
  --bg-card:     #1a1a2e;
  --bg-card-alt: #16213e;
  --surface:     #1f1f38;
  --text:        #eaeaea;
  --text-dim:    #9e9eb8;
  --accent:      #ffd54f;
  --accent-glow: rgba(255, 213, 79, 0.3);
  --danger:      #ef5350;
  --success:     #66bb6a;

  /* Current mood color — updated by JS */
  --mood-color: var(--cool);

  /* Spacing */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #050510;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ---------- VFX CANVAS (BACKGROUND WORLD) ---------- */
#vfx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- MOOD BAR ---------- */
#mood-bar {
  flex-shrink: 0;
  padding: calc(var(--safe-top) + 8px) 16px 8px;
  background: linear-gradient(180deg, rgba(8,8,18,0.82) 0%, rgba(8,8,18,0.65) 100%);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 2px solid var(--mood-color);
  z-index: 100;
  transition: border-color 0.8s ease;
}

.mood-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 430px;
  margin: 0 auto;
}

.mood-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mood-icon {
  font-size: 20px;
  animation: globe-pulse 3s ease-in-out infinite;
}

@keyframes globe-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.mood-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mood-meter {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mood-meter-track {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mood-meter-fill {
  height: 100%;
  width: 8%;
  background: var(--mood-color);
  border-radius: 4px;
  transition: width 1s ease, background 0.8s ease;
  position: relative;
}

.mood-meter-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  border-radius: 0 4px 4px 0;
}

.mood-level {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--mood-color);
  min-width: 72px;
  text-align: right;
  transition: color 0.8s ease;
}

.mood-temp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--mood-color);
  min-width: 48px;
  text-align: right;
  transition: color 0.8s ease;
}

/* ECG heartbeat line overlaid on meter track */
.ecg-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.6;
}

/* Vitals sub-row */
.mood-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 430px;
  margin: 4px auto 0;
  padding: 0 2px;
}

.mood-weather-icon {
  font-size: 13px;
  line-height: 1;
}

.mood-panic {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--mood-color);
  opacity: 0.7;
  transition: color 0.8s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sparkline {
  flex-shrink: 0;
  width: 80px;
  height: 20px;
  opacity: 0.6;
}

/* ---------- FEED ---------- */

/* World Ticker */
.world-ticker {
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(8,8,18,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  height: 26px;
  position: relative;
  z-index: 50;
}

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
}

.ticker-track .ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 24px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ticker-track .ticker-item .ticker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mood-color);
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

#feed-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 12px 12px calc(var(--safe-bottom) + 64px);
}

#feed {
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- EVENT CARDS ---------- */
.event-card {
  background: rgba(18,18,36,0.55);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
  animation: card-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transform-origin: center top;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.event-card.consequence-card {
  border-left: 3px solid var(--accent);
  background: rgba(20,18,10,0.55);
}

.event-card.decision-result-card {
  border-left: 3px solid var(--success);
  background: linear-gradient(135deg, rgba(18,18,36,0.55) 0%, rgba(102,187,106,0.08) 100%);
}

.event-card.solution-result-card {
  border-left: 3px solid #ce93d8;
  background: linear-gradient(135deg, rgba(18,18,36,0.55) 0%, rgba(206,147,216,0.08) 100%);
}

@keyframes card-enter {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface);
  flex-shrink: 0;
}

.card-agent-info {
  flex: 1;
  min-width: 0;
}

.card-agent-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.card-location {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
}

.card-timestamp {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.5;
  flex-shrink: 0;
}

.card-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}

.card-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Planet Voice — snarky Earth commentary */
.planet-voice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: rgba(79,195,247,0.06);
  border-left: 2px solid var(--mood-color);
  font-size: 12px;
  font-style: italic;
  color: var(--mood-color);
  line-height: 1.4;
  opacity: 0.85;
}
.planet-voice-icon {
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.3;
}
.planet-voice-text {
  flex: 1;
}

.card-mood-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--mood-color);
  margin-bottom: 12px;
}

/* ---------- CHOICE BUTTONS ---------- */
.card-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(25,25,50,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.choice-btn:active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.08);
}

.choice-btn.selected {
  border-color: var(--accent);
  background: rgba(255,213,79,0.1);
  color: var(--accent);
}

.choice-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.choice-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.choice-label {
  flex: 1;
}

.choice-confidence {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  margin-left: auto;
  white-space: nowrap;
}
.choice-btn.voted .choice-confidence { display: none; }

.choice-percent {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.choice-btn.voted .choice-percent {
  opacity: 1;
}

.choice-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255,213,79,0.08);
  width: 0;
  transition: width 0.8s ease;
  border-radius: 12px;
}

/* ---------- FEED LOADER ---------- */
.feed-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: loader-bounce 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes loader-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- SOLUTION BAR ---------- */
#solution-bar {
  flex-shrink: 0;
  padding: 10px 16px calc(var(--safe-bottom) + 10px);
  background: linear-gradient(0deg, rgba(8,8,18,0.82) 0%, rgba(8,8,18,0.5) 100%);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
}

#solution-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px;
  border: 2px dashed rgba(255,213,79,0.3);
  border-radius: 14px;
  background: rgba(255,213,79,0.05);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#solution-toggle:active {
  transform: scale(0.97);
  background: rgba(255,213,79,0.1);
}

.solution-icon {
  font-size: 18px;
}

/* ---------- MODALS ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal.hidden .modal-content {
  transform: translateY(100%);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(var(--safe-bottom) + 20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consequence-content {
  text-align: center;
  border-radius: 24px 24px 0 0;
  padding-top: 32px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

#solution-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}

#solution-input:focus {
  border-color: var(--accent);
}

.char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

.modal-footer {
  margin-top: 16px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #1a1a2e;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- CONSEQUENCE MODAL ---------- */
.consequence-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: consequence-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes consequence-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

#consequence-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}

#consequence-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
}

.consequence-impact {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.consequence-impact.heat-up {
  background: rgba(239,83,80,0.15);
  color: var(--danger);
}

.consequence-impact.cool-down {
  background: rgba(102,187,106,0.15);
  color: var(--success);
}

.consequence-impact.neutral {
  background: rgba(255,213,79,0.15);
  color: var(--accent);
}

.consequence-dismiss {
  margin-top: 8px;
}

/* ---------- TOAST ---------- */
#toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 70px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(18,18,36,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: auto;
}

.toast.toast-out {
  animation: toast-out 0.3s ease both;
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* ---------- VFX STATES ---------- */
body.mood-cool     { --mood-color: var(--cool); }
body.mood-warm     { --mood-color: var(--warm); }
body.mood-sweaty   { --mood-color: var(--sweaty); }
body.mood-toasty   { --mood-color: var(--toasty); }
body.mood-spicy    { --mood-color: var(--spicy); }
body.mood-barbecue { --mood-color: var(--barbecue); }

/* Heat shimmer overlay */
body.mood-toasty #feed-container,
body.mood-spicy #feed-container,
body.mood-barbecue #feed-container {
  animation: heat-shimmer 4s ease-in-out infinite;
}

@keyframes heat-shimmer {
  0%, 100% { filter: none; }
  50% { filter: blur(0.3px); }
}

/* Barbecue red glow */
body.mood-barbecue #mood-bar {
  box-shadow: 0 2px 30px rgba(183,28,28,0.3);
}

/* ---------- SCROLLBAR STYLING ---------- */
#feed-container::-webkit-scrollbar {
  width: 3px;
}
#feed-container::-webkit-scrollbar-track {
  background: transparent;
}
#feed-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* ---------- WORLD BULLETIN (chain events) ---------- */
.world-bulletin {
  text-align: center;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
}

.world-bulletin::before,
.world-bulletin::after {
  content: '—';
  margin: 0 8px;
  opacity: 0.4;
}

/* ---------- ANIMATIONS ---------- */
.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Glow pulse on new card */
.event-card.new-glow {
  box-shadow: 0 0 20px var(--accent-glow);
  transition: box-shadow 1.5s ease;
}

.event-card.new-glow.glow-fade {
  box-shadow: none;
}

/* ---------- RESPONSIVE FINE-TUNING ---------- */

/* ---------- GENE PANEL ---------- */
.gene-toggle {
  position: fixed;
  bottom: 80px;
  right: 12px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(18,18,36,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.gene-toggle:active { transform: scale(0.92); }

.gene-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  height: 100dvh;
  z-index: 500;
  background: rgba(12,12,28,0.88);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  box-shadow: -4px 0 30px rgba(0,0,0,0.5);
}
.gene-panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.gene-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gene-panel-header h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
}
.gene-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 2px 6px;
}

.gene-pool-stats {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gene-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-dim);
}
.gene-stat-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.gene-stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.gene-pool-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
}
.gene-pool-list .gene-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  margin: 2px;
  border-radius: 8px;
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
}

.gene-pool-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

/* ---- SHARE BUTTON ON CARDS ---- */
.card-share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.card-share-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.15); }

/* ---- SHARE MODAL ---- */
.share-content {
  max-width: 440px;
}
.share-preview {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 0;
}
.share-preview canvas {
  width: 100%;
  max-height: 340px;
  border-radius: 10px;
  object-fit: contain;
  background: #0a0a1a;
}
.share-format-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.share-format-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.share-format-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.share-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.share-actions .btn-primary {
  flex: 1;
  font-size: 13px;
  padding: 10px 0;
}
.share-btn-native {
  background: linear-gradient(135deg, #7c4dff, #536dfe) !important;
}

/* ---- REPORT CARD MODAL ---- */
.report-content {
  max-width: 420px;
}
.report-body {
  padding: 0 20px 16px;
}
.report-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.report-stat-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
}
.report-stat-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}
.report-grade {
  text-align: center;
  padding: 20px 0 10px;
}
.report-grade-letter {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}
.report-grade-comment {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 6px;
}
.report-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 20px;
}
.report-actions .btn-primary {
  flex: 1;
  font-size: 13px;
  padding: 10px 0;
}

/* ---- REPORT TOGGLE FAB ---- */
.report-toggle {
  position: fixed;
  bottom: 136px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18,18,36,0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s;
}
.report-toggle:active { transform: scale(0.92); }

@media (max-width: 360px) {
  .card-headline { font-size: 15px; }
  .mood-title { font-size: 10px; }
  .mood-level { font-size: 11px; min-width: 60px; }
}

@media (min-width: 412px) {
  .card-headline { font-size: 18px; }
  .event-card { padding: 18px; }
}

/* ============================================
   VIRAL UI — Phase 5.5
   LIVE badge, breaking badges, controversy meter,
   danger/good tints, ripple, emoji blast, streak
   ============================================ */

/* ---- LIVE BADGE ---- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #ff4444;
  background: rgba(255,68,68,0.12);
  padding: 2px 7px;
  border-radius: 4px;
  animation: live-pulse 1.5s ease-in-out infinite;
  margin-left: 6px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4444;
  display: inline-block;
  animation: live-dot-blink 1s steps(2,start) infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes live-dot-blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- BREAKING / URGENT / DEVELOPING BADGES ---- */
.card-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  animation: badge-flash 0.6s ease both;
}
.badge-breaking {
  background: rgba(239,83,80,0.2);
  color: #ef5350;
  border: 1px solid rgba(239,83,80,0.4);
  animation: badge-flash 0.6s ease both, badge-urgent-glow 2s ease-in-out infinite;
}
.badge-urgent {
  background: rgba(255,183,77,0.15);
  color: #ffb74d;
  border: 1px solid rgba(255,183,77,0.35);
}
.badge-developing {
  background: rgba(79,195,247,0.12);
  color: #4fc3f7;
  border: 1px solid rgba(79,195,247,0.3);
}
@keyframes badge-flash {
  0% { opacity: 0; transform: scale(0.8); }
  50% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes badge-urgent-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(239,83,80,0); }
  50% { box-shadow: 0 0 12px rgba(239,83,80,0.3); }
}

/* ---- CONTROVERSY METER ---- */
.controversy-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.controversy-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.controversy-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--success) 0%, var(--warm) 50%, var(--danger) 100%);
  transition: width 0.6s ease;
}
.controversy-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* ---- DANGER / GOOD CHOICE TINTS ---- */
.choice-btn.danger-choice {
  border-color: rgba(239,83,80,0.25);
  background: rgba(239,83,80,0.05);
}
.choice-btn.danger-choice .choice-confidence {
  color: rgba(239,83,80,0.5);
}
.choice-btn.good-choice {
  border-color: rgba(102,187,106,0.25);
  background: rgba(102,187,106,0.05);
}
.choice-btn.good-choice .choice-confidence {
  color: rgba(102,187,106,0.5);
}

/* ---- RIPPLE EFFECT ---- */
.choice-ripple {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,213,79,0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}
.choice-ripple.active {
  animation: choice-ripple-anim 0.55s ease-out forwards;
}
@keyframes choice-ripple-anim {
  0% { width: 0; height: 0; opacity: 0.5; }
  100% { width: 300px; height: 300px; opacity: 0; }
}

/* ---- EMOJI BLAST PARTICLES ---- */
.emoji-blast-particle {
  position: fixed;
  font-size: 18px;
  pointer-events: none;
  z-index: 9999;
  animation: emoji-fly 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes emoji-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(180deg); }
}

/* ---- HOT STREAK DISPLAY ---- */
#streak-display {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(239,83,80,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239,83,80,0.3);
  border-radius: 24px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#streak-display.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#streak-display.cool-streak {
  background: rgba(102,187,106,0.15);
  border-color: rgba(102,187,106,0.3);
}
.streak-flames {
  font-size: 14px;
  animation: streak-bounce 0.5s ease infinite alternate;
}
.streak-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: #ef5350;
}
#streak-display.cool-streak .streak-count {
  color: #66bb6a;
}
@keyframes streak-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* ---- VISIT COUNTER ---- */
.visit-counter {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-left: auto;
  padding-right: 4px;
}

/* ============================================
   QUIETDEN EXPERIENCE — Footer & Legal
   ============================================ */

.qd-footer {
  padding: 32px 20px 40px;
  text-align: center;
  margin-top: 24px;
}

.qd-divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  margin: 0 auto 28px;
}

.qd-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.qd-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,213,79,0.15), rgba(206,147,216,0.15));
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -0.5px;
  text-shadow: 0 0 12px rgba(255,213,79,0.3);
}

.qd-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.qd-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.85);
}

.qd-tagline {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.8px;
  font-style: italic;
  margin-top: 1px;
}

.qd-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.qd-link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.2s;
  text-decoration: none;
  letter-spacing: 0.3px;
}
.qd-link:hover, .qd-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.qd-dot {
  color: rgba(255,255,255,0.15);
  font-size: 10px;
}

.qd-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.qd-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
.qd-contact-item:hover {
  color: rgba(255,255,255,0.6);
}
.qd-contact-icon {
  font-size: 12px;
  opacity: 0.6;
}

.qd-copyright {
  font-size: 10px;
  color: rgba(255,255,255,0.15);
  letter-spacing: 0.5px;
}

/* ---- Legal Modal Styling ---- */
.qd-legal-content {
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
}

.qd-legal-content .modal-header h2 {
  font-size: 16px;
  letter-spacing: 0.5px;
}

.qd-legal-body {
  padding: 4px 0 12px;
  line-height: 1.65;
}

.qd-legal-body h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin: 16px 0 6px;
  letter-spacing: 0.3px;
}

.qd-legal-body h4:first-of-type {
  margin-top: 8px;
}

.qd-legal-body p {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
}

.qd-legal-body a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 2px;
}
.qd-legal-body a:hover {
  text-decoration: underline;
}

.qd-legal-updated {
  font-size: 10px !important;
  color: rgba(255,255,255,0.25) !important;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: var(--font-display);
  margin-bottom: 12px !important;
}

.qd-legal-close {
  width: 100%;
  font-size: 12px;
  letter-spacing: 1px;
}

/* ============================================
   STICKER REACTIONS
   ============================================ */
.sticker-bar {
  display: flex;
  gap: 4px;
  padding: 8px 0 2px;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 8px;
}
.sticker-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
}
.sticker-btn:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.08);
}
.sticker-btn.sticker-active {
  background: rgba(255,213,79,0.12);
  border-color: rgba(255,213,79,0.25);
}
.sticker-emoji {
  font-size: 14px;
}
.sticker-count {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
}
.sticker-btn.sticker-active .sticker-count {
  color: var(--accent);
}
.sticker-float {
  position: fixed;
  font-size: 24px;
  z-index: 9999;
  pointer-events: none;
  animation: sticker-fly 0.8s ease-out forwards;
}
@keyframes sticker-fly {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* ============================================
   CHAOS COMBO OVERLAY
   ============================================ */
.chaos-combo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: chaos-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.chaos-combo-overlay.chaos-fade {
  animation: chaos-out 0.6s ease forwards;
}
.chaos-combo-text {
  font-family: var(--font-display);
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 700;
  color: #ef5350;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 0 30px rgba(239,83,80,0.5);
  letter-spacing: 1px;
  animation: chaos-pulse 0.5s ease infinite alternate;
}
.chaos-combo-count {
  font-size: 36px;
  animation: chaos-pulse 0.3s ease infinite alternate;
}
@keyframes chaos-in {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes chaos-out {
  0% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}
@keyframes chaos-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* ============================================
   MUSEUM PANEL (Extinct Genes)
   ============================================ */
.museum-toggle {
  position: fixed;
  bottom: 88px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30,30,50,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s ease, background 0.2s ease;
}
.museum-toggle:hover { transform: scale(1.1); background: rgba(40,40,60,0.8); }
.museum-toggle:active { transform: scale(0.95); }

.museum-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60vh;
  background: rgba(12,12,24,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px 16px 0 0;
  z-index: 300;
  padding: 16px 16px calc(var(--safe-bottom) + 16px);
  overflow-y: auto;
  transform: translateY(0);
  transition: transform 0.3s ease;
}
.museum-panel.hidden { transform: translateY(100%); pointer-events: none; }
.museum-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.museum-panel-header h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.7);
}
.museum-panel-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.museum-subtext {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
}
.museum-list { display: flex; flex-direction: column; gap: 6px; }
.museum-gene {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
}
.museum-gene-badge { font-size: 20px; }
.museum-gene-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.museum-gene-label { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7); }
.museum-gene-cause { font-size: 10px; color: rgba(255,255,255,0.3); }
.museum-gene-gen { font-family: var(--font-display); font-size: 10px; color: rgba(255,255,255,0.25); }
.museum-empty {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ============================================
   NEW ITEMS PILL (Backpressure)
   ============================================ */
.new-items-pill {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(var(--accent), 0.15);
  background: rgba(255,213,79,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,213,79,0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  cursor: pointer;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.new-items-pill.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   SW UPDATE BANNER
   ============================================ */
.sw-update-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,40,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,213,79,0.3);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  animation: card-enter 0.4s ease both;
}
.sw-update-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.sw-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
}

/* ============================================
   SUGGESTION CHIPS
   ============================================ */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.suggestion-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.suggestion-chip:hover {
  background: rgba(255,213,79,0.1);
  border-color: rgba(255,213,79,0.2);
  color: var(--accent);
}

/* ============================================
   ACCESSIBILITY — Focus & Reduced Motion
   ============================================ */
/* Visible focus rings for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Minimum tap targets (48px) */
.choice-btn,
.sticker-btn,
.gene-toggle,
.report-toggle,
.museum-toggle,
.qd-link,
.suggestion-chip {
  min-height: 44px;
  min-width: 44px;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion: disable all animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .live-dot { animation: none !important; }
  .ticker-track { animation: none !important; }
  .emoji-blast-particle { display: none !important; }
  .sticker-float { display: none !important; }
  #vfx-canvas { opacity: 0.3; }
  .chaos-combo-overlay { animation: none !important; }
}
