/* Traymon World uses the night, cream and orange tokens below in its game menu. */
:root {
  color-scheme: dark;
  --page: #121827;
  --panel: #262830;
  --panel-deep: #171921;
  --border: #635747;
  --hairline: #413d40;
  --text: #f7eedc;
  --muted: #e0cfb4;
  --dim: #bdaf9e;
  --action: #f57119;
  --accent: #ffb44d;
  --beige: #8a7c66;
  --positive: #73d765;
  --radius-control: 2px;
  --radius-panel: 2px;
  --shell-gutter: clamp(14px, 2.22vw, 32px);
  --shell-width: 1560px;
  --pixel-font: "TMW Maru", Galmuri11, system-ui, sans-serif;
  --sans: var(--pixel-font);
  font-family: var(--sans);
  background: var(--page);
  color: var(--text);
  font-synthesis: none;
  caret-color: var(--accent);
}
@font-face {
  font-family: Galmuri11;
  src: url("fonts/Galmuri11.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "TMW Maru"; src: url("fonts/TMWMaru.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "TMW Han SC"; src: url("fonts/FusionPixel12-zh_hans.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
@font-face {
  font-family: "TMW Han TC"; src: url("fonts/FusionPixel12-zh_tw.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
}
:root:lang(zh-CN) { --pixel-font: "TMW Han SC", "TMW Maru", Galmuri11, system-ui, sans-serif; }
:root:lang(zh-TW) { --pixel-font: "TMW Han TC", "TMW Maru", Galmuri11, system-ui, sans-serif; }
:root:lang(ja) { --pixel-font: Galmuri11, "TMW Maru", system-ui, sans-serif; }
::selection { background: var(--accent); color: var(--page); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, select, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
button { border: 0; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 4;
  color: var(--page);
  background: var(--accent);
  padding: 10px 14px;
  transform: translateY(-160%);
}
.skip:focus { transform: translateY(0); }

.site-header {
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.header-inner, .site-main, .site-footer {
  width: min(var(--shell-width), calc(100% - var(--shell-gutter) - var(--shell-gutter)));
  margin-inline: auto;
}
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #2b241d;
  border: 1px solid var(--beige);
  border-radius: 4px;
}
.brand-icon img { object-fit: contain; image-rendering: pixelated; }
.brand strong { font: 400 17px/1.2 var(--pixel-font); white-space: nowrap; }
.navigation { display: flex; align-items: stretch; align-self: stretch; min-width: 0; gap: clamp(14px, 2vw, 27px); }
.navigation a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; text-align: center; }
.navigation a:hover, .navigation a[aria-current] { color: var(--accent); }
.navigation a[aria-current]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--accent);
}
.header-tools { flex: 0 0 auto; }
.language-select select, .select-field select, .sort-field select {
  border: 1px solid var(--border);
  background: var(--panel-deep);
  border-radius: var(--radius-control);
  padding: 8px 11px;
  line-height: 1.3;
}
.language-select select { font-size: 14px; min-height: 42px; max-width: 168px; }

.site-main { flex: 1; padding: 24px 0 44px; }
.hero {
  min-height: 230px;
  margin-bottom: 30px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: #0b0d16;
}
.hero-scene { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 100%, #77665e 0%, #302e31 33%, transparent 67%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #0b0d16 3%, #0b0d16f2 27%, #0b0d16a8 49%, transparent 72%);
  pointer-events: none;
}
.scene-mountains, .scene-ground {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  image-rendering: pixelated;
}
.scene-mountains {
  background-image: url("images/meadow-near.png"), url("images/meadow-mid.png"), url("images/field-1.png");
  background-size: 760px auto, 725px auto, 650px auto;
  background-position: right 0 bottom -22px, right 140px bottom 4px, right 80px bottom 34px;
  opacity: .68;
}
.scene-ground { background: url("images/meadow-floor.png") right bottom -17px / 720px auto repeat-x; }
.scene-monster {
  position: absolute;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 6px #0a0a0c80);
}
.scene-nature { width: clamp(105px, 13vw, 186px); height: auto; right: 22%; bottom: 22px; }
.scene-fire { width: clamp(92px, 9vw, 124px); height: auto; right: 6.5%; bottom: 34px; }
.scene-light { width: clamp(48px, 5.4vw, 75px); height: auto; right: 23%; bottom: 128px; }
.hero-copy { width: min(740px, 66%); padding: 30px clamp(20px, 3vw, 40px); }
.hero h1 { color: var(--text); font: 400 clamp(31px, 4.1vw, 59px)/1.2 var(--pixel-font); }
.hero-name { white-space: nowrap; }
.hero-wiki { color: var(--accent); }
.hero-copy p { color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 38ch; margin-top: 9px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 0 18px; }

.section-heading { margin: 0 0 17px; }
.section-heading h2 { font-size: 28px; line-height: 1.22; letter-spacing: -.025em; }
.section-heading p { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 5px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-panel); }
.directory-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.directory-tools { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: center; gap: 10px 22px; }
.filters { padding: 15px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.filter-head h3 { font-size: 15px; }
.filter-toggle { display: none; }
.text-button { padding: 5px 0; background: transparent; font-size: 13px; color: var(--accent); white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.filter-caption, .select-field, .sort-field { color: var(--muted); font-size: 13px; font-weight: 600; }
.element-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 7px 0 14px; }
.element-option {
  background: var(--panel-deep);
  border: 1px solid var(--border);
  color: var(--muted);
  min-height: 38px;
  padding: 5px 4px;
  min-width: 0;
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.element-option i, .chip i { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: rgb(var(--tone)); }
.element-option:hover, .element-option[aria-pressed="true"], .element-option[aria-current] {
  border-color: var(--action);
  background: #2b241d;
  color: var(--accent);
}
.all-element { grid-column: 1 / -1; }
.select-field { display: grid; gap: 5px; }
.filters .select-field + .select-field { margin-top: 11px; }
.select-field select { width: 100%; min-width: 0; min-height: 37px; }
.segmented { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.segment { color: var(--muted); min-height: 44px; padding: 7px 10px; border-radius: var(--radius-control); border: 1px solid transparent; background: transparent; font-size: 13px; white-space: nowrap; }
.segment > span { margin-left: 2px; color: var(--dim); font-variant-numeric: tabular-nums; }
.segment[aria-pressed="true"] { background: #2b241d; color: var(--accent); border-color: var(--beige); }
.segment[aria-pressed="true"] > span { color: var(--accent); }
.segment:hover { color: var(--accent); }
.search-field {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--beige);
  border-radius: var(--radius-control);
  padding: 0 12px 0 14px;
}
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-field > i { width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; position: relative; flex-shrink: 0; }
.search-field > i::after { content: ""; position: absolute; height: 1.5px; width: 5px; right: -4px; bottom: -2px; transform: rotate(45deg); background: var(--muted); }
.search-field input { min-width: 0; flex: 1; color: var(--text); outline: none; padding: 10px 0; border: 0; background: transparent; font-size: 15px; }
.search-field input::placeholder { color: var(--dim); opacity: 1; }
.search-field kbd { font: inherit; font-size: 13px; color: var(--dim); padding: 1px 6px; border: 1px solid var(--border); border-radius: 3px; }
.results-section { min-width: 0; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.sort-field { min-width: 0; }
.sort-field select { max-width: 100%; min-height: 36px; padding-block: 5px; }
.monster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.monster-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid var(--border); background: var(--panel-deep); border-radius: var(--radius-panel); overflow: hidden; }
.monster-card:hover, .skill-row:hover { border-color: var(--accent); background: var(--panel); }
.fire { --tone: 249 128 87; }
.water { --tone: 119 183 249; }
.nature { --tone: 147 211 129; }
.light { --tone: 246 211 119; }
.dark { --tone: 189 149 241; }
.soul { --tone: 143 174 229; }
.neutral { --tone: 170 185 186; }
.common { --tone: 191 203 202; }
.uncommon { --tone: 159 218 138; }
.rare { --tone: 124 192 251; }
.epic { --tone: 203 169 255; }
.legendary { --tone: 255 212 125; }
.mythic { --tone: 255 137 174; }
.monster-art, .detail-art, .skill-thumb {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 92%, rgb(var(--tone) / .16), transparent 76%), #252630;
}
.monster-art { height: 132px; display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.portrait { display: block; object-fit: contain; image-rendering: pixelated; }
.monster-art .portrait { width: min(73%, 129px); height: 92px; margin-top: 13px; filter: drop-shadow(0 4px 3px #0005); }
.art-id, .detail-code, .code { font-size: 13px; font-variant-numeric: tabular-nums; }
.art-id { position: absolute; left: 9px; top: 9px; color: var(--muted); z-index: 1; }
.card-grade {
  position: absolute;
  right: 8px;
  top: 7px;
  z-index: 1;
  color: rgb(var(--tone));
  border: 1px solid rgb(var(--tone) / .26);
  background: var(--panel-deep);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}
.monster-info { display: grid; grid-template-rows: 1fr auto; gap: 7px; padding: 10px 12px 11px; min-width: 0; }
.monster-info > div:first-child { min-width: 0; }
.monster-info h3 { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.monster-en { font-size: 13px; color: var(--dim); margin-top: 2px; overflow-wrap: anywhere; }
.row-arrow { color: var(--dim); font-size: 14px; }
.monster-card:hover .row-arrow, .skill-row:hover .row-arrow { color: var(--accent); }
.card-chips, .detail-chips { grid-column: 1 / -1; display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 10px;
  padding: 2px 5px;
  color: rgb(var(--tone));
  background: rgb(var(--tone) / .09);
  border: 1px solid rgb(var(--tone) / .19);
  border-radius: 4px;
}
.card-chips .chip { border: 0; padding: 0; background: transparent; font-size: 13px; }
.card-chips .chip + .chip { color: var(--dim); margin-left: 4px; }
.card-chips .neutral i { display: none; }
.chip i { width: 5px; height: 5px; margin: 0 4px 0 0; }
.skill-list { display: grid; gap: 8px; }
.skill-row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 14px; padding: 9px 13px 9px 9px; }
.skill-thumb { height: 67px; display: grid; place-items: center; border-radius: 6px; }
.skill-thumb .portrait { width: 62px; height: 55px; }
.skill-title { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.skill-title h3 { font-size: 15px; }
.skill-owner, .skill-description { font-size: 14px; margin-top: 4px; line-height: 1.5; }
.skill-owner { color: var(--dim); }
.skill-description { color: var(--muted); }
.loading, .empty { text-align: center; color: var(--muted); padding: 24px 15px; grid-column: 1 / -1; }
.empty { border: 1px dashed var(--border); border-radius: var(--radius-panel); }
.empty .text-button { margin-top: 5px; }

.back-link, .text-link { color: var(--accent); font-size: 12px; font-weight: 600; }
.back-link { display: inline-block; margin-bottom: 16px; }
.text-link { display: inline-block; margin-top: 13px; }
.back-link:hover, .text-link:hover { text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.monster-detail { grid-template-columns: minmax(240px, 34%) minmax(0, 1fr); align-items: center; }
.detail-art { min-height: 226px; display: grid; place-items: center; }
.detail-art .art-id { top: 13px; left: 13px; }
.detail-portrait { width: min(72%, 245px); height: 170px; filter: drop-shadow(0 10px 0 #0004); }
.detail-heading { padding: 18px; }
.detail-heading h2 { font-size: 32px; line-height: 1.25; margin: 4px 0; overflow-wrap: anywhere; }
.detail-code { color: var(--accent); display: inline-block; margin-bottom: 4px; }
.original-names { color: var(--dim); font-size: 14px; }
.original-names span { padding: 0 4px; }
.detail-heading .detail-chips { margin-top: 13px; }
.detail-chips .chip { font-size: 12px; padding: 4px 7px; }
.detail-panels { margin-top: 14px; }
.content-panel { padding: 17px; min-width: 0; }
.content-panel h3 { font-size: 16px; margin-bottom: 12px; }
.content-panel h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.data-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.data-tiles > div { border-bottom: 1px solid var(--hairline); padding: 8px 0; }
.data-tiles dt { color: var(--muted); font-size: 13px; line-height: 1.4; }
.data-tiles dd { font-size: 18px; font-weight: 700; margin-top: 3px; }
.data-tiles small { display: block; color: var(--positive); font-size: 13px; margin-top: 3px; }
.detail-skill h4 { color: var(--text); font-size: 18px; margin: 2px 0 6px; }
.detail-skill p, .source-panel p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.detail-skill .detail-chips { margin-top: 12px; }
.region-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.region-card { overflow: hidden; }
.region-card:hover { border-color: rgb(var(--tone) / .6); }
.region-art {
  min-height: 117px;
  position: relative;
  background: var(--region-image) center bottom / auto 100% repeat-x,
    linear-gradient(#302e31, rgb(var(--tone) / .35));
  image-rendering: pixelated;
  border-bottom: 1px solid var(--hairline);
}
.region-art .art-id { background: #0f0e0fed; border-radius: 4px; padding: 3px 6px; }
.region-copy { padding: 13px; }
.region-copy h3 { font-size: 15px; }
.region-copy p { font-size: 12px; color: var(--muted); margin: 5px 0 8px; }
.section-tools, .arena-controls { display: flex; gap: 11px; align-items: end; flex-wrap: wrap; }
.section-tools .select-field { min-width: 140px; }
.section-tools .select-field:nth-child(2) { min-width: 210px; }
.stat-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.stat-table th, .stat-table td { padding: 8px 9px; border-bottom: 1px solid var(--border); }
.stat-table thead th { color: var(--dim); font-weight: 600; white-space: nowrap; }
.stat-table tbody th { font-weight: 650; }
.stat-table td { font-variant-numeric: tabular-nums; }
.small-help { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.wide-panel { margin-top: 14px; }
.rank-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rank-heading h3 { margin-bottom: 0; }
.rank-table { overflow-x: auto; }
.rank-table td { white-space: nowrap; }
.rank-explanation { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 9px 0 4px; }
.rank-badge { display: inline-block; min-width: 31px; font: 700 12px var(--sans); color: rgb(var(--tone)); }
.rank-badge[data-grade="S"] { --tone: 255 214 92; }
.rank-badge[data-grade="A"] { --tone: 194 167 255; }
.rank-badge[data-grade="B"] { --tone: 106 202 252; }
.rank-badge[data-grade="C"] { --tone: 168 162 176; }
.wave-list { display: grid; gap: 7px; }
.wave { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; border-top: 1px solid var(--hairline); padding-top: 6px; }
.wave > div { display: flex; flex-wrap: wrap; gap: 6px; }
.wave-label { font-size: 12px; color: var(--muted); }
.wave-stack { display: inline-flex; align-items: center; gap: 2px; }
.wave-stack > small { color: var(--dim); font: 11px var(--sans); }
.wave-unit { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgb(var(--tone) / .25); border-radius: 5px; padding: 4px 7px; font-size: 11px; background: var(--panel-deep); }
.wave-unit:hover { border-color: var(--accent); }
.wave-unit img { width: 25px; height: 24px; }
.arena-elements { display: flex; flex-wrap: wrap; margin: 0; }
.arena-elements .element-option { min-width: 62px; }
.arena-boss { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.section-sub { font-size: 12px; color: var(--dim); font-weight: 500; }
.achievement-search { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.achievement-card { display: grid; grid-template-columns: 43px 1fr; gap: 10px; padding: 11px; align-items: start; }
.achievement-icon { display: grid; place-items: center; background: #2b241d; color: var(--accent); width: 43px; height: 43px; border: 1px solid var(--beige); border-radius: 6px; font-size: 22px; }
.achievement-icon .portrait { width: 33px; height: 33px; }
.achievement-card h3 { font-size: 14px; }
.achievement-card p, .achievement-card small { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.achievement-card small { display: inline-block; font-size: 10px; color: var(--dim); }
:lang(en) .achievement-card small { display: none; }
.matchups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 0; margin: 0 0 12px; list-style: none; }
.matchups li { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); }
.talent-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.talent-timeline > div { display: grid; gap: 4px; text-align: center; border: 1px solid var(--hairline); padding: 8px 2px; border-radius: 5px; font-size: 12px; }
.talent-timeline span { color: var(--accent); font: 10px var(--sans); }
.source-panel { max-width: 680px; }
.source-list { display: grid; gap: 6px; margin-bottom: 14px; }
.source-list > div { display: grid; grid-template-columns: 105px 1fr; gap: 7px; font-size: 13px; align-items: center; }
.source-list dt { color: var(--dim); }
.source-list dd { overflow-wrap: anywhere; }
.site-footer { border-top: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 0; color: var(--dim); font-size: 13px; }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .monster-card, .skill-row, .element-option, .segment, .region-card {
    transition: border-color 160ms ease-out, background-color 160ms ease-out;
  }
}
@media (max-width: 1080px) {
  .directory-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 14px; }
  .directory-tools { grid-template-columns: minmax(0, 1fr) auto; }
  .filters { padding: 12px; }
  .monster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 810px) {
  .header-inner { flex-wrap: wrap; padding: 8px 0 0; gap: 4px 8px; }
  .navigation { order: 3; width: 100%; min-height: 44px; gap: 3px 14px; flex-wrap: wrap; }
  .navigation a { min-height: 44px; }
  .site-main { padding-top: 16px; }
  .hero { min-height: 176px; margin-bottom: 22px; }
  .hero-copy { width: min(66%, 480px); padding: 24px 18px; }
  .hero h1 { font-size: clamp(29px, 5.3vw, 42px); }
  .hero-copy p { font-size: 14px; }
  .scene-fire { right: 5%; bottom: 18px; }
  .scene-nature { right: 19%; bottom: 16px; }
  .scene-light { right: 19%; bottom: 99px; }
  .section-heading { margin-bottom: 13px; }
  .section-heading h2 { font-size: 24px; }
  .directory-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .directory-tools { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .filters { padding: 0 10px; }
  .filter-head { margin: 0; }
  .filter-head h3 { display: none; }
  .filter-toggle { display: flex; flex: 1; gap: 8px; align-items: center; min-height: 44px; background: transparent; padding: 0; font-size: 13px; font-weight: 650; text-align: left; }
  .filter-count { color: var(--accent); font-variant-numeric: tabular-nums; }
  .filter-toggle::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: -3px 3px 0 auto; }
  .filter-toggle[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 3px; }
  .filter-head .text-button { min-height: 44px; padding-inline: 7px; }
  .filter-head:has([aria-expanded="false"]) .text-button { display: none; }
  .filter-head:has([aria-expanded="false"]) + #filter-fields { display: none; }
  #filter-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--hairline); padding: 10px 0; }
  #filter-fields .filter-caption, #filter-fields .element-options { grid-column: 1 / -1; margin: 0; }
  #filter-fields .element-options { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  #filter-fields .select-field + .select-field { margin-top: 0; }
  .element-option, .select-field select, .sort-field select { min-height: 44px; }
  .element-option i { margin-right: 4px; }
  .all-element { grid-column: auto; }
  .region-grid, .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-heading { padding: 0; }
}
@media (max-width: 510px) {
  .brand { gap: 6px; }
  .brand strong { font-size: 14px; }
  .language-select select { max-width: min(42vw, 150px); }
  .navigation { column-gap: 12px; }
  .navigation a { font-size: 13px; }
  html:not(:lang(zh), :lang(ko), :lang(ja)) .navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 8px;
  }
  html:not(:lang(zh), :lang(ko), :lang(ja)) .navigation a { justify-content: center; }
  .hero { min-height: 154px; }
  .hero-copy { width: 100%; padding: 16px 13px 19px; }
  .hero h1 { font-size: clamp(26px, 7.4vw, 39px); max-width: 13ch; }
  .hero-copy p { max-width: 24ch; font-size: 13px; }
  .hero::after { background: linear-gradient(90deg, #0b0d16 2%, #0b0d16f2 35%, #0b0d1694 60%, transparent 84%); }
  .scene-mountains { background-size: 490px auto, 520px auto, 440px auto; background-position: right bottom -20px, right bottom, right bottom 10px; }
  .scene-ground { background-size: 570px auto; }
  .scene-fire { width: 64px; right: 4%; bottom: 22px; }
  .scene-nature { width: 76px; right: 18%; bottom: 14px; }
  .scene-light { width: 36px; right: 19%; bottom: 84px; }
  .segment { padding-inline: 8px; }
  .search-field input { font-size: 16px; }
  .search-field kbd { display: none; }
  #filter-fields .element-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .monster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .monster-art { height: 108px; }
  .monster-art .portrait { height: 70px; margin-top: 18px; }
  .monster-info { padding-inline: 9px; }
  .achievement-grid { grid-template-columns: minmax(0, 1fr); }
  .section-tools .select-field, .section-tools .select-field:nth-child(2) { min-width: min(100%, 170px); flex: 1; }
  .skill-row { grid-template-columns: 49px minmax(0, 1fr) auto; gap: 8px; }
  .skill-thumb .portrait { width: 43px; }
  .wave { grid-template-columns: 1fr; }
}

/* Shared shell and reading layouts */
:root { scroll-padding-top: 5rem; }
.wiki-masthead { gap: 18px; min-height: 68px; }
.wiki-masthead .brand strong { font-size: 16px; }
.wiki-masthead .brand strong span, .wiki-hero h1 span { color: var(--accent); }
.wiki-navigation { gap: clamp(11px, 1.2vw, 18px); }
.wiki-navigation a { min-height: 44px; font-size: 14px; line-height: 1.25; }
.language-menu { position: relative; flex: 0 0 auto; z-index: 2; }
.language-menu summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 11px;
  list-style: none; cursor: pointer; font-size: .875rem;
  border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--panel-deep);
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: ""; width: 6px; height: 6px; border: solid var(--accent); border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.language-menu[open] summary { border-color: var(--accent); }
.language-links {
  position: absolute; z-index: 2; min-width: 175px; top: calc(100% + 6px); right: 0;
  padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-panel);
  background: var(--panel); box-shadow: 0 8px 22px #0009;
}
.language-links a { display: flex; align-items: center; min-height: 44px; padding: 5px 10px; font-size: .875rem; }
.language-links a:hover, .language-links a[aria-current] { background: var(--panel-deep); color: var(--accent); }
.breadcrumb {
  display: flex; gap: 5px 12px; flex-wrap: wrap; margin: 0 0 21px;
  align-items: baseline; color: var(--muted); font-size: .875rem;
}
.breadcrumb :is(a, span) { overflow-wrap: anywhere; }
.breadcrumb a { text-decoration: underline; text-decoration-color: var(--beige); text-underline-offset: 4px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb > :not(:first-child)::before { content: "/"; margin-right: 12px; color: var(--beige); }
.section-heading h1, .detail-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.13; letter-spacing: -.032em;
  text-wrap: balance; overflow-wrap: anywhere;
}
.section-heading p { max-width: 65ch; margin-top: 9px; }
.site-footer { gap: 16px; flex-wrap: wrap; }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.site-footer .footer-brand { color: var(--text); text-decoration: none; }
.site-footer a:focus-visible, .site-footer a:hover { color: var(--accent); }
.guide-jumps {
  display: flex; flex-wrap: wrap; gap: 0 20px; border-block: 1px solid var(--hairline); margin: 0 0 20px;
}
.guide-jumps a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
.guide-jumps a:is(:hover, [aria-current]) { color: var(--accent); }
.tool-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; margin-bottom: 12px; }
.tool-links a { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; font-size: .875rem; }
.calc-intro .tool-links { margin-bottom: 0; }
.adventure-atlas, .arena-atlas { display: grid; gap: 8px 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.atlas-region, .atlas-arena { border-top: 1px solid var(--border); padding: 20px 0; min-width: 0; }
.atlas-region > div:last-child { padding: 14px 0 0; }
.atlas-region h2, .atlas-arena h2 { font-size: 1.25rem; }
.atlas-art { height: 100px; border-radius: var(--radius-control); background: var(--panel) var(--region-image) center / cover; image-rendering: pixelated; }
.stage-links, .floor-links { list-style: none; margin: 9px 0 0; padding: 0; }
.stage-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.stage-links a {
  display: flex; align-items: center; gap: 10px; min-height: 42px; border-bottom: 1px solid var(--hairline);
  color: var(--text); font-size: .875rem; overflow-wrap: anywhere;
}
.stage-links span { flex: 0 0 35px; color: var(--muted); font-variant-numeric: tabular-nums; }
.floor-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 5px; }
.floor-links a { display: grid; place-items: center; min-height: 44px; border-radius: var(--radius-control); border: 1px solid var(--hairline); background: var(--panel); }
.stage-links a:hover, .floor-links a:hover { color: var(--accent); border-color: var(--accent); }
.site-main .section-heading + .section-tools { margin-top: 16px; }

/* The only illustrated entrance is the Wiki homepage. */
.wiki-hero { min-height: 310px; margin-bottom: 0; border-color: var(--hairline); }
.wiki-hero::after { background: linear-gradient(90deg, #0b0d16 2%, #0b0d16f5 29%, #0b0d16b3 53%, transparent 81%); }
.wiki-hero .hero-copy { width: min(700px, 64%); padding: clamp(24px, 4vw, 54px); }
.wiki-hero h1 { font-size: clamp(35px, 5vw, 70px); max-width: 14ch; text-wrap: balance; }
.wiki-hero .hero-copy p { max-width: 45ch; color: var(--text); }
.wiki-hero .scene-nature { right: 19%; bottom: 34px; width: clamp(110px, 17vw, 220px); }
.wiki-hero .scene-light { right: 31%; bottom: 147px; width: clamp(43px, 7vw, 96px); }
.wiki-hero .scene-fire { right: 6%; bottom: 43px; width: clamp(86px, 12vw, 152px); }
.hero-search { display: flex; gap: 4px; max-width: 455px; margin-top: 17px; padding: 4px; border: 1px solid var(--beige); border-radius: var(--radius-control); background: var(--panel-deep); }
.hero-search input { min-width: 0; width: 100%; min-height: 44px; padding: 0 8px; border: 0; background: transparent; }
.hero-search input::placeholder { color: var(--muted); opacity: 1; }
.hero-search button, .action-link { min-height: 44px; padding: 0 15px; background: var(--accent); color: var(--page); font-weight: 700; border-radius: var(--radius-control); }
.hero-search button { flex: 0 0 auto; white-space: nowrap; }
.hero-search button:hover, .action-link:hover { background: var(--text); }
.home-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 32px; column-gap: 24px; }
.home-index a {
  min-width: 0; position: relative; display: grid; align-content: center; min-height: 76px;
  padding: 10px 26px 10px 0; border-bottom: 1px solid var(--hairline); gap: 4px;
  font-size: .875rem; overflow-wrap: anywhere;
}
.home-index a:hover strong, .home-section-title a:hover { color: var(--accent); }
.home-index a strong { font-size: 1rem; }
.home-index a span:nth-child(2) { color: var(--muted); }
.home-index a span:last-child { position: absolute; right: 2px; top: 50%; color: var(--accent); transform: translateY(-50%); transition: translate 180ms ease-out; }
.home-index a:hover span:last-child { translate: 3px; }
.home-section-title { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.home-section-title h2 { font-size: 1.25rem; }
.home-section-title a { color: var(--muted); font-size: .875rem; }
.home-monsters ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.home-monsters li { min-width: 0; }
.home-monsters li a { display: grid; justify-items: center; align-content: start; gap: 6px; height: 100%; padding: 8px; border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--panel); text-align: center; font-size: .875rem; overflow-wrap: anywhere; }
.home-monsters li a:hover { border-color: var(--accent); color: var(--accent); }
.home-monsters img { object-fit: contain; image-rendering: pixelated; }
@media (max-width: 1180px) {
  .wiki-masthead { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding-top: 6px; }
  .wiki-navigation { grid-area: 2 / 1 / auto / span 2; justify-content: space-between; min-height: 44px; }
  .wiki-masthead .language-menu { grid-column: 2; grid-row: 1; }
}
@media (max-width: 780px) {
  .wiki-masthead :is(.wiki-navigation, .wiki-navigation a) { min-height: 44px; }
  .wiki-masthead .wiki-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 0 6px; }
  .wiki-navigation a { justify-content: center; }
  .adventure-atlas, .arena-atlas { grid-template-columns: 1fr; }
  .wiki-hero { min-height: 264px; margin-bottom: 0; }
  .wiki-hero .hero-copy { width: min(510px, 75%); }
  .home-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 17px; }
  .home-monsters ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .wiki-masthead .brand { gap: 6px; }
  .wiki-masthead .brand-icon { width: 29px; height: 30px; }
  .wiki-masthead .brand strong { font-size: 14px; }
  .wiki-masthead .language-menu summary { padding-inline: 7px; gap: 5px; line-height: 1.25; max-width: 110px; }
  .wiki-masthead .wiki-navigation a { font-size: .8125rem; overflow-wrap: anywhere; }
  .wiki-hero .hero-copy { width: 100%; padding: 18px 15px; }
  .wiki-hero .hero-copy p { max-width: 23ch; }
  .wiki-hero::after { background: linear-gradient(90deg, #0b0d16 2%, #0b0d16e8 42%, #0b0d1680 77%, #0b0d1635); }
  .wiki-hero .scene-nature { display: none; }
  .wiki-hero .scene-light { display: none; }
  .wiki-hero .scene-fire { right: 5%; bottom: 53px; width: 78px; }
  .hero-search button { padding: 0 9px; }
  .hero-search input { font-size: .875rem; }
  .breadcrumb { margin-bottom: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-index a span:last-child { transition: none; }
}
