:root {
  --bg: #08111f;
  --panel: #101c2d;
  --panel-2: #16253a;
  --surface: rgba(18, 31, 50, 0.82);
  --surface-2: rgba(24, 39, 62, 0.9);
  --text: #f5f7fb;
  --muted: #a8b3c7;
  --line: rgba(163, 191, 255, 0.14);
  --line-strong: rgba(105, 173, 255, 0.34);
  --gold: #ffd166;
  --blue: #55b8ff;
  --red: #ff5b6e;
  --green: #48d597;
  --violet: #7c5cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(85, 184, 255, 0.16), transparent 31rem),
    radial-gradient(circle at 88% 12%, rgba(124, 92, 255, 0.14), transparent 34rem),
    radial-gradient(circle at 44% 96%, rgba(72, 213, 151, 0.1), transparent 28rem),
    linear-gradient(145deg, #06101d 0%, #0a1628 48%, #111426 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body.light-mode {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-2: #edf3f8;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(242, 247, 255, 0.92);
  --text: #132033;
  --muted: #5d6b7f;
  --line: rgba(20, 35, 52, 0.12);
  --line-strong: rgba(42, 113, 199, 0.28);
  background: linear-gradient(135deg, #f7fbff, #edf5ff 48%, #fff8e1);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(8, 17, 31, 0.72);
  backdrop-filter: blur(18px);
}

body.light-mode .sidebar { background: rgba(255, 255, 255, 0.72); }

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 30px;
}

.brand-logo, .brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.brand-logo {
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.32));
}

.brand-wordmark {
  width: min(184px, 100%);
  height: auto;
  border-radius: 8px;
  overflow: hidden;
}

.brand-mark {
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, var(--gold), #ff8f4f 48%, var(--blue));
  color: #07101d;
  font: 900 24px Sora, sans-serif;
}

.brand strong, .brand small { display: block; }
.brand strong { font: 800 17px Sora, sans-serif; }
.brand small {
  color: var(--muted);
  margin-left: 4px;
  margin-top: 0;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

body.light-mode .nav-link:hover, body.light-mode .nav-link.active { background: rgba(42, 113, 199, 0.1); }

.sidebar-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-card p { margin: 8px 0 0; }
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(72, 213, 151, 0.16);
}

main { min-width: 0; padding: 26px clamp(14px, 3vw, 40px) 54px; overflow: hidden; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: Sora, Inter, sans-serif; letter-spacing: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 5vw, 46px); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(330px, 42vw);
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.clear-search {
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(105, 173, 255, 0.24);
  border-radius: 50%;
  background: rgba(85, 184, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.search.has-value {
  border-color: rgba(85, 184, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(85, 184, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search.has-value .clear-search { display: grid; }

.clear-search:hover {
  border-color: rgba(255, 209, 102, 0.48);
  background: rgba(255, 209, 102, 0.14);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.view { display: none; }
.active-view { display: block; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: clamp(22px, 5vw, 54px);
  align-items: center;
  min-height: min(720px, calc(100vh - 150px));
  padding: clamp(22px, 5vw, 58px) 0;
}

.home-hero {
  position: relative;
  min-height: min(760px, calc(100vh - 118px));
  padding-inline: clamp(0px, 2vw, 18px);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 24px -18px;
  z-index: -1;
  border: 1px solid rgba(105, 173, 255, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(120deg, rgba(85, 184, 255, 0.08), transparent 38%),
    linear-gradient(300deg, rgba(255, 209, 102, 0.05), transparent 42%),
    rgba(9, 20, 35, 0.28);
}

.home-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.home-kicker img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.3));
}

.badge, .quality {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.1);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.quality {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.hero h2 {
  max-width: 790px;
  margin: 16px 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
}

.hero p {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.65;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-chip-row span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hero-actions, .controls-row, .utility-row, .tier-toolbar, .table-tools, .bench-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  letter-spacing: 0;
}

.primary-button {
  background: linear-gradient(135deg, var(--gold), #ff9f43);
  color: #08111f;
  box-shadow: 0 16px 36px rgba(255, 159, 67, 0.24);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.compact-button {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 12px;
}

.hero-board {
  position: relative;
  min-height: 500px;
  display: grid;
  align-content: center;
  justify-items: stretch;
  padding: 24px;
  border: 1px solid rgba(105, 173, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 75% 20%, rgba(85, 184, 255, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(13, 27, 46, 0.96), rgba(11, 19, 35, 0.9));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-logo-card {
  position: relative;
  z-index: 3;
  top: auto;
  left: auto;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(105, 173, 255, 0.2);
  border-radius: 12px;
  background: rgba(7, 14, 26, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.hero-logo-card img {
  width: min(250px, 42vw);
  height: auto;
  display: block;
  border-radius: 8px;
}

.board-glow {
  position: absolute;
  inset: 10%;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(85, 184, 255, 0.18), transparent 58%),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 38px);
  filter: blur(0.5px);
  opacity: 0.7;
}

.mini-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  width: min(440px, 100%);
  justify-self: center;
  padding: 20px;
  border: 1px solid rgba(105, 173, 255, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(17, 32, 53, 0.92), rgba(15, 24, 42, 0.84)),
    repeating-linear-gradient(135deg, rgba(85, 184, 255, 0.07) 0 1px, transparent 1px 34px);
  box-shadow: var(--shadow);
  transform: none;
}

.mini-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  border: 1px solid rgba(140, 190, 255, 0.2);
  background: rgba(132, 166, 208, 0.14);
}

.mini-cell img, .bench-card img, .table-card img, .info-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.hero-panel {
  position: relative;
  z-index: 2;
  right: auto;
  bottom: auto;
  justify-self: end;
  margin-top: 16px;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(105, 173, 255, 0.22);
  border-radius: 10px;
  background: rgba(7, 14, 26, 0.88);
  box-shadow: var(--shadow);
}

body.light-mode .hero-panel { background: rgba(255, 255, 255, 0.9); }
.hero-panel span { color: var(--green); font-weight: 900; }

.metric-grid, .feature-grid, .info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid article, .feature-grid article, .info-card, .arena-panel, .bench-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

body.light-mode .metric-grid article, body.light-mode .feature-grid article, body.light-mode .info-card, body.light-mode .arena-panel, body.light-mode .bench-panel {
  background: rgba(255, 255, 255, 0.78);
}

.metric-grid article { padding: 16px; }
.metric-grid span { color: var(--muted); font-weight: 800; }
.metric-grid strong { display: block; margin-top: 6px; font: 900 28px Sora, sans-serif; }

.home-metrics article {
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.1), rgba(255, 209, 102, 0.055)),
    rgba(255, 255, 255, 0.07);
}

.home-command {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.home-command a,
.showcase-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.07), rgba(255, 209, 102, 0.04)),
    var(--surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.home-command a {
  display: grid;
  gap: 8px;
  padding: 18px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.home-command a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.5);
}

.home-command strong,
.showcase-grid strong {
  font: 900 18px Sora, sans-serif;
}

.home-command span,
.showcase-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.section-band { padding: 58px 0 0; }
.section-heading { margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 6px 0 0; font-size: clamp(26px, 4vw, 42px); }
.section-heading.compact h2 { font-size: 25px; }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid article, .info-card { padding: 18px; }
.feature-grid p, .info-card p { color: var(--muted); line-height: 1.55; }
.feature-icon, .card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border: 1px solid rgba(85, 184, 255, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.2), rgba(72, 213, 151, 0.06)),
    rgba(255, 255, 255, 0.045);
  color: var(--blue);
  font-weight: 900;
}

.feature-icon {
  position: relative;
  color: transparent;
}

.feature-icon::before,
.feature-icon::after {
  content: "";
  position: absolute;
}

.feature-icon-fights::before {
  width: 22px;
  height: 22px;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  background: linear-gradient(145deg, var(--blue), rgba(72, 213, 151, 0.9));
  box-shadow: 0 0 0 5px rgba(85, 184, 255, 0.14);
}

.feature-icon-fights::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #06101d;
}

.feature-icon-tiers::before {
  width: 24px;
  height: 22px;
  border-radius: 5px;
  background:
    linear-gradient(to top, var(--gold) 0 42%, transparent 42%) 0 0 / 6px 100% no-repeat,
    linear-gradient(to top, var(--blue) 0 68%, transparent 68%) 9px 0 / 6px 100% no-repeat,
    linear-gradient(to top, var(--green) 0 88%, transparent 88%) 18px 0 / 6px 100% no-repeat;
}

.feature-icon-data::before {
  width: 24px;
  height: 24px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(85, 184, 255, 0.12);
}

.feature-icon-data::after {
  width: 13px;
  height: 7px;
  border-left: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(-45deg) translate(1px, -1px);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.showcase-grid article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.showcase-grid img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.showcase-grid strong,
.showcase-grid span {
  display: block;
}

.showcase-grid span {
  margin-top: 5px;
  font-size: 14px;
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(270px, 330px);
  gap: 18px;
  align-items: start;
}

.arena-panel, .bench-panel {
  min-width: 0;
  padding: 18px;
}

.bench-panel {
  overflow: hidden;
}

#calculator.view.active-view {
  position: relative;
}

#calculator.view.active-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(85, 184, 255, 0.16), transparent 34%),
    radial-gradient(circle at 82% 84%, rgba(72, 213, 151, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(6, 13, 28, 0.55), rgba(12, 20, 37, 0.72));
  filter: blur(0.2px);
}
.controls-row label, .table-tools select, .bench-filters select {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.utility-row {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.18);
}

.utility-status {
  min-width: 116px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.arena {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(5, var(--hex-size));
  grid-auto-rows: calc(var(--hex-size) * 0.82);
  justify-content: center;
  gap: calc(var(--hex-size) * 0.04);
  --hex-size: clamp(56px, 5.45vw, 80px);
  max-width: 740px;
  margin: 18px auto;
  padding: clamp(28px, 4vw, 48px) clamp(46px, 6vw, 78px);
  border: 1px solid rgba(105, 173, 255, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 48%, rgba(85, 184, 255, 0.12), transparent 54%),
    linear-gradient(to bottom, rgba(72, 38, 59, 0.84) 0 50%, rgba(17, 68, 94, 0.86) 50% 100%),
    linear-gradient(145deg, #0f1b2e, #081321 70%, #090d18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 44px rgba(0, 0, 0, 0.28),
    0 24px 70px rgba(0, 0, 0, 0.32);
  overflow: clip;
}

.arena::before,
.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.arena::before {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, rgba(255, 91, 110, 0.08) 0 50%, rgba(85, 184, 255, 0.1) 50% 100%);
  opacity: 0.68;
}

.arena::after {
  z-index: -1;
  background:
    linear-gradient(to bottom, transparent calc(50% - 1px), rgba(240, 248, 255, 0.34) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, rgba(85, 184, 255, 0.16), transparent 18% 82%, rgba(255, 91, 110, 0.12)),
    radial-gradient(ellipse at 50% 50%, transparent 46%, rgba(0, 0, 0, 0.22) 100%);
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.24);
}

.tile {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--hex-size);
  height: calc(var(--hex-size) * 0.9);
  transform: translateX(0);
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
  overflow: visible;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 6%;
  background:
    linear-gradient(145deg, rgba(185, 214, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(94, 123, 160, 0.16);
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  opacity: 0.95;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.26));
  box-shadow:
    inset 0 0 0 1px rgba(205, 226, 255, 0.26),
    inset 0 -16px 24px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(85, 184, 255, 0.06);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 7%;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 2px rgba(255, 209, 102, 0.72),
    0 0 22px rgba(85, 184, 255, 0.2);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tile:nth-child(10n + 6),
.tile:nth-child(10n + 7),
.tile:nth-child(10n + 8),
.tile:nth-child(10n + 9),
.tile:nth-child(10n + 10) {
  transform: translateX(calc(var(--hex-size) * 0.5));
}

.tile:hover {
  filter: brightness(1.12);
}

.tile:hover::after { opacity: 1; }
.tile.enemy::before {
  background:
    linear-gradient(145deg, rgba(255, 106, 136, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(83, 53, 75, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(255, 146, 170, 0.34),
    inset 0 -16px 28px rgba(0, 0, 0, 0.16),
    0 0 18px rgba(255, 91, 110, 0.08);
}
.tile.player::before {
  background:
    linear-gradient(145deg, rgba(85, 201, 255, 0.22), rgba(255, 255, 255, 0.05)),
    rgba(55, 115, 154, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(202, 241, 255, 0.48),
    inset 0 -16px 28px rgba(0, 0, 0, 0.16),
    0 0 18px rgba(85, 184, 255, 0.1);
}
.tile img {
  position: relative;
  z-index: 1;
  width: 68%;
  height: 76%;
  object-fit: contain;
  border: 0;
  border-radius: 10px;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.09);
  background: rgba(8, 17, 31, 0.18);
}

.tile[draggable="true"] {
  background: transparent;
}

.tile[draggable="true"]::before {
  background:
    linear-gradient(145deg, rgba(255, 209, 102, 0.24), rgba(85, 184, 255, 0.16)),
    rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 102, 0.34),
    inset 0 -16px 28px rgba(0, 0, 0, 0.16),
    0 0 20px rgba(85, 184, 255, 0.16);
}

.tile span {
  position: absolute;
  z-index: 2;
  right: 5px;
  bottom: 6px;
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.55);
  background: rgba(0, 0, 0, 0.82);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.38);
}

.tile em {
  position: absolute;
  z-index: 2;
  left: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(8, 17, 31, 0.82);
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.tile i {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 17, 31, 0.78);
  color: var(--text);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.tile i:empty { display: none; }
.tile.building::before { background: linear-gradient(145deg, rgba(255, 209, 102, 0.28), rgba(255, 255, 255, 0.09)); }
.tile.building img { width: 62%; height: 70%; }
.tile.ruler::before { background: linear-gradient(145deg, rgba(85, 184, 255, 0.28), rgba(255, 209, 102, 0.16)); }

.result-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.result-strip div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.result-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-strip strong { display: block; margin-top: 4px; }

.sim-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.sim-panel section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.sim-panel h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.sim-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sim-stats span, .sim-pill, .sim-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.24);
}

.sim-stats span {
  display: grid;
  gap: 3px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sim-stats b {
  color: var(--text);
  font: 900 18px Sora, sans-serif;
}

.sim-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sim-pill {
  display: inline-grid;
  gap: 3px;
  max-width: 100%;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.sim-pill b { color: var(--gold); }
.enemy-pills .sim-pill b { color: #ff9cad; }
.sim-empty { color: var(--muted); font-size: 13px; }

.sim-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sim-list li {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sim-list b { color: var(--text); }
.timeline-list li { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }

.wide-section {
  grid-column: 1 / -1;
}

.attack-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attack-row {
  display: grid;
  grid-template-columns: 44px minmax(160px, 1fr) repeat(3, minmax(64px, 0.2fr));
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.28);
}

.attack-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.attack-row b, .attack-row span, .attack-row small {
  display: block;
}

.attack-row span, .attack-row small {
  color: var(--muted);
  font-size: 12px;
}

.attack-row strong {
  color: var(--text);
  font: 900 14px Sora, sans-serif;
  text-align: right;
}

.empty-row {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.bench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 14px;
  max-height: 470px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 4px 8px 6px;
}

.equipment-tray {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.tray-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.tray-title strong {
  color: var(--muted);
  font-size: 12px;
}

.equipment-list, .special-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 156px;
  overflow: auto;
  padding-right: 2px;
}

.equipment-chip, .special-chip {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  text-align: left;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.equipment-chip:hover, .special-chip:hover, .bench-card:hover, .primary-button:hover, .secondary-button:hover, .icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.65);
}

.secondary-button:disabled:hover {
  transform: none;
  border-color: var(--line);
}

.equipment-chip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(85, 184, 255, 0.16);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.equipment-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.equipment-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.special-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.special-chip span {
  min-width: 0;
}

.special-chip strong, .special-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-chip strong { font-size: 12px; }
.special-chip small { color: var(--muted); font-size: 11px; }

.bench-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 10px 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(108, 73, 206, 0.26), rgba(43, 180, 111, 0.12)),
    rgba(9, 17, 32, 0.62);
  color: var(--text);
  text-align: center;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.bench-card i {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 28px;
  clip-path: polygon(50% 0, 86% 18%, 100% 54%, 74% 100%, 26% 100%, 0 54%, 14% 18%);
  border: 0;
  background: linear-gradient(145deg, #ffe38a, #f9a72f 58%, #ce6b17);
  color: #111827;
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.36);
}

.bench-card img {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 10px 18px rgba(0, 0, 0, 0.34);
}

.bench-card strong,
.bench-card small,
.bench-card b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bench-card strong {
  font-size: 11px;
  line-height: 1.05;
}

.bench-card small {
  color: var(--blue);
  margin-top: 2px;
  font-size: 10px;
  font-weight: 950;
}

.bench-card b {
  color: var(--gold);
  font-size: 10px;
  line-height: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(16, 28, 45, 0.96);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}

body.light-mode th { background: rgba(255, 255, 255, 0.96); }

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 800;
  line-height: 1.45;
}

.table-empty {
  text-align: center;
}

.table-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.table-card img {
  width: 38px;
  height: 38px;
}

.info-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  align-items: start;
  grid-auto-flow: dense;
}
.info-card {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 286px;
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.075), rgba(255, 209, 102, 0.035)),
    var(--surface);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.info-card > .quality { margin-top: 12px; }
.info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.45);
}
.info-card img { width: 74px; height: 74px; margin-bottom: 12px; object-fit: contain; }
.info-card img {
  padding: 6px;
  border: 1px solid rgba(105, 173, 255, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 28%, rgba(85, 184, 255, 0.16), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.visual-card img { width: 82px; height: 82px; }
.ability-card { min-height: 286px; }
.ability-card p { margin-bottom: 12px; }
.info-card h3 { margin-bottom: 6px; font-size: 19px; line-height: 1.15; }
.info-card b { display: block; margin-bottom: 10px; color: var(--gold); font-size: 14px; line-height: 1.28; }
.info-card p, .info-card b, .source-panel p, .source-panel span {
  overflow-wrap: anywhere;
}

.card-excerpt {
  display: -webkit-box;
  min-height: 5.7em;
  max-height: 5.7em;
  margin-bottom: 14px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.read-more-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(85, 184, 255, 0.3);
  border-radius: 999px;
  background: rgba(85, 184, 255, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.read-more-button:hover {
  border-color: rgba(255, 209, 102, 0.62);
  background: rgba(255, 209, 102, 0.12);
}

.mode-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 4px;
  padding: 0;
  min-height: 286px;
}

.mode-card h3,
.mode-card b,
.mode-card p {
  margin-left: 18px;
  margin-right: 18px;
}

.mode-card .card-footer {
  margin: auto 18px 18px;
}

.card-footer .quality {
  max-width: 148px;
  min-width: 0;
  flex-shrink: 1;
  font-size: 10px;
}

.mode-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 104px;
  margin-bottom: 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, rgba(85, 184, 255, 0.22), transparent 58%),
    linear-gradient(135deg, rgba(85, 184, 255, 0.12), rgba(255, 209, 102, 0.07)),
    rgba(8, 17, 31, 0.28);
}

.mode-art img {
  width: 76px;
  height: 76px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.32));
}

.mode-art .avatar-fallback {
  width: 74px;
  height: 74px;
  font-size: 20px;
}

.tier-toolbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 25, 43, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.tier-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tier-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tier-summary article {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.tier-summary b,
.tier-summary span {
  display: block;
}

.tier-summary b {
  color: var(--gold);
  font: 900 18px Sora, sans-serif;
  text-transform: capitalize;
}

.tier-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tier-board {
  display: grid;
  gap: 10px;
}

.tier-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
}

.tier-label {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.22), rgba(85, 184, 255, 0.12));
  border-right: 1px solid var(--line);
}

.tier-label strong {
  font: 900 34px Sora, sans-serif;
  color: var(--text);
}

.tier-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.tier-dropzone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  min-width: 0;
  padding: 10px;
  border: 1px dashed transparent;
  border-radius: 0 8px 8px 0;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.tier-dropzone.is-drop-target {
  border-color: rgba(85, 184, 255, 0.42);
  background: rgba(85, 184, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(85, 184, 255, 0.12);
}

.tier-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(92px, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(260px, 100%);
  min-height: 62px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 17, 31, 0.46);
  color: var(--text);
  text-align: left;
  cursor: grab;
  transition: border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.tier-card:hover {
  border-color: rgba(255, 209, 102, 0.65);
  transform: translateY(-1px);
}

.tier-card:active {
  cursor: grabbing;
}

.tier-card.is-dragging {
  opacity: 0.2;
  transform: scale(0.96);
}

.tier-card.is-insert-before,
.tier-card.is-insert-after {
  border-color: rgba(255, 209, 102, 0.95);
  background: rgba(255, 209, 102, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.22), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.tier-card.is-insert-before::after,
.tier-card.is-insert-after::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.5);
}

.tier-card.is-insert-before::after { left: -6px; }
.tier-card.is-insert-after::after { right: -6px; }

.tier-card img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
}

.tier-card span,
.tier-card strong,
.tier-card small {
  display: block;
  min-width: 0;
}

.tier-card strong,
.tier-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.tier-card > b {
  color: var(--gold);
  font-size: 12px;
}

.tier-empty {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-weight: 800;
}

.source-panel {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.source-panel p, .source-panel a, .patch-list a {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.source-panel span, .patch-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.patch-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 1180px;
}

.source-history { margin-top: 34px; }

.legal-panel {
  display: grid;
  gap: 14px;
  max-width: 980px;
}

.legal-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.legal-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font: 900 18px Sora, sans-serif;
}

.legal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.detail-list dt {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.table-tools {
  position: sticky;
  top: 12px;
  z-index: 4;
  padding: 10px;
  border: 1px solid rgba(105, 173, 255, 0.14);
  border-radius: 10px;
  background: rgba(12, 25, 43, 0.78);
  backdrop-filter: blur(16px);
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-width: 48px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(105, 173, 255, 0.25);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(85, 184, 255, 0.2), rgba(255, 209, 102, 0.12)),
    rgba(8, 17, 31, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: rgba(255, 209, 102, 0.54);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.94), rgba(72, 213, 151, 0.72)),
    var(--panel);
  color: #06101d;
  font-weight: 900;
}

.detail-modal[hidden] {
  display: none;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 16, 0.72);
  backdrop-filter: blur(10px);
}

.detail-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 44px));
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(105, 173, 255, 0.26);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(85, 184, 255, 0.08), rgba(255, 209, 102, 0.04)),
    #0d192b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.detail-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-right: 72px;
}

.detail-head img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.detail-head h2 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
}

.detail-head b {
  color: var(--gold);
}

#detail-body {
  margin: 18px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

#detail-extra .detail-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (prefers-reduced-motion: no-preference) {
  .active-view {
    animation: viewFade 180ms ease both;
  }

  .info-card,
  .tier-row,
  .tier-summary article,
  .metric-grid article,
  .feature-grid article,
  .primary-button,
  .secondary-button,
  .read-more-button,
  .bench-card,
  .equipment-chip,
  .special-chip {
    transition:
      transform 160ms ease,
      border-color 160ms ease,
      background 160ms ease,
      box-shadow 160ms ease,
      opacity 160ms ease;
  }

  .read-more-button:hover,
  .bench-card:hover,
  .equipment-chip:hover,
  .special-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  }

  .detail-dialog {
    animation: modalIn 160ms ease both;
  }

  .tier-card.is-insert-before::after,
  .tier-card.is-insert-after::after {
    animation: insertPulse 900ms ease infinite;
  }

  @keyframes viewFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  @keyframes insertPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    display: grid;
    gap: 16px;
  }
  .nav-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sidebar-card { position: static; }
  .hero, .calc-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .metric-grid, .result-strip, .sim-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-command, .showcase-grid { grid-template-columns: 1fr; }
  .tier-summary { grid-template-columns: 1fr; }
  .patch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  main { padding-inline: 14px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { align-items: stretch; }
  .search { min-width: 0; flex: 1; }
  .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h2 { font-size: 42px; line-height: 1; }
  .hero-board { min-height: 340px; }
  .metric-grid, .feature-grid, .info-grid, .result-strip, .sim-panel, .sim-stats { grid-template-columns: 1fr; }
  .hero-logo-card { position: relative; top: auto; left: auto; margin-bottom: 12px; }
  .showcase-grid article { grid-template-columns: 64px minmax(0, 1fr); }
  .showcase-grid img { width: 64px; height: 64px; }
  .patch-list { grid-template-columns: 1fr; }
  .detail-dialog { padding: 18px; }
  .detail-head { grid-template-columns: 70px minmax(0, 1fr); padding-right: 0; }
  .detail-head img { width: 70px; height: 70px; }
  .detail-close { position: relative; top: auto; right: auto; justify-self: end; margin-bottom: 12px; }
  .tier-row { grid-template-columns: 1fr; }
  .tier-label { border-right: 0; border-bottom: 1px solid var(--line); }
  .tier-card { width: 100%; }
  .arena {
    --hex-size: clamp(42px, 14vw, 62px);
    gap: 1px;
    padding: 26px 34px 30px 18px;
    border-radius: 12px;
  }
  .attack-row { grid-template-columns: 40px minmax(0, 1fr); }
  .attack-row strong { text-align: left; }
}
