
:root {
  --ink: #502B04;
  --cream: #FCF4D5;
  --paper: #fffaf0;
  --coral: #f2705f;
  --yellow: #f6c445;
  --teal: #5bc0d8;
  --pink: #f6b8c8;
  --olive: #5a6b3f;
  --muted: #4a463c;
  --b: 3px solid var(--ink);
  --s: 5px 5px 0 var(--ink);
  --s-sm: 3px 3px 0 var(--ink);
  --s-lg: 8px 8px 0 var(--ink);
  --r: 18px;

  --r-common: #c9ccd3;
  --r-uncommon: #b9cf8f;
  --r-rare: #5bc0d8;
  --r-epic: #b9a3ef;
  --r-legendary: #f6c445;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; font-family: "Baloo 2", system-ui, sans-serif; background: var(--cream); color: var(--ink); line-height: 1.45; -webkit-tap-highlight-color: transparent; }

::selection { background: var(--yellow); color: var(--ink); }
button, .btn, .nav, .chip, .eyebrow, .tab, .item, .dex-card, .stat, .panel-toggle, .locate, .leaflet-container { -webkit-user-select: none; user-select: none; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.bg-deco { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-deco::before {
  content: ""; position: absolute; inset: 0; opacity: 0.07;
  background-image: radial-gradient(var(--ink) 1.2px, transparent 1.2px); background-size: 22px 22px;
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; }
.blob.b1 { width: 460px; height: 460px; top: -140px; left: -160px; background: radial-gradient(circle, var(--coral), transparent 70%); }
.blob.b2 { width: 520px; height: 520px; top: 35%; right: -200px; background: radial-gradient(circle, var(--teal), transparent 70%); }
.blob.b3 { width: 420px; height: 420px; bottom: -160px; left: 25%; background: radial-gradient(circle, var(--yellow), transparent 70%); }

.nav { position: sticky; top: 0; z-index: 1100; padding: 12px 16px 0; }
.nav .bar {
  max-width: 1180px; margin: 0 auto; height: 62px; padding: 0 10px 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: rgba(255, 250, 240, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: var(--b); border-radius: 20px; box-shadow: var(--s);
}
.logo { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.logo img { width: 42px; height: 42px; border-radius: 12px; border: var(--b); box-shadow: var(--s-sm); object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 0.4rem; }
.nav-links .tab {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.8rem; border-radius: 12px;
  font-weight: 800; text-decoration: none; border: 2.5px solid transparent;
}
.nav-links .tab:hover { border-color: var(--ink); background: #fff; }
.nav-links .tab.on { background: var(--yellow); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }

.lang-switch { display: inline-flex; margin-left: 0.3rem; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); }
.lang-switch a { padding: 0.15rem 0.55rem; font-weight: 800; font-size: 0.82rem; text-decoration: none; background: var(--paper); }
.lang-switch a + a { border-left: 2.5px solid var(--ink); }
.lang-switch a.on { background: var(--yellow); }
.lang-switch a:not(.on):hover { background: #fff3cf; }

@media (max-width: 640px) {
  .logo span { display: none; }
  .nav-links { gap: 0.25rem; }
  .nav-links .tab { flex-direction: column; gap: 0; padding: 0.2rem 0.55rem; font-size: 0.68rem; line-height: 1.15; }
  .nav-links .tab .bi { font-size: 1.05rem; }
  .nav-links .tab .lbl { white-space: nowrap; }
}

@media (max-width: 420px) {
  .nav .logo { display: none; }
  .nav-links { flex: 1; justify-content: space-between; }
  .nav-links .tab { padding: 0.2rem 0.45rem; }
  .lang-switch { margin-left: 0; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.55rem 1.1rem; border: var(--b); border-radius: 14px; box-shadow: var(--s-sm);
  font-weight: 800; text-decoration: none; cursor: pointer; background: var(--paper);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-teal { background: var(--teal); }
.btn-yellow { background: var(--yellow); }
.btn-icon { width: 44px; height: 44px; padding: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem; background: var(--paper);
  border: var(--b); border-radius: 999px; box-shadow: var(--s-sm);
  padding: 0.2rem 0.85rem; font-weight: 800; font-size: 0.85rem; text-transform: lowercase; transform: rotate(-2deg);
}
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 0.1rem 0.65rem; font-weight: 800; font-size: 0.78rem; background: #fff; white-space: nowrap;
}
.rarity { background: var(--r-common); }
.rarity[data-r="Uncommon"] { background: var(--r-uncommon); }
.rarity[data-r="Rare"] { background: var(--r-rare); }
.rarity[data-r="Epic"] { background: var(--r-epic); }
.rarity[data-r="Legendary"] { background: var(--r-legendary); }

.search { position: relative; display: block; }
.search .bi { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); }
.search input {
  width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.3rem; border: var(--b); border-radius: 14px;
  font: 600 1rem "Baloo 2", sans-serif; background: #fff;
}
.search input:focus { outline: none; box-shadow: var(--s-sm); }

.toast {
  position: fixed; left: 50%; top: 92px; transform: translateX(-50%); z-index: 1300; max-width: min(460px, 92vw);
  background: var(--paper); border: var(--b); border-radius: 14px; box-shadow: var(--s);
  padding: 0.6rem 1rem; font-weight: 800; display: flex; gap: 0.6rem; align-items: center;
}
.toast.err { background: #ffe1db; }
.toast button { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 0; }

.paw-ic { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'%3E%3Cellipse cx='0' cy='5' rx='8' ry='6.5'/%3E%3Ccircle cx='-9' cy='-4' r='3.4'/%3E%3Ccircle cx='-3.4' cy='-9.5' r='3.4'/%3E%3Ccircle cx='3.4' cy='-9.5' r='3.4'/%3E%3Ccircle cx='9' cy='-4' r='3.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'%3E%3Cellipse cx='0' cy='5' rx='8' ry='6.5'/%3E%3Ccircle cx='-9' cy='-4' r='3.4'/%3E%3Ccircle cx='-3.4' cy='-9.5' r='3.4'/%3E%3Ccircle cx='3.4' cy='-9.5' r='3.4'/%3E%3Ccircle cx='9' cy='-4' r='3.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.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; }

/* Icon fonts: Bootstrap Icons nudges the glyph itself (::before, vertical-align -.125em). Move that nudge
   onto a 1em box instead: inline in text it still sits on the text like before, and inside flex
   controls (buttons, chips, pills) the box is centred exactly, so the icon is never off-centre. */
.bi { display: inline-block; line-height: 1; vertical-align: middle; }
.bi::before { vertical-align: top; }
/* thin outline icons look weak next to the bold Baloo 2 text: thicken them (em, so it scales with the icon) */
:is(.bi-search, .bi-x-lg, .bi-plus-lg, .bi-arrow-counterclockwise, .bi-chevron-right, .bi-chevron-down, .bi-list-ul, .bi-calendar3, .bi-calendar-check, .bi-clock, .bi-hourglass-split, .bi-emoji-surprise, .bi-emoji-frown, .bi-question-lg, .bi-question-circle, .bi-controller, .bi-book-half, .bi-crosshair, .bi-download, .bi-shield-check, .bi-gem, .bi-globe2, .bi-graph-up-arrow, .bi-star)::before { -webkit-text-stroke: 0.045em currentColor; }
