:root {
  color-scheme: dark;
  --page: #0e1716;
  --surface: #182422;
  --line: #35453f;
  --text: #f4f0dc;
  --muted: #b4c3b5;
  --gold: #f3c66e;
  --mint: #a8d5b7;
  font: 100%/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button, select { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}
button:disabled { cursor: default; opacity: .45; }
button, input, select { border: 1px solid var(--line); background: #172420; border-radius: .55rem; }
button { padding: .58rem .95rem; }
button:hover:enabled, select:hover { border-color: #849c86; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wrap { width: min(74rem, calc(100% - 2.5rem)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: #12201c; }
.top-inner { display: flex; gap: 1.3rem; align-items: center; min-height: 4.25rem; }
.brand { margin-right: auto; display: flex; align-items: center; gap: .5rem; color: var(--gold); font: bold 1.5rem Georgia,serif; text-decoration: none; }
.brand img { object-fit: contain; image-rendering: pixelated; }
.back { font-size: .88rem; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--text); text-decoration: underline; }
.locale select { padding: .45rem; }
main { padding-block: 1.5rem 3.5rem; }
.hero { isolation: isolate; position: relative; display: flex; align-items: center; min-height: 14.5rem; overflow: hidden; border: 1px solid #3a5947; border-radius: 1rem; background: #143525; }
.hero-art { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #152c25 6%, rgba(16,44,32,.95) 25%, rgba(17,43,28,.48) 63%, rgba(11,23,15,.17)), url('../img/ilhas/comum.webp') center 54%/cover; }
/* Greymon's atlas has eight directions and sixteen frames; show the left-facing pose. */
.hero-partner { position: absolute; top: 50%; right: 9%; transform: translateY(-50%); width: min(25%, 15rem); aspect-ratio: 153/135; background: url('../img/digimon/greymon.png') 42.857% 0 / 800% 1600%; filter: drop-shadow(0 .6rem .6rem #0e201c99); image-rendering: pixelated; }
.hero-text { width: 57%; padding: 2.4rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, .detail-title { font-family: Georgia, 'Times New Roman', serif; }
h1 { color: #fff2c7; font-size: clamp(2.7rem, 5.5vw, 4.6rem); line-height: 1.05; letter-spacing: -.045em; }
.hero-text p { margin-top: .9rem; max-width: 36ch; color: #e2e8d9; }
.catalog-heading, .dialog-bar, .pager, .card-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.catalog-heading { margin-block: 2rem 1.1rem; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.12; }
.favorites-toggle { display: inline-flex; gap: .45rem; align-items: center; }
.favorites-toggle > span:first-child, .favorite[aria-pressed="true"] { color: var(--gold); }
.favorites-toggle[aria-pressed="true"] { border-color: var(--gold); background: #302c1c; }
#fav-count { font-size: .85em; color: var(--muted); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; }
.filters label { min-width: 0; display: grid; gap: .27rem; font-size: .83rem; color: var(--muted); }
.filters select, .filters input { width: 100%; min-height: 2.8rem; padding: .42rem .7rem; color: var(--text); font-size: 1rem; }
input::placeholder { color: #a3ada7; }
.summary { margin-block: .9rem; color: var(--muted); font-size: .88rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,12.6rem),1fr)); gap: .85rem; }
.card { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); border-radius: .8rem; }
.card:hover, .card:focus-within { border-color: #758e7d; }
.card-head { padding: .5rem .65rem 0 .85rem; }
.number { font: .82rem/1.3 ui-monospace,monospace; color: var(--mint); }
.favorite { min-width: 2.45rem; height: 2.45rem; padding: 0; font-size: 1.35rem; line-height: 1; color: var(--muted); background: #12201b; }
.card-open { border: 0; background: none; text-align: left; flex: 1; display: flex; flex-direction: column; width: 100%; padding: 0 .85rem .85rem; }
.specimen { align-self: stretch; display: grid; place-items: center; margin-bottom: .65rem; background: radial-gradient(ellipse 55% 55% at center, #385041 1%, transparent 94%); }
.specimen img { width: 100%; height: 6.3rem; padding: .2rem; object-fit: contain; image-rendering: pixelated; }
.card-name { font: 650 1.06rem/1.2 system-ui,sans-serif; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; color: var(--muted); font-size: .8rem; }
.meta i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); border: 1px solid #ffffff44; }
.pager { justify-content: center; margin-top: 1.6rem; }
.pager span { color: var(--muted); }
dialog { color: var(--text); border: 1px solid #5d7565; border-radius: 1rem; width: min(37rem, calc(100% - 1.25rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 0; background: #16221f; box-shadow: 0 1.2rem 4rem #0009; }
dialog::backdrop { background: #050c0bd4; }
.dialog-bar { position: sticky; top: 0; z-index: 1; background: #172621; padding: .55rem 1rem; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.dialog-bar button { min-width: 2.5rem; padding: 0; font-size: 1.6rem; }
#detail-content { padding: 1.2rem; }
.detail-hero { display: flex; align-items: center; gap: 1rem; }
.detail-hero img { width: 7.5rem; height: 7.5rem; max-width: 30%; object-fit: contain; image-rendering: pixelated; }
.detail-title { line-height: 1.12; overflow-wrap: anywhere; margin: .2rem 0; }
.detail-hero button { margin-top: .5rem; padding: .35rem .7rem; }
.subheading { margin: 1.2rem 0 .45rem; font-size: 1rem; color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .45rem; margin: 0; }
.stats div { padding: .55rem; border: 1px solid var(--line); border-radius: .4rem; }
.stats dt, .hint, .row small { color: var(--muted); font-size: .83rem; }
.stats dd { margin: 0; font-weight: 650; }
.row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.row a { overflow-wrap: anywhere; }
.row small { text-align: right; }
.evo-link { background: transparent; padding: 0; min-height: 2rem; color: var(--mint); border: 0; text-decoration: underline; text-underline-offset: .2em; text-align: left; }
@media(max-width: 660px) {
  .wrap { width: calc(100% - 1.5rem); } .top-inner { gap: .75rem; }
  .hero { min-height: 12rem; } .hero-text { width: 68%; padding: 1.1rem; }
  .hero-partner { right: 2%; width: 31%; }
  .hero-text p { font-size: .9rem; }
  .filters { grid-template-columns: 1fr 1fr; } .search { grid-column: 1/-1; }
  .catalog-heading { align-items: start; } .favorites-toggle { padding: .4rem .55rem; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .specimen img { height: 5.2rem; } .card-open { padding: 0 .55rem .7rem; }
}
@media(max-width: 350px) { .hero-text { width: 90%; } .hero-partner { opacity: .4; } .catalog-heading { flex-wrap: wrap; } }

.train { display: inline-flex; align-items: center; padding: .5rem .75rem; margin: .8rem 0 0; border-radius: .45rem; font-weight: 650; color: #13251b; background: var(--mint); text-decoration: none; }
.train:hover { background: #c4e5cb; }
