/* Crystal Bond — site styles. Palette from the game's ui/common/ui_theme.gd */
@font-face {
  font-family: "CritterPixel";
  src: url("/fonts/CritterPixel.ttf") format("truetype");
  font-display: swap;
}
:root {
  --bg: #221913;
  --bg-deep: #17110d;
  --panel: #3a2b20;
  --panel-2: #2d2119;
  --line: #5e4630;
  --line-dark: #120c08;
  --accent: #f2c14e;
  --gold: #d9a74a;
  --text: #f6ecd2;
  --muted: #b9a789;
  --danger: #e05a47;
  --ok: #6cc551;
  --hover: #fff4d6;
  --radius: 4px;
  --font: "CritterPixel", "Trebuchet MS", system-ui, sans-serif;
  --shadow: 0 4px 0 var(--line-dark);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -20%, #3a2a1c 0, transparent 60%);
  color: var(--text);
  font: 20px/1.35 var(--font);
  letter-spacing: .02em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
.px, img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--hover); }
h1, h2, h3, h4 { font-weight: normal; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .03em; }
h1 { font-size: clamp(36px, 6vw, 56px); color: var(--accent); text-shadow: 0 3px 0 var(--line-dark); }
h2 { font-size: clamp(28px, 4vw, 38px); color: var(--accent); text-shadow: 0 3px 0 var(--line-dark); }
h3 { font-size: 26px; color: var(--text); }
p { margin: 0 0 1em; }
small { font-size: .8em; }
code { background: var(--bg-deep); padding: 0 .3em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* language switching: <span data-l="es">…</span><span data-l="en">…</span> */
html[lang="es"] [data-l="en"], html[lang="en"] [data-l="es"] { display: none !important; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(23, 17, 13, .94);
  border-bottom: 3px solid var(--line);
  box-shadow: 0 3px 0 var(--line-dark);
  backdrop-filter: blur(4px);
}
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-txt { display: flex; flex-direction: column; line-height: .95; }
.brand-txt b { font-weight: normal; font-size: 24px; color: var(--accent); }
.brand-txt small { font-size: 15px; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--text); text-decoration: none; padding: 6px 12px; font-size: 21px;
  border: 2px solid transparent; border-radius: var(--radius);
}
.nav a:hover { border-color: var(--line); color: var(--hover); }
.nav a[aria-current="page"] { color: var(--accent); border-color: var(--gold); background: var(--panel); }
.lang-toggle { display: flex; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang-toggle button {
  font: inherit; font-size: 18px; background: var(--bg-deep); color: var(--muted); border: 0; padding: 4px 9px; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--bg-deep); }
.nav-toggle { display: none; margin-left: auto; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); width: 44px; height: 40px; cursor: pointer; padding: 0; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 22px; height: 3px; background: var(--accent); margin: 0 auto; position: relative; content: ""; }
.nav-toggle .bars::before { position: absolute; top: -7px; }
.nav-toggle .bars::after { position: absolute; top: 7px; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; background: var(--bg-deep); border-bottom: 3px solid var(--line); padding: 8px 16px 14px;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 24px; padding: 10px 12px; }
  .lang-toggle { order: 3; }
  .brand-txt small { display: none; }
}

/* ------------------------------------------------------------------ buttons / cards */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font: inherit; font-size: 22px; line-height: 1; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--panel);
  border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 -3px 0 rgba(0,0,0,.25);
  padding: 12px 20px; margin: 4px;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { color: var(--hover); border-color: var(--gold); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-dark); }
.btn-gold { background: linear-gradient(#f6cf63, #d9a74a); color: #2a1a0c; border-color: #8a5f22; }
.btn-gold:hover { color: #1b1007; background: linear-gradient(#ffe08a, #e8b552); border-color: #8a5f22; }
.btn-big { font-size: 26px; padding: 16px 26px; }
.btn-small { font-size: 18px; padding: 8px 14px; }
.btn.is-disabled { opacity: .75; cursor: default; color: var(--muted); }
.btn.is-disabled:hover { border-color: var(--line); color: var(--muted); }
.btn.is-disabled:active { transform: none; box-shadow: var(--shadow); }
.ico { width: 18px; height: 18px; flex: none; shape-rendering: crispEdges; }
.card {
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(0,0,0,.18);
  padding: 18px;
}
.grid { display: grid; gap: 16px; }
.section { padding: 56px 0; }
.section.alt { background: var(--bg-deep); border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
.h-deco { text-align: center; }
.h-deco::before, .h-deco::after { content: "◆"; color: var(--gold); font-size: .5em; vertical-align: middle; margin: 0 .6em; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; min-height: min(78vh, 720px); display: flex; align-items: center; border-bottom: 3px solid var(--line); }
.hero picture, .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg { object-fit: cover; object-position: center 40%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,17,13,.35) 0%, rgba(23,17,13,.15) 40%, rgba(23,17,13,.85) 100%); }
.hero-in { position: relative; text-align: center; padding-top: 48px; padding-bottom: 32px; }
.logo { display: flex; flex-direction: column; align-items: center; margin: 0 0 14px; }
.logo-main {
  font-size: clamp(56px, 12vw, 128px); line-height: .9; color: var(--accent);
  text-shadow: 0 4px 0 #8a5f22, 0 8px 0 var(--line-dark), 0 0 30px rgba(242,193,78,.35);
}
.logo-sub { font-size: clamp(26px, 4.5vw, 44px); color: var(--text); text-shadow: 0 3px 0 var(--line-dark); letter-spacing: .12em; }
.pitch {
  max-width: 720px; margin: 0 auto 22px; font-size: clamp(21px, 2.6vw, 26px);
  background: rgba(23,17,13,.72); border: 2px solid var(--line); padding: 12px 18px; border-radius: var(--radius);
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.parade { display: flex; justify-content: center; align-items: flex-end; gap: 22px; margin-top: 26px; min-height: 100px; }
.parade-mon { height: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,.45)); animation: bob 2.4s steps(4) infinite; }
.parade-mon:nth-child(2) { animation-delay: .3s; }
.parade-mon:nth-child(3) { animation-delay: .6s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.intro p { font-size: 23px; text-align: center; }
.feats { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.feat h3 { color: var(--accent); margin-top: 6px; }
.feat p { color: var(--text); margin: 0; }
.feat-ico { width: 48px; height: 48px; background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; }
.ico-plat { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%236cc551' d='M0 9h5v1H0zM7 6h5v1H7z'/%3E%3Cpath fill='%23c08a4a' d='M0 10h5v2H0zM7 7h5v2H7z'/%3E%3Cpath fill='%23f2c14e' d='M3 4h2v3H3z'/%3E%3Cpath fill='%23f6ecd2' d='M3 2h2v2H3z'/%3E%3C/svg%3E"); }
.ico-bond { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%2345d1c2' d='M5 0h2v1h1v2h1v3H8v3H7v3H5V9H4V6H3V3h1V1h1z'/%3E%3Cpath fill='%23e8fffb' d='M5 2h1v3H5z'/%3E%3C/svg%3E"); }
.ico-fight { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23d0d8e0' d='M1 1h2v1h1v1h1v1h1v1H5v1H4V5H3V4H2V3H1zM11 1H9v1H8v1H7v1H6v1h1v1h1V5h1V4h1V3h1z'/%3E%3Cpath fill='%23c08a4a' d='M3 8h2v1h1v1H5v1H3V9H2V8zM9 8H7v1H6v1h1v1h2V9h1V8z'/%3E%3C/svg%3E"); }
.ico-evo { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23f07838' d='M1 7h3v4H1z'/%3E%3Cpath fill='%23f2c14e' d='M5 5h1v1h1v1H6v1H5zM8 3h3v8H8z'/%3E%3Cpath fill='%23fff4d6' d='M9 1h1v2H9z'/%3E%3C/svg%3E"); }
.ico-story { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23f6ecd2' d='M1 2h4v1h2V2h4v8H7v1H5v-1H1z'/%3E%3Cpath fill='%23b9a789' d='M6 3h1v7H6zM2 4h3v1H2zM2 6h3v1H2zM8 4h2v1H8zM8 6h2v1H8z'/%3E%3C/svg%3E"); }
.ico-quest { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%23f2c14e' d='M5 1h2v7H5zM5 9h2v2H5z'/%3E%3Cpath fill='%238a5f22' d='M7 1h1v7H7zM7 9h1v2H7z'/%3E%3C/svg%3E"); }

.shots { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 18px; }
.shot { display: block; border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-deep); aspect-ratio: 16/9; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.shot:hover { border-color: var(--gold); }
.shot:hover img { transform: scale(1.04); }

.note-mini header { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.ver { color: var(--accent); font-weight: normal; font-size: 26px; }
time { color: var(--muted); }
.cta-end { background: linear-gradient(180deg, transparent, rgba(0,0,0,.3)); }

/* ------------------------------------------------------------------ page head */
.page-head { padding: 36px 0 10px; }
.page-head p { font-size: 22px; max-width: 820px; }
.detail-open .page-head { display: none; }
.detail-open .wiki { padding-top: 16px; }

/* ------------------------------------------------------------------ filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; padding: 14px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 17px; color: var(--muted); }
.filters .f-search { flex: 1 1 260px; }
input[type="search"], select {
  font: inherit; font-size: 20px; color: var(--text); background: var(--bg-deep);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 44px; width: 100%;
}
select { padding-right: 28px; }
input[type="search"]:focus, select:focus { border-color: var(--accent); outline: none; }
.count { color: var(--muted); margin: 4px 2px 12px; }

/* ------------------------------------------------------------------ creature cards */
.mons { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mon-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; color: var(--text);
  background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 8px 12px; position: relative; transition: transform .1s;
}
.mon-card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--hover); }
.mon-card b { font-weight: normal; font-size: 22px; line-height: 1.05; }
.mon-img { display: flex; align-items: flex-end; justify-content: center; height: 112px; width: 100%;
  background: radial-gradient(ellipse at 50% 92%, rgba(0,0,0,.35) 0 22%, transparent 23%); }
.mon-img img { max-height: 108px; max-width: 128px; width: auto; height: auto; image-rendering: pixelated; }
.mon-n { color: var(--muted); font-size: 16px; }
.mon-card .leg-star { position: absolute; top: 6px; right: 8px; color: var(--accent); }
.types { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.type {
  display: inline-block; font-size: 15px; line-height: 1; padding: 4px 7px 3px; border-radius: 3px;
  border: 2px solid rgba(0,0,0,.35); text-shadow: none; white-space: nowrap;
}
.badge { display: inline-block; font-size: 15px; padding: 3px 7px; border-radius: 3px; background: var(--bg-deep); border: 2px solid var(--line); color: var(--muted); }
.badge.gold { color: var(--accent); border-color: var(--gold); }

/* ------------------------------------------------------------------ creature detail */
.detail-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.d-hero {
  position: relative; display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 0; overflow: hidden; padding: 0;
}
.d-stage {
  position: relative; min-height: 280px; display: flex; align-items: flex-end; justify-content: center;
  background: var(--bg-deep) center / cover no-repeat; border-right: 3px solid var(--line);
}
.d-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.35)); }
.d-stage img { object-fit: contain; position: relative; z-index: 1; margin-bottom: 26px; max-width: 92%; max-height: 260px; width: auto; height: auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); image-rendering: pixelated; }
.d-info { padding: 18px 20px; }
.d-info h1 { margin-bottom: 4px; }
.d-sub { color: var(--muted); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-info .types { justify-content: flex-start; margin: 6px 0 12px; }
.d-info .type { font-size: 18px; padding: 5px 9px 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.kv div { background: var(--bg-deep); border: 2px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.kv dt { color: var(--muted); font-size: 15px; }
.kv dd { margin: 0; font-size: 22px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.d-grid > * { min-width: 0; }
.d-grid > .wide { grid-column: 1 / -1; }
.card h2 { font-size: 28px; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: auto 3ch 1fr; gap: 6px 10px; align-items: center; }
.stats .lbl { color: var(--muted); }
.stats .val { text-align: right; }
.bar { height: 14px; background: var(--bg-deep); border: 2px solid var(--line-dark); position: relative; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); transition: width .4s steps(8); }
.bar i.s-hp { background: #6cc551; } .bar i.s-atk { background: #f07838; } .bar i.s-def { background: #4f8fe8; } .bar i.s-spd { background: #f5d33a; }
.stats .total { grid-column: 1 / -1; border-top: 2px dashed var(--line); padding-top: 6px; color: var(--accent); }
.matchups { display: grid; gap: 8px; }
.matchups .row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.matchups .row > span:first-child { color: var(--muted); min-width: 120px; }
.evo-line { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px; justify-content: center; }
.evo-step { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); padding: 8px; border: 2px solid transparent; border-radius: var(--radius); min-width: 120px; }
.evo-step:hover { border-color: var(--line); color: var(--hover); }
.evo-step.cur { border-color: var(--gold); background: rgba(242,193,78,.08); }
.evo-step .mon-img { height: 96px; }
.evo-step .mon-img img { max-height: 92px; max-width: 110px; }
.evo-arrow { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--accent); font-size: 17px; max-width: 170px; }
.evo-arrow .arr { font-size: 30px; line-height: 1; }
.evo-arrow .mats { color: var(--muted); font-size: 15px; }
.mat { white-space: nowrap; }
.mat::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; background: var(--mc, #ccc); border: 1px solid #000; vertical-align: 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 2px solid rgba(94,70,48,.55); vertical-align: middle; }
th { color: var(--muted); font-weight: normal; font-size: 17px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover { background: rgba(255,255,255,.03); }
.table-wrap { overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.eff { color: var(--muted); font-size: 17px; }
.mv-link { color: var(--text); text-decoration: none; }
.mv-link:hover { color: var(--accent); text-decoration: underline; }
.empty { color: var(--muted); }

/* moves page */
table.moves th[data-sort] { cursor: pointer; user-select: none; }
table.moves th[data-sort]::after { content: " ↕"; opacity: .35; }
table.moves th[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; color: var(--accent); }
table.moves th[aria-sort="descending"]::after { content: " ▼"; opacity: 1; color: var(--accent); }
table.moves tbody tr.mv { cursor: pointer; }
table.moves tbody tr.mv.open, table.moves tbody tr.mv:target { background: rgba(242,193,78,.08); }
tr.learners td { background: var(--bg-deep); }
.learner-list { display: flex; flex-wrap: wrap; gap: 6px; }
.learner { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 3px 8px 3px 4px; font-size: 17px; }
.learner img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.learner:hover { border-color: var(--gold); }
.learner small { color: var(--muted); }
.tag { font-size: 14px; color: var(--accent); border: 1px solid var(--gold); padding: 1px 4px; margin-left: 4px; border-radius: 2px; white-space: nowrap; }

/* ------------------------------------------------------------------ media */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.tabs button { font: inherit; font-size: 20px; color: var(--text); background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); padding: 8px 14px; cursor: pointer; box-shadow: var(--shadow); }
.tabs button small { color: var(--muted); }
.tabs button[aria-selected="true"] { border-color: var(--gold); color: var(--accent); background: var(--bg-deep); }
.gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery figure { margin: 0; }
.gallery figcaption { color: var(--muted); font-size: 17px; padding: 4px 2px 0; }
.gallery .shot.portrait { aspect-ratio: 1; background: radial-gradient(circle, #4a3828, var(--bg-deep)); }
.gallery .shot.portrait img { object-fit: contain; image-rendering: pixelated; }
.gallery.portraits { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.region-h { grid-column: 1 / -1; margin: 14px 0 0; font-size: 26px; color: var(--accent); }
.video { position: relative; aspect-ratio: 16/9; border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video.vertical { aspect-ratio: 9/16; max-height: 640px; }
.video button { all: unset; cursor: pointer; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px;
  background: linear-gradient(rgba(23,17,13,.55), rgba(23,17,13,.8)), url("/img/battle/thumb/battle_forest.webp") center / cover; color: var(--text); }
.video button .play { width: 64px; height: 64px; background: var(--accent); clip-path: polygon(25% 15%, 85% 50%, 25% 85%); }
.video button small { color: var(--muted); font-size: 15px; max-width: 320px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.videos-empty { grid-column: 1 / -1; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,7,5,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto; border: 3px solid var(--line); box-shadow: 0 6px 0 #000; }
.lightbox img.px { min-width: min(480px, 90vw); }
.lightbox .lb-cap { color: var(--text); margin-top: 10px; text-align: center; }
.lightbox button { position: absolute; font: inherit; font-size: 28px; color: var(--text); background: var(--panel); border: 3px solid var(--line); border-radius: var(--radius); width: 52px; height: 52px; cursor: pointer; }
.lightbox button:hover { border-color: var(--gold); color: var(--accent); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* ------------------------------------------------------------------ patch notes */
.toc { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-block; padding: 4px 10px; border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.notes { display: grid; gap: 24px; padding-bottom: 50px; }
.note header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; border-bottom: 2px dashed var(--line); margin-bottom: 14px; padding-bottom: 8px; }
.note h2 { margin: 0; }
.md h4 { color: var(--accent); font-size: 25px; margin: 18px 0 8px; }
.md ul { padding-left: 1.1em; margin: 0 0 1em; }
.md li { margin-bottom: .55em; }
.md li::marker { content: "◆  "; color: var(--gold); font-size: .7em; }
.md strong { color: var(--hover); font-weight: normal; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.note-mini ul { padding-left: 1.1em; }

/* ------------------------------------------------------------------ footer */
.footer { margin-top: 40px; background: var(--bg-deep); border-top: 3px solid var(--line); padding: 28px 0 22px; color: var(--muted); }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; }
.ft-title { color: var(--accent); font-weight: normal; font-size: 24px; }
.ft-links { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.ft-small { grid-column: 1 / -1; font-size: 16px; margin: 10px 0 0; }
.lost { padding: 30px 0; }
.lost-mon { width: 144px; height: auto; transform: scaleX(-1); animation: bob 2.4s steps(4) infinite; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 760px) {
  body { font-size: 19px; }
  .section { padding: 40px 0; }
  .d-hero { grid-template-columns: 1fr; }
  .d-stage { border-right: 0; border-bottom: 3px solid var(--line); min-height: 220px; }
  .d-grid { grid-template-columns: 1fr; }
  .mons { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .mon-img { height: 92px; }
  .mon-img img { max-height: 88px; max-width: 110px; }
  .shots { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .footer-in { grid-template-columns: 1fr; }
  .ft-links { text-align: left; }
  .filters label:not(.f-search) { flex: 1 1 calc(50% - 12px); }
  .btn-big { font-size: 23px; padding: 14px 18px; width: 100%; max-width: 360px; }
  .parade { gap: 10px; }
  .parade-mon { max-height: 90px; width: auto; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  table.learnset .eff-col { display: none; }
  .stats { grid-template-columns: auto 3ch 1fr; }
}

/* generated by build.py from data/types.json */
.t-normal{--tc:#c9bfa5;background:#c9bfa5;color:#1b130e}.tb-normal{--tc:#c9bfa5}
.t-fire{--tc:#f07838;background:#f07838;color:#1b130e}.tb-fire{--tc:#f07838}
.t-water{--tc:#4f8fe8;background:#4f8fe8;color:#1b130e}.tb-water{--tc:#4f8fe8}
.t-grass{--tc:#6cc551;background:#6cc551;color:#1b130e}.tb-grass{--tc:#6cc551}
.t-ice{--tc:#8fe3f0;background:#8fe3f0;color:#1b130e}.tb-ice{--tc:#8fe3f0}
.t-electric{--tc:#f5d33a;background:#f5d33a;color:#1b130e}.tb-electric{--tc:#f5d33a}
.t-earth{--tc:#c08a4a;background:#c08a4a;color:#1b130e}.tb-earth{--tc:#c08a4a}
.t-air{--tc:#a9b8ef;background:#a9b8ef;color:#1b130e}.tb-air{--tc:#a9b8ef}
.t-shadow{--tc:#8a5cc2;background:#8a5cc2;color:#fff6e0}.tb-shadow{--tc:#8a5cc2}
.t-bug{--tc:#9bbf3a;background:#9bbf3a;color:#1b130e}.tb-bug{--tc:#9bbf3a}
.t-light{--tc:#ffe08a;background:#ffe08a;color:#1b130e}.tb-light{--tc:#ffe08a}
.t-metal{--tc:#9aa7b5;background:#9aa7b5;color:#1b130e}.tb-metal{--tc:#9aa7b5}
.t-fairy{--tc:#f29ad8;background:#f29ad8;color:#1b130e}.tb-fairy{--tc:#f29ad8}
.t-ether{--tc:#45d1c2;background:#45d1c2;color:#1b130e}.tb-ether{--tc:#45d1c2}
