/* Estilo del celular. Provisional, cálido/orgánico (GAME_PLAN 1.1). Reemplazable por arte. */
:root {
  --bg: #14281d;
  --card: #1e3a2b;
  --ink: #f2f5ee;
  --accent: #8fd694;
  --muted: #9fb3a4;
  --season-accent: #8fcde2;
}
body[data-season="spring"] { --season-accent: #91d89b; }
body[data-season="summer"] { --season-accent: #edca66; }
body[data-season="autumn"] { --season-accent: #df9a68; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 50% 0%, #1d3a2a, var(--bg));
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
#app {
  flex: 1;
  display: grid;
  align-items: center;
  justify-content: center;
  justify-items: center;
  grid-template-columns: minmax(0, 440px);
  padding: 24px;
}
.step { grid-area: 1 / 1; width: 100%; max-width: 440px; text-align: center; }
#screen-leadup:not(.hidden) { min-height: calc(100vh - 80px); min-height: calc(100svh - 80px); display: flex; flex-direction: column; }
.hidden { display: none; }
.step.is-entering { animation: step-in 0.24s ease-in-out both; }
.step.is-leaving { animation: step-out 0.24s ease-in-out both; pointer-events: none; }
@keyframes step-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes step-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-3px); } }
h1 { font-size: 1.9rem; margin: 0 0 8px; }
h2 { font-size: 1.4rem; margin: 0 0 20px; line-height: 1.3; }
.sub { color: var(--muted); margin: 0 0 24px; }
.tag { color: var(--season-accent); font-weight: 700; margin: 0 0 2px; }
.leadup-stage { margin: 0 0 14px; color: var(--muted); font-size: .88rem; font-weight: 600; line-height: 1.3; }
.leadup-bottom { margin-top: auto; padding-top: 12px; }
.decision-question { max-width: 38rem; margin: 0 auto; color: var(--muted); font-size: .96rem; font-weight: 650; line-height: 1.35; }
.text-transitioning { opacity: 1; transition: opacity .18s ease-in-out, min-height .28s ease-in-out; }
.text-transitioning.is-fading-out { opacity: 0; }
.leadup-card-viewport {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow-x: clip;
  overflow-y: visible;
  width: 100%;
}
.leadup-card {
  grid-area: 1 / 1;
  align-self: start;
  width: 100%;
  min-width: 0;
}
.leadup-card.is-incoming { pointer-events: none; }
.leadup-question { min-height: 2.6em; }
.round-progress { margin: -10px 0 8px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; display: grid; justify-items: center; gap: 5px; min-height: 4.5em; }
.vote-count { font-weight: 650; }
.vote-pending-status { min-height: 1.25em; font-size: .82rem; font-weight: 650; }
.round-progress.is-awaiting-state { visibility: hidden; }
.external-timer { display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--ink); font-weight: 800; white-space: nowrap; transition: color .18s ease-in, background-color .18s ease-in; }
#round-timer, #done-timer { margin: 12px auto 0; }
#screen-leadup #round-timer { margin: 0 auto 10px; }
#round-timer:empty, #done-timer:empty { visibility: hidden; }
#done-timer { margin-top: 14px; }
.external-timer.has-internal-timer.is-expired { color: #ff7272; background: rgba(255,72,72,.15); animation: external-timer-pulse 1.15s ease-in-out infinite; }
@keyframes external-timer-pulse { 0%, 100% { transform: scale(1); } 52% { transform: scale(1.12); } }
.vote-open-status { min-height: 1.25em; color: #ffaaaa; font-size: .82rem; font-weight: 650; }
.vote-feedback { min-height: 1.4em; margin: 0 0 8px; color: #ffaaaa; font-size: .9rem; }
.choices { display: flex; flex-direction: column; gap: 12px; transition: min-height .28s ease-in-out; }
.choice {
  appearance: none;
  border: 1px solid rgba(143, 214, 148, 0.35);
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
  padding: 18px 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.intro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.intro-list li {
  background: var(--card);
  border: 1px solid rgba(143, 214, 148, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  line-height: 1.4;
}
.choice:active { transform: scale(0.97); }
.choice:disabled { opacity: .65; cursor: wait; }
.vote-option { flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
.vote-option .opt-label { font-size: 1.1rem; font-weight: 600; }
.vote-option .opt-fx { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fx {
  font-size: 0.82rem;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.fx.up   { background: rgba(143, 214, 148, 0.18); color: #8fd694; }
.fx.down { background: rgba(230, 138, 138, 0.18); color: #e68a8a; }
.fx.none { background: rgba(144, 167, 149, 0.15); color: var(--muted); font-style: italic; }
.choice.primary { background: var(--accent); color: #10231a; font-weight: 700; }
.step > .choice.primary { width: fit-content; min-width: 180px; max-width: 100%; margin-inline: auto; }
.icon { font-size: 1.4rem; }
.tick { font-size: 3rem; margin-bottom: 8px; }
.fox-journey {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto 20px;
}
.journey-connections {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  background: transparent;
}
.journey-connection {
  opacity: .78;
  transition: opacity .35s ease-in-out;
}
.journey-connection.is-new { opacity: 0; }
.journey-connection.is-fading { opacity: .3; }
.journey-connection.is-expiring {
  opacity: 0;
  transition-duration: .75s;
  transition-timing-function: ease-out;
}
.journey-connection-glow {
  stroke: #67d6f7;
  stroke-width: 3.2;
  stroke-linecap: round;
  opacity: .18;
}
.journey-connection-core {
  stroke: url(#journey-connection-metal);
  stroke-width: 1.25;
  stroke-linecap: round;
}
.journey-connection-shimmer {
  stroke: #effcff;
  stroke-width: .7;
  stroke-linecap: round;
  stroke-dasharray: 4 21;
  stroke-dashoffset: 0;
  opacity: 0;
  transition: opacity .18s ease-in;
}
@keyframes connection-flow { to { stroke-dashoffset: -100; } }
.journey-connection.is-complete .journey-connection-shimmer {
  opacity: .76;
  animation: connection-flow 2.4s linear infinite;
}
.journey-trees { position: absolute; inset: 0; }
.journey-tree {
  position: absolute;
  font-size: 2rem;
  line-height: 1;
  padding: .12em;
  border-radius: 50%;
  background-color: var(--bg);
  transform: translate(-50%, -50%);
  isolation: isolate;
}
.journey-tree::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.24em;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 246, 255, .62) 0%, rgba(100, 218, 249, .34) 42%, rgba(100, 218, 249, 0) 76%);
  opacity: 0;
  transform: scale(.58);
  pointer-events: none;
}
.journey-tree.arrival-glow::before {
  animation: tree-arrival-radiation .52s ease-out both;
}
@keyframes tree-arrival-radiation {
  0% { opacity: 0; transform: scale(.6); }
  24% { opacity: .64; transform: scale(.92); }
  100% { opacity: 0; transform: scale(1.3); }
}
.journey-tree.has-vote {
  z-index: 1;
  animation: voted-tree-glow 2.2s ease-in-out infinite;
  will-change: transform, filter;
}
@keyframes voted-tree-glow {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1.08);
    filter: drop-shadow(0 0 1px rgba(255, 224, 125, 1)) drop-shadow(0 0 6px rgba(255, 191, 46, 0.58));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.25);
    filter: drop-shadow(0 0 2px rgba(255, 230, 139, 1)) drop-shadow(0 0 12px rgba(255, 191, 46, 0.82));
  }
}
.fox-orbit {
  position: absolute;
  inset: 0;
}
.journey-fox {
  position: absolute;
  left: 50%;
  top: 18%;
  font-size: 2rem;
  line-height: 1;
  transform: translate(-50%, -50%);
  will-change: left, top, transform;
}
.fox-journey + h2 { margin-bottom: 12px; }
.result { margin: 20px 0; padding: 16px; border-radius: 16px; background: rgba(143, 214, 148, 0.12); border: 1px solid rgba(143, 214, 148, 0.35); }
.result.hidden { display: none; }
.result.tied::before { content: "🪙"; display: block; font-size: 1.5rem; animation: phone-coin .9s ease-out both; }
@keyframes phone-coin { 0% { opacity: .2; transform: rotateY(0) scale(.8); } 60% { opacity: 1; transform: rotateY(540deg) scale(1.15); } 100% { opacity: 1; transform: rotateY(720deg) scale(1); } }
.result:not(.hidden) { animation: result-reveal .18s ease-out both; }
@keyframes result-reveal { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.result-where { margin: 0 0 8px; font-weight: 700; }
.result-label { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; }
.result-option { min-height: 2.6em; margin: 0; font-size: 1.3rem; line-height: 1.3; font-weight: 700; color: var(--accent); }
.forest-impact { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(143, 214, 148, 0.2); text-align: left; }
.impact-title { margin: 0 0 4px; font-size: 1rem; line-height: 1.3; }
.impact-status { min-height: 2.5em; margin: 0 0 10px; color: var(--muted); font-size: .82rem; line-height: 1.3; }
.impact-bars { display: grid; gap: 10px; }
.impact-row { min-width: 0; }
.impact-row-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.impact-label { min-width: 0; font-size: .86rem; font-weight: 700; }
.impact-values { flex: none; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.impact-meter-line { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.impact-track { position: relative; flex: 1; height: 10px; overflow: visible; border-radius: 999px; background: rgba(255,255,255,.12); }
.impact-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
.impact-marker { display: inline-flex; flex: 0 0 1.8rem; justify-content: center; align-items: center; font-size: .78rem; white-space: nowrap; }
.impact-marker-empty { visibility: hidden; }
.impact-emoji { display: inline-block; }
.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; }
.status {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px;
  min-height: 1.2em;
}
.phone-announcement {
  position: fixed; z-index: 10; left: 16px; right: 16px; bottom: 56px;
  max-width: 520px; margin: 0 auto; padding: 12px 16px;
  border: 1px solid rgba(143, 214, 148, 0.4); border-radius: 14px;
  background: rgba(20, 40, 29, 0.97); color: var(--ink); text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.32);
  animation: announcement-in .18s ease-out both;
}
.phone-announcement.hidden { display: none; }
@keyframes announcement-in { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .step.is-entering, .step.is-leaving { animation: none; }
  .choice, .phone-announcement, .result, .text-transitioning { transition-duration: .12s; animation-duration: .12s; }
  .phone-announcement { animation-name: announcement-in-reduced; }
  .result:not(.hidden) { animation-name: result-reveal-reduced; }
  .journey-tree.has-vote { animation-duration: 3.6s; }
  .journey-tree.has-vote, .mood-happy, .mood-scared, .external-timer.has-internal-timer.is-expired, .result.tied::before,
  .impact-fill { transition: none; }
  .choice:active { transform: none; }
  .journey-connection { transition-duration: .12s; }
  .choices { transition-duration: .12s; }
  .journey-connection.is-expiring { transition-duration: .12s; }
  .journey-connection.is-complete .journey-connection-shimmer { animation: none; stroke-dashoffset: 0; opacity: .45; }
  .journey-tree.arrival-glow::before { animation-name: tree-arrival-radiation-reduced; animation-duration: .12s; }
  @keyframes tree-arrival-radiation-reduced {
    from { opacity: .45; }
    to { opacity: 0; }
  }
  @keyframes announcement-in-reduced { from { opacity: .7; } to { opacity: 1; } }
  @keyframes result-reveal-reduced { from { opacity: .7; } to { opacity: 1; } }
}
