:root {
  color-scheme: dark;
  --bg: #07111e;
  --surface: #0c1827;
  --surface-2: #111f31;
  --surface-3: #17283b;
  --line: #26384d;
  --line-bright: #365069;
  --text: #f1f6fb;
  --muted: #91a1b5;
  --cyan: #35d5e6;
  --cyan-soft: #8beaf3;
  --amber: #f7bd4a;
  --green: #61d88b;
  --red: #ef777c;
  --orange: #ef9e4f;
  --blue: #6aa4ff;
  --radius: 6px;
  --shadow: 0 20px 55px rgb(0 0 0 / 30%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(70px, 1fr);
  align-items: stretch;
  min-height: 66px;
  padding: 0 max(22px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(7 17 30 / 96%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: .97rem;
  font-weight: 800;
}

.brand b {
  color: var(--cyan);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: #06111d;
  background: var(--cyan);
  clip-path: polygon(50% 0, 100% 18%, 85% 78%, 50% 100%, 15% 78%, 0 18%);
  font-size: .7rem;
  font-weight: 1000;
  letter-spacing: -.06em;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.nav-link {
  position: relative;
  min-width: 82px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .91rem;
  font-weight: 650;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  background: transparent;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--cyan-soft);
}

.nav-link.is-active::after {
  background: var(--cyan);
}

.icon-button {
  align-self: center;
  justify-self: end;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.return-to-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  color: var(--text);
  background: #0a1624;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.return-to-game:hover {
  border-color: var(--cyan);
  color: var(--cyan-soft);
  background: #0e2133;
}

.patch-setter {
  display: inline-flex;
  align-items: center;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  background: #0a1624;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.patch-setter > span {
  padding-left: 10px;
}

.patch-setter select {
  align-self: stretch;
  min-width: 122px;
  border: 0;
  padding: 0 28px 0 8px;
  outline: 0;
  color: var(--text);
  background: #0a1624;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.patch-setter:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}

.page-shell {
  width: min(1540px, calc(100% - 44px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .71rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3vw, 3.15rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.intro-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.quality-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.quality-strip span {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
  font-size: .78rem;
}

.quality-strip b {
  color: var(--text);
}

.quality-strip .source-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.source-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.source-status.source-live {
  border-color: #287957;
  color: #9bdbb5;
}

.source-status.source-live i {
  background: var(--green);
  box-shadow: 0 0 0 3px rgb(97 216 139 / 12%);
}

.source-status.source-connecting i {
  background: var(--amber);
  animation: source-pulse 1.1s ease-in-out infinite alternate;
}

.source-status.source-error,
.source-status.source-unavailable,
.source-status.source-signed-out,
.source-status.source-offline {
  border-color: #66464a;
  color: #d8a0a3;
}

.source-status.source-error i,
.source-status.source-unavailable i,
.source-status.source-signed-out i,
.source-status.source-offline i {
  background: var(--red);
}

@keyframes source-pulse {
  to { opacity: .35; }
}

.data-notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #5a4c2a;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  background: #171a1c;
  color: #c7c1b0;
  font-size: .82rem;
}

.patch-fallback-notice {
  margin: -6px 0 18px;
}

.data-notice p {
  margin: 0;
}

.data-notice strong {
  color: var(--text);
}

.data-notice button {
  border: 0;
  background: transparent;
  color: var(--cyan-soft);
  cursor: pointer;
  font-weight: 700;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  color: var(--amber);
  font-weight: 900;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 250px;
  max-width: 340px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  background: #081422;
  color: var(--muted);
}

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

.search-box input::placeholder {
  color: #718299;
}

.segmented-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  overflow: hidden;
}

.segmented-control button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line-bright);
  background: #0a1624;
  color: var(--muted);
  cursor: pointer;
  font-size: .79rem;
  font-weight: 650;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button:hover,
.segmented-control button.is-active {
  background: #102332;
  color: var(--cyan-soft);
}

.select-control {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding-left: 10px;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  color: var(--muted);
  background: #0a1624;
  font-size: .77rem;
}

.select-control select {
  align-self: stretch;
  border: 0;
  padding: 0 26px 0 6px;
  color: var(--text);
  background: #0a1624;
  cursor: pointer;
  font-size: .79rem;
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
  font-size: .77rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 510px);
  align-items: start;
  gap: 16px;
}

.tier-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.loading-state,
.error-state,
.empty-results {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.loader {
  width: 38px;
  height: 38px;
  border: 3px solid var(--line-bright);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tier-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 116px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tier-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.tier-row[data-tier="S"] { --tier-color: var(--amber); }
.tier-row[data-tier="A"] { --tier-color: var(--orange); }
.tier-row[data-tier="B"] { --tier-color: var(--blue); }
.tier-row[data-tier="C"] { --tier-color: var(--green); }
.tier-row[data-tier="D"] { --tier-color: var(--red); }

.tier-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--tier-color) 8%, #0a1522);
}

.tier-letter {
  color: var(--tier-color);
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 2.1rem;
  font-weight: 900;
}

.tier-count {
  color: var(--muted);
  font-size: .68rem;
}

.tier-characters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.character-card {
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.character-card:hover {
  border-color: var(--line-bright);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.character-card.is-selected {
  border-color: var(--cyan);
  background: #102735;
  box-shadow: inset 0 0 0 1px rgb(53 213 230 / 20%);
}

.portrait,
.mini-portrait {
  display: block;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: #06101b;
}

.portrait {
  width: 47px;
  height: 47px;
}

.card-name {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .81rem;
  font-weight: 750;
}

.card-wr {
  display: block;
  margin-top: 3px;
  color: var(--cyan-soft);
  font-size: .76rem;
  font-weight: 750;
}

.card-games {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
}

.character-panel {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 98px);
  min-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-color: var(--line-bright) var(--surface);
}

.panel-empty {
  display: grid;
  place-items: center;
  min-height: 518px;
  padding: 42px;
  color: var(--muted);
  text-align: center;
}

.panel-empty > span {
  color: var(--cyan);
  font-size: 2rem;
}

.panel-empty h2 {
  margin: 18px 0 8px;
  color: var(--text);
}

.detail-header {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #0a1725;
}

.detail-portrait-wrap {
  position: relative;
  width: 84px;
  height: 84px;
}

.detail-portrait {
  width: 84px;
  height: 84px;
  border: 2px solid var(--line-bright);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #06101b;
}

.detail-tier {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--amber);
  color: #23190a;
  font-weight: 900;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-title-row h2 {
  margin: 2px 0 5px;
  font-size: 1.45rem;
  line-height: 1.05;
}

.detail-role {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.panel-close {
  display: none;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.detail-metric {
  padding-right: 7px;
  border-right: 1px solid var(--line);
}

.detail-metric:last-child {
  border-right: 0;
}

.detail-metric span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .65rem;
}

.detail-metric strong {
  display: block;
  margin-top: 3px;
  color: var(--cyan-soft);
  font-size: .91rem;
}

.detail-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-tabs button {
  position: relative;
  flex: 1 0 auto;
  min-width: 82px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 650;
}

.detail-tabs button::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 2px;
  background: transparent;
}

.detail-tabs button:hover,
.detail-tabs button.is-active {
  color: var(--cyan-soft);
}

.detail-tabs button.is-active::after {
  background: var(--cyan);
}

.detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.section-card {
  min-width: 0;
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.section-heading h3,
.section-card > h3 {
  margin: 0;
  font-size: .84rem;
}

.section-heading small,
.section-card small {
  color: var(--muted);
  font-size: .68rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: var(--muted);
  background: #0b1725;
  font-size: .65rem;
  font-weight: 700;
}

.tag.warn {
  border-color: #80672c;
  color: var(--amber);
}

.tag.cyan {
  border-color: #247b86;
  color: var(--cyan-soft);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.stat-box {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a1624;
}

.stat-box-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.stat-box span {
  display: block;
  color: var(--muted);
  font-size: .65rem;
}

.stat-box .stat-rank {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 17px;
  padding: 2px 5px;
  border: 1px solid rgba(39, 201, 214, .42);
  border-radius: 3px;
  background: rgba(39, 201, 214, .08);
  color: var(--cyan-soft);
  font-size: .52rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.stat-box strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 1rem;
}

.stat-box em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
  font-style: normal;
}

.score-breakdown {
  display: grid;
  gap: 11px;
}

.score-signal > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}

.score-signal span {
  color: var(--text);
  font-size: .7rem;
  font-weight: 650;
}

.score-signal small {
  color: var(--muted);
  font-size: .61rem;
}

.score-signal strong {
  min-width: 34px;
  color: var(--cyan-soft);
  text-align: right;
  font-size: .7rem;
}

.score-signal .score-track {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: #07121e;
}

.score-track i {
  display: block;
  height: 100%;
  background: var(--cyan);
}

.inventory-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-icon-wrap {
  position: relative;
}

.item-icon {
  display: block;
  width: 43px;
  height: 43px;
  border: 1px solid #8a6a25;
  border-radius: 4px;
  object-fit: cover;
  background: #08121c;
}

.build-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
}

.build-summary strong {
  color: var(--cyan-soft);
  font-size: .84rem;
}

.sample-warning {
  display: flex;
  gap: 9px;
  margin: -2px 0 0;
  padding: 10px;
  border: 1px solid #66562f;
  border-radius: 4px;
  color: #c8bfa9;
  background: #181a1d;
  font-size: .69rem;
  line-height: 1.45;
}

.sample-warning b {
  color: var(--amber);
}

.item-signal-list {
  display: grid;
  gap: 7px;
}

.item-signal-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #081522;
  cursor: help;
  outline: none;
}

.item-signal-card:hover,
.item-signal-card:focus-visible {
  border-color: #8a6a25;
  box-shadow: 0 0 0 1px rgba(225, 176, 73, .18), 0 8px 20px rgba(0, 0, 0, .18);
}

.item-signal-icon {
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid #8a6a25;
  border-radius: 4px;
  object-fit: cover;
  background: #08121c;
}

.item-signal-copy,
.item-signal-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.item-signal-copy strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .76rem;
}

.item-signal-copy span,
.item-signal-metric span,
.item-signal-metric small {
  color: var(--muted);
  font-size: .63rem;
}

.item-signal-copy em {
  width: max-content;
  margin-top: 3px;
  padding: 1px 4px;
  border: 1px solid #66562f;
  border-radius: 2px;
  color: var(--amber);
  font-size: .54rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.item-signal-metric {
  align-items: flex-end;
  text-align: right;
}

.item-signal-metric > strong {
  color: var(--cyan-soft);
  font-size: .9rem;
}

.item-signal-metric small {
  margin-top: 2px;
}

.meta-item-tooltip {
  position: fixed;
  z-index: 10020;
  width: min(310px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #38566e;
  border-radius: 8px;
  background: rgba(3, 10, 18, .97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48), 0 0 0 1px rgba(68, 220, 235, .08);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  backdrop-filter: blur(12px);
}

.meta-item-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.meta-tooltip-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.meta-tooltip-header img {
  width: 46px;
  height: 46px;
  border: 1px solid #8a6a25;
  border-radius: 6px;
  object-fit: cover;
  background: #08121c;
}

.meta-tooltip-header h3 {
  margin: 0 0 3px;
  font-size: .88rem;
}

.meta-tooltip-header p {
  margin: 0;
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.meta-tooltip-header .rarity-common { color: #c7d0d8; }
.meta-tooltip-header .rarity-uncommon { color: #69da83; }
.meta-tooltip-header .rarity-rare { color: #5eb8ff; }
.meta-tooltip-header .rarity-epic { color: #c38cff; }
.meta-tooltip-header .rarity-legendary { color: #ffb84d; }
.meta-tooltip-header .rarity-mythic { color: #ff6d8a; }

.meta-tooltip-unique {
  margin: 10px 0 0;
  color: #d9e2e9;
  font-size: .69rem;
  line-height: 1.48;
}

.meta-tooltip-unique strong {
  color: var(--amber);
}

.meta-tooltip-section {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.meta-tooltip-section h4 {
  margin: 0 0 7px;
  color: var(--cyan-soft);
  font-size: .68rem;
}

.meta-tooltip-stat {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: .67rem;
}

.meta-tooltip-stat b {
  color: #73e89a;
}

.meta-tooltip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-tooltip-chip {
  display: inline-flex;
  padding: 2px 7px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: rgba(56, 139, 162, .12);
  color: #d6e8ef;
  font-size: .61rem;
  font-weight: 700;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .7rem;
}

.data-table th {
  padding: 7px 5px;
  border-bottom: 1px solid var(--line-bright);
  color: var(--muted);
  text-align: right;
  font-weight: 600;
}

.data-table .output-breakdown {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .52rem;
  font-weight: 500;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  width: 46%;
  text-align: left;
}

.data-table td {
  padding: 7px 5px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.table-item img {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  object-fit: cover;
  background: #08121c;
}

.table-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.matchup-list {
  display: grid;
  gap: 7px;
}

.matchup-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a1624;
}

.mini-portrait {
  width: 36px;
  height: 36px;
}

.matchup-name {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .7rem;
  font-weight: 700;
}

.matchup-games {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .61rem;
}

.matchup-rate {
  color: var(--cyan-soft);
  text-align: right;
  font-size: .69rem;
  font-weight: 800;
}

.rate-bad { color: var(--red); }
.rate-mid { color: var(--amber); }
.rate-good { color: var(--green); }

.empty-card {
  padding: 18px;
  border: 1px dashed var(--line-bright);
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
  font-size: .73rem;
}

.method-note {
  padding: 11px;
  border-left: 2px solid var(--cyan);
  background: #0a1725;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.5;
}

.method-note strong {
  color: var(--text);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px max(22px, calc((100vw - 1540px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #06101b;
  font-size: .72rem;
}

.method-dialog {
  width: min(620px, calc(100% - 30px));
  padding: 0;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.method-dialog::backdrop {
  background: rgb(0 6 12 / 78%);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  position: relative;
  padding: 26px;
}

.dialog-shell h2 {
  margin-bottom: 18px;
}

.dialog-shell p,
.dialog-shell li {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}

.dialog-shell code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cyan-soft);
  background: #08131f;
  font-family: Consolas, monospace;
  font-size: .77rem;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
}

.dialog-action {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  border: 1px solid #268b96;
  border-radius: 4px;
  color: #051116;
  background: var(--cyan);
  cursor: pointer;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 430px;
  }

  .tier-characters {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .result-count {
    margin-left: 0;
  }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .primary-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    justify-content: space-around;
    gap: 0;
    height: 56px;
    border-top: 1px solid var(--line);
    background: #07111e;
  }

  .nav-link {
    flex: 1;
    min-width: 0;
    font-size: .72rem;
  }

  .header-actions {
    grid-column: 2;
  }

  .page-shell {
    width: min(100% - 28px, 760px);
    padding-top: 26px;
    padding-bottom: 80px;
  }

  .page-intro {
    display: grid;
  }

  .quality-strip {
    justify-content: flex-start;
  }

  .content-layout {
    display: block;
  }

  .character-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    max-height: none;
    border: 0;
    border-radius: 0;
    visibility: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
  }

  body.panel-open {
    overflow: hidden;
  }

  body.panel-open .character-panel {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  .panel-close {
    display: block;
  }
}

@media (max-width: 650px) {
  .brand {
    font-size: .78rem;
  }

  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .return-to-game {
    width: 38px;
    min-width: 38px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .return-to-game::before {
    content: "↩";
    font-size: 1rem;
  }

  .patch-setter > span {
    display: none;
  }

  .patch-setter select {
    width: 128px;
    min-width: 0;
    padding-left: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .data-notice {
    grid-template-columns: auto 1fr;
  }

  .data-notice button {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-box,
  .segmented-control {
    width: 100%;
    max-width: none;
  }

  .segmented-control button {
    flex: 1;
    padding: 0 7px;
  }

  .select-control {
    flex: 1;
  }

  .result-count {
    width: 100%;
  }

  .tier-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .tier-letter {
    font-size: 1.65rem;
  }

  .tier-characters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px;
  }

  .character-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 6px;
    min-height: 64px;
    padding: 6px;
  }

  .portrait {
    width: 40px;
    height: 40px;
  }

  .card-name {
    font-size: .74rem;
  }

  .detail-header {
    grid-template-columns: 70px minmax(0, 1fr);
    padding: 14px;
  }

  .detail-portrait-wrap,
  .detail-portrait {
    width: 70px;
    height: 70px;
  }

  .detail-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-metric:nth-child(2) {
    border-right: 0;
  }

  .detail-metric:last-child {
    grid-column: 1 / -1;
    padding-top: 5px;
    border-top: 1px solid var(--line);
  }

  .stat-grid,
  .matchup-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
    padding-bottom: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
