﻿:root {
  --bg: #b37a43;
  --stone: #6c4320;
  --stone-2: #875527;
  --paper: #e2b878;
  --paper-2: #c99255;
  --ink: #2d2115;
  --muted: #735f42;
  --gold: #c99535;
  --gold-2: #875d22;
  --crimson: #7a241d;
  --green: #244f37;
  --line: rgba(101, 55, 20, 0.36);
  --shadow: 0 18px 50px rgba(78, 42, 15, 0.28);
  --parchment-url: url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/parchment-01.jpg");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #352415;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 238, 198, 0.22), transparent 20rem),
    radial-gradient(circle at 18% 68%, rgba(104, 54, 20, 0.22), transparent 24rem),
    linear-gradient(180deg, rgba(42, 28, 16, 0.9), rgba(42, 28, 16, 0.76));
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.38;
  background:
    radial-gradient(circle at 12% 18%, rgba(73, 37, 13, 0.34), transparent 12rem),
    radial-gradient(circle at 32% 58%, rgba(255, 238, 190, 0.28), transparent 16rem),
    radial-gradient(circle at 88% 10%, rgba(76, 39, 15, 0.28), transparent 15rem),
    linear-gradient(112deg, transparent 0 35%, rgba(86, 54, 22, 0.34) 35.2% 35.45%, transparent 35.8%),
    linear-gradient(42deg, transparent 0 62%, rgba(86, 54, 22, 0.26) 62.1% 62.32%, transparent 62.8%),
    linear-gradient(157deg, transparent 0 48%, rgba(86, 54, 22, 0.22) 48.1% 48.35%, transparent 48.8%);
  mix-blend-mode: multiply;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(87, 42, 14, 0.18) 74%, rgba(53, 24, 7, 0.42) 100%),
    linear-gradient(0deg, rgba(255, 241, 202, 0.12), transparent 24%, transparent 74%, rgba(65, 29, 8, 0.22));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100vh;
  padding: 18px;
}

.wiki-frame {
  position: relative;
  width: min(1180px, 100%);
  max-width: 100%;
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(98, 61, 29, 0.72);
  background:
    linear-gradient(180deg, rgba(248, 241, 224, 0.84), rgba(212, 182, 139, 0.78)),
    var(--parchment-url) center / cover no-repeat;
  box-shadow: 0 24px 60px rgba(24, 16, 10, 0.34), inset 0 0 0 1px rgba(255, 243, 214, 0.52);
}

.wiki-frame::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.26;
  background:
    radial-gradient(circle at 18% 18%, rgba(75, 37, 12, 0.24), transparent 18rem),
    radial-gradient(circle at 74% 64%, rgba(255, 230, 182, 0.16), transparent 20rem),
    linear-gradient(118deg, transparent 0 29%, rgba(90, 55, 18, 0.32) 29.2% 29.45%, transparent 29.8%),
    linear-gradient(24deg, transparent 0 71%, rgba(90, 55, 18, 0.24) 71.1% 71.35%, transparent 71.8%),
    radial-gradient(circle at 70% 20%, rgba(105, 73, 32, 0.16), transparent 18rem);
  mix-blend-mode: multiply;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

.home-page {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.home-hero {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(115, 74, 34, 0.62);
  background: #402c1a;
  box-shadow:
    0 16px 32px rgba(34, 22, 11, 0.24),
    inset 0 0 0 4px rgba(255, 237, 185, 0.16);
}

.home-hero::before {
  position: absolute;
  inset: 10px;
  z-index: 1;
  content: "";
  border: 1px solid rgba(255, 224, 147, 0.26);
  pointer-events: none;
}

.home-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(35, 23, 12, 0.14), rgba(35, 23, 12, 0.56)),
    linear-gradient(90deg, rgba(49, 32, 16, 0.54), rgba(49, 32, 16, 0.08) 28%, rgba(49, 32, 16, 0.08) 72%, rgba(49, 32, 16, 0.54));
}

.hero-scene {
  position: absolute;
  inset: 0;
}

.hero-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 40px;
  text-align: center;
  color: #fff0c2;
  min-width: 0;
  overflow: hidden;
}

.hero-content h1 {
  width: min(820px, 100%);
  min-width: 0;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-shadow:
    0 3px 0 rgba(79, 40, 12, 0.78),
    0 12px 28px rgba(0, 0, 0, 0.42);
}

.hero-content h1 span {
  display: inline-block;
}

.home-search,
.list-tools {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(247, 239, 221, 0.94), rgba(214, 184, 140, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48), 0 8px 18px rgba(64, 41, 16, 0.12);
}

.home-search {
  grid-template-columns: minmax(0, 1fr) 124px;
}

.list-tools {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 14px;
}

.list-search-row,
.list-filter-row {
  display: grid;
  min-width: 0;
}

.list-search-row {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.list-filter-row {
  grid-template-columns: 1fr;
  border-top: 1px solid rgba(117, 83, 35, 0.3);
}

.list-tools.filter-count-2 .list-filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-search input,
.list-tools input,
.list-tools select {
  min-width: 0;
  height: 48px;
  border: 0;
  border-right: 1px solid rgba(117, 83, 35, 0.36);
  background: transparent;
  color: var(--ink);
  outline: none;
}

.home-search input,
.list-tools input {
  padding: 0 16px;
}

.list-filter-row select:last-of-type {
  border-right: 0;
}

.list-tools select {
  padding: 0 34px 0 12px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold-2) 50%) right 16px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--gold-2) 50%, transparent 50%) right 9px center / 7px 7px no-repeat;
  font-weight: 800;
}

.reset-button,
.back-button {
  border: 1px solid rgba(108, 72, 40, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 248, 233, 0.86), rgba(214, 186, 142, 0.94));
  color: #3d2613;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 244, 214, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 220, 0.42);
}

.reset-button:hover,
.back-button:hover,
.menu-card:hover,
.item-button:hover,
.result-card:hover {
  filter: brightness(1.06);
}

.menu-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.menu-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  min-height: 104px;
  padding: 16px 72px 18px;
  border: 1px solid rgba(108, 72, 40, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.88), rgba(210, 183, 140, 0.96));
  color: #3e2714;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(24px, 2.1vw, 34px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow:
    0 1px 0 rgba(255, 247, 224, 0.92),
    0 2px 10px rgba(48, 30, 16, 0.14);
  box-shadow:
    0 10px 22px rgba(41, 26, 14, 0.24),
    inset 0 0 0 1px rgba(255, 245, 221, 0.56);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.menu-card::before {
  position: absolute;
  inset: 7px 58px;
  content: "";
  border: 1px solid rgba(111, 71, 39, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 36%, rgba(72, 47, 24, 0.08) 100%);
  pointer-events: none;
}

.menu-card::after {
  position: absolute;
  inset: 7px;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(70, 44, 24, 0.98), rgba(181, 151, 111, 0.96) 50%, rgba(78, 48, 26, 0.86)) left center / 58px 82% no-repeat,
    linear-gradient(-90deg, rgba(70, 44, 24, 0.98), rgba(181, 151, 111, 0.96) 50%, rgba(78, 48, 26, 0.86)) right center / 58px 82% no-repeat,
    radial-gradient(circle at 24px 50%, rgba(62, 38, 18, 0.98) 0 13px, rgba(208, 180, 136, 0.9) 13px 17px, transparent 17px) left center / 58px 78% no-repeat,
    radial-gradient(circle at calc(100% - 24px) 50%, rgba(62, 38, 18, 0.98) 0 13px, rgba(208, 180, 136, 0.9) 13px 17px, transparent 17px) right center / 58px 78% no-repeat;
  opacity: 0.94;
}

.menu-card span {
  position: relative;
  z-index: 1;
}

.detail-section::before,
.identity-card::before {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(255, 226, 158, 0.16);
  pointer-events: none;
}

.menu-card:hover,
.menu-card:focus-visible {
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(255, 226, 158, 0.28);
  transform: translateY(-3px);
}

.menu-card small {
  display: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
  color: #6b3f16;
  text-shadow: 0 1px 0 rgba(255, 239, 190, 0.72);
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.section-title span {
  color: #8b6328;
  font-weight: 800;
}

.result-grid,
.card-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(216, 173, 85, 0.46);
  background:
    linear-gradient(180deg, rgba(250, 238, 204, 0.98), rgba(224, 198, 143, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.result-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.result-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.result-card strong,
.result-card small {
  display: block;
}

.result-card small {
  margin-top: 3px;
  color: var(--muted);
}

.sub-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: #5d3413;
}

.sub-header .back-button {
  min-width: 72px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(216, 173, 85, 0.56);
}

.sub-header h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 239, 190, 0.65);
}

.eyebrow {
  margin: 0 0 5px;
  color: #cfa957;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.item-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.item-button {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  min-height: auto;
  border: 1px solid rgba(216, 173, 85, 0.5);
  background:
    linear-gradient(180deg, rgba(214, 155, 86, 0.64), rgba(114, 62, 25, 0.74));
  color: #ffe7a3;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 158, 0.12);
}

.item-art {
  display: grid;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 8px;
}

.identity-media img,
.ability-icon img,
.cost-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.item-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.list-page-units .item-button {
  border: 0;
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background:
    linear-gradient(145deg, rgba(255, 222, 139, 0.92), rgba(94, 55, 24, 0.94));
  box-shadow: none;
}

.list-page-units .item-button::before {
  position: absolute;
  inset: 4px;
  z-index: 0;
  content: "";
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 235, 176, 0.34), transparent 46%),
    linear-gradient(180deg, rgba(154, 95, 39, 0.72), rgba(55, 34, 19, 0.92));
}

.list-page-units .item-art {
  inset: 5px;
  z-index: 1;
  padding: 0;
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
}

.list-page-units .item-art img {
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  transform: scale(1.08);
}

.list-page-units .card-grid {
  grid-template-columns: repeat(auto-fit, minmax(128px, 148px));
  justify-content: center;
  gap: 8px 6px;
  padding-bottom: 36px;
}

.list-page-units .item-card:nth-child(even) {
  transform: translateY(32px);
}

.list-page-units .item-copy strong {
  z-index: 2;
  bottom: 14px;
}

.item-copy strong {
  display: block;
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  padding: 0 6px;
  color: #ffe18d;
  text-shadow:
    0 2px 0 rgba(54, 28, 9, 0.9),
    0 0 8px rgba(0, 0, 0, 0.62);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span,
.pill-list span {
  border: 1px solid rgba(122, 36, 29, 0.32);
  background: rgba(255, 242, 205, 0.72);
  color: #6b251b;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.detail-composition {
  display: grid;
  gap: 16px;
}

.detail-composition-laws,
.detail-composition-laws .detail-sections {
  grid-template-columns: 1fr;
}

.detail-composition-heroes .detail-sections {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.identity-card,
.detail-section {
  position: relative;
  border: 1px solid rgba(216, 173, 85, 0.5);
  background:
    linear-gradient(180deg, rgba(250, 222, 169, 0.92), rgba(213, 156, 87, 0.84));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36), 0 4px 0 rgba(113, 77, 27, 0.14);
}

.identity-card {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

.identity-media {
  display: grid;
  min-height: 224px;
  place-items: center;
}

.identity-media img {
  width: 100%;
  max-height: 250px;
}

.identity-copy {
  min-width: 0;
}

.identity-copy h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.detail-subtitle {
  margin-bottom: 12px;
  color: #6e321e;
  font-weight: 900;
}

.detail-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-section {
  min-width: 0;
  padding: 16px;
}

.detail-section-wide {
  grid-column: 1 / -1;
}

.unit-stats-section .fact-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.detail-section h2 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(117, 83, 35, 0.32);
  color: #4d2f12;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 22px;
}

.detail-section p {
  color: var(--muted);
  line-height: 1.78;
}

.pipe-text-list {
  display: grid;
  gap: 6px;
}

.pipe-text-row {
  display: grid;
  grid-template-columns: repeat(var(--pipe-columns, 3), minmax(0, 1fr));
  margin: 0;
}

.pipe-text-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 2px 12px;
  white-space: nowrap;
}

.pipe-text-item:first-child {
  padding-left: 0;
}

.pipe-text-item + .pipe-text-item {
  border-left: 1px solid rgba(92, 67, 43, 0.42);
}

.pipe-text-item b {
  color: #5c3d20;
  font-weight: 900;
}

.pipe-text-item strong {
  min-width: 0;
  color: #2e2115;
  font-weight: 900;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fact-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.fact-card {
  min-width: 0;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.6);
  padding: 9px;
}

.fact-card span {
  display: block;
  color: #7a6040;
  font-size: 12px;
  font-weight: 900;
}

.fact-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  line-height: 1.42;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cost-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.6);
  padding: 10px;
}

.cost-card img,
.cost-card .fallback-icon {
  width: 46px;
  height: 46px;
}

.identity-cost {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(117, 83, 35, 0.28);
}

.identity-cost h2 {
  margin: 0 0 9px;
  color: #4d2f12;
  font-size: 17px;
}

.identity-cost .cost-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ability-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.6);
  padding: 10px;
}

.ability-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
}

.ability-card h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.ability-card p {
  margin-bottom: 0;
  white-space: pre-line;
}

.plain-list,
.spell-effect-list,
.level-effect-list {
  display: grid;
  gap: 8px;
}

.plain-list p,
.spell-effect-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.78;
}

.compact-list {
  gap: 5px;
}

.level-effect-list article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.58);
  padding: 10px;
}

.level-effect-list span {
  color: #6b3f16;
  font-weight: 900;
}

.level-effect-list p {
  margin: 0;
}

.hero-initial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-initial-grid article,
.subclass-card,
.entity-card,
.reward-card {
  min-width: 0;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.58);
  padding: 10px;
}

.hero-initial-grid h3,
.subclass-card h3,
.combat-formation-area h3 {
  margin: 0 0 8px;
  color: #4d2f12;
  font-size: 16px;
}

.inline-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.inline-stat-grid span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  color: var(--muted);
}

.inline-stat-grid b {
  color: #6b3f16;
}

.growth-stat-list {
  display: grid;
  gap: 8px;
}

.growth-stat-list p {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid rgba(117, 83, 35, 0.24);
  background: rgba(255, 247, 222, 0.5);
  padding: 9px 10px;
}

.growth-stat-list span,
.growth-stat-list b {
  color: #6b3f16;
}

.growth-stat-list strong {
  color: #3d2613;
}

.probability-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  color: var(--ink);
}

.probability-table th,
.probability-table td {
  border: 1px solid rgba(117, 83, 35, 0.28);
  padding: 9px;
  text-align: left;
}

.probability-table th {
  background: rgba(116, 65, 25, 0.24);
  color: #4d2f12;
}

.probability-table-multi {
  table-layout: fixed;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.entity-card {
  display: grid;
  grid-template-rows: 78px auto;
  gap: 8px;
  align-items: center;
  justify-items: center;
  color: var(--ink);
  text-align: center;
}

.entity-card:disabled {
  cursor: default;
}

.entity-card img,
.entity-card .fallback-icon {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.entity-card strong {
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.portrait-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.portrait-grid .entity-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  grid-template-rows: 74px auto;
  padding: 4px;
}

.portrait-grid .entity-card img,
.portrait-grid .entity-card .fallback-icon {
  width: 74px;
  height: 74px;
}

.portrait-grid .entity-card strong {
  color: #4d2f12;
  font-size: 13px;
  text-shadow: 0 1px 0 rgba(255, 239, 190, 0.7);
}

.initial-entity-grid {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}

.initial-entity-grid .entity-card {
  grid-template-rows: 52px auto;
}

.initial-entity-grid .entity-card img,
.initial-entity-grid .entity-card .fallback-icon {
  width: 52px;
  height: 52px;
}

.hero-peer-grid {
  grid-template-columns: repeat(3, minmax(0, 112px));
  justify-content: start;
}

.hero-peer-grid .entity-card strong {
  font-size: 12px;
}

.subclass-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.subclass-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
}

.subclass-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
}

.subclass-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.combat-panel {
  display: grid;
  gap: 14px;
}

.combat-summary {
  color: #4d2f12;
  font-weight: 900;
}

.combat-summary p {
  margin-bottom: 10px;
  color: #4d2f12;
}

.combat-enemy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 86px));
  gap: 8px;
}

.combat-enemy-grid .entity-card {
  grid-template-rows: 58px auto;
  padding: 2px;
}

.combat-enemy-grid .entity-card img,
.combat-enemy-grid .entity-card .fallback-icon {
  width: 58px;
  height: 58px;
}

.combat-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.combat-controls > div {
  display: grid;
  gap: 8px;
}

.combat-controls span {
  color: #6b3f16;
  font-weight: 900;
}

.combat-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.combat-button-row button {
  min-width: 48px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(108, 72, 40, 0.72);
  background: linear-gradient(180deg, rgba(255, 248, 233, 0.86), rgba(214, 186, 142, 0.94));
  color: #3d2613;
  font-size: 13px;
  font-weight: 900;
}

.combat-button-row button.active {
  border-color: rgba(255, 218, 118, 0.86);
  background: linear-gradient(180deg, rgba(126, 39, 29, 0.94), rgba(79, 35, 20, 0.98));
  color: #ffe8a1;
  box-shadow: 0 0 0 2px rgba(255, 211, 101, 0.18), inset 0 0 18px rgba(255, 218, 118, 0.22);
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.reward-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.reward-icon,
.reward-icon img,
.reward-icon .fallback-icon {
  width: 58px;
  height: 58px;
}

.reward-icon img {
  object-fit: contain;
}

.reward-card strong,
.reward-card span {
  display: block;
}

.reward-card span {
  margin-top: 4px;
  color: #6b3f16;
  font-weight: 900;
}

.combat-formation-area {
  min-width: 0;
  overflow: hidden;
}

.combat-formation-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.formation-board {
  display: grid;
  gap: 0;
  width: max-content;
  max-width: none;
  overflow: visible;
  padding: 8px 0;
}

.formation-row {
  display: flex;
  gap: 2px;
  min-width: max-content;
}

.formation-row:nth-child(even) {
  margin-left: 28px;
}

.formation-cell {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  background: linear-gradient(180deg, rgba(111, 96, 55, 0.72), rgba(55, 73, 40, 0.82));
}

.formation-cell.empty {
  opacity: 0.36;
}

.formation-cell.filled {
  background: linear-gradient(180deg, rgba(255, 220, 130, 0.92), rgba(88, 42, 20, 0.98));
}

.formation-cell img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.formation-cell b {
  position: absolute;
  right: 8px;
  bottom: 6px;
  min-width: 18px;
  color: #ffe8a1;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px #1b1009;
}

.effect-list {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
  line-height: 1.8;
}

.effect-list li + li {
  margin-top: 7px;
}

.set-effect-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.8;
}

.set-effect-list p {
  margin: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.set-title {
  margin-bottom: 12px;
  color: #4d2f12;
  font-size: 20px;
  font-weight: 900;
}

.set-part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.set-part-card {
  display: grid;
  grid-template-rows: 96px auto;
  gap: 8px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  border: 1px solid rgba(117, 83, 35, 0.28);
  background: rgba(255, 247, 222, 0.55);
  padding: 9px;
  text-align: center;
}

.set-part-card img,
.set-part-card .fallback-icon {
  width: 100%;
  height: 96px;
  object-fit: contain;
}

.set-part-card strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.empty-field {
  margin-bottom: 0;
  color: #8b7656;
}

.fallback-icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, var(--crimson), var(--green) 54%, var(--gold-2));
  color: #fff4cd;
  font-size: 28px;
  font-weight: 900;
}

.fallback-icon.large {
  height: 240px;
  font-size: 68px;
}

.empty-note {
  grid-column: 1 / -1;
  padding: 24px;
  color: #e2c983;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Darker parchment shell with transparent stone panels. */
body {
  background:
    linear-gradient(180deg, rgba(24, 17, 10, 0.16), rgba(31, 19, 10, 0.22)),
    radial-gradient(circle at 50% 12%, rgba(255, 219, 151, 0.1), transparent 24rem),
    var(--parchment-url) center top / cover fixed no-repeat;
}

body::before {
  opacity: 0.22;
  background:
    radial-gradient(circle at 8% 18%, rgba(38, 21, 10, 0.52), transparent 19rem),
    radial-gradient(circle at 92% 16%, rgba(38, 21, 10, 0.5), transparent 18rem),
    radial-gradient(circle at 20% 78%, rgba(26, 14, 7, 0.44), transparent 20rem),
    linear-gradient(112deg, transparent 0 34%, rgba(61, 38, 18, 0.36) 34.2% 34.45%, transparent 34.9%),
    linear-gradient(40deg, transparent 0 63%, rgba(61, 38, 18, 0.32) 63.1% 63.35%, transparent 63.9%);
}

body::after {
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(46, 23, 9, 0.1) 82%, rgba(18, 10, 4, 0.26) 100%),
    linear-gradient(0deg, rgba(255, 230, 177, 0.03), transparent 22%, transparent 74%, rgba(20, 10, 4, 0.1));
}

.wiki-frame {
  border-color: rgba(80, 57, 37, 0.56);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(233, 210, 164, 0.16), 0 22px 72px rgba(15, 9, 4, 0.34);
}

.wiki-frame::before {
  opacity: 0.18;
  background:
    linear-gradient(118deg, transparent 0 29%, rgba(95, 68, 35, 0.5) 29.2% 29.42%, transparent 29.8%),
    linear-gradient(24deg, transparent 0 71%, rgba(88, 60, 31, 0.44) 71.1% 71.34%, transparent 71.8%);
}

.home-search,
.list-tools,
.result-card,
.reset-button,
.back-button,
.item-button,
.identity-card,
.detail-section,
.fact-card,
.cost-card,
.ability-card,
.hero-initial-grid article,
.level-effect-list article,
.reward-card,
.growth-stat-list p,
.set-part-card {
  border-color: rgba(85, 63, 42, 0.52);
  background:
    linear-gradient(180deg, rgba(196, 169, 124, 0.48), rgba(116, 82, 47, 0.36));
  box-shadow: inset 0 0 0 1px rgba(255, 239, 198, 0.14), 0 8px 22px rgba(30, 18, 8, 0.14);
}

.menu-card,
.identity-card,
.detail-section {
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(184, 154, 108, 0.46), rgba(96, 68, 40, 0.34));
}

.menu-card::before {
  position: absolute;
  inset: -42px;
  z-index: 0;
  content: "";
  border: 0;
  pointer-events: none;
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tl.png") left top / 132px 132px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tr.png") right top / 132px 132px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-bl.png") left bottom / 132px 132px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-br.png") right bottom / 132px 132px no-repeat;
}

.identity-card::before,
.detail-section::before {
  position: absolute;
  inset: -38px;
  z-index: 0;
  content: "";
  border: 0;
  pointer-events: none;
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tl.png") left top / 120px 120px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tr.png") right top / 120px 120px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-bl.png") left bottom / 120px 120px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-br.png") right bottom / 120px 120px no-repeat;
}

.identity-card > *,
.detail-section > * {
  position: relative;
  z-index: 1;
}

.menu-card {
  border-color: rgba(86, 64, 42, 0.66);
  color: #3a2a1b;
  text-shadow: 0 1px 0 rgba(241, 224, 180, 0.62), 0 8px 18px rgba(23, 13, 5, 0.2);
}

.menu-card::after {
  display: none;
}

.home-page .menu-card {
  padding-right: 34px;
  padding-left: 34px;
}

.home-page .menu-card::before {
  display: block;
}

.home-page .menu-card::after {
  display: none;
}

.item-button {
  background:
    linear-gradient(180deg, rgba(152, 116, 72, 0.42), rgba(66, 45, 27, 0.62));
}

.list-page-units .item-button {
  background:
    linear-gradient(145deg, rgba(190, 159, 103, 0.52), rgba(60, 43, 28, 0.7));
}

.list-page-units .item-button::before {
  background:
    radial-gradient(circle at 50% 37%, rgba(235, 208, 144, 0.22), transparent 45%),
    linear-gradient(180deg, rgba(115, 78, 42, 0.52), rgba(35, 25, 17, 0.76));
}

.detail-section h2,
.sub-header h1,
.section-title h2 {
  color: #3f2c19;
}

.detail-section p,
.plain-list p,
.spell-effect-list p,
.effect-list,
.set-effect-list,
.result-card small {
  color: #4f3c27;
}

.fact-card,
.cost-card,
.ability-card,
.level-effect-list article,
.reward-card,
.growth-stat-list p,
.set-part-card {
  background: rgba(220, 197, 150, 0.3);
}

.subclass-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 4px;
}

.subclass-icon {
  width: 86px;
  height: 86px;
}

.initial-entity-grid .entity-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  grid-template-rows: 68px auto;
  padding: 2px;
}

.initial-entity-grid .entity-card img,
.initial-entity-grid .entity-card .fallback-icon {
  width: 68px;
  height: 68px;
}

.initial-entity-grid .entity-card strong {
  font-size: 12px;
}

.hero-peer-grid {
  grid-template-columns: repeat(3, 100px);
}

.hero-peer-grid .entity-card {
  grid-template-rows: 100px auto;
  width: 100px;
}

.hero-peer-grid .entity-card img,
.hero-peer-grid .entity-card .fallback-icon {
  width: 100px;
  height: 100px;
}

.probability-grid {
  display: grid;
  grid-template-columns: repeat(var(--probability-columns), minmax(0, 1fr));
  border-top: 1px solid rgba(92, 67, 43, 0.36);
  border-left: 1px solid rgba(92, 67, 43, 0.36);
}

.probability-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-right: 1px solid rgba(92, 67, 43, 0.36);
  border-bottom: 1px solid rgba(92, 67, 43, 0.36);
  background: rgba(222, 199, 153, 0.34);
  padding: 8px 10px;
}

.probability-grid span {
  color: #4b351f;
  font-weight: 800;
}

.probability-grid strong {
  color: #2e2115;
}

.relation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.relation-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(92, 67, 43, 0.36);
  background: rgba(222, 199, 153, 0.34);
  padding: 9px;
  color: var(--ink);
  text-align: left;
}

.relation-card:disabled {
  cursor: default;
}

.relation-icon,
.relation-icon img,
.relation-icon .fallback-icon {
  width: 62px;
  height: 62px;
}

.relation-icon img {
  object-fit: contain;
}

.relation-copy strong,
.relation-copy small {
  display: block;
}

.relation-copy strong {
  color: #3e2b19;
  line-height: 1.32;
}

.relation-copy small {
  margin-top: 4px;
  color: #66543c;
  font-size: 12px;
  line-height: 1.5;
}

.combat-reward-title {
  margin: 0 0 8px;
  color: #4d2f12;
  font-size: 16px;
}

.combat-formation-scroll {
  display: flex;
  justify-content: center;
  cursor: grab;
  scrollbar-width: none;
}

.combat-formation-scroll::-webkit-scrollbar {
  display: none;
}

.combat-formation-scroll.dragging {
  cursor: grabbing;
}

.formation-board {
  padding: 10px 16px;
}

.formation-row {
  gap: 0;
  height: 56px;
}

.formation-row:nth-child(even) {
  margin-left: 32px;
}

.formation-cell {
  width: 64px;
  height: 74px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(180deg, rgba(79, 72, 48, 0.42), rgba(38, 48, 32, 0.5));
}

.formation-cell.filled {
  background: linear-gradient(180deg, rgba(190, 159, 103, 0.58), rgba(58, 39, 24, 0.76));
}

.formation-cell img {
  width: 58px;
  height: 64px;
}

@media (min-width: 981px) {
  .list-page-units .card-grid {
    grid-template-columns: repeat(6, 154px);
    grid-auto-rows: 136px;
    gap: 0 8px;
    justify-content: center;
    padding: 8px 42px 68px 0;
  }

  .list-page-units .item-card {
    width: 154px;
  }

  .list-page-units .item-card:nth-child(even),
  .list-page-units .item-card:nth-child(3n + 2) {
    transform: none;
  }

  .list-page-units .item-card:nth-child(12n + 7),
  .list-page-units .item-card:nth-child(12n + 8),
  .list-page-units .item-card:nth-child(12n + 9),
  .list-page-units .item-card:nth-child(12n + 10),
  .list-page-units .item-card:nth-child(12n + 11),
  .list-page-units .item-card:nth-child(12n + 12) {
    transform: translateX(81px);
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .page {
    padding: 16px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid,
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .list-page-units .card-grid {
    grid-template-columns: repeat(3, minmax(0, 150px));
  }

  .list-page-units .item-card:nth-child(even) {
    transform: none;
  }

  .list-page-units .item-card:nth-child(3n + 2) {
    transform: translateY(24px);
  }

  .identity-card,
  .detail-sections,
  .detail-composition-laws {
    grid-template-columns: 1fr;
  }

  .detail-section-wide {
    grid-column: auto;
  }

  .fact-grid,
  .ability-grid,
  .hero-initial-grid,
  .subclass-grid,
  .combat-controls,
  .detail-composition-heroes .detail-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
  }

  .wiki-frame {
    width: 100%;
    min-height: 100vh;
    border: 0;
  }

  .home-hero,
  .hero-content {
    min-height: 260px;
  }

  .hero-content {
    padding: 22px;
  }

  .hero-content h1 {
    max-width: 320px;
    font-size: 27px;
  }

  .hero-content h1 span {
    display: block;
  }

  .home-search {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .list-tools {
    grid-template-columns: minmax(0, 1fr) 104px 66px;
  }

  .home-search input,
  .list-tools input,
  .list-tools select {
    height: 44px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 14px;
  }

  .list-tools select {
    padding-right: 24px;
    background:
      linear-gradient(45deg, transparent 50%, var(--gold-2) 50%) right 12px center / 6px 6px no-repeat,
      linear-gradient(135deg, var(--gold-2) 50%, transparent 50%) right 6px center / 6px 6px no-repeat;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .list-page-units .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding-bottom: 18px;
  }

  .list-page-units .item-card:nth-child(even) {
    transform: none;
  }

  .list-page-units .item-card:nth-child(3n + 2) {
    transform: translateY(16px);
  }

  .menu-card {
    min-height: 84px;
    padding: 14px 56px 16px;
    font-size: 21px;
  }

  .menu-card::before {
    inset: -30px;
    background-size: 98px 98px;
  }

  .menu-card::after {
    background-size: 44px 78%, 44px 78%, 44px 72%, 44px 72%;
  }

  .sub-header {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .sub-header .back-button {
    min-width: 64px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .item-button {
    aspect-ratio: 1 / 1;
  }

  .item-copy strong {
    right: 4px;
    bottom: 7px;
    left: 4px;
    padding: 0 3px;
    font-size: 12px;
  }

  .item-art {
    height: 100%;
  }

  .identity-card {
    padding: 14px;
  }

  .identity-media {
    min-height: 188px;
  }

  .identity-copy h1 {
    font-size: 30px;
  }

  .fact-grid,
  .ability-grid,
  .cost-grid,
  .hero-initial-grid,
  .subclass-grid,
  .combat-controls,
  .detail-composition-heroes .detail-sections {
    grid-template-columns: 1fr;
  }

  .combat-button-row {
    gap: 6px;
  }

  .combat-button-row button {
    min-width: 40px;
    min-height: 32px;
    padding: 0 6px;
    font-size: 11px;
  }

  .combat-enemy-grid {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  }

  .combat-formation-scroll {
    justify-content: flex-start;
  }

  .probability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    font-size: 12px;
  }

  .probability-grid article {
    gap: 5px;
    padding: 7px;
  }

  .relation-grid {
    grid-template-columns: 1fr;
  }

  .relation-card {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 7px;
  }

  .relation-icon,
  .relation-icon img,
  .relation-icon .fallback-icon {
    width: 54px;
    height: 54px;
  }

  .growth-stat-list p {
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto;
    gap: 7px;
    font-size: 13px;
  }

  .hero-peer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .level-effect-list article {
    grid-template-columns: 1fr;
  }

  .formation-cell {
    width: 52px;
    height: 60px;
  }

  .formation-row:nth-child(even) {
    margin-left: 26px;
  }

  .formation-cell img {
    width: 46px;
    height: 52px;
  }

  .unit-stats-section .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .identity-cost .cost-grid {
    grid-template-columns: 1fr;
  }

  .ability-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .ability-icon {
    width: 62px;
    height: 62px;
  }
}

/* Current visual pass: quieter scrollbars, lighter parchment, and aligned stone corners. */
html,
body,
.wiki-frame,
.page,
.combat-formation-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.wiki-frame::-webkit-scrollbar,
.page::-webkit-scrollbar,
.combat-formation-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.wiki-frame {
  background:
    linear-gradient(180deg, rgba(248, 241, 224, 0.5), rgba(212, 182, 139, 0.5)),
    transparent;
}

.identity-card::before,
.detail-section::before {
  inset: -18px;
  background-size: 86px 86px;
}

.home-page .menu-card::before {
  inset: -12px;
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tr.png") right top -4px / 84px 84px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-bl.png") left bottom -4px / 84px 84px no-repeat;
}

.home-page .menu-card {
  min-height: 92px;
  padding: 14px 28px 16px;
  font-size: clamp(22px, 1.9vw, 30px);
}

.list-tools {
  overflow: hidden;
  border-color: rgba(83, 58, 34, 0.62);
  background:
    linear-gradient(180deg, rgba(203, 179, 132, 0.5), rgba(104, 73, 43, 0.4));
}

.list-tools select {
  border-left: 1px solid rgba(91, 63, 34, 0.44);
  border-right: 1px solid rgba(91, 63, 34, 0.44);
  background:
    linear-gradient(45deg, transparent 50%, #5f3e1e 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, #5f3e1e 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(219, 195, 145, 0.58), rgba(112, 78, 43, 0.42));
  color: #372512;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 239, 198, 0.16);
}

.list-tools select:focus-visible {
  outline: 1px solid rgba(123, 80, 34, 0.7);
  outline-offset: -4px;
}

.list-tools select option {
  background: #d6bd88;
  color: #372512;
  font-weight: 800;
}

@media (max-width: 640px) {
  .home-page .menu-card {
    min-height: 76px;
    padding: 12px 24px 14px;
    font-size: 19px;
  }

  .identity-card::before,
  .detail-section::before {
    inset: -15px;
    background-size: 70px 70px;
  }

  .home-page .menu-card::before {
    inset: -9px;
    background:
      url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tr.png") right top -4px / 68px 68px no-repeat,
      url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-bl.png") left bottom -4px / 68px 68px no-repeat;
  }

  .list-tools select {
    padding-right: 24px;
    background:
      linear-gradient(45deg, transparent 50%, #5f3e1e 50%) right 12px center / 6px 6px no-repeat,
      linear-gradient(135deg, #5f3e1e 50%, transparent 50%) right 6px center / 6px 6px no-repeat,
      linear-gradient(180deg, rgba(219, 195, 145, 0.58), rgba(112, 78, 43, 0.42));
    font-size: 13px;
  }
}

/* V0.7.0: clearer parchment layer, denser data tables, and refined icon layouts. */
.wiki-frame {
  background:
    linear-gradient(180deg, rgba(248, 241, 224, 0.75), rgba(212, 182, 139, 0.75)),
    transparent;
}

.home-page .menu-card {
  background:
    linear-gradient(180deg, rgba(202, 177, 132, 0.58), rgba(92, 66, 41, 0.46));
}

.home-page .menu-card::before {
  filter: sepia(0.16) saturate(0.78) brightness(0.78) contrast(0.92);
  opacity: 0.9;
}

.back-button {
  border-color: rgba(75, 48, 24, 0.82);
  background:
    linear-gradient(180deg, rgba(235, 216, 171, 0.96), rgba(128, 86, 47, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 205, 0.32),
    0 6px 14px rgba(34, 19, 8, 0.22);
}

.home-search,
.list-tools {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(73, 50, 28, 0.72);
  background:
    linear-gradient(180deg, rgba(219, 196, 150, 0.7), rgba(104, 74, 45, 0.56));
}

.home-search::before,
.list-tools::before {
  position: absolute;
  inset: -11px;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.76;
  filter: sepia(0.12) saturate(0.85) brightness(0.82);
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tl.png") left top / 52px 52px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tr.png") right top / 52px 52px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-bl.png") left bottom / 52px 52px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-br.png") right bottom / 52px 52px no-repeat;
}

.home-search::after,
.list-tools::after {
  position: absolute;
  inset: 5px;
  z-index: 0;
  content: "";
  border: 1px solid rgba(74, 50, 27, 0.34);
  pointer-events: none;
}

.home-search input,
.list-tools input,
.list-tools select,
.home-search .reset-button,
.list-tools .reset-button {
  position: relative;
  z-index: 1;
}

.home-search input,
.list-tools input {
  background:
    linear-gradient(90deg, rgba(255, 243, 204, 0.18), rgba(91, 63, 35, 0.08));
}

@media (min-width: 981px) {
  .list-page:not(.list-page-units):not(.list-page-classes):not(.list-page-factions) .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.fact-grid-compact .fact-card,
.fact-grid-table .fact-card {
  display: grid;
  grid-template-columns: minmax(48px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.fact-grid-compact .fact-card span,
.fact-grid-table .fact-card span {
  margin: 0;
  color: #6a4a2b;
}

.fact-grid-compact .fact-card strong,
.fact-grid-table .fact-card strong {
  margin: 0;
  text-align: right;
}

.unit-stats-section .fact-grid-table {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-top: 1px solid rgba(82, 59, 36, 0.38);
  border-left: 1px solid rgba(82, 59, 36, 0.38);
}

.unit-stats-section .fact-grid-table .fact-card {
  border-width: 0 1px 1px 0;
  border-color: rgba(82, 59, 36, 0.38);
  background: rgba(217, 194, 151, 0.36);
}

.entity-card strong {
  display: block;
}

.entity-name,
.entity-count {
  display: block;
}

.entity-count {
  margin-top: 2px;
  color: #6b3f16;
  font-style: normal;
  font-weight: 900;
}

.list-page-heroes .item-art {
  padding: 0;
}

.list-page-heroes .item-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-initial-grid,
.hero-initial-grid h3,
.hero-initial-grid .entity-card strong {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.hero-initial-grid h3 {
  font-weight: 900;
}

.hero-peer-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  justify-content: stretch;
}

.hero-peer-grid .entity-card {
  width: auto;
}

.subclass-card {
  align-items: start;
}

.subclass-card > div:last-child {
  display: grid;
  align-content: start;
}

.subclass-card h3,
.subclass-card p {
  margin-top: 0;
}

.relation-grid-compact-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 104px));
  gap: 10px;
  justify-content: start;
}

.relation-grid-compact-icons .relation-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 66px auto;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 104px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px;
  text-align: center;
}

.relation-grid-compact-icons .relation-icon,
.relation-grid-compact-icons .relation-icon img,
.relation-grid-compact-icons .relation-icon .fallback-icon {
  width: 66px;
  height: 66px;
}

.relation-grid-compact-icons .relation-copy strong {
  display: block;
  overflow: hidden;
  width: 100%;
  color: #4d2f12;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-grid-compact-icons .relation-copy small {
  display: none;
}

.skill-subskill-grid .relation-card {
  min-height: 84px;
}

.faction-section-list {
  display: grid;
  gap: 12px;
}

.faction-info-block {
  border: 1px solid rgba(82, 59, 36, 0.34);
  background: rgba(218, 195, 151, 0.28);
  padding: 12px;
}

.faction-info-block h3 {
  margin: 0 0 8px;
  color: #3f2c19;
  font-size: 18px;
}

.faction-info-block p {
  margin: 0 0 8px;
}

.faction-related-grid {
  margin-top: 10px;
}

.formation-board {
  --hex-w: 72px;
  --hex-h: 83px;
  padding: 12px 28px 30px;
}

.formation-row {
  gap: 0;
  height: calc(var(--hex-h) * 0.75);
}

.formation-row:nth-child(even) {
  margin-left: calc(var(--hex-w) / 2);
}

.formation-cell {
  width: var(--hex-w);
  height: var(--hex-h);
  overflow: hidden;
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background: #3f3528;
  box-shadow: none;
}

.formation-cell::before {
  position: absolute;
  inset: 3px;
  z-index: 0;
  content: "";
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background:
    radial-gradient(circle at 35% 30%, rgba(138, 159, 63, 0.48), transparent 34%),
    radial-gradient(circle at 72% 62%, rgba(56, 82, 42, 0.52), transparent 38%),
    linear-gradient(135deg, rgba(90, 118, 48, 0.9), rgba(51, 72, 35, 0.94));
  box-shadow: inset 0 0 12px rgba(19, 26, 14, 0.48);
}

.formation-cell.empty {
  opacity: 1;
}

.formation-cell.filled::before {
  background:
    radial-gradient(circle at 50% 30%, rgba(226, 200, 128, 0.28), transparent 45%),
    linear-gradient(180deg, rgba(93, 66, 39, 0.94), rgba(40, 29, 22, 0.96));
}

.formation-cell img,
.formation-cell b,
.formation-cell span {
  position: relative;
  z-index: 2;
}

.formation-cell img {
  width: calc(var(--hex-w) * 0.82);
  height: calc(var(--hex-h) * 0.76);
  object-fit: contain;
  object-position: center;
}

.formation-cell b {
  right: 9px;
  bottom: 8px;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(18, 13, 9, 0.48);
}

@media (max-width: 640px) {
  .pipe-text-list {
    gap: 4px;
    font-size: 12px;
  }

  .pipe-text-item {
    gap: 0;
    padding: 2px 8px;
  }

  .unit-stats-section .fact-grid-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    font-size: 12px;
  }

  .fact-grid-compact .fact-card,
  .fact-grid-table .fact-card {
    grid-template-columns: minmax(34px, 0.72fr) minmax(0, 1fr);
    gap: 4px;
  }

  .fact-grid-compact .fact-card strong,
  .fact-grid-table .fact-card strong {
    text-align: right;
  }

  .list-page-units .card-grid {
    row-gap: 18px;
    padding-bottom: 34px;
  }

  .hero-peer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .relation-grid-compact-icons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .formation-board {
    --hex-w: 58px;
    --hex-h: 67px;
    padding: 10px 18px 24px;
  }
}

/* V0.7.1: parchment opacity, cleaner ornament contrast, and tighter battle-grid polish. */
.wiki-frame {
  background:
    linear-gradient(180deg, rgba(248, 241, 224, 0.75), rgba(212, 182, 139, 0.75)),
    transparent;
}

.back-button,
.sub-header .back-button {
  opacity: 1;
  border-color: rgba(71, 45, 22, 0.9);
  background:
    linear-gradient(180deg, rgba(245, 225, 181, 0.98), rgba(135, 91, 50, 0.98));
  color: #2f1d0d;
}

.home-page .menu-card {
  border-color: rgba(66, 46, 30, 0.72);
  background:
    linear-gradient(180deg, rgba(184, 158, 116, 0.6), rgba(76, 55, 36, 0.5));
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 190, 0.18),
    0 10px 24px rgba(28, 17, 8, 0.18);
}

.home-page .menu-card::before {
  inset: -8px;
  opacity: 0.82;
  filter: sepia(0.24) saturate(0.76) brightness(0.68) contrast(0.96) drop-shadow(0 3px 4px rgba(22, 13, 6, 0.28));
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tr.png") right top -3px / 76px 76px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-bl.png") left bottom -3px / 76px 76px no-repeat;
}

.home-page .menu-card span {
  color: #362415;
  text-shadow:
    0 1px 0 rgba(236, 216, 168, 0.7),
    0 6px 14px rgba(21, 13, 6, 0.24);
}

.home-search,
.list-tools {
  border-color: rgba(63, 43, 24, 0.76);
  background:
    linear-gradient(180deg, rgba(203, 177, 132, 0.66), rgba(91, 66, 42, 0.52));
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 192, 0.18),
    0 8px 20px rgba(31, 19, 9, 0.16);
}

.home-search::before,
.list-tools::before {
  inset: -10px;
  opacity: 0.7;
  filter: sepia(0.18) saturate(0.8) brightness(0.72) contrast(0.94);
  background:
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tl.png") left top / 48px 48px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-tr.png") right top / 48px 48px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-bl.png") left bottom / 48px 48px no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-05-br.png") right bottom / 48px 48px no-repeat;
}

.home-search input,
.list-tools input,
.list-tools select {
  color: #2f2114;
}

.list-tools select {
  border-color: rgba(73, 49, 27, 0.45);
  background:
    linear-gradient(45deg, transparent 50%, #3e2915 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, #3e2915 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(218, 193, 146, 0.58), rgba(102, 73, 45, 0.44));
}

.item-copy strong {
  font-size: 12.5px;
}

.hero-peer-grid .entity-card img,
.hero-peer-grid .entity-card .fallback-icon {
  object-fit: cover;
}

.subclass-card {
  align-items: start;
}

.subclass-icon {
  align-self: start;
}

.skill-synergy-grid {
  grid-template-columns: repeat(auto-fill, minmax(86px, 108px));
  justify-content: start;
}

.skill-synergy-grid .relation-card {
  max-width: 108px;
}

.skill-synergy-grid .relation-copy strong {
  font-size: 11.5px;
}

.combat-formation-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 14px;
  touch-action: pan-y;
  user-select: none;
}

.formation-board {
  --hex-w: 72px;
  --hex-h: 83px;
  padding: 10px 22px 28px;
}

.formation-row {
  height: calc(var(--hex-h) * 0.75);
  gap: 0;
}

.formation-row:nth-child(even) {
  margin-left: calc(var(--hex-w) / 2);
}

.formation-cell {
  width: var(--hex-w);
  height: var(--hex-h);
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background: #2e271e;
  filter: drop-shadow(0 1px 0 rgba(241, 218, 153, 0.12));
}

.formation-cell::before {
  inset: 2px;
  background:
    linear-gradient(120deg, rgba(255, 236, 166, 0.08), transparent 34%),
    radial-gradient(circle at 34% 30%, rgba(129, 153, 64, 0.46), transparent 34%),
    radial-gradient(circle at 72% 62%, rgba(51, 76, 41, 0.55), transparent 38%),
    linear-gradient(135deg, rgba(86, 112, 47, 0.96), rgba(46, 68, 34, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(229, 208, 141, 0.1),
    inset 0 0 14px rgba(12, 18, 10, 0.62);
}

.formation-cell.filled::before {
  background:
    radial-gradient(circle at 50% 30%, rgba(226, 200, 128, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(96, 70, 43, 0.96), rgba(38, 28, 21, 0.98));
}

.formation-cell img {
  width: calc(var(--hex-w) * 0.84);
  height: calc(var(--hex-h) * 0.76);
  object-fit: contain;
  object-position: center;
}

.formation-cell b {
  right: calc(var(--hex-w) * 0.12);
  bottom: calc(var(--hex-h) * 0.1);
}

@media (max-width: 640px) {
  .home-page .menu-card::before {
    inset: -7px;
    background:
      url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-tr.png") right top -3px / 62px 62px no-repeat,
      url("https://img1.gamersky.com/image2026/04/20260428_msl_535_1/assets/ui/stone-corner-06-bl.png") left bottom -3px / 62px 62px no-repeat;
  }

  .home-search::before,
  .list-tools::before {
    inset: -8px;
    background-size: 42px 42px;
  }

  .formation-board {
    --hex-w: 58px;
    --hex-h: 67px;
    padding: 8px 16px 22px;
  }
}

/* V0.7.4: search bars without corner ornaments, natural-size detail art, and lazy-image fit. */
.home-search::before,
.list-tools::before {
  content: none;
  display: none;
  background: none;
}

.home-search,
.list-tools {
  overflow: hidden;
}

.identity-card {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
}

.identity-media {
  --identity-max: 320px;
  width: min(var(--image-w, var(--natural-w, 250px)), var(--identity-max), 100%);
  max-width: 100%;
  min-height: 0;
  aspect-ratio: var(--image-ratio, var(--natural-ratio, 1 / 1));
  justify-self: center;
  overflow: visible;
}

.identity-media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 640px) {
  .identity-card {
    grid-template-columns: 1fr;
  }

  .identity-media {
    --identity-max: 260px;
    width: min(var(--image-w, var(--natural-w, 220px)), var(--identity-max), 100%);
  }
}

/* V0.7.5: prevent small source images from being upscaled into blurry slots. */
img.natural-size-image {
  width: auto !important;
  height: auto !important;
  max-width: min(100%, var(--fit-max-w, 100%)) !important;
  max-height: min(100%, var(--fit-max-h, 100%)) !important;
  object-fit: contain !important;
}

.item-art,
.entity-card,
.relation-icon,
.subclass-icon,
.ability-icon,
.reward-icon,
.set-part-card,
.cost-card {
  image-rendering: auto;
}

/* V0.7.6: unit data tables, combat honeycomb, artifact rarity, and compact skill links. */
.unit-stats-section .fact-grid-table {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-top: 1px solid rgba(92, 67, 43, 0.36);
  border-left: 1px solid rgba(92, 67, 43, 0.36);
}

.unit-stats-section .fact-grid-table .fact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  margin: 0;
  border: 0;
  border-right: 1px solid rgba(92, 67, 43, 0.36);
  border-bottom: 1px solid rgba(92, 67, 43, 0.36);
  background: rgba(222, 199, 153, 0.34);
  box-shadow: none;
  padding: 8px 10px;
}

.unit-stats-section .fact-grid-table .fact-card span {
  margin: 0;
  color: #4b351f;
  font-weight: 800;
}

.unit-stats-section .fact-grid-table .fact-card strong {
  margin: 0;
  color: #2e2115;
  text-align: right;
}

.ability-card {
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
}

.ability-card > div:not(.ability-icon) {
  display: contents;
}

.ability-card .ability-icon {
  grid-column: 1;
  width: 66px;
  height: 66px;
}

.ability-card h3 {
  grid-column: 2;
  align-self: center;
  margin: 0;
}

.ability-card p {
  grid-column: 1 / -1;
  margin: 0;
  border-top: 1px solid rgba(92, 67, 43, 0.34);
  padding-top: 10px;
}

.fact-card-rarity strong {
  font-weight: 1000;
  -webkit-text-stroke: 0.35px rgba(39, 25, 13, 0.78);
  text-shadow:
    -0.6px -0.6px 0 rgba(39, 25, 13, 0.65),
    0.6px -0.6px 0 rgba(39, 25, 13, 0.65),
    -0.6px 0.6px 0 rgba(39, 25, 13, 0.65),
    0.6px 0.6px 0 rgba(39, 25, 13, 0.65),
    0 1px 2px rgba(255, 245, 210, 0.35);
}

.rarity-common strong {
  color: #fff7e4;
}

.rarity-rare strong {
  color: #52a7ff;
}

.rarity-epic strong {
  color: #b260ff;
}

.rarity-legendary strong {
  color: #f4a335;
}

.formation-board {
  --hex-w: 72px;
  --hex-h: 83px;
  gap: 0;
  padding: 12px calc(var(--hex-w) + 18px) 34px;
}

.formation-row {
  display: flex;
  gap: 0;
  height: calc(var(--hex-h) * 0.75);
  min-width: max-content;
}

.formation-row:nth-child(even) {
  margin-left: calc(var(--hex-w) * -1);
}

.formation-cell {
  position: relative;
  display: grid;
  width: var(--hex-w);
  height: var(--hex-h);
  overflow: visible;
  place-items: center;
  clip-path: none;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.formation-cell::before,
.formation-cell::after {
  position: absolute;
  content: "";
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  pointer-events: none;
}

.formation-cell::before {
  inset: 0;
  z-index: 0;
  background: rgba(75, 56, 36, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(55, 38, 23, 0.92),
    inset 0 0 0 3px rgba(232, 206, 150, 0.28);
}

.formation-cell::after {
  inset: 3px;
  z-index: 1;
  background:
    linear-gradient(145deg, rgba(196, 171, 122, 0.42), rgba(98, 75, 50, 0.58)),
    rgba(121, 97, 64, 0.42);
}

.formation-cell.empty {
  opacity: 1;
}

.formation-cell.filled::after {
  background:
    radial-gradient(circle at 50% 36%, rgba(235, 208, 144, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(125, 92, 56, 0.62), rgba(60, 43, 29, 0.76));
}

.formation-cell img,
.formation-cell span {
  position: relative;
  z-index: 2;
}

.formation-cell img {
  width: calc(var(--hex-w) * 0.98);
  height: calc(var(--hex-h) * 0.98);
  object-fit: contain;
  object-position: center;
}

.formation-cell b {
  z-index: 3;
  right: -5px;
  bottom: -4px;
  min-width: 20px;
  border: 1px solid rgba(238, 206, 121, 0.54);
  background: rgba(37, 25, 15, 0.82);
}

.skill-synergy-grid {
  grid-template-columns: repeat(auto-fill, minmax(64px, 76px));
  gap: 8px;
}

.skill-synergy-grid .relation-card {
  grid-template-rows: 48px auto;
  max-width: 76px;
}

.skill-synergy-grid .relation-icon,
.skill-synergy-grid .relation-icon img,
.skill-synergy-grid .relation-icon .fallback-icon {
  width: 48px;
  height: 48px;
}

@media (max-width: 640px) {
  .list-page-units .card-grid {
    --unit-hex: clamp(96px, 29vw, 126px);
    grid-template-columns: repeat(3, var(--unit-hex));
    grid-auto-rows: calc(var(--unit-hex) * 0.88);
    gap: 0 4px;
    justify-content: center;
    padding: 6px calc(var(--unit-hex) * 0.52 + 8px) 56px 0;
  }

  .list-page-units .item-card {
    width: var(--unit-hex);
    transform: none !important;
  }

  .list-page-units .item-card:nth-child(6n + 4),
  .list-page-units .item-card:nth-child(6n + 5),
  .list-page-units .item-card:nth-child(6n + 6) {
    transform: translateX(calc(var(--unit-hex) * 0.52)) !important;
  }

  .unit-stats-section .fact-grid-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    font-size: 11px;
  }

  .unit-stats-section .fact-grid-table .fact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    padding: 7px 6px;
  }

  .ability-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .ability-card .ability-icon {
    width: 58px;
    height: 58px;
  }

  .formation-board {
    --hex-w: 54px;
    --hex-h: 62px;
    padding: 10px calc(var(--hex-w) + 14px) 26px;
  }

  .skill-synergy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .skill-synergy-grid .relation-card {
    width: 100%;
    max-width: none;
    grid-template-rows: 44px auto;
  }

  .skill-synergy-grid .relation-icon,
  .skill-synergy-grid .relation-icon img,
  .skill-synergy-grid .relation-icon .fallback-icon {
    width: 44px;
    height: 44px;
  }
}

/* V0.7.7: tighter mobile unit honeycomb, centered ability headers, and 12/13 combat rows. */
.ability-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.ability-card > div.ability-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 68px;
  border-bottom: 1px solid rgba(92, 67, 43, 0.34);
  padding-bottom: 10px;
}

.ability-card .ability-icon {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
}

.ability-card h3 {
  margin: 0;
  text-align: center;
}

.ability-card p {
  margin: 0;
  border-top: 0;
  padding-top: 0;
}

.formation-board {
  --hex-w: 72px;
  --hex-h: 83px;
  padding: 12px calc(var(--hex-w) * 0.58 + 18px) 34px;
}

.formation-row {
  height: calc(var(--hex-h) * 0.75);
}

.formation-row:nth-child(even) {
  margin-left: calc(var(--hex-w) * -0.5);
}

@media (max-width: 640px) {
  .list-page-units .card-grid {
    --unit-hex: clamp(80px, 25.5vw, 104px);
    grid-template-columns: repeat(3, var(--unit-hex));
    grid-auto-rows: calc(var(--unit-hex) * 0.76);
    gap: 0 2px;
    justify-content: center;
    padding: 6px calc(var(--unit-hex) * 0.52 + 10px) 44px 10px;
  }

  .list-page-units .item-card {
    width: var(--unit-hex);
    transform: none !important;
  }

  .list-page-units .item-card:nth-child(6n + 4),
  .list-page-units .item-card:nth-child(6n + 5),
  .list-page-units .item-card:nth-child(6n + 6) {
    transform: translateX(calc(var(--unit-hex) * 0.51)) !important;
  }

  .ability-card > div.ability-card-head {
    min-height: 60px;
    gap: 10px;
  }

  .ability-card .ability-icon {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .formation-board {
    --hex-w: 54px;
    --hex-h: 62px;
    padding: 10px calc(var(--hex-w) * 0.58 + 12px) 26px;
  }
}

/* V0.7.9: ability bars mirror the reference layout without changing the palette. */
.ability-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.ability-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 14px 16px;
}

.ability-card > div.ability-card-head {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  justify-content: start;
  align-items: center;
  gap: 20px;
  min-height: 76px;
  border-bottom: 1px solid rgba(92, 67, 43, 0.34);
  padding: 0 0 12px;
}

.ability-card .ability-icon {
  display: grid;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border-radius: 50%;
  place-items: center;
}

.ability-card .ability-icon img,
.ability-card .ability-icon .fallback-icon {
  width: 100%;
  height: 100%;
}

.ability-card h3 {
  align-self: center;
  justify-self: start;
  margin: 0;
  text-align: left;
}

.ability-card p {
  margin: 0;
  border-top: 0;
  padding: 12px 2px 0;
}

@media (max-width: 640px) {
  .ability-grid {
    gap: 10px;
  }

  .ability-card {
    padding: 12px 14px;
  }

  .ability-card > div.ability-card-head {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    min-height: 66px;
    padding-bottom: 10px;
  }

  .ability-card .ability-icon {
    width: 56px;
    height: 56px;
  }
}

/* V0.7.11: transparent list frames for unit and hero buttons. */
.list-page-units .item-button,
.list-page-heroes .item-button {
  border: 0;
  box-shadow: none;
}

.list-page-units .item-button::after,
.list-page-heroes .item-button::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.list-page-units .item-button::after {
  background-image: url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/unit-list-frame.png");
}

.list-page-heroes .item-button::after {
  background-image: url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/hero-list-frame.png");
}

.list-page-units .item-art,
.list-page-heroes .item-art {
  width: auto;
  height: auto;
  overflow: hidden;
}

.list-page-units .item-art {
  inset: 8.5%;
  z-index: 1;
}

.list-page-heroes .item-art {
  inset: 9.4% 8.8% 9.2%;
  z-index: 1;
}

.list-page-units .item-art img {
  transform: scale(1.12);
}

.list-page-units .item-copy strong,
.list-page-heroes .item-copy strong {
  z-index: 4;
}

.list-page-units .item-copy strong {
  bottom: 13%;
}

.list-page-heroes .item-copy strong {
  bottom: 8%;
}

@media (max-width: 640px) {
  .list-tools {
    grid-template-columns: minmax(0, 1fr) 86px 64px;
  }

  .list-tools input {
    padding: 0 10px;
  }

  .list-tools select {
    padding: 0 24px 0 9px;
    background-position:
      right 14px center,
      right 8px center,
      center;
  }

  .list-page-units .card-grid {
    padding: 6px calc(var(--unit-hex) * 0.51 + 4px) 44px 2px;
  }
}

/* V0.7.12: source-data detail fields and cleaner tactical grids. */
.detail-page-artifacts .artifact-effect-section .fact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fact-card-school .school-fact-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  gap: 8px;
  text-align: right;
}

.fact-card-school .school-fact-value img {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.spell-effect-list p {
  white-space: normal;
}

.law-upgrade-cost {
  margin: 0;
  color: #4f3c27;
  font-weight: 400;
  line-height: 1.78;
}

.level-label {
  color: #4d2f12;
  font-weight: 900;
}

.law-level-effect-list {
  gap: 6px;
}

.law-level-effect-list p {
  margin: 0;
  color: #4f3c27;
  line-height: 1.78;
}

.hero-specialty {
  margin-top: 12px;
  border-top: 1px solid rgba(117, 83, 35, 0.28);
  padding-top: 12px;
}

.hero-specialty h3 {
  margin: 0 0 6px;
  color: #4d2f12;
  font-size: 16px;
}

.hero-specialty p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.66;
}

.hero-specialty .hero-specialty-title {
  margin-bottom: 4px;
  color: #4d2f12;
  font-weight: 900;
}

.hero-specialty-mobile-section {
  display: none;
}

.growth-stat-list .growth-late-note {
  display: block;
  border-color: transparent;
  background: transparent;
  color: #4d2f12;
  font-weight: 900;
  text-align: center;
  box-shadow: none;
}

.subclass-required {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  border-top: 1px solid rgba(117, 83, 35, 0.22);
  padding-top: 8px;
}

.subclass-required span {
  color: #6b3f16;
  font-size: 12px;
  font-weight: 900;
}

.subclass-required strong {
  color: #3d2613;
  line-height: 1.45;
}

.skill-synergy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.skill-synergy-card {
  min-width: 0;
  border: 1px solid rgba(117, 83, 35, 0.34);
  background: rgba(255, 247, 222, 0.58);
  padding: 10px;
}

.skill-synergy-head {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(117, 83, 35, 0.24);
  background: rgba(116, 65, 25, 0.12);
  padding: 8px;
  color: #4d2f12;
  text-align: left;
}

.skill-synergy-head:disabled {
  cursor: default;
}

.skill-synergy-icon,
.skill-synergy-icon img,
.skill-synergy-icon .fallback-icon {
  width: 50px;
  height: 50px;
}

.skill-synergy-icon {
  display: grid;
  place-items: center;
}

.skill-synergy-icon img,
.skill-synergy-subskill-icon img {
  object-fit: contain;
}

.skill-synergy-head strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.3;
}

.skill-synergy-subskill-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.skill-synergy-subskill {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(117, 83, 35, 0.22);
  background: rgba(255, 255, 255, 0.24);
  padding: 8px;
}

.skill-synergy-subskill-icon,
.skill-synergy-subskill-icon img,
.skill-synergy-subskill-icon .fallback-icon {
  width: 42px;
  height: 42px;
}

.skill-synergy-subskill-icon {
  display: grid;
  place-items: center;
}

.skill-synergy-subskill-copy {
  display: grid;
  gap: 4px;
}

.skill-synergy-subskill-copy strong {
  color: #4d2f12;
  line-height: 1.3;
}

.skill-synergy-subskill-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.formation-cell {
  clip-path: none;
  background: transparent;
}

.formation-cell::before,
.formation-cell::after {
  position: absolute;
  content: "";
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  pointer-events: none;
}

.formation-cell::before {
  inset: 0;
  z-index: 0;
  background: rgba(73, 54, 34, 0.92);
  box-shadow: none;
}

.formation-cell::after {
  inset: 1px;
  z-index: 1;
  background:
    linear-gradient(145deg, rgba(190, 170, 126, 0.38), rgba(105, 87, 58, 0.36)),
    rgba(130, 115, 74, 0.34);
}

.formation-cell.filled::after {
  background:
    linear-gradient(145deg, rgba(190, 170, 126, 0.38), rgba(105, 87, 58, 0.36)),
    rgba(130, 115, 74, 0.34);
}

.formation-cell.filled::before,
.formation-cell.filled::after {
  content: none;
  display: none;
}

.formation-cell img {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: calc(var(--hex-w) * 1.05);
  height: calc(var(--hex-h) * 1.05);
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
}

.formation-cell.filled img {
  width: 100%;
  height: 100%;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  object-fit: cover;
}

.formation-cell b {
  position: absolute;
  z-index: 3;
  right: -4px;
  bottom: -4px;
}

.list-page-heroes .item-button::after {
  inset: -4px;
}

.list-page-heroes .item-art {
  inset: 4.6% 4.3% 4.8%;
}

.list-page-heroes .item-art img {
  transform: scale(1.04);
}

.detail-page-heroes,
.detail-page-heroes .identity-copy h1,
.detail-page-heroes .detail-section h2,
.detail-page-heroes .hero-initial-grid h3,
.detail-page-heroes .subclass-card h3,
.detail-page-heroes .entity-card strong,
.detail-page-heroes .hero-specialty p {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

@media (max-width: 640px) {
  .detail-page-artifacts .artifact-effect-section .fact-grid,
  .skill-synergy-list {
    grid-template-columns: 1fr;
  }

  .detail-page .identity-copy > h1 {
    text-align: center;
  }

  .hero-specialty-desktop {
    display: none;
  }

  .hero-specialty-mobile-section {
    display: block;
  }

  .hero-specialty-mobile {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }

  .hero-specialty-mobile p {
    color: #3d2613;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.42;
    text-shadow: none;
  }

  .skill-synergy-head {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .skill-synergy-icon,
  .skill-synergy-icon img,
  .skill-synergy-icon .fallback-icon {
    width: 44px;
    height: 44px;
  }

  .formation-cell img {
    width: calc(var(--hex-w) * 1.08);
    height: calc(var(--hex-h) * 1.08);
  }

  .formation-cell.filled img {
    width: 100%;
    height: 100%;
  }
}

/* V0.7.15: main menu buttons use the provided parchment frame artwork. */
.home-page .menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
}

.home-page .menu-card {
  --menu-button-cap: clamp(29px, 2.7vw, 34px);
  --menu-button-top-ornament: clamp(26px, 2.8vw, 32px);
  --menu-button-bottom-ornament: clamp(22px, 2.4vw, 28px);
  isolation: isolate;
  min-height: clamp(64px, 5.2vw, 70px);
  overflow: visible;
  padding: 12px clamp(34px, 5vw, 56px) 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #382414;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(22px, 1.8vw, 29px);
  line-height: 1.08;
  letter-spacing: 0.08em;
}

.home-page .menu-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  content: "";
  opacity: 1;
  background:
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-left-frame.png") left center / var(--menu-button-cap) 100% no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-right-frame.png") right center / var(--menu-button-cap) 100% no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-rail-frame.png") center center / auto 100% repeat-x;
  filter: drop-shadow(0 4px 5px rgba(35, 20, 8, 0.34));
  pointer-events: none;
}

.home-page .menu-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  content: "";
  opacity: 1;
  background:
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-top-frame.png") center top -1px / var(--menu-button-top-ornament) auto no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-bottom-frame.png") center bottom -1px / var(--menu-button-bottom-ornament) auto no-repeat;
  transform: none;
  filter: none;
  pointer-events: none;
}

.home-page .menu-card span {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 100%;
  color: #352111;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(246, 225, 175, 0.88),
    0 5px 10px rgba(33, 19, 8, 0.22);
  overflow-wrap: anywhere;
}

.home-page .menu-card:hover,
.home-page .menu-card:focus-visible {
  box-shadow: none;
}

.home-page .menu-card:hover::before,
.home-page .menu-card:focus-visible::before {
  filter: brightness(1.04) drop-shadow(0 5px 6px rgba(35, 20, 8, 0.38));
}

@media (max-width: 640px) {
  .home-page .menu-grid {
    gap: 9px 10px;
  }

  .home-page .menu-card {
    --menu-button-cap: 23px;
    --menu-button-top-ornament: 23px;
    --menu-button-bottom-ornament: 21px;
    min-height: clamp(52px, 14vw, 58px);
    padding: 11px 18px 12px;
    font-size: clamp(16px, 5vw, 20px);
    letter-spacing: 0.04em;
  }

  .home-page .menu-card::before {
    filter: drop-shadow(0 2px 3px rgba(35, 20, 8, 0.28));
  }
}

@media (max-width: 380px) {
  .home-page .menu-card {
    --menu-button-cap: 22px;
    --menu-button-top-ornament: 22px;
    --menu-button-bottom-ornament: 20px;
    min-height: 52px;
    padding: 10px 16px 11px;
    font-size: 16px;
  }
}

/* V0.7.24: fetch UI artwork from the 20260429 Gamersky asset path. */
:root {
  --side-parchment-url: url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-side-muted.jpg");
  --inner-parchment-url: url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-inner-03.png");
}

body {
  background:
    linear-gradient(180deg, rgba(31, 20, 11, 0.16), rgba(28, 17, 8, 0.24)),
    radial-gradient(ellipse at center, rgba(238, 218, 176, 0.04), rgba(33, 21, 10, 0.12) 70%, rgba(20, 12, 5, 0.22)),
    var(--side-parchment-url) center top / 672px 504px repeat;
}

body::before {
  opacity: 0.06;
}

body::after {
  background:
    radial-gradient(ellipse at center, transparent 54%, rgba(55, 32, 14, 0.12) 78%, rgba(18, 10, 4, 0.24) 100%),
    linear-gradient(0deg, rgba(255, 237, 194, 0.03), transparent 30%, transparent 76%, rgba(24, 13, 5, 0.1));
}

.wiki-frame {
  background:
    linear-gradient(180deg, rgba(248, 231, 190, 0.2), rgba(198, 158, 94, 0.14)),
    var(--inner-parchment-url) center top / 836px 471px repeat;
  border-color: rgba(89, 59, 28, 0.46);
  box-shadow:
    0 22px 64px rgba(31, 18, 7, 0.24),
    inset 0 0 0 1px rgba(106, 68, 28, 0.18);
}

.wiki-frame::before {
  opacity: 0.05;
  background: none;
}

.home-page .menu-card::before {
  background:
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-left-frame.png") left center / var(--menu-button-cap) 100% no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-right-frame.png") right center / var(--menu-button-cap) 100% no-repeat,
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/menu-button-rail-frame.png") center center / auto 100% repeat-x;
}

@media (min-width: 981px) {
  .list-page-classes .card-grid,
  .list-page-factions .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.home-search {
  overflow: hidden;
  border: 1px solid rgba(91, 63, 31, 0.58);
  background:
    linear-gradient(180deg, rgba(240, 218, 175, 0.72), rgba(200, 166, 108, 0.62)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  box-shadow: 0 4px 10px rgba(45, 25, 9, 0.14);
}

.home-search::before,
.home-search::after {
  display: none;
  content: none;
}

.home-search input {
  background: transparent;
  color: #4d3218;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 600;
  text-shadow: none;
  box-shadow: none;
}

.home-search input::placeholder {
  color: rgba(86, 60, 32, 0.58);
}

.home-search .reset-button {
  min-width: 88px;
  border: 0;
  border-left: 1px solid rgba(82, 53, 23, 0.46);
  background:
    linear-gradient(180deg, rgba(205, 170, 108, 0.46), rgba(148, 105, 55, 0.36));
  color: #3d2712;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none;
}

.home-search .reset-button:hover,
.home-search .reset-button:focus-visible {
  background:
    linear-gradient(180deg, rgba(218, 184, 121, 0.54), rgba(151, 106, 54, 0.42));
  filter: none;
}

@media (max-width: 640px) {
  .home-search .reset-button {
    min-width: 78px;
    font-size: 15px;
  }
}

/* V0.7.25: single-line title, split filters, and clean formation unit buttons. */
.hero-content h1 {
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.list-tools.filter-count-2 .list-filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-tools select {
  background:
    linear-gradient(45deg, transparent 50%, #3e2915 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, #3e2915 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(232, 207, 158, 0.66), rgba(139, 96, 49, 0.42)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
}

.formation-cell.filled {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.formation-cell.filled img {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 640px) {
  .hero-content h1 {
    max-width: 100%;
    font-size: clamp(20px, 5.9vw, 26px);
  }

  .list-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    overflow: visible;
    border-color: rgba(75, 52, 28, 0.72);
    background:
      linear-gradient(180deg, rgba(218, 193, 146, 0.68), rgba(112, 78, 43, 0.5)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  }

  .list-search-row {
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 8px;
  }

  .list-filter-row,
  .list-tools.filter-count-2 .list-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-top: 0;
  }

  .list-tools.filter-count-1 .list-filter-row {
    grid-template-columns: 1fr;
  }

  .list-tools input {
    grid-column: auto;
    padding: 0 12px;
    border: 1px solid rgba(82, 53, 23, 0.36);
    background: rgba(255, 241, 198, 0.18);
  }

  .list-tools select {
    width: 100%;
    height: 42px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(82, 53, 23, 0.46);
    background:
      linear-gradient(45deg, transparent 50%, #3e2915 50%) right 16px center / 6px 6px no-repeat,
      linear-gradient(135deg, #3e2915 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
      linear-gradient(180deg, rgba(232, 207, 158, 0.7), rgba(139, 96, 49, 0.44)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
  }

  .list-tools .reset-button {
    grid-column: auto;
    min-width: 0;
    height: 42px;
    border: 1px solid rgba(82, 53, 23, 0.46);
    background:
      linear-gradient(180deg, rgba(205, 170, 108, 0.5), rgba(148, 105, 55, 0.38));
    font-size: 13px;
  }
}

/* Current pass: PC tools stay in one row; mobile keeps split rows and safer detail rendering. */
@media (min-width: 641px) {
  .list-tools {
    display: grid;
    gap: 0;
    padding: 0;
  }

  .list-tools.filter-count-1 {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) 96px;
  }

  .list-tools.filter-count-2 {
    grid-template-columns: minmax(0, 1fr) minmax(126px, 174px) minmax(108px, 146px) 96px;
  }

  .list-search-row,
  .list-filter-row {
    display: contents;
  }

  .list-search-row input {
    order: 1;
  }

  .list-filter-row select {
    order: 2;
    border-top: 0;
  }

  .list-search-row .reset-button {
    order: 3;
  }
}

.list-tools .reset-button {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
}

@media (max-width: 640px) {
  .home-page {
    gap: 14px;
  }

  .home-hero,
  .hero-content {
    min-height: 216px;
  }

  .hero-content {
    padding: 18px;
  }

  .hero-content h1 {
    max-width: min(88vw, 320px);
    font-size: clamp(18px, 5.2vw, 22px);
    line-height: 1.18;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .list-tools .reset-button {
    font-size: 15px;
  }

  .detail-page,
  .detail-composition,
  .detail-sections {
    overflow: visible;
  }

  .detail-composition,
  .detail-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .detail-section,
  .identity-card {
    contain: none;
    content-visibility: visible;
  }

  .detail-page .identity-card::before,
  .detail-page .detail-section::before {
    content: none;
    display: none;
  }
}

/* Current pass: unify search and filter control colors. */
.home-search,
.list-tools {
  --tool-ink: #3f2a16;
  --tool-muted: rgba(63, 42, 22, 0.62);
  --tool-border: rgba(92, 61, 30, 0.5);
  --tool-fill-top: rgba(235, 211, 164, 0.64);
  --tool-fill-bottom: rgba(178, 126, 63, 0.34);
  border-color: var(--tool-border);
  background:
    linear-gradient(180deg, rgba(230, 204, 154, 0.62), rgba(154, 106, 54, 0.34)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
}

.home-search input,
.list-tools input,
.list-tools select,
.home-search .reset-button,
.list-tools .reset-button {
  border-color: var(--tool-border);
  color: var(--tool-ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  text-shadow: none;
}

.home-search input,
.list-tools input {
  background: rgba(255, 241, 198, 0.14);
  font-weight: 600;
}

.home-search input::placeholder,
.list-tools input::placeholder {
  color: var(--tool-muted);
}

.list-tools select {
  background:
    linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  font-weight: 700;
}

.list-tools select option {
  background: #dcc08a;
  color: var(--tool-ink);
}

.home-search .reset-button,
.list-tools .reset-button {
  background:
    linear-gradient(180deg, rgba(226, 194, 132, 0.58), rgba(166, 112, 55, 0.38)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 239, 198, 0.16);
}

.home-search .reset-button:hover,
.home-search .reset-button:focus-visible,
.list-tools .reset-button:hover,
.list-tools .reset-button:focus-visible {
  background:
    linear-gradient(180deg, rgba(234, 202, 139, 0.66), rgba(174, 118, 58, 0.44)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  color: var(--tool-ink);
  filter: none;
}

@media (max-width: 640px) {
  .list-tools select {
    background:
      linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 16px center / 6px 6px no-repeat,
      linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
      linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
    font-size: 13px;
  }

  .home-search .reset-button,
  .list-tools .reset-button {
    font-size: 15px;
  }
}

/* Current pass: slimmer top controls with fewer nested outlines. */
.home-search,
.list-tools {
  overflow: hidden;
  border: 1px solid rgba(92, 61, 30, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 239, 198, 0.1),
    0 3px 8px rgba(45, 25, 9, 0.08);
}

.home-search input,
.list-tools input,
.list-tools select,
.home-search .reset-button,
.list-tools .reset-button {
  height: 38px;
  border: 0;
  box-shadow: none;
}

.home-search input,
.list-tools input {
  padding: 0 12px;
}

.home-search .reset-button,
.list-tools .reset-button {
  min-width: 78px;
  border-left: 1px solid rgba(92, 61, 30, 0.42);
}

.list-tools select {
  padding: 0 28px 0 10px;
  border-left: 1px solid rgba(92, 61, 30, 0.38);
  background:
    linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
}

.list-filter-row select:first-of-type {
  border-left: 0;
}

.sub-header .back-button,
.back-button {
  min-width: 68px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(92, 61, 30, 0.5);
  background:
    linear-gradient(180deg, rgba(226, 194, 132, 0.58), rgba(166, 112, 55, 0.38)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  color: #3f2a16;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 239, 198, 0.12),
    0 3px 8px rgba(45, 25, 9, 0.08);
  filter: none;
}

.sub-header .back-button:hover,
.sub-header .back-button:focus-visible,
.back-button:hover,
.back-button:focus-visible {
  background:
    linear-gradient(180deg, rgba(234, 202, 139, 0.66), rgba(174, 118, 58, 0.44)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  color: #3f2a16;
  filter: none;
}

@media (min-width: 641px) {
  .list-tools.filter-count-1 {
    grid-template-columns: minmax(0, 1fr) minmax(136px, 204px) 78px;
  }

  .list-tools.filter-count-2 {
    grid-template-columns: minmax(0, 1fr) minmax(114px, 160px) minmax(102px, 138px) 78px;
  }
}

@media (max-width: 640px) {
  .home-search,
  .list-tools {
    border-width: 1px;
  }

  .home-search input,
  .list-tools input,
  .list-tools select,
  .home-search .reset-button,
  .list-tools .reset-button {
    height: 36px;
    font-size: 13px;
  }

  .home-search {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .list-search-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 6px;
  }

  .list-filter-row,
  .list-tools.filter-count-2 .list-filter-row {
    gap: 6px;
  }

  .list-tools input,
  .list-tools select,
  .list-tools .reset-button {
    border: 0;
  }

  .list-tools select {
    padding-right: 24px;
    background:
      linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 14px center / 6px 6px no-repeat,
      linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 8px center / 6px 6px no-repeat,
      linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  }

  .home-search .reset-button,
  .list-tools .reset-button {
    min-width: 0;
    border-left: 1px solid rgba(92, 61, 30, 0.36);
    font-size: 13px;
  }

  .sub-header {
    gap: 9px;
    margin-bottom: 12px;
  }

  .sub-header .back-button,
  .back-button {
    min-width: 62px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 13px;
  }
}

/* Current pass: reduce search/filter block height by another 20%. */
.home-search input,
.list-tools input,
.list-tools select,
.home-search .reset-button,
.list-tools .reset-button {
  height: 30px;
}

.home-search input,
.list-tools input {
  padding: 0 10px;
}

.list-tools select {
  padding: 0 24px 0 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 14px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 9px center / 5px 5px no-repeat,
    linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
    url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
}

@media (min-width: 641px) {
  .home-search input,
  .list-tools input,
  .list-tools select,
  .home-search .reset-button,
  .list-tools .reset-button {
    height: 38px;
    font-size: 16px;
  }

  .home-search input,
  .list-tools input {
    padding: 0 12px;
  }

  .home-search input,
  .list-tools input,
  .list-tools select {
    border-right: 1px solid rgba(92, 61, 30, 0.42);
  }

  .list-tools.filter-count-1 select,
  .list-tools.filter-count-2 select:last-of-type {
    border-right: 1px solid rgba(92, 61, 30, 0.42);
  }

  .home-search .reset-button,
  .list-tools .reset-button {
    border-left: 0;
  }

  .list-tools select {
    padding: 0 28px 0 10px;
    background:
      linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 16px center / 6px 6px no-repeat,
      linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
      linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  }

  .home-search .reset-button,
  .list-tools .reset-button {
    min-width: 78px;
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .list-tools {
    gap: 5px;
    padding: 6px;
    margin-bottom: 10px;
  }

  .list-search-row,
  .list-filter-row,
  .list-tools.filter-count-2 .list-filter-row {
    gap: 5px;
  }

  .home-search input,
  .list-tools input,
  .list-tools select,
  .home-search .reset-button,
  .list-tools .reset-button {
    height: 29px;
    font-size: 12px;
  }

  .list-tools select {
    padding-right: 22px;
    background:
      linear-gradient(45deg, transparent 50%, var(--tool-ink) 50%) right 13px center / 5px 5px no-repeat,
      linear-gradient(135deg, var(--tool-ink) 50%, transparent 50%) right 8px center / 5px 5px no-repeat,
      linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  }
}

/* Current pass: in-page mobile dropdowns instead of native picker popups. */
.mobile-filter-control {
  display: none;
}

@media (max-width: 640px) {
  .list-tools {
    overflow: visible;
  }

  .list-tools select {
    display: none;
  }

  .mobile-filter-control {
    position: relative;
    z-index: 5;
    display: block;
    min-width: 0;
  }

  .mobile-filter-button {
    position: relative;
    display: grid;
    width: 100%;
    height: 29px;
    min-width: 0;
    align-items: center;
    padding: 0 24px 0 8px;
    border: 0;
    background:
      linear-gradient(180deg, var(--tool-fill-top), var(--tool-fill-bottom)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
    color: var(--tool-ink);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-shadow: none;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255, 239, 198, 0.1);
  }

  .mobile-filter-button::after {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 0;
    height: 0;
    content: "";
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    border-top: 5px solid var(--tool-ink);
    transform: translateY(-42%);
    pointer-events: none;
  }

  .mobile-filter-button:focus-visible {
    box-shadow:
      inset 0 0 0 1px rgba(255, 239, 198, 0.16),
      0 0 0 1px rgba(92, 61, 30, 0.42);
  }

  .mobile-filter-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-filter-control.open {
    z-index: 20;
  }

  .mobile-filter-control.open .mobile-filter-button {
    background:
      linear-gradient(180deg, rgba(238, 211, 160, 0.76), rgba(179, 124, 61, 0.48)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
  }

  .mobile-filter-control.open .mobile-filter-button::after {
    border-top: 0;
    border-bottom: 5px solid var(--tool-ink);
    transform: translateY(-58%);
  }

  .mobile-filter-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: none;
    max-height: min(58vh, 280px);
    overflow-y: auto;
    border: 1px solid rgba(92, 61, 30, 0.58);
    background:
      linear-gradient(180deg, rgba(231, 205, 154, 0.96), rgba(184, 132, 70, 0.88)),
      url("https://img1.gamersky.com/image2026/04/20260429_msl_535_2/assets/ui/parchment-fill-02.png") center center / auto auto repeat;
    box-shadow:
      inset 0 0 0 1px rgba(255, 239, 198, 0.16),
      0 8px 18px rgba(44, 25, 10, 0.2);
    scrollbar-width: none;
  }

  .mobile-filter-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobile-filter-control.open .mobile-filter-menu {
    display: grid;
  }

  .mobile-filter-menu button {
    min-width: 0;
    min-height: 30px;
    border: 0;
    border-bottom: 1px solid rgba(92, 61, 30, 0.22);
    background: transparent;
    color: #3f2a16;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-shadow: none;
  }

  .mobile-filter-menu button:last-child {
    border-bottom: 0;
  }

  .mobile-filter-menu button[aria-selected="true"] {
    background: rgba(111, 70, 31, 0.18);
    color: #2e1d0e;
    font-weight: 900;
  }
}

/* Current pass: site credit placement. */
.site-credit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  color: #3f2a16;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  text-shadow: 0 1px 0 rgba(255, 239, 198, 0.52);
  white-space: nowrap;
}

.site-credit-logo {
  display: block;
  width: auto;
  max-width: min(285px, 27vw);
  height: auto;
  max-height: 51px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-credit {
  justify-self: center;
  display: block;
  margin-top: 0;
  text-align: center;
}

.home-feedback-link {
  justify-self: center;
  margin-top: -6px;
  color: #3f2a16;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 0 rgba(255, 239, 198, 0.52);
}

.home-feedback-link:hover,
.home-feedback-link:focus-visible {
  color: #6b3f16;
}

@media (min-width: 641px) {
  .sub-header {
    grid-template-columns: auto minmax(0, 1fr) minmax(285px, 27vw);
  }

  .list-page .sub-header,
  .detail-page .sub-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .list-page .sub-header .site-credit,
  .detail-page .sub-header .site-credit {
    display: none;
  }
}

@media (max-width: 640px) {
  .list-page .sub-header,
  .detail-page .sub-header {
    display: none;
    margin: 0;
  }

  .sub-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .sub-header h1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-credit {
    grid-column: auto;
    justify-self: end;
    max-width: 128px;
    margin-top: 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-credit-logo {
    max-width: 128px;
    max-height: 26px;
  }

  .home-credit {
    grid-column: 1 / -1;
    justify-self: center;
    display: block;
    margin-top: -2px;
    max-width: none;
    font-size: 13px;
    text-align: center;
    overflow: visible;
  }

  .home-feedback-link {
    grid-column: 1 / -1;
    margin-top: 0;
    font-size: 13px;
  }
}

/* Current pass: cleaner list labels, round spell frames, and plain artifact rarity text. */
.fact-card-rarity strong {
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.item-copy strong {
  right: 2px;
  left: 2px;
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 1px 4px 2px;
  white-space: nowrap;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.98),
    0 0 4px rgba(0, 0, 0, 0.92),
    0 0 8px rgba(0, 0, 0, 0.66);
}

.list-page-spells .item-button {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 22px;
  align-items: center;
  justify-items: center;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.list-page-spells .item-art {
  position: relative;
  inset: auto;
  width: 82%;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(92, 61, 30, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 221, 166, 0.22), rgba(77, 48, 25, 0.48) 72%),
    linear-gradient(180deg, rgba(218, 186, 121, 0.64), rgba(83, 54, 31, 0.62));
  box-shadow:
    inset 0 0 0 2px rgba(255, 235, 175, 0.18),
    0 2px 5px rgba(45, 25, 9, 0.22);
  padding: 0;
  place-items: center;
}

.list-page-spells .item-art img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.list-page-spells .item-copy {
  display: block;
  width: 100%;
  min-width: 0;
}

.list-page-spells .item-copy strong {
  position: static;
  width: 100%;
  transform: none;
  color: #f0c95f;
}

.faction-skill-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.faction-skill-icon {
  display: grid;
  width: 96px;
  min-height: 104px;
  grid-template-rows: 72px auto;
  gap: 6px;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: #3f2a16;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 239, 198, 0.55);
  box-shadow: none;
}

.faction-skill-icon img,
.faction-skill-icon .fallback-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.faction-skill-icon span:not(.fallback-icon) {
  display: block;
}

.list-page-heroes .item-card-two-line-name .item-copy strong {
  min-height: 34px;
  flex-direction: column;
  gap: 0;
  line-height: 1.12;
  white-space: normal;
}

.list-page-heroes .item-card-two-line-name .item-copy strong span {
  display: block;
}

@media (max-width: 640px) {
  .item-copy strong {
    right: 1px;
    left: 1px;
    min-height: 20px;
    padding: 1px 3px;
    font-size: 11px;
  }

  .list-page-heroes .item-card-two-line-name .item-copy strong {
    min-height: 30px;
    font-size: 10.5px;
  }
}

/* V0.8.10: keep unit detail art at one compact size on PC and mobile. */
.detail-page-units .identity-media {
  display: flex;
  width: 220px;
  height: auto;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  align-self: center;
  align-items: center;
  justify-content: center;
}

.detail-page-units .identity-media img,
.detail-page-units .identity-media img.natural-size-image {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 220px !important;
  max-height: 210px !important;
  object-fit: contain !important;
}

/* V0.8.16: vivo WebView detail fallback. Avoid ratio/min() image slots leaving huge blank areas. */
@media (max-width: 640px) {
  .detail-page .identity-card {
    display: flex;
    height: auto;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
  }

  .detail-page .identity-media {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: 240px;
    flex: 0 0 auto;
    aspect-ratio: auto !important;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  .detail-page .identity-media img,
  .detail-page .identity-media img.natural-size-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 260px !important;
    max-height: 240px !important;
    object-fit: contain !important;
  }

  .detail-page-units .identity-media {
    width: 220px;
    max-width: 100%;
    height: auto;
    max-height: 210px;
    margin-right: auto;
    margin-left: auto;
  }

  .detail-page-units .identity-copy .fact-grid-compact,
  .detail-page-artifacts .identity-copy .fact-grid-compact,
  .detail-page-laws .identity-copy .fact-grid-compact,
  .detail-page-spells .identity-copy .fact-grid-compact,
  .detail-page-heroes .identity-copy .fact-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-page-spells .identity-copy .fact-grid-compact .fact-card:first-child {
    grid-column: 1 / -1;
  }

  .detail-page-units .identity-media img,
  .detail-page-units .identity-media img.natural-size-image {
    width: auto !important;
    height: auto !important;
    max-width: 220px !important;
    max-height: 210px !important;
  }

  .detail-page-units .ability-card {
    height: auto;
    min-height: 0;
  }

  .detail-page-units .ability-card > div.ability-card-head {
    display: flex;
    height: auto;
    min-height: 0;
    max-height: 76px;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
  }

  .detail-page-units .ability-card .ability-icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    min-height: 0;
    max-height: 56px;
    aspect-ratio: auto !important;
  }

  .detail-page-units .ability-card .ability-icon img,
  .detail-page-units .ability-card .ability-icon img.natural-size-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: contain !important;
  }
}
