:root {
  --ink: #2a2420;
  --ink-soft: #4a443c;
  --paper: #f8f3eb;
  --paper-2: #ebe3d6;
  --card: #fffdf9;
  --dark: #2a2430;
  --dark-2: #1a1620;
  --line: #ddd2c4;
  --muted: #7a7268;
  --gold: #e8b84a;
  --gold-deep: #c4922a;
  --green: #3dbd6a;
  --green-deep: #1f7a42;
  --amber: #f08a42;
  --amber-deep: #c45a22;
  --red: #e25555;
  --blue: #4a8ec4;
  --display: "Fraunces", Georgia, serif;
  --brand: "Syne", "Nunito", system-ui, sans-serif;
  --sans: "Nunito", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 2px 8px rgba(28, 18, 10, 0.07);
  --shadow-md: 0 8px 22px rgba(28, 18, 10, 0.11);
  --shadow-lg: 0 18px 42px rgba(20, 12, 8, 0.22);
  --shadow-xl: 0 24px 56px rgba(14, 8, 6, 0.32);
  --shadow-3d: 0 6px 0 rgba(28, 18, 10, 0.14), 0 14px 28px rgba(20, 12, 8, 0.18);
  --shadow-3d-sm: 0 3px 0 rgba(28, 18, 10, 0.12), 0 8px 16px rgba(20, 12, 8, 0.1);
  --grad-green: linear-gradient(180deg, #5ee08a 0%, #38c46a 38%, #249a52 100%);
  --grad-amber: linear-gradient(180deg, #f5a45a 0%, #e88438 48%, #c85e22 100%);
  --grad-cream: linear-gradient(165deg, #fffefb 0%, #f8f0e4 55%, #ebe0d2 100%);
  --grad-card: linear-gradient(180deg, #ffffff 0%, #f9f2e8 100%);
  --grad-dark: linear-gradient(165deg, #3d3648 0%, #2a2430 42%, #18141c 100%);
  --grad-dark-soft: linear-gradient(180deg, #342e3c 0%, #24202a 100%);
  --grad-hero-sky: linear-gradient(180deg, #ffd898 0%, #f0a060 28%, #e07040 48%, #8a3850 72%, #1e1420 100%);
  --shine: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(232, 184, 74, 0.18), transparent 55%),
    linear-gradient(180deg, #1a1410 0%, #12100e 100%);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.phone {
  width: min(430px, 100%);
  height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(255, 248, 238, 0.9), transparent 70%),
    linear-gradient(180deg, #faf6f0 0%, #f2ebe0 45%, #ebe3d6 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 480px) {
  body { display: grid; place-items: center; padding: 24px; }
  .phone {
    height: min(880px, calc(100dvh - 48px));
    border-radius: 32px;
    box-shadow:
      var(--shadow-xl),
      0 0 0 1px rgba(255, 248, 238, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid #3a3228;
  }
}

.art { display: block; width: 28px; height: 28px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(20, 12, 8, 0.15)); }
.art-lg { width: 96px; height: 96px; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(20, 12, 8, 0.2)); }
.art-xl { width: 132px; height: 132px; margin: 0 auto; }
.art-seed { width: 52px; height: 52px; }
.art-char { width: 120px; height: 120px; margin: 0 auto; filter: drop-shadow(0 8px 16px rgba(20, 12, 8, 0.22)); }
.art-logo { width: 44px; height: 44px; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(180, 120, 20, 0.45)); }
.art-crown { width: 88px; height: 88px; filter: drop-shadow(0 10px 18px rgba(180, 100, 20, 0.45)); }
.art-city { width: 100%; height: 100%; filter: none; }
.art-radar { width: 180px; height: 180px; margin: 0 auto; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 8px;
  padding-top: max(10px, env(safe-area-inset-top));
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.96) 0%, rgba(248, 243, 235, 0) 100%);
  border-bottom: 1px solid rgba(220, 200, 170, 0.2);
}
.topbar.is-hidden { display: none; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 4px 6px 4px 2px;
  cursor: pointer;
  background: none;
  font: inherit;
  border-radius: 14px;
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease);
}
.logo:active { transform: scale(0.97); }
.logo-mark { display: grid; place-items: center; line-height: 0; }
.logo-word {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.95;
  text-align: left;
}
.logo-vida {
  font-family: var(--brand);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #2a2018 0%, #6a5040 45%, #3a3028 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0 rgba(255, 248, 238, 0.5));
}
.logo-sa {
  font-family: var(--sans);
  font-weight: 900;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  margin-top: 1px;
}
.hero-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hero-logo .art-logo {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.hero-brand .logo-vida {
  font-size: clamp(2rem, 9vw, 2.6rem);
  color: #fff8ee;
  background: linear-gradient(180deg, #fff8ee 0%, #f6d070 55%, #e8b84a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.4));
}
.hero-brand .logo-sa {
  font-size: 0.72rem;
  color: #f6d070;
  letter-spacing: 0.28em;
  margin-top: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.top-meta {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.perk-chip {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6418;
  background: linear-gradient(180deg, #f8ecd0 0%, #edd9b0 100%);
  padding: 5px 12px;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(200, 160, 80, 0.25);
}
.perk-chip[hidden] { display: none !important; }

.hud {
  margin: 0 12px 6px;
  padding: 10px 12px 8px;
  background: var(--grad-cream);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    var(--shadow-3d-sm),
    var(--shine),
    inset 0 -1px 0 rgba(180, 160, 130, 0.15);
  flex-shrink: 0;
}
.hud[hidden] { display: none !important; }
.phone.is-capitalismo .hud {
  background: linear-gradient(180deg, #fff8e8 0%, #f3e4c4 55%, #ead6a8 100%);
  border-color: rgba(232, 184, 74, 0.35);
}
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hud-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff8ee 0%, #e8d8c0 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow:
    0 3px 8px rgba(40, 24, 10, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}
.hud-avatar .art-char { width: 48px; height: 48px; filter: none; }
.hud-id { min-width: 0; }
.hud-id strong { display: block; font-size: 0.98rem; color: var(--ink); line-height: 1.15; }
.hud-life, .hud-role {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  font-weight: 700;
}
.hud-role { color: #6a5a40; }
.hud-role[hidden] { display: none !important; }
.hud-cash-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #e8f8ec 0%, #d4f0d8 100%);
  border: 1px solid rgba(60, 160, 90, 0.25);
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: var(--shine);
}
.hud-cash-ico { font-size: 1rem; line-height: 1; }
.hud-cash {
  font-weight: 800;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  color: #1f7a42;
}
.hud-cash.is-neg { color: #c43b32; }
.hud-cash-wrap:has(.hud-cash.is-neg) {
  background: linear-gradient(180deg, #fde8e8 0%, #f8d0d0 100%);
  border-color: rgba(196, 59, 50, 0.25);
}
.hud-vitals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.vital {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(180deg, #fffaf2 0%, #efe4d4 100%);
  border: 1px solid rgba(220, 200, 170, 0.5);
  border-radius: 99px;
  padding: 5px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(200, 180, 150, 0.35), var(--shine);
}
.vital-emoji { font-size: 0.92rem; line-height: 1; }
.vital .art { width: 18px; height: 18px; filter: none; }
.vital.is-pop { animation: stat-pop 0.45s var(--ease); }
.vital.is-pop-up b { color: #1f7a42; }
.vital.is-pop-down b { color: #c43b32; }
.hud-cash.is-pop { animation: stat-pop 0.45s var(--ease); }
@keyframes stat-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.hud-context {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(180, 160, 130, 0.35);
}
#hud-date {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 800;
}
.hud-extra {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.name-input {
  width: 100%;
  border: 1px solid rgba(210, 190, 160, 0.55);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1.1rem;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #f8f0e4 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
#stage { flex: 1; overflow: auto; padding: 4px 14px 12px; -webkit-overflow-scrolling: touch; }
.fade-in { animation: rise 0.42s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  background: linear-gradient(90deg, var(--gold) 0%, #f6d070 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0 0 10px; }
h1 { font-size: clamp(1.9rem, 7.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 5.5vw, 1.7rem); }
.lead { color: var(--muted); font-size: 1.02rem; line-height: 1.45; margin: 0 0 14px; }
.card-body { font-size: 1.02rem; line-height: 1.5; margin: 0; }
.note { color: var(--muted); font-size: 0.9rem; font-style: italic; margin: 10px 0 18px; }
.motto { font-size: 0.8rem; color: rgba(255, 240, 220, 0.78); margin: 14px 0 0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }

.screen-hero {
  position: relative;
  min-height: 100%;
  margin: -6px -16px -16px;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  color: #fff8ee;
  overflow: visible;
  background: var(--grad-hero-sky);
}
.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-bg .art-city { width: 100%; height: 100%; }
.hero-shade {
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, rgba(255, 220, 140, 0.15), transparent 60%),
    linear-gradient(180deg, transparent 12%, rgba(30, 16, 24, 0.55) 55%, rgba(20, 12, 18, 0.92) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.screen-hero h1 {
  color: #fff8ee;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.screen-hero .lead { color: #f3dcc0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); }
.screen-hero .eyebrow { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3)); }
.hero-stats { display: flex; justify-content: center; gap: 10px; margin: 0 0 14px; }
.hero-stat {
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.18) 0%, rgba(255, 248, 238, 0.06) 100%);
  border: 1px solid rgba(255, 248, 238, 0.22);
  border-radius: 14px;
  padding: 9px 16px;
  min-width: 88px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), var(--shine);
  backdrop-filter: blur(6px);
}
.hero-stat b { display: block; font-size: 1.25rem; }
.hero-stat span { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.last-life { margin: 0 0 14px; font-size: 0.85rem; color: #f3d8b8; }
.last-life em { color: #fff; font-style: normal; font-weight: 800; }
.continue-card {
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.16) 0%, rgba(20, 12, 16, 0.35) 100%);
  border: 1px solid rgba(255, 248, 238, 0.22);
  border-radius: 22px;
  padding: 16px 16px 14px;
  margin: 0 0 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}
.continue-kicker {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #f6d070;
}
.continue-who {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff8ee;
}
.continue-meta, .continue-event, .continue-copy {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #f3dcc0;
  line-height: 1.4;
}
.continue-card .btn-xl { margin-top: 6px; }
.continue-card.is-warn { border-color: rgba(240, 112, 128, 0.4); }
.world-lock {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.22) 100%);
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f3d8b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.world-lock .art { width: 22px; height: 22px; filter: none; }

.btn, .choice, .seed-card, .link-btn {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.btn {
  width: 100%;
  border: 0;
  background: var(--grad-green);
  color: #fff;
  padding: 16px 18px;
  min-height: 56px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1.08rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    var(--shine),
    0 6px 0 var(--green-deep),
    0 10px 24px rgba(36, 154, 82, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.btn:active {
  transform: translateY(4px);
  box-shadow:
    var(--shine),
    0 2px 0 var(--green-deep),
    0 4px 12px rgba(36, 154, 82, 0.25);
}
.btn.ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: inherit;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  margin-top: 10px;
  text-shadow: none;
}
.btn.ghost:active { transform: translateY(2px); }
.screen:not(.screen-hero) .btn.ghost,
.screen-post .btn.ghost {
  background: var(--grad-cream);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-xl { min-height: 64px; font-size: 1.2rem; border-radius: 22px; }
.link-btn {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 12px 0;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.85;
}
.row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-actions .btn:only-child { grid-column: 1 / -1; }
.progress-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.dot {
  width: 26px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(180deg, #e8ddd0 0%, #d8ccc0 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.dot.is-on {
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold) 100%);
  width: 38px;
  box-shadow: 0 2px 8px rgba(196, 146, 42, 0.35);
}

.seed-grid { display: grid; gap: 12px; }
.seed-card {
  text-align: left;
  border: 1px solid rgba(220, 200, 170, 0.55);
  background: var(--grad-card);
  border-radius: 22px;
  padding: 14px 14px 12px;
  box-shadow:
    var(--shadow-md),
    var(--shine),
    inset 0 -2px 0 rgba(210, 190, 160, 0.2);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.seed-card:active {
  transform: scale(0.985) translateY(2px);
  box-shadow: var(--shadow-sm), inset 0 2px 6px rgba(0, 0, 0, 0.04);
}
.seed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.seed-emoji {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff8ee 0%, #e8dcc8 100%);
  display: grid;
  place-items: center;
  box-shadow:
    0 4px 0 rgba(200, 180, 150, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(230, 210, 180, 0.6);
  flex-shrink: 0;
}
.seed-title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; display: block; color: var(--ink); }
.seed-tension {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--gold-deep), #d4a030);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.seed-body { margin: 8px 0 10px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.seed-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid transparent;
}
.tag-ok {
  background: linear-gradient(180deg, #e8f8ee 0%, #d0eed8 100%);
  color: #1a6b38;
  border-color: rgba(42, 154, 82, 0.2);
  box-shadow: var(--shine);
}
.tag-warn {
  background: linear-gradient(180deg, #fff0e8 0%, #fde0d4 100%);
  color: #9a3a28;
  border-color: rgba(200, 90, 50, 0.2);
  box-shadow: var(--shine);
}
.seed-cta {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-weight: 800;
  background: linear-gradient(90deg, #38c46a, #249a52);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.perk-panel {
  margin: 0 0 14px;
  padding: 12px;
  background: linear-gradient(180deg, #f0e8dc 0%, #e6dcd0 100%);
  border-radius: 18px;
  border: 1px solid rgba(210, 190, 160, 0.5);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.perk-panel-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.8rem; }
.perk-panel-pv {
  background: linear-gradient(90deg, #38c46a, #249a52);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.perk-panel-lead { margin: 4px 0 10px; font-size: 0.8rem; color: var(--muted); }
.perk-grid { display: grid; gap: 8px; }
.perk-card {
  background: var(--grad-card);
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(220, 200, 170, 0.4);
  box-shadow: var(--shadow-sm);
}
.perk-card.is-equipped {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 184, 74, 0.35), var(--shadow-sm);
}
.perk-card-top { display: flex; justify-content: space-between; }
.perk-tagline { margin: 6px 0 8px; font-size: 0.8rem; color: var(--muted); }
.perk-actions { display: flex; gap: 6px; }
.perk-btn {
  width: auto;
  flex: 1;
  min-height: 42px;
  padding: 8px;
  font-size: 0.8rem;
  box-shadow: 0 4px 0 var(--green-deep), var(--shine);
  margin: 0;
}
.perk-btn.is-on {
  background: linear-gradient(180deg, #f0c860 0%, #c4922a 100%);
  box-shadow: 0 4px 0 #8a6418, var(--shine);
}
.perk-btn:disabled { opacity: 0.4; }
.perk-maxed { font-size: 0.7rem; color: var(--green); font-weight: 800; align-self: center; }

.stage-tag { margin: 2px 0 10px; font-size: 0.78rem; color: var(--muted); font-weight: 800; }
.stage-pill {
  display: inline-block;
  background: linear-gradient(180deg, #f8ecd4 0%, #efe0c0 100%);
  color: var(--gold-deep);
  border: 1px solid rgba(200, 160, 80, 0.3);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 0.68rem;
  text-transform: uppercase;
  box-shadow: var(--shine);
}

.life-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.life-month-bar {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffefb 0%, #f3ead8 55%, #ebe0d0 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-3d-sm), var(--shine);
  text-align: center;
}
.life-month-label {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 6vw, 1.65rem);
  font-weight: 700;
  color: #2a2420;
  letter-spacing: 0.02em;
}
.life-month-meta {
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.life-chip {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 99px;
  padding: 4px 9px;
  background: #fff8ee;
  border: 1px solid rgba(200, 170, 130, 0.35);
  color: var(--ink-soft);
}
.life-chip.is-star { background: #fff4d0; color: #8a6418; }
.life-chip.is-heart { background: #fde8ee; color: #a04058; }

.choose-prompt {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a6418;
}

.decision-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin-bottom: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff8ee 0%, #f0e4d0 100%);
  border: 1px solid rgba(232, 184, 74, 0.35);
  box-shadow: var(--shadow-3d-sm), var(--shine);
  font-weight: 800;
  color: #6a5040;
  animation: rise 0.35s var(--ease) both;
}
.decision-pending-ico {
  font-size: 1.2rem;
  animation: stat-pop 0.9s var(--ease) infinite;
}
.event-card.event-card-hero {
  padding: 0;
  margin-bottom: 14px;
  min-height: 0;
}
.event-visual {
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  line-height: 1;
  padding: 22px 16px 10px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(255, 248, 238, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.event-card-inner { padding: 10px 16px 16px; position: relative; z-index: 1; }
.event-card h2 {
  font-size: clamp(1.28rem, 5.5vw, 1.55rem);
}
.choices-stack { gap: 10px; }
.choice.choice-card {
  align-items: center;
  min-height: 68px;
  padding: 14px 14px;
  border-radius: 18px;
  box-shadow:
    0 6px 0 rgba(150, 130, 100, 0.45),
    var(--shine),
    0 12px 24px rgba(40, 24, 10, 0.12);
}
.choice-chevron {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(42, 36, 32, 0.35);
  margin-left: 4px;
}
.choice-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a6e62;
  line-height: 1.25;
}
.choice-a.choice-card { border-left: 4px solid #2f9a52; }
.choice-b.choice-card { border-left: 4px solid #d07028; }
.choice-c.choice-card { border-left: 4px solid #3a7eb8; }
.choice-d.choice-card { border-left: 4px solid #6a50a0; }
.screen-life {
  padding-bottom: 8px;
}
.screen-life.is-resolved .event-card {
  opacity: 0.92;
  transform: scale(0.995);
}

.event-card {
  background: var(--grad-dark);
  color: #f6efe4;
  border-radius: 22px;
  padding: 14px 16px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    var(--shadow-3d),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.event-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.06) 0%, transparent 42%);
  pointer-events: none;
}
.event-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gold);
}
.event-card.is-story::before { background: linear-gradient(180deg, #ffe08a, #c4922a); }
.event-card.cat-familia::before { background: #f08a42; }
.event-card.cat-amistad::before { background: #4a8ec4; }
.event-card.cat-escuela::before { background: #3dbd6a; }
.event-card.cat-trabajo::before { background: #e8b84a; }
.event-card.cat-dinero::before { background: #3dbd6a; }
.event-card.cat-salud::before { background: #e25555; }
.event-card.cat-relaciones::before { background: #e07090; }
.event-card.cat-personalidad::before { background: #8a70c4; }
.event-card.cat-oportunidad::before { background: #f0c860; }
.event-card.cat-especial::before { background: #c4922a; }
.event-cat {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f6d070;
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-cat-ico { font-size: 0.95rem; }
.event-card h2 {
  color: #fff8ee;
  margin-bottom: 6px;
  font-size: clamp(1.15rem, 5vw, 1.45rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.event-card .card-body {
  color: #d8cfc2;
  font-size: 0.95rem;
  line-height: 1.42;
}

.choices { display: grid; gap: 8px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 12px 12px;
  min-height: 56px;
  color: #2a2420;
  font-weight: 800;
  background: linear-gradient(180deg, #fffdf8 0%, #f4ead8 55%, #ebe0d0 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 5px 0 rgba(170, 150, 120, 0.5),
    var(--shine),
    0 10px 20px rgba(40, 24, 10, 0.1);
  transition: transform 0.1s var(--ease), box-shadow 0.1s var(--ease);
  cursor: pointer;
  font-family: inherit;
}
.choice.has-hint { min-height: 64px; }
.choice-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
  background: linear-gradient(180deg, #3d3648, #2a2430);
  color: #fff8ee;
  margin-top: 1px;
}
.choice-a .choice-mark { background: linear-gradient(180deg, #4ac878, #1f7a42); }
.choice-b .choice-mark { background: linear-gradient(180deg, #f5a45a, #c45a22); }
.choice-c .choice-mark { background: linear-gradient(180deg, #6aaee8, #3a6ea5); }
.choice-d .choice-mark { background: linear-gradient(180deg, #8a70c4, #5a4088); }
.choice-copy { min-width: 0; flex: 1; }
.choice:active,
.choice.is-picking {
  transform: translateY(3px);
  box-shadow: 0 1px 0 transparent, var(--shine);
}
.choice-label { display: block; font-size: 0.98rem; line-height: 1.25; }
.choice-hint { display: block; margin-top: 3px; font-size: 0.76rem; font-weight: 700; color: var(--muted); }

.discover-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.discover-chip {
  font-size: 0.7rem;
  font-weight: 800;
  color: #8a6418;
  background: linear-gradient(180deg, #fff4d0, #f0e0a8);
  border-radius: 99px;
  padding: 4px 10px;
}

.juice-kicker {
  margin: 0 0 2px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #f6d070;
}
.juice-char {
  min-height: 88px;
  display: grid;
  place-items: center;
  margin: 4px 0 6px;
}
.juice-char .art-char { width: 88px; height: 88px; }
.delta-emoji { font-size: 1.05rem; }
.delta-val { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }

.overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(232, 184, 74, 0.08), transparent 60%),
    rgba(14, 10, 12, 0.84);
  backdrop-filter: blur(4px);
  display: none;
  place-items: end center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  pointer-events: none;
}
.overlay.is-on { display: grid; pointer-events: auto; }
.overlay-card {
  width: 100%;
  background: var(--grad-dark);
  color: #f6efe4;
  border-radius: 26px;
  padding: 22px 18px 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: pop 0.38s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(0.95); } to { opacity: 1; transform: none; } }

.juice-years {
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  background: linear-gradient(90deg, var(--gold), #f6d070);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.juice-hero {
  font-family: var(--display);
  font-size: clamp(2.1rem, 9vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  margin: 2px 0 8px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.juice-card.is-gain .juice-hero { color: #6fd88a; }
.juice-card.is-loss .juice-hero { color: #f07080; }
.juice-card.is-mix .juice-hero { color: var(--gold); }
.juice-line { font-size: 1.02rem; margin: 0 0 12px; line-height: 1.4; color: #d8cfc2; }
.juice-deltas { display: grid; gap: 6px; margin-bottom: 12px; }
.delta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #2a2430 0%, #1e1824 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.delta-left { display: flex; align-items: center; gap: 8px; }
.delta .art { width: 20px; height: 20px; filter: none; }
.delta.up { color: #6fd88a; }
.delta.down { color: #f07080; }
.juice-hook {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: #f6d070;
  font-weight: 800;
  font-style: italic;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(246, 208, 112, 0.08);
  border: 1px solid rgba(246, 208, 112, 0.15);
}
.juice-line {
  font-size: 1rem;
  line-height: 1.45;
  margin: 0 0 10px;
  color: #e8dfd0;
}

.reveal-art { min-height: 120px; display: grid; place-items: center; margin: 6px 0 10px; }
.reveal-art .art-lg { width: 120px; height: 120px; }
.reveal-card h2 { color: #fff8ee; }
.reveal-card .eyebrow { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3)); }

.screen-post { text-align: center; padding-top: 8px; }
.post-card {
  background: var(--grad-dark);
  color: #f6efe4;
  border-radius: 24px;
  padding: 22px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.post-card h2 { color: #fff8ee; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.post-card .lead { color: #d8cfc2; }
.axes-box { display: grid; gap: 8px; margin: 0 0 8px; text-align: left; }
.axis-row {
  background: linear-gradient(180deg, #2a2430 0%, #1e1824 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fineprint {
  padding: 8px 16px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}
.fineprint.is-hidden { display: none; }

.bottom-nav {
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px 10px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #342e38 0%, #1e1820 55%, #121018 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 248, 238, 0.06);
  flex-shrink: 0;
  z-index: 20;
}
.bottom-nav[hidden] { display: none; }
.nav-tab {
  flex: 1;
  max-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: #a8a098;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.12s var(--ease), color 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.nav-tab:active { transform: scale(0.94); }
.nav-tab.is-on {
  color: #fff8ee;
  background: linear-gradient(180deg, rgba(232, 184, 74, 0.28) 0%, rgba(255, 255, 255, 0.08) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 238, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 2px 0 rgba(232, 184, 74, 0.35);
  transform: translateY(-2px);
}
.nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
.nav-tab { font-size: 0.52rem; max-width: 72px; padding: 6px 2px 6px; }
.life-map { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 22px; }
.life-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.life-node {
  min-width: 88px;
  max-width: 120px;
  padding: 10px 8px;
  border-radius: 18px;
  background: rgba(255, 248, 238, 0.08);
  text-align: center;
  color: #fff8ee;
}
.life-node.is-you { background: linear-gradient(180deg, rgba(232, 184, 74, 0.35), rgba(255,255,255,0.08)); }
.life-node.is-empty { opacity: 0.45; }
.life-avatar { display: block; font-size: 1.4rem; }
.life-who { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #c4b8a8; }
.legacy-moments { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.legacy-moments li {
  background: rgba(255,248,238,0.07);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.92rem;
}
.epitaph { font-family: Fraunces, serif; font-size: 1.15rem; line-height: 1.45; }
.ended-facts { list-style: none; padding: 0; display: grid; gap: 6px; margin: 16px 0; }

.nav-label { line-height: 1.1; text-align: center; width: 100%; }

.screen-sub { padding-bottom: 8px; }
.story-grid, .collect-grid { display: grid; gap: 10px; margin-top: 12px; }
.collect-grid { grid-template-columns: repeat(2, 1fr); }
.story-card, .collect-card, .mission-card {
  background: var(--grad-dark);
  color: #f6efe4;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-3d-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.story-card.is-open { cursor: pointer; }
.story-card.is-locked { opacity: 0.78; }
.story-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.story-emoji { font-size: 1.6rem; }
.story-title { display: block; font-size: 1rem; }
.story-status, .collect-state { display: block; font-size: 0.75rem; color: #b8aea2; margin-top: 2px; }
.story-desc, .collect-desc { margin: 0; font-size: 0.88rem; color: #d8cfc2; line-height: 1.35; }
.story-count, .story-mystery { margin: 6px 0 0; font-size: 0.75rem; font-weight: 800; color: #f6d070; }
.story-mystery { color: #9a9088; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 10px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #f6d070);
}
.collect-section { margin-top: 16px; }
.collect-section h3 { margin: 0 0 8px; font-size: 0.95rem; color: #3a3228; }
.phone.is-playing .collect-section h3,
.screen-collection .collect-section h3 { color: var(--ink); }
.collect-card { text-align: center; }
.collect-emoji { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.collect-price { display: block; font-size: 0.8rem; color: var(--gold); margin-top: 4px; font-weight: 800; }
.collect-card.is-hidden { opacity: 0.7; filter: saturate(0.4); }
.mission-card { margin-top: 12px; }
.mission-card.is-current {
  border-color: rgba(232, 184, 74, 0.35);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(232, 184, 74, 0.15);
}
.mission-bar { height: 10px; }
.mission-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}
.mission-desc { margin: 0 0 8px; color: #d8cfc2; font-size: 0.9rem; }
.mission-money { margin: 6px 0 0; font-weight: 800; color: #fff8ee; }
.mission-done { color: #6fd88a; font-weight: 800; margin: 6px 0 0; }
.mission-lock { color: #b8aea2; font-size: 0.82rem; margin: 6px 0 0; }
.story-path { margin-top: 14px; display: grid; gap: 4px; }
.path-step {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2a2430 0%, #1e1824 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.path-step.is-done { border-color: rgba(111, 216, 138, 0.35); }
.path-step.is-next { border-color: rgba(232, 184, 74, 0.4); }
.path-step.is-hidden { opacity: 0.55; }
.path-emoji { font-size: 1.2rem; }
.path-line { text-align: center; color: #7a746e; font-size: 0.9rem; }
.back-link { margin-bottom: 8px; }
.unlock-emoji { font-size: 3rem; margin: 8px 0; }
.unlock-card h2 { color: #fff8ee; margin: 0 0 8px; }

@media (max-width: 380px) {
  .hud { margin: 0 8px 4px; padding: 8px 10px 7px; }
  .hud-avatar, .hud-avatar .art-char { width: 42px; height: 42px; }
  .hud-cash { font-size: 1rem; }
  .vital { font-size: 0.72rem; padding: 4px 4px; }
  .event-card { padding: 14px 14px 16px; margin-bottom: 12px; }
  .event-card h2 { font-size: 1.2rem; }
  .event-card .card-body { font-size: 0.92rem; }
  .choices { gap: 10px; }
  .choice { min-height: 58px; padding: 11px 12px; font-size: 0.95rem; }
  .choice.has-hint { min-height: 68px; }
  .choose-prompt { font-size: 0.88rem; margin-bottom: 8px; }
  .overlay-card { padding: 20px 16px 16px; border-radius: 22px; }
  .juice-hero { font-size: 2rem; }
}

.shake { animation: shake 0.35s ease; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (prefers-reduced-motion: reduce) {
  .fade-in, .overlay-card { animation: none; }
  .btn, .choice, .seed-card, .nav-tab { transition: none; }
}

html[data-fx="decision"] .phone { animation: fx-pulse 0.22s var(--ease); }
html[data-fx="unlock"] .phone { animation: fx-glow 0.35s var(--ease); }
html[data-fx="month"] #stage { animation: rise 0.35s var(--ease); }
@keyframes fx-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.008); }
}
@keyframes fx-glow {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.04); }
}
