/* Raleway (licencia SIL OFL) incluida en la app para que funcione sin internet. */
@font-face { font-family: "Raleway"; src: url("../fonts/Raleway-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* Mascotia, el juego de Sakura — prototipo. Paleta de marca: turquesa #00acbb, Raleway. */
:root {
  --turquoise-500: #00acbb;
  --turquoise-600: #0098a5;
  --turquoise-700: #007a85;
  --turquoise-50: #ebf9fb;
  --turquoise-100: #d7f3fb;
  --gray-900: #3a4753;
  --gray-700: #5d6a78;
  --gray-200: #dbe3ea;
  --gray-100: #f4f5f6;
  --white: #fff;
  --danger: #e85d5d;
  --gold: #f2b84b;
  --shadow: 0 10px 30px rgba(0, 80, 90, 0.14);
  --radius: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Raleway", "Segoe UI", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: linear-gradient(180deg, #00acbb 0%, #5bb4c5 48%, #b9e4ee 100%);
  color: var(--gray-900);
  font-family: var(--font);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.22), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(255,255,255,0.16), transparent 24%),
    linear-gradient(180deg, #00acbb 0%, #4fb8c8 42%, #e8f7fa 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), var(--shadow);
}

/* patitas de fondo */
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><g fill='white'><ellipse cx='13.5' cy='24.5' rx='6.5' ry='8.2'/><ellipse cx='25.5' cy='14.5' rx='6.5' ry='8.2'/><ellipse cx='44.5' cy='16.5' rx='6.5' ry='8.2'/><ellipse cx='54' cy='28' rx='6.2' ry='8'/><path d='M32 29 C24 29,18 35,15 40 C12 45,9 48,9 52 C9 58,15 60,21 58 C26 56,30 55,32 55 C34 55,38 56,43 58 C49 60,55 58,55 52 C55 48,52 45,49 40 C46 35,40 29,32 29 Z'/></g></svg>");
  background-size: 72px 72px;
  background-repeat: repeat;
  z-index: 0;
}

.screen, .overlay { position: absolute; inset: 0; z-index: 1; }

.screen {
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-t)) 20px calc(16px + var(--safe-b));
}

.screen[hidden], .overlay[hidden], [hidden] { display: none !important; }
.screen.active { display: flex; }

/* ===== Inicio ===== */
.home-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  gap: 10px;
  z-index: 1;
}

.brand-mark {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: var(--white);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
}
.paw-logo { width: 58px; height: 58px; }

.eyebrow {
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.95;
}

.home-inner h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0,80,90,0.08);
}

.lead {
  max-width: 22em;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: #eefbfe;
  margin: 4px 0 8px;
}

.lives-panel {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 12px 18px;
  margin: 8px 0 14px;
  min-width: 240px;
}
.hearts, .hud-lives { display: flex; gap: 4px; justify-content: center; }
.heart {
  width: 22px; height: 22px;
  display: inline-block;
  transition: transform 0.2s;
}
.heart svg { width: 100%; height: 100%; display: block; }
.heart.off { opacity: 0.28; filter: grayscale(0.6); }
.lives-caption {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f4fdff;
}

.home-foot-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.home-foot {
  margin-top: 18px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
}

/* ===== Botones ===== */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 999px;
  padding: 14px 28px;
  min-height: 48px;
  min-width: 220px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary {
  background: var(--white);
  color: var(--turquoise-700);
  box-shadow: 0 8px 18px rgba(0, 70, 80, 0.16);
}
.btn-primary:hover { background: #f4fdff; }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
  min-width: 220px;
}
.screen-game .btn-ghost, .modal .btn-ghost {
  color: var(--turquoise-700);
  border-color: var(--turquoise-500);
}
.btn-ad {
  background: var(--turquoise-500);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(0, 120, 130, 0.28);
}
.btn-ad:hover { background: var(--turquoise-600); }

.icon-btn {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ===== Cómo se juega ===== */
#screen-howto { justify-content: center; }
.sheet {
  background: var(--white);
  border-radius: 28px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  color: var(--gray-900);
  z-index: 1;
}
.sheet h2, .modal h2 {
  font-weight: 800;
  font-size: 1.55rem;
  margin-bottom: 12px;
  color: var(--gray-900);
}
.howto-list {
  padding-left: 1.15em;
  display: grid;
  gap: 10px;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--gray-700);
  margin-bottom: 14px;
}
.note {
  font-size: 0.86rem;
  color: var(--gray-700);
  line-height: 1.4;
  background: var(--turquoise-50);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
#screen-howto .btn-primary { width: 100%; min-width: 0; color: var(--white); background: var(--turquoise-500); }

/* ===== HUD del juego ===== */
#screen-game {
  background: linear-gradient(180deg, #00acbb 0%, #2eb3c0 26%, #eef7f9 26%);
  padding-left: 14px;
  padding-right: 14px;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  margin-bottom: 10px;
  min-height: 40px;
}
.game-brand {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
#screen-game .hud-lives .heart { width: 18px; height: 18px; }
#screen-game .hud-lives .heart svg path,
#screen-game .hud-lives .heart svg { filter: none; }

.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
  z-index: 1;
}
.hud-card, .hud-moves {
  background: var(--white);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 6px 16px rgba(0,70,80,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 62px;
}
.hud-label { font-size: 0.68rem; font-weight: 700; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.06em; }
.hud-card strong { font-size: 1.25rem; font-weight: 800; color: var(--gray-900); }
.hud-moves {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  align-items: center;
  text-align: center;
  border: 4px solid var(--turquoise-500);
  padding: 0;
  margin-top: -8px;
}
.hud-moves strong { font-size: 1.7rem; font-weight: 800; color: var(--turquoise-700); line-height: 1; }
.hud-moves span { font-size: 0.6rem; font-weight: 700; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.03em; }
.hud-goal { gap: 2px; }
.goal-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}
.goal-row .mini-tile {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  flex: 0 0 22px;
}
.goal-row .mini-tile svg { width: 16px; height: 16px; }
.goal-row.done { color: var(--turquoise-700); }

/* ===== Tablero ===== */
.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  z-index: 1;
}
.board-wrap { touch-action: none; }
.board {
  position: relative;
  width: min(100%, calc(100dvh - 280px), 402px);
  aspect-ratio: 1;
  background: rgba(255,255,255,0.78);
  border-radius: 20px;
  box-shadow: var(--shadow);
  touch-action: none;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.tile {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  padding: 4px;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  transition: transform 0.2s ease;
  will-change: transform;
  z-index: 1;
}
.tile.dragging {
  cursor: grabbing;
  z-index: 6;
  transition: none;
}
.tile.dragging .face,
.tile.drag-partner .face { transform: scale(1.06); }
.tile.drag-partner { z-index: 5; transition: none; }
.tile .face {
  width: 100%;
  height: 100%;
  border-radius: 22%;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    0 3px 0 rgba(0,0,0,0.08);
  background: var(--tile);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(0,0,0,0.06));
}
.tile .face svg { width: 62%; height: 62%; pointer-events: none; }
.tile.selected { z-index: 3; }
.tile.selected .face {
  transform: scale(1.08);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.5),
    0 0 0 3px var(--white),
    0 0 0 6px var(--turquoise-500);
}
.tile.pop .face {
  animation: pop 0.28s ease forwards;
}
.tile.spawn .face { animation: spawn 0.28s ease; }
.tile.invalid .face { animation: shake 0.32s ease; }
.tile.hint .face { animation: pulse 0.8s ease infinite; }

@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes spawn {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(0,172,187,0.35); }
}

.hint-line {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  padding: 8px 8px 4px;
  min-height: 1.6em;
  z-index: 1;
}

/* ===== Overlays / modales ===== */
.overlay {
  z-index: 20;
  background: rgba(20, 50, 58, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: #ffffff;
  color: var(--gray-900);
  border-radius: 28px;
  padding: 28px 22px 22px;
  width: min(100%, 360px);
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: rise 0.25s ease;
}
@keyframes rise {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-kicker {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--turquoise-600);
}
.modal-detail { color: var(--gray-700); font-size: 0.98rem; line-height: 1.4; margin-bottom: 8px; }
.modal .btn { width: 100%; min-width: 0; }
.countdown { font-weight: 800; font-size: 1.15rem; color: var(--turquoise-700); }

/* ===== Video / espacio publicitario ===== */
.overlay-ad {
  background: linear-gradient(180deg, #007a85 0%, #00acbb 100%);
  padding: 12px 12px calc(12px + var(--safe-b));
  align-items: stretch;
}
.ad-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
  width: 100%;
  color: var(--white);
}
.ad-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 10px;
  font-weight: 700;
}
.ad-badge {
  background: var(--white);
  color: var(--turquoise-700);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
}
.ad-sponsor { font-size: 0.8rem; opacity: 0.92; }
.ad-frame {
  flex: 1;
  min-height: 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #082024;
}
.ad-progress {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  margin: 10px 0 8px;
  overflow: hidden;
}
.ad-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--turquoise-500);
}
.ad-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 150px; }
.ad-wait { font-size: 0.85rem; font-weight: 600; opacity: 0.9; }
.overlay-ad .btn-primary { min-width: 200px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: 999px;
  z-index: 40;
  box-shadow: var(--shadow);
  max-width: 90vw;
  text-align: center;
}
.toast[hidden] { display: none !important; }

@media (min-width: 800px) {
  body { padding: 16px; background: #d7eef2; }
  #app {
    height: min(900px, 100dvh - 32px);
    min-height: 0;
    border-radius: 28px;
  }
}

@media (max-height: 700px) {
  .home-inner h1 { font-size: 2.4rem; }
  .brand-mark { width: 72px; height: 72px; }
  .hud-moves { width: 72px; height: 72px; }
}

/* ===== Fichas ilustradas de Sakura ===== */
.tile .face img.tile-icon,
.mini-tile img.tile-icon,
.fichas-grid img.tile-icon {
  width: 84%;
  height: 84%;
  object-fit: contain;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 40, 50, 0.18));
}
.tile .face svg { width: 62%; height: 62%; pointer-events: none; } /* respaldo */
.goal-row .mini-tile {
  overflow: hidden;
}
.goal-row .mini-tile img.tile-icon { width: 20px; height: 20px; }

.credit { font-weight: 600; opacity: 0.85; font-size: 0.7rem; }
.credit-note { font-size: 0.78rem; color: var(--gray-700); line-height: 1.4; margin-top: 8px; }

/* ===== Relato de Sakura ===== */
.modal-story { padding-top: 20px; }
.story-photo-wrap {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  margin: 2px auto 8px;
  background: var(--turquoise-50);
  box-shadow: 0 0 0 6px #fff, 0 0 0 10px rgba(0, 172, 187, 0.35);
}
.story-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-goal {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--turquoise-700);
  margin-bottom: 6px;
}
#overlay-complete .story-photo-wrap { width: 180px; height: 220px; border-radius: 28px; }

/* ===== Trivia ===== */
.modal-trivia { text-align: center; }
.trivia-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 8px 0 4px;
}
.trivia-option {
  appearance: none;
  border: 2px solid var(--gray-200);
  background: #fff;
  color: var(--gray-900);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: left;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
}
.trivia-option:active { transform: scale(0.99); }
.trivia-option.correct { border-color: #2fa36a; background: #e7f8ef; }
.trivia-option.wrong { border-color: #e85d5d; background: #fdecec; }
.trivia-option[disabled] { cursor: default; }
.trivia-verdict { font-weight: 800; font-size: 1.05rem; margin: 8px 0 4px; }
.trivia-verdict.ok { color: #1f8a55; }
.trivia-verdict.bad { color: #c43c3c; }
.trivia-reward { font-weight: 700; color: var(--turquoise-700); }
.trivia-source { font-size: 0.75rem; color: var(--gray-700); margin-bottom: 8px; }
.trivia-result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* ===== Galería de fichas (captura / crédito) ===== */
.fichas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
  width: 100%;
  margin: 8px 0 12px;
}
.ficha-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ficha-card .face-demo {
  width: 86px;
  height: 86px;
  border-radius: 22%;
  display: grid;
  place-items: center;
  background: var(--tile, #fff);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 3px 0 rgba(0,0,0,0.08);
}
.ficha-card .face-demo img { width: 78%; height: 78%; }
.ficha-card span { font-weight: 700; font-size: 0.82rem; color: var(--gray-700); }

@media (max-height: 740px) {
  .story-photo-wrap { width: 128px; height: 128px; }
  #overlay-complete .story-photo-wrap { width: 132px; height: 160px; }
  .modal-story h2 { font-size: 1.25rem; }
}
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.modal-story, .modal-trivia { max-height: min(92dvh, 760px); overflow-y: auto; }

/* ===== Diálogos del relato ===== */
.modal-story .story-photo-wrap { width: 116px; height: 116px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px rgba(0, 172, 187, 0.35); }
.modal-story .modal-detail { font-size: 0.92rem; line-height: 1.4; }
.story-lines { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 12px; text-align: left; }
.bubble {
  display: flex; flex-direction: column; gap: 1px;
  max-width: 88%; padding: 7px 12px 8px; border-radius: 16px;
  font-size: 0.9rem; line-height: 1.32; color: var(--gray-900);
  animation: bubble-in 0.35s ease both;
}
.bubble-who { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
.bubble-text { font-weight: 600; }
.who-josefa { align-self: flex-start; background: #d7f3fb; border-bottom-left-radius: 5px; }
.who-nico { align-self: flex-start; background: #e6edf9; border-bottom-left-radius: 5px; }
.who-sakura { align-self: flex-end; background: #ffe0ee; border-bottom-right-radius: 5px; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ===== Mapa ilustrado de Santiago ===== */
#screen-map { padding-bottom: calc(10px + var(--safe-b)); }
#screen-map .hud-lives .heart { width: 18px; height: 18px; }
.map-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  color: #fff; margin-bottom: 10px;
}
.map-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.map-title { font-size: 1.7rem; font-weight: 800; line-height: 1.05; }
.map-prog { text-align: right; font-size: 0.76rem; font-weight: 700; min-width: 112px; }
.map-prog-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.35); margin-top: 5px; overflow: hidden; }
.map-prog-bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 6px; transition: width 0.6s ease; }
.map-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.map-canvas {
  position: relative; width: 100%; max-height: 100%; aspect-ratio: 360 / 600;
  border-radius: 26px; overflow: hidden; background: #cfeff3;
  box-shadow: 0 0 0 4px #fff, var(--shadow);
}
@supports not (aspect-ratio: 1) { .map-canvas { height: 0; padding-bottom: 166%; } }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-nodes { position: absolute; inset: 0; }
.map-node {
  position: absolute; transform: translate(-50%, -50%);
  background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.node-dot {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: #fff;
  background: var(--turquoise-500); box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(0,80,90,0.3);
}
.map-node.done .node-dot { background: #f2b84b; }
.map-node.locked .node-dot { background: #9aa8b4; }
.map-node.locked { cursor: not-allowed; }
.map-node.current .node-dot { animation: node-pulse 1.6s ease-in-out infinite; }
.map-node.just-unlocked .node-dot { animation: node-pop 0.8s ease both, node-pulse 1.6s 0.8s ease-in-out infinite; }
@keyframes node-pulse { 0%,100% { box-shadow: 0 0 0 4px #fff, 0 0 0 4px rgba(0,172,187,0.5), 0 6px 14px rgba(0,80,90,0.3); } 50% { box-shadow: 0 0 0 4px #fff, 0 0 0 13px rgba(0,172,187,0), 0 6px 14px rgba(0,80,90,0.3); } }
@keyframes node-pop { 0% { transform: scale(0.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.node-sakura {
  position: absolute; width: 44px; height: 44px; top: -34px; right: -26px;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25)); animation: sakura-hop 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sakura-hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.node-label {
  font-size: 0.7rem; font-weight: 800; line-height: 1.12; color: var(--gray-900);
  background: rgba(255,255,255,0.94); padding: 3px 8px; border-radius: 10px;
  max-width: 112px; text-align: center; box-shadow: 0 2px 6px rgba(0,80,90,0.18);
}
.map-node.locked .node-label { color: var(--gray-700); }
.map-next {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  background: rgba(58,71,83,0.88); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px;
}
@media (max-height: 740px) { .map-title { font-size: 1.4rem; } .node-dot { width: 40px; height: 40px; } }

/* ===== Anuncios propios (tarjeta) y botón a Instagram ===== */
.ad-card {
  width: 100%; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 22px 20px; text-align: center;
  background: var(--ad-bg, #fff7e6); color: var(--ad-ink, #2b2b2b);
}
.ad-card[hidden] { display: none !important; }
.ad-card-logo { width: min(78%, 280px); height: auto; }
.ad-card-icon {
  width: 84px; height: 84px; border-radius: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--ad-accent, #6a4cff); color: #fff; font-weight: 800; font-size: 2rem; letter-spacing: -0.04em;
}
.ad-card h2 { font-size: 1.45rem; line-height: 1.2; font-weight: 800; color: var(--ad-accent, #6a4cff); }
.ad-card p { font-size: 1rem; line-height: 1.4; font-weight: 600; }
.ad-card ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ad-card li {
  background: #fff; color: var(--ad-ink, #2b2b2b); border: 2px solid var(--ad-accent, #6a4cff);
  border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; font-weight: 700;
}
.btn-ig {
  min-width: 240px; padding: 14px 22px; border-radius: 999px; font-weight: 800; font-size: 1rem;
  color: #fff !important; background: linear-gradient(45deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
  box-shadow: 0 4px 0 rgba(80, 20, 90, 0.35);
}
.btn-ig[hidden] { display: none !important; }
.btn-web { background: linear-gradient(45deg, #007a85 0%, #00acbb 100%); box-shadow: 0 4px 0 rgba(0, 60, 70, 0.35); }
.btn-ig-2 { min-width: 200px; padding: 10px 18px; font-size: 0.92rem; }

.btn-wa {
  background: #25D366;
  color: #fff !important;
  box-shadow: 0 4px 0 #1aa34a;
}
.btn-wa:hover { background: #20bd5a; }
