:root {
  --ink: #1a2a24;
  --muted: #5c6a62;
  --paper: #f3ecdf;
  --paper-2: #fffaf3;
  --line: #e0d3bd;
  --river: #12857c;
  --river-deep: #0b4a45;
  --leaf: #35804a;
  --ochre: #a56b2f;
  --clay: #8d3d32;
  --gold: #d99a26;
  --sun: #f2b234;
  --shadow: 0 18px 50px rgba(20, 40, 32, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, #e7f0ea, transparent 40%),
    #c9d5cc;
  color: var(--ink);
  font-family: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
}

.phone {
  position: relative;
  width: min(100vw, 430px);
  height: min(100dvh, 880px);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .phone {
    border-radius: 28px;
    border: 1px solid rgba(26, 42, 36, 0.12);
  }
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 8px;
}

.me { width: 36px; flex: 0 0 36px; }
.me svg { width: 36px; height: 48px; display: block; }

.brand {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.where {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0 18px 8px;
  font-size: 0.68rem;
}

.steps li {
  flex: 1;
  text-align: center;
  padding: 4px 0;
  border-bottom: 3px solid var(--line);
  color: var(--muted);
}

.steps li.done { border-color: var(--river); color: var(--river-deep); }
.steps li.now { border-color: var(--gold); color: var(--ink); font-weight: 700; }

.content {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 8px;
  animation: arrive 0.35s ease;
}

.dock {
  display: grid;
  gap: 8px;
  padding: 12px 18px 18px;
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead, p { line-height: 1.45; }

.lead { margin-top: 0; }

.muted { color: var(--muted); }

.kicker {
  margin: 0 0 6px;
  color: var(--river-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--river-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

button, .hit {
  font: inherit;
  color: inherit;
}

.primary, .secondary, .equal, .choice, .trait, .avatar {
  border-radius: 14px;
  cursor: pointer;
}

.primary {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#17968c, var(--river));
  color: white;
  font-weight: 800;
  box-shadow: 0 5px 0 var(--river-deep);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--river-deep);
}

.primary:disabled {
  background: #b7c4be;
  box-shadow: 0 5px 0 #93a29b;
  cursor: not-allowed;
}

.secondary, .equal {
  min-height: 50px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper-2);
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(26, 42, 36, 0.55);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.secondary:active, .equal:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(26, 42, 36, 0.55);
}

.equal { width: 100%; }

.choice-pair, .stack, .specimens, .cards, .avatars, .maps {
  display: grid;
  gap: 10px;
}

.avatars { grid-template-columns: repeat(3, 1fr); }

.avatar {
  min-height: 92px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  padding: 8px;
}

.avatar[aria-pressed="true"] {
  border-color: var(--river);
  background: #e7f3f1;
}

.avatar svg { width: 100%; height: 92px; }

.avatar span { display: block; margin-top: 4px; font-size: 0.82rem; }

.world {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #d7e6c6;
  animation: arrive 0.45s ease;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.terrain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.place {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  z-index: 2;
}

.pname {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(246, 240, 228, 0.94);
  font-size: 0.75rem;
  font-weight: 700;
}

.place.wait .pname { opacity: 0.55; }

.place.here .pin { position: relative; left: auto; top: auto; }

.done-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--river);
  box-shadow: 0 0 0 4px rgba(27, 107, 102, 0.25);
}

.walker {
  position: absolute;
  z-index: 3;
  width: 58px;
  margin-left: -29px;
  margin-top: -78px;
  pointer-events: none;
  filter: drop-shadow(0 6px 3px rgba(26, 42, 36, 0.2));
}

.walker.walking {
  transition: left 1.6s ease-in-out, top 1.6s ease-in-out;
}

.walker.walking svg { animation: bob 0.32s ease-in-out infinite; transform-origin: 50% 100%; }
.walker.walking.face-left svg { animation-name: bob-left; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-7deg); }
  50% { transform: translateY(-5px) rotate(7deg); }
}

@keyframes bob-left {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(-7deg); }
  50% { transform: scaleX(-1) translateY(-5px) rotate(7deg); }
}

.preview {
  display: grid;
  place-items: center;
  height: 150px;
  margin: 4px 0 8px;
}

.preview svg { width: 92px; height: 124px; }

.swatches, .choices { display: flex; gap: 8px; margin-bottom: 10px; }

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
}

.swatch[aria-pressed="true"], .choice[aria-pressed="true"] {
  border-color: var(--ink);
}

.choice {
  flex: 1;
  min-height: 40px;
  border: 2px solid var(--line);
  background: var(--paper-2);
}

.map-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(243, 236, 223, 0.95);
}

.map-card .secondary { width: 100%; margin-top: 8px; }

.route-list {
  position: absolute;
  inset: 12px 12px 148px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.list-item.quiet {
  cursor: default;
  opacity: 0.72;
}

.map-scene {
  display: grid;
  grid-template-rows: 1.1fr 0.9fr;
  gap: 10px;
  min-height: 360px;
}

.zone {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 150px;
}

.zone.river {
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.25), transparent 30%),
    linear-gradient(160deg, #2a8f88, #0e3c39);
  color: white;
}

.zone.bank {
  background:
    radial-gradient(circle at 70% 30%, #d7ecc8, transparent 35%),
    linear-gradient(160deg, #6ea35a, #245433);
  color: white;
}

.zone p {
  position: absolute;
  left: 14px;
  bottom: 10px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.pin {
  position: absolute;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 220, 120, 0.95) 19% 38%, transparent 39%);
  box-shadow: 0 0 0 0 rgba(255, 220, 120, 0.7);
  animation: pulse 1.8s ease-out infinite;
  cursor: pointer;
}

.pin.river-pin { left: 28%; top: 28%; }
.pin.bank-pin { right: 18%; top: 22%; }

.pin span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 16px rgba(255, 220, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 220, 120, 0); }
}

.demo-note, .source, .game-note, .clarify {
  color: var(--muted);
  font-size: 0.82rem;
}

.list-item {
  width: 100%;
  text-align: left;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  cursor: pointer;
}

.stage {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(#e7f4f2, #f7f1e6);
  min-height: 210px;
  overflow: hidden;
}

.stage svg { width: 100%; height: auto; display: block; }

.swim { animation: swim 2.4s ease-in-out infinite; }

@keyframes swim {
  50% { transform: translateX(10px); }
}

.hit {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 2px rgba(26, 42, 36, 0.28);
  cursor: pointer;
}

.hit.reveal {
  background: rgba(182, 124, 42, 0.28);
  box-shadow: inset 0 0 0 3px var(--gold);
}

.hint {
  min-height: 1.4em;
  color: var(--ochre);
  font-weight: 650;
}

.card, .specimen, .community, .sheet, .map-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

.card h2, .specimen h2, .sheet h2, .map-card h2 {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.latin { font-style: italic; color: var(--muted); }

.hitos { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

.hito {
  padding: 4px 8px;
  border-radius: 999px;
  background: #efe6d6;
  font-size: 0.78rem;
}

.hito.open { background: #d9efe4; color: var(--river-deep); font-weight: 700; }

.stamp {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  border: 3px solid var(--gold);
  color: #7a5210;
  background: #fff6df;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  animation: slam 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes slam {
  from { opacity: 0; transform: scale(2.3) rotate(-16deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(-1deg); }
  to { transform: scale(1) rotate(-3deg); }
}

.creek {
  position: relative;
  height: 78px;
  margin: 0 0 12px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(#b7e0dc, #176862);
}

.bloom {
  position: absolute;
  left: 8%;
  right: 18%;
  bottom: 0;
  height: 0;
  border-radius: 46% 54% 0 0;
  background: #c4a15a;
  animation: cover 1.5s ease forwards;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: none; }
}

@keyframes cover {
  to { height: 72%; }
}

@media (prefers-reduced-motion: reduce) {
  .content, .world, .walker, .stamp, .bloom, .swim, .pin { animation: none; }
  .walker.walking { transition: none; }
  .bloom { height: 72%; }
}

.sheet { margin-top: 10px; }

.pending {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8e7c8;
  color: #6a4a12;
  font-size: 0.82rem;
}

.maps { grid-template-columns: 1fr 1fr; }

.maplet {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-align: center;
}

.blob {
  height: 72px;
  border-radius: 40% 60% 55% 45%;
  margin-bottom: 6px;
}

.blob.chile { background: #2f6a3c; }
.blob.lejos { background: #8d3d32; }

.maplet figcaption { font-size: 0.82rem; }

.specimen { text-align: left; cursor: pointer; width: 100%; }
.pick { padding: 8px 12px; }
.pick h2 { font-size: 1.05rem; }
.pick p { margin: 4px 0; }
.community { min-height: 0; padding: 10px 12px; }
.specimen[aria-pressed="true"], .community[aria-pressed="true"] {
  border-color: var(--river);
  box-shadow: inset 0 0 0 1px var(--river);
}

.stars { color: var(--gold); letter-spacing: 0.08em; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }

.chips li, .contrib {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f3f1;
  font-size: 0.78rem;
  font-weight: 700;
}

.trait {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  background: white;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--river-deep);
}

.trait svg { width: 16px; height: 16px; flex: 0 0 16px; }

.trait-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.trait[aria-pressed="true"] {
  border-color: var(--river);
  background: #e7f3f1;
}

.trait-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff;
  border-radius: 10px;
}

.stones {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.stones strong { color: var(--river-deep); }

.stones-row {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.stones-row .stone {
  flex: 1;
  max-width: 46px;
  height: auto;
  transition: transform 0.2s ease;
}

.stones-row .stone.covered { transform: translateY(2px); }

.medal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: linear-gradient(#fff4d8, #fbe3ad);
  font-weight: 900;
  font-size: 0.95rem;
}

.medal svg { width: 15px; height: 15px; }

.fab {
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  background: #e7f3f1;
  color: var(--river-deep);
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(11, 74, 69, 0.3);
}

.fab:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(11, 74, 69, 0.3); }

.album-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.species-tile {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}

.species-tile svg { width: 100%; height: 60px; }

.species-tile h2 {
  margin: 4px 0 2px;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.species-tile p { margin: 0; font-size: 0.75rem; }

.pips {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 7px;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.pip.on { background: var(--river); box-shadow: 0 0 0 2px rgba(18, 133, 124, 0.25); }

.album-h {
  margin: 14px 0 8px;
  font-family: Georgia, serif;
  font-size: 1.15rem;
}

.board {
  border-radius: 18px;
  background: linear-gradient(#eaf4e2, #d7e6c6);
  padding: 6px;
  margin-bottom: 10px;
}

.board svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Arena de contención */
.arena {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 10px;
  background: linear-gradient(#bfe6df 0 44%, #2f8d84 44% 100%);
  box-shadow: inset 0 0 0 3px rgba(11, 74, 69, 0.15);
}

.arena svg { width: 100%; height: auto; display: block; }

.arena .didymo-mass {
  transform-origin: 50% 0;
  animation: didymo-lunge 1.2s ease both;
}

.arena .puye-guard {
  transform-origin: 100% 50%;
  animation: puye-dart 1.2s ease 0.3s both;
}

@keyframes didymo-lunge {
  0% { transform: translateY(-6px) scale(0.96); }
  45% { transform: translateY(10px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes puye-dart {
  0% { transform: translateX(0); }
  40% { transform: translateX(-70px) rotate(-4deg); }
  100% { transform: translateX(0); }
}

.floater {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.pop {
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.05rem;
  color: #fff;
  opacity: 0;
  animation: pop-up 1.4s ease both;
}

.pop.harm { background: #b8472e; }
.pop.help { background: #12857c; animation-delay: 0.5s; }

@keyframes pop-up {
  0% { opacity: 0; transform: translateY(14px) scale(0.7); }
  25% { opacity: 1; transform: translateY(-4px) scale(1.1); }
  70% { opacity: 1; transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-26px) scale(1); }
}

.say {
  margin: 0 0 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-left: 5px solid var(--river);
  font-weight: 700;
  min-height: 1.4em;
  animation: arrive 0.35s ease;
}

.turn-dots { display: flex; gap: 7px; justify-content: center; margin: 6px 0 2px; }

.turn-dots .d {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--line);
}
.turn-dots .d.on { background: var(--sun); }
.turn-dots .d.past { background: var(--river); }

.attr-chips { display: grid; gap: 8px; margin: 4px 0 10px; }

.attr-chips li {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.attr-chips .ic {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #e7f3f1;
  color: var(--river-deep);
}

.attr-chips .ic svg { width: 20px; height: 20px; }
.attr-chips.attr-danger .ic { background: #f6ded6; color: var(--clay); }

.portrait {
  border-radius: 12px;
  background: linear-gradient(#d9f3ec, #a9d9cd);
  margin-bottom: 6px;
  padding: 2px;
}

.portrait svg { width: 100%; height: 56px; display: block; }

.arena-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 18px;
}

.arena-btn .arena { margin-bottom: 0; }

.arena-btn:active .arena { transform: scale(0.99); }

.tap-hint {
  margin: 8px 0 2px;
  text-align: center;
  font-weight: 800;
  color: var(--river-deep);
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  50% { transform: translateY(3px); }
}

button.stage.tappable {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.stage.tappable::after {
  content: "Toca el pez para observarlo";
  position: absolute;
  left: 50%; bottom: 8px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(246, 240, 228, 0.95);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--river-deep);
}

@media (prefers-reduced-motion: reduce) {
  .tap-hint { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .arena .didymo-mass, .arena .puye-guard, .pop { animation: none; }
  .pop { opacity: 1; }
}

.attrs { padding-left: 18px; }

.attrs li { margin: 4px 0; }

.clarify {
  margin-top: 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--ochre);
}

.locked {
  opacity: 0.72;
  padding: 12px;
  border-radius: 14px;
  background: #efe6d6;
}

.facilitador {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.river-hero, .plant-hero {
  height: 140px;
  border-radius: 18px;
  margin-bottom: 12px;
}

.river-hero {
  background:
    linear-gradient(to top, #0e3c39 0 38%, transparent 38%),
    linear-gradient(#d7ecf5, #8fb9a4);
}

.plant-hero {
  background:
    radial-gradient(circle at 30% 40%, #1f6b34 0 28px, transparent 29px),
    radial-gradient(circle at 58% 34%, #2e8a45 0 36px, transparent 37px),
    radial-gradient(circle at 74% 48%, #176b38 0 22px, transparent 23px),
    linear-gradient(#e7f6d8, #c4d7a4);
}

/* Navegación y resultados de la demostración abierta. */
.demo-nav { display: flex; gap: 8px; padding: 0 18px 8px; }
.demo-nav .secondary { flex: 1; padding: 8px; min-height: 40px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0; }
.summary-grid article { background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 8px; text-align: center; }
.summary-grid strong { display: block; font-size: 2rem; color: var(--river-deep); }
.summary-grid span { display: block; font-size: .8rem; }
.card .primary { width: 100%; }
button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
