/**
 * Mapa compacto + juego cofre del tesoro
 */

.ft-mapa {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232, 184, 74, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #eef5f8 0%, #f8f2ea 100%);
  position: relative;
  overflow: hidden;
}

.ft-mapa__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ft-mapa__header h2 {
  color: #1e4556;
  margin-bottom: 0.5rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
}

.ft-mapa__header > p.ft-mapa__intro {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  color: #4a5d68;
  font-size: 1rem;
  line-height: 1.55;
}

/* Tarjetas de regalos por fases */
.ft-mapa__prizes {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  max-width: 820px;
  margin: 0 auto 1.35rem;
  flex-wrap: wrap;
}

.ft-mapa__prize {
  flex: 1 1 200px;
  max-width: 240px;
  padding: 1rem 0.85rem 0.9rem;
  background: #fff;
  border-radius: 16px;
  border: 2px solid rgba(30, 69, 86, 0.12);
  box-shadow: 0 8px 28px rgba(30, 69, 86, 0.08);
  text-align: center;
  position: relative;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.ft-mapa__prize--gold {
  border-color: rgba(232, 184, 74, 0.45);
  background: linear-gradient(160deg, #fffdf6 0%, #fff8e8 100%);
}

.ft-mapa__prize.is-unlocked {
  border-color: #e8b84a;
  box-shadow: 0 12px 36px rgba(232, 184, 74, 0.28);
  transform: translateY(-4px);
}

.ft-mapa__prize.is-unlocked .ft-mapa__prize-lock {
  color: #2d7a4a;
  background: rgba(45, 122, 74, 0.12);
}

.ft-mapa__prize.is-current {
  animation: ft-mapa-prize-pulse 2s ease-in-out infinite;
}

@keyframes ft-mapa-prize-pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(196, 97, 58, 0.15); }
  50% { box-shadow: 0 12px 40px rgba(196, 97, 58, 0.35); }
}

.ft-mapa__prize-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4613a;
  margin-bottom: 0.35rem;
}

.ft-mapa__prize--gold .ft-mapa__prize-badge {
  color: #9e7420;
}

.ft-mapa__prize-emoji {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  filter: grayscale(0.3);
  transition: filter 0.3s, transform 0.3s;
}

.ft-mapa__prize.is-unlocked .ft-mapa__prize-emoji {
  filter: none;
  transform: scale(1.1);
}

.ft-mapa__prize h3 {
  margin: 0 0 0.25rem;
  font-family: var(--fg-font-display);
  font-size: 1.05rem;
  color: #1e4556;
}

.ft-mapa__prize > p {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #5a6b75;
}

.ft-mapa__prize-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #8a9aa3;
  padding: 0.25rem 0.55rem;
  background: rgba(30, 69, 86, 0.06);
  border-radius: 999px;
}

.ft-mapa__prize-arrow {
  display: flex;
  align-items: center;
  color: #e8b84a;
  font-size: 1rem;
  opacity: 0.7;
  padding-top: 2rem;
}

/* HUD del juego */
.ft-mapa__hud {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, #fff 0%, #f8f4ec 100%);
  border-radius: var(--fg-radius-lg);
  border: 2px solid rgba(232, 184, 74, 0.5);
  box-shadow: 0 12px 40px rgba(30, 69, 86, 0.1);
}

.ft-mapa__hud-main {
  min-width: 0;
}

.ft-mapa__hud-score {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e4556;
  margin-bottom: 0.5rem;
}

.ft-mapa__hud-score i {
  color: #c4613a;
  margin-right: 0.35rem;
}

.ft-mapa__hud-score strong {
  color: #c4613a;
  font-size: 1.1rem;
}

.ft-mapa__progress {
  position: relative;
  height: 10px;
  background: rgba(30, 69, 86, 0.1);
  border-radius: 999px;
  overflow: visible;
}

.ft-mapa__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c4613a, #e8b84a);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(232, 184, 74, 0.5);
}

.ft-mapa__progress-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(30, 69, 86, 0.2);
  font-size: 0.55rem;
  font-weight: 800;
  color: #1e4556;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ft-mapa__progress-mark.is-done {
  background: #e8b84a;
  border-color: #c99a2e;
  color: #1a2f38;
}

.ft-mapa__loot-teaser {
  text-align: center;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(145deg, #1e4556, #2a5f73);
  border-radius: 14px;
  min-width: 120px;
  border: 2px solid rgba(232, 184, 74, 0.35);
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  transition: transform 0.25s, box-shadow 0.25s;
}

.ft-mapa__loot-teaser:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 69, 86, 0.25);
}

.ft-mapa__loot-icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.15rem;
  transition: transform 0.4s;
}

.ft-mapa__loot-teaser.is-ready .ft-mapa__loot-icon {
  animation: ft-mapa-shake 0.6s ease-in-out infinite;
}

.ft-mapa__loot-teaser span[data-mapa-loot-label] {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.ft-mapa__loot-teaser small[data-mapa-loot-sub] {
  display: block;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.2rem;
  font-weight: 500;
}

.ft-mapa__loot-teaser.is-ready small[data-mapa-loot-sub] {
  color: #f5d78a;
}

@keyframes ft-mapa-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.ft-mapa__hint {
  font-size: 0.78rem;
  color: #5a6b75;
  margin: 0.75rem 0 0;
  text-align: center;
}

.ft-mapa__hint i { color: #e8b84a; margin-right: 0.25rem; }

/* Layout */
.ft-mapa__layout {
  display: grid;
  grid-template-columns: minmax(0, 300px) 1fr;
  gap: 1.25rem;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.ft-mapa__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ft-mapa__svg-wrap {
  width: 100%;
  max-width: 260px;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(30, 69, 86, 0.15);
  overflow: hidden;
  background: #d4e8d0;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.ft-mapa__svg {
  display: block;
  width: 100%;
  height: auto;
}

.ft-mapa__land { fill: #ebe3d4; }
.ft-mapa__hills { fill: none; stroke: #c4b498; stroke-width: 0.4; opacity: 0.5; }
.ft-mapa__sea { fill: url(#ft-mapa-sea-gradient); }

.ft-mapa__coast-label {
  font-size: 7px;
  font-weight: 700;
  fill: rgba(30, 69, 86, 0.35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Pines mini */
.ft-mapa__pin {
  cursor: pointer;
  outline: none;
  transition: transform 0.25s ease;
}

.ft-mapa__pin:hover,
.ft-mapa__pin:focus-visible,
.ft-mapa__pin.is-active {
  transform: scale(1.35);
}

.ft-mapa__pin-ring {
  fill: none;
  stroke: #e8b84a;
  stroke-width: 1;
  opacity: 0;
}

.ft-mapa__pin.is-active .ft-mapa__pin-ring {
  opacity: 0.8;
  animation: ft-mapa-pulse 1.8s ease-out infinite;
}

.ft-mapa__pin.is-discovered .ft-mapa__pin-ring {
  opacity: 0.35;
}

@keyframes ft-mapa-pulse {
  0% { r: 3; opacity: 0.7; }
  100% { r: 10; opacity: 0; }
}

.ft-mapa__pin-dot {
  fill: #c4613a;
  stroke: #fff;
  stroke-width: 0.8;
  transition: fill 0.25s;
}

.ft-mapa__pin.is-discovered .ft-mapa__pin-dot,
.ft-mapa__pin.is-active .ft-mapa__pin-dot {
  fill: #e8b84a;
}

.ft-mapa__pin-label { display: none; }

/* Chips compactos */
.ft-mapa__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.75rem;
  justify-content: center;
  max-width: 280px;
}

.ft-mapa__chip {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(30, 69, 86, 0.14);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  color: #1e4556;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.ft-mapa__chip:hover,
.ft-mapa__chip.is-active {
  background: #1e4556;
  color: #fff;
}

.ft-mapa__chip.is-discovered:not(.is-active) {
  border-color: rgba(232, 184, 74, 0.6);
  background: rgba(232, 184, 74, 0.15);
}

/* Panel */
.ft-mapa__panel {
  background: #fff;
  border-radius: var(--fg-radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(30, 69, 86, 0.12);
  border: 1px solid rgba(30, 69, 86, 0.08);
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.ft-mapa__panel-welcome {
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.75rem;
}

.ft-mapa__chest {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2a3f48, #1e4556);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #5a6b75;
  border: 2px dashed rgba(232, 184, 74, 0.35);
  position: relative;
}

.ft-mapa__chest.is-locked::after {
  content: '🔒';
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 1rem;
}

.ft-mapa__panel-welcome h3 {
  margin: 0;
  font-family: var(--fg-font-display);
  font-size: 1.2rem;
  color: #1e4556;
}

.ft-mapa__panel-welcome > p {
  margin: 0;
  font-size: 0.88rem;
  color: #5a6b75;
  line-height: 1.5;
  max-width: 280px;
}

.ft-mapa__panel-prize {
  padding: 0.55rem 0.9rem;
  background: linear-gradient(135deg, rgba(196, 97, 58, 0.1), rgba(232, 184, 74, 0.15));
  border-radius: var(--fg-radius);
  font-size: 0.8rem;
  font-weight: 700;
  color: #9e4a28;
  border: 1px dashed rgba(196, 97, 58, 0.35);
}

.ft-mapa__panel-next {
  font-size: 0.82rem;
  color: #c4613a;
  font-weight: 600;
  margin: 0;
}

/* Escalera de regalos (panel lateral) */
.ft-mapa__ladder {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ft-mapa__ladder-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #f4f8f9;
  border-radius: 12px;
  border: 2px solid rgba(30, 69, 86, 0.1);
  opacity: 0.55;
  transition: opacity 0.3s, border-color 0.3s, transform 0.3s;
}

.ft-mapa__ladder-step.is-done {
  opacity: 1;
  border-color: rgba(232, 184, 74, 0.55);
  background: linear-gradient(135deg, rgba(232, 184, 74, 0.15), rgba(255, 255, 255, 0.9));
}

.ft-mapa__ladder-step.is-current:not(.is-done) {
  opacity: 0.9;
  border-color: rgba(196, 97, 58, 0.4);
  border-style: dashed;
}

.ft-mapa__ladder-emoji {
  font-size: 1.75rem;
  line-height: 1;
  width: 44px;
  text-align: center;
}

.ft-mapa__ladder-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e4556;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-mapa__ladder-step.is-done .ft-mapa__ladder-num {
  background: linear-gradient(145deg, #e8b84a, #c99a2e);
  color: #1a2f38;
}

.ft-mapa__ladder-body strong {
  display: block;
  font-size: 0.85rem;
  color: #1e4556;
  margin-bottom: 0.15rem;
}

.ft-mapa__ladder-body p {
  margin: 0;
  font-size: 0.78rem;
  color: #5a6b75;
  line-height: 1.4;
}

.ft-mapa__ladder-body ul {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ft-mapa__ladder-body li {
  font-size: 0.75rem;
  color: #5a6b75;
  padding: 0.1rem 0;
}

.ft-mapa__panel-welcome .ft-mapa__play-cta {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c4613a;
  padding: 0.5rem 1rem;
  background: rgba(196, 97, 58, 0.1);
  border-radius: 999px;
  border: 1px dashed rgba(196, 97, 58, 0.35);
}

.ft-mapa__panel-reward-banner {
  padding: 0.55rem 0.85rem;
  background: linear-gradient(90deg, rgba(232, 184, 74, 0.2), rgba(196, 97, 58, 0.12));
  font-size: 0.78rem;
  color: #1e4556;
  border-bottom: 1px solid rgba(232, 184, 74, 0.35);
}

.ft-mapa__panel-reward-banner i {
  color: #c4613a;
  margin-right: 0.35rem;
}

.ft-mapa__panel-img {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.ft-mapa__panel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ft-mapa__panel-badge {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  padding: 0.25rem 0.6rem;
  background: rgba(15, 31, 38, 0.85);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8b84a;
}

.ft-mapa__panel-body {
  padding: 1.1rem 1.2rem 1.25rem;
}

.ft-mapa__panel-body h3 {
  margin: 0 0 0.5rem;
  font-family: var(--fg-font-display);
  font-size: 1.25rem;
  color: #1e4556;
}

.ft-mapa__panel-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.ft-mapa__service {
  padding: 0.22rem 0.5rem;
  background: rgba(30, 69, 86, 0.07);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #1e4556;
}

.ft-mapa__panel-body > p {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #5a6b75;
}

.ft-mapa__panel-tip {
  font-size: 0.78rem;
  padding: 0.55rem 0.7rem;
  background: #f8f4ec;
  border-radius: 8px;
  margin-bottom: 0.85rem;
  border-left: 3px solid #e8b84a;
  color: #1e4556;
}

.ft-mapa__panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ft-mapa__panel-actions .fg-btn {
  font-size: 0.78rem;
  padding: 0.5rem 0.85rem;
}

/* Oferta desbloqueada */
.ft-mapa__offer {
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(160deg, #1e4556 0%, #2a5f73 100%);
  color: #fff;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.ft-mapa__offer-chest {
  font-size: 3rem;
  animation: ft-mapa-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ft-mapa-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.ft-mapa__offer h3 {
  margin: 0;
  font-family: var(--fg-font-display);
  font-size: 1.35rem;
  color: #fff;
}

.ft-mapa__offer-level {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8b84a;
}

.ft-mapa__offer-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  width: 100%;
  max-width: 280px;
}

.ft-mapa__offer-perks li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ft-mapa__offer-perks li i {
  color: #e8b84a;
  margin-right: 0.4rem;
}

.ft-mapa__offer-note {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.ft-mapa__offer-next {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-style: italic;
}

.ft-mapa__offer-next i {
  color: #e8b84a;
  margin-right: 0.3rem;
}

.ft-mapa__offer-badge {
  font-size: 2rem;
  font-weight: 800;
  color: #e8b84a;
  line-height: 1;
}

.ft-mapa__offer p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 280px;
  line-height: 1.45;
}

.ft-mapa__code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--fg-radius);
  border: 1px dashed rgba(232, 184, 74, 0.5);
}

.ft-mapa__code strong {
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #e8b84a;
}

.ft-mapa__code button {
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: #e8b84a;
  color: #1a2f38;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.ft-mapa__code button:hover {
  background: #f5d078;
}

/* Toast nivel */
.ft-mapa__toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: #1e4556;
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  border: 2px solid #e8b84a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}

.ft-mapa__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ft-mapa__toast i {
  color: #e8b84a;
  margin-right: 0.4rem;
}

/* Partículas */
.ft-mapa__burst {
  position: absolute;
  pointer-events: none;
  z-index: 10;
}

.ft-mapa__particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: ft-mapa-burst 0.75s ease-out forwards;
}

@keyframes ft-mapa-burst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.ft-mapa__confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

@media (max-width: 768px) {
  .ft-mapa__layout {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .ft-mapa__prizes {
    flex-direction: column;
    align-items: center;
  }

  .ft-mapa__prize-arrow {
    transform: rotate(90deg);
    padding: 0;
  }

  .ft-mapa__prize {
    max-width: 100%;
    width: 100%;
  }

  .ft-mapa__hud {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ft-mapa__loot-teaser {
    min-width: auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ft-mapa__loot-teaser.is-ready .ft-mapa__loot-icon,
  .ft-mapa__pin-ring,
  .ft-mapa__prize.is-current { animation: none; }
}
