:root {
  --bg: #fffaf0;
  --surface: #ffffff;
  --surface-muted: #f0ede2;
  --text: #1f2933;
  --text-muted: #5f6c72;
  --border: #e2dcc8;
  --primary: #2d6a4f;
  --primary-light: #d8f3dc;
  --primary-hover: #1b4332;
  --rare-common-bg: #eef2ef;
  --rare-common-fg: #4a5759;
  --rare-uncommon-bg: #e0f2fe;
  --rare-uncommon-fg: #0369a1;
  --rare-rare-bg: #fef3c7;
  --rare-rare-fg: #b45309;
  --shadow: 0 2px 8px rgba(31, 41, 51, 0.06);
  --radius: 16px;
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
  color: #ffffff;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.18);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  background: #faf4e4;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 6px 14px 6px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.brand-badge {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  line-height: 0;
}

.brand-title-img {
  height: 46px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.22);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.demo-link-btn:hover {
  background: rgba(255, 209, 102, 0.34);
}

.save-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.save-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.progress-card {
  flex: 1;
  min-width: 170px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #ffd166;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 14px 48px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-muted);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.filter-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.filter-trigger-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-trigger-btn.is-filtered {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-hover);
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 2px;
}

.meta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-link {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

.action-link:hover {
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  border: 1.5px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  border: none;
  background: var(--surface-muted);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.modal-btn:active {
  transform: scale(0.98);
}

.modal-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.modal-btn-primary:hover {
  background: var(--primary-hover);
}

.modal-btn-secondary {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

.modal-btn-secondary:hover {
  background: #e7e2d3;
}

.modal-btn-danger {
  background: #dc2626;
  color: #ffffff;
  margin-top: 4px;
}

.modal-btn-danger:hover {
  background: #b91c1c;
}

.modal-card-wide {
  max-width: 760px;
}

.interactive-map-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #e9d8b4;
}

.interactive-map-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.map-hotspot {
  position: absolute;
  border: 2.5px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  border-color: #ffd166;
  outline: none;
}

.map-hotspot.is-active {
  background: rgba(45, 106, 79, 0.24);
  border-color: #2d6a4f;
}

.hotspot-pill {
  background: rgba(31, 41, 51, 0.88);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.map-hotspot.is-active .hotspot-pill {
  background: var(--primary);
}

/* Posiciones exactas sobre ParqueCompleto.png */
.hotspot-calm-lake {
  left: 14%;
  top: 17%;
  width: 26%;
  height: 30%;
}

.hotspot-sunny-farm {
  left: 42%;
  top: 31%;
  width: 25%;
  height: 30%;
}

.hotspot-pine-forest {
  left: 69%;
  top: 8%;
  width: 26%;
  height: 29%;
}

.hotspot-crawler-swamp {
  left: 68%;
  top: 47%;
  width: 27%;
  height: 36%;
}

.map-modal-footer {
  margin-top: 14px;
}

.rarity-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rarity-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.rarity-option-btn:hover {
  background: var(--surface-muted);
}

.rarity-option-btn:active {
  transform: scale(0.98);
}

.rarity-option-btn.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.rarity-option-btn .rarity-badge {
  font-size: 0.85rem;
  padding: 5px 14px;
}

.rarity-all {
  background: var(--surface-muted);
  color: var(--text);
}

@media (max-width: 520px) {
  .hotspot-pill {
    font-size: 0.6rem;
    padding: 2px 5px;
  }
}

.feedback-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 60;
}

.feedback-card {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.feedback-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.feedback-icon.is-success {
  background: #dcfce7;
  color: #16a34a;
}

.feedback-icon.is-error {
  background: #fee2e2;
  color: #dc2626;
}

.feedback-icon svg {
  width: 32px;
  height: 32px;
}

.feedback-message {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.text-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.text-btn:hover {
  color: #b91c1c;
}

.bug-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bug-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.bug-card.is-caught {
  border-color: #74c69d;
  background: #f6fcf8;
}

.bug-thumb {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  background: #faf4e4;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.bug-sprite {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.bug-info {
  flex: 1;
  min-width: 0;
}

.bug-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bug-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.rarity-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rarity-common {
  background: var(--rare-common-bg);
  color: var(--rare-common-fg);
}

.rarity-uncommon {
  background: var(--rare-uncommon-bg);
  color: var(--rare-uncommon-fg);
}

.rarity-rare {
  background: var(--rare-rare-bg);
  color: var(--rare-rare-fg);
}

.rarity-legendary {
  background: #fee2e2;
  color: #b91c1c;
}

.zone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.zone-pill {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 500;
}

.catch-btn {
  flex-shrink: 0;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.catch-btn:active {
  transform: scale(0.96);
}

.catch-btn.caught {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

.hidden {
  display: none;
}

/* Tablet y escritorio */
@media (min-width: 680px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .progress-card {
    min-width: 240px;
  }

  .filter-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .status-tabs {
    min-width: 300px;
  }

  .filter-btn-group {
    min-width: 340px;
  }

  .bug-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1000px) {
  .bug-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
