:root {
  --ink: #0d0d0f;
  --paper: #f5f2ec;
  --ripple: #1a6b5c;
  --ripple-light: #e8f4f1;
  --ripple-mid: #4a9d8a;
  --amber: #e8a020;
  --amber-light: #fdf3e0;
  --coral: #d95f4b;
  --coral-light: #fceae7;
  --slate: #6b7280;
  --slate-light: #f3f4f6;
  --border: rgba(13, 13, 15, 0.12);
  --radius: 16px;
  --shadow: 0 4px 24px rgba(13, 13, 15, 0.1);
  --shadow-lg: 0 12px 48px rgba(13, 13, 15, 0.15);
  --ecology: #5b9e5e;
  --ecology-light: #edf5ee;
  --ecology-dark: #3d7a41;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  margin: 0 -20px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.logo-word {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ripple);
}

.logo-wave {
  font-size: 18px;
  animation: bobble 3s ease-in-out infinite;
}

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

.stats-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ripple-light);
  border-radius: 100px;
  padding: 6px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--ripple);
}

.stats-divider {
  opacity: 0.4;
}

/* Hero / Intro */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 40px;
  gap: 32px;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ripple);
  opacity: 0.8;
}

.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  line-height: 1.1;
  font-weight: 700;
}

.hero-headline em {
  font-style: italic;
  color: var(--ripple);
}

.hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate);
  font-weight: 300;
  max-width: 340px;
}

.ripple-visual {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

.ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--ripple);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ripple-out 3s ease-out infinite;
}

.ripple-ring:nth-child(1) { width: 30px; height: 30px; animation-delay: 0s; opacity: 0.8; }
.ripple-ring:nth-child(2) { width: 60px; height: 60px; animation-delay: 0.5s; opacity: 0.5; }
.ripple-ring:nth-child(3) { width: 100px; height: 100px; animation-delay: 1s; opacity: 0.25; }
.ripple-ring:nth-child(4) { width: 140px; height: 140px; animation-delay: 1.5s; opacity: 0.1; }

.ripple-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--ripple);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes ripple-out {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.intro-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-hint {
  text-align: center;
  font-size: 12px;
  color: var(--slate);
}

/* Buttons */
.btn-primary {
  background: var(--ripple);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 16px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
  box-shadow: 0 4px 20px rgba(26, 107, 92, 0.3);
}

.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--ripple);
  border: 2px solid var(--ripple);
  border-radius: 100px;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.btn-secondary:hover { background: var(--ripple-light); }

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
}

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

/* Categories */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 16px 20px 8px;
  margin: 0 -20px;
}

.categories::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.cat-pill.active {
  background: var(--ink);
  color: var(--paper);
}

.cat-pill:not(.active) {
  background: var(--slate-light);
  color: var(--slate);
}

/* Scenario Card */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-category-bar { height: 4px; }
.cat-Business .card-category-bar { background: var(--amber); }
.cat-Policy .card-category-bar { background: var(--ripple); }
.cat-Ecology .card-category-bar { background: var(--ecology); }
.cat-Society .card-category-bar { background: var(--coral); }

.card-body { padding: 20px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-cat-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.cat-Business .card-cat-label { background: var(--amber-light); color: var(--amber); }
.cat-Policy .card-cat-label { background: var(--ripple-light); color: var(--ripple); }
.cat-Ecology .card-cat-label { background: var(--ecology-light); color: var(--ecology-dark); }
.cat-Society .card-cat-label { background: var(--coral-light); color: var(--coral); }

.card-difficulty {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--slate);
}

.card-scenario {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-hook {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.55;
  font-style: italic;
}

/* Prediction Section */
.prediction-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ripple);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chain-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chain-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chain-node {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 14px;
}

.chain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ripple-mid);
}

.chain-line {
  width: 2px;
  background: linear-gradient(to bottom, var(--ripple-mid), transparent);
  height: 20px;
  opacity: 0.4;
}

.chain-input-wrap { flex: 1; }

.chain-order {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--slate);
  margin-bottom: 4px;
}

.chain-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  resize: none;
  transition: border-color 0.15s;
  line-height: 1.4;
  min-height: 56px;
}

.chain-input:focus {
  outline: none;
  border-color: var(--ripple-mid);
  background: white;
}

.chain-input::placeholder {
  color: var(--slate);
  opacity: 0.6;
}

.add-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ripple-mid);
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  padding: 4px 0;
  font-weight: 500;
}

.predict-nav {
  padding-top: 16px;
  padding-bottom: 12px;
}

.predict-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.predict-hint {
  text-align: center;
  font-size: 12px;
  color: var(--slate);
}

/* Loading */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 60px 20px;
}

.thinking-rings {
  position: relative;
  width: 80px;
  height: 80px;
}

.t-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--ripple);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin 1.5s linear infinite;
}

.t-ring:nth-child(1) { width: 30px; height: 30px; animation-duration: 1s; }
.t-ring:nth-child(2) { width: 50px; height: 50px; animation-duration: 1.5s; animation-direction: reverse; border-top-color: var(--ripple-mid); }
.t-ring:nth-child(3) { width: 70px; height: 70px; animation-duration: 2s; border-top-color: rgba(26, 107, 92, 0.25); }

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  text-align: center;
}

.loading-sub {
  font-size: 13px;
  color: var(--slate);
  text-align: center;
  line-height: 1.6;
  max-width: 280px;
}

/* Reveal */
.reveal-top {
  padding-top: 16px;
  padding-bottom: 4px;
}

.reveal-scenario-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--slate);
  margin-bottom: 8px;
}

.reveal-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-header {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.score-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(26, 107, 92, 0.4) 0%, transparent 60%);
}

.score-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.6;
  position: relative;
  margin-bottom: 8px;
}

.score-number {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  color: var(--ripple-mid);
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.score-max {
  font-size: 20px;
  opacity: 0.5;
  position: relative;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
}

.score-grade {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  position: relative;
  margin-top: 8px;
  opacity: 0.9;
}

.reveal-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  animation: slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal-section-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reveal-section-title.hit { color: var(--ripple); }
.reveal-section-title.miss { color: var(--amber); }
.reveal-section-title.blind { color: var(--coral); }

.reveal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.reveal-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.reveal-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.reveal-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.reveal-annotation {
  font-size: 12px;
  color: var(--slate);
  line-height: 1.4;
  margin-top: 3px;
}

.insight-box {
  background: var(--ripple-light);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ripple);
  font-style: italic;
  border-left: 3px solid var(--ripple-mid);
}

.streak-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.streak-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate);
}

.streak-val {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
}

.reveal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* Feed */
.feed-header {
  padding: 20px 0 8px;
}

.feed-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.feed-sub {
  font-size: 14px;
  color: var(--slate);
}

.feed-list {
  padding-top: 12px;
}

.feed-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
}

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

.feed-card-body { padding: 18px; }

.feed-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
}

.feed-card-hook {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}

.feed-card-footer { margin-top: 12px; }

.feed-card-cta {
  font-size: 12px;
  color: var(--ripple);
  font-weight: 500;
}

/* Error */
.error-box {
  background: var(--coral-light);
  border: 1px solid var(--coral);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--coral);
  line-height: 1.6;
}

/* Tag */
.tag {
  font-size: 11px;
  color: var(--slate);
  background: var(--slate-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  margin-left: 6px;
}