:root {
  --bg: #090c11;
  --bg-2: #0d1219;
  --panel: #121922;
  --panel-2: #0f151d;
  --panel-3: #17212c;
  --line: #243241;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #eaf0f7;
  --muted: #8e9cae;
  --muted-2: #677586;
  --accent: #ff8a3d;
  --accent-deep: #ff6a1f;
  --accent-soft: rgba(255, 138, 61, 0.13);
  --gold: #ffd166;
  --teal: #56d6c8;
  --red: #ff6474;
  --green: #7ee081;
  --radius: 18px;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 540px at 84% -8%, rgba(255, 138, 61, 0.17), transparent 62%),
    radial-gradient(700px 460px at -4% 18%, rgba(86, 214, 200, 0.075), transparent 60%),
    radial-gradient(700px 500px at 50% 108%, rgba(255, 138, 61, 0.06), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, auto, 46px 46px, 46px 46px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}

::selection {
  color: #170a02;
  background: var(--accent);
}

img { max-width: 100%; }

a { color: inherit; text-decoration: none; }

button,
input,
select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }

ul, ol { padding: 0; }

.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;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #180a02;
  font-weight: 800;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 14px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 12, 17, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 138, 61, 0.55), transparent);
  opacity: 0.6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 138, 61, 0.42);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 138, 61, 0.18), rgba(255, 138, 61, 0.03));
  box-shadow: inset 0 0 18px rgba(255, 138, 61, 0.08);
}

.brand-mark img {
  width: 31px;
  height: 31px;
  image-rendering: pixelated;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-size: 1.02rem;
  letter-spacing: 0.05em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.78rem;
  transition: 0.2s ease;
}

.icon-btn:hover {
  border-color: rgba(255, 209, 102, 0.5);
  color: var(--gold);
}

.icon-btn span[aria-hidden] { font-size: 0.92rem; }

.fav-count {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-align: center;
}

.fav-count.has-fav {
  background: var(--gold);
  color: #211703;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, #ff9a53, #ff6b1f);
  color: #1b0b02;
  box-shadow: 0 10px 30px rgba(255, 106, 31, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(255, 106, 31, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 138, 61, 0.45);
  background: rgba(255, 138, 61, 0.07);
  transform: translateY(-2px);
}

.btn-small {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.78rem;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.96fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 6.5vw, 92px) 24px clamp(56px, 7vw, 96px);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 138, 61, 0.25);
  border-radius: 999px;
  background: rgba(255, 138, 61, 0.07);
  color: #ffba86;
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(86, 214, 200, 0.12);
  animation: pulse 2.2s ease-in-out infinite;
}

.wordmark {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 20px 0 6px;
  color: transparent;
  background: linear-gradient(180deg, #ffe09a 0%, #ffb14e 35%, #ff6b1f 78%, #d54500 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-family: "Arial Black", "Microsoft YaHei", var(--font);
  font-size: clamp(3.2rem, 8.6vw, 8rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.055em;
  transform: skewX(-4deg);
  transform-origin: left bottom;
  filter: drop-shadow(0 5px 0 #4d1700) drop-shadow(0 9px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 24px 42px rgba(255, 106, 31, 0.22));
}

.hero-title {
  display: block;
  max-width: 650px;
  margin-top: 20px;
  font-size: clamp(1.65rem, 3.4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.26;
  letter-spacing: -0.035em;
}

.hero-title .accent {
  margin: 0 0.12em;
  color: var(--accent);
}

.hero-lead {
  max-width: 590px;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  line-height: 1.9;
}

.hero-lead strong {
  color: #d8e1ec;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.hero-stats > div {
  padding: 0 16px;
  border-left: 1px solid var(--line-soft);
}

.hero-stats > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats dt {
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-stats dd {
  margin-top: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.hero-note span { color: var(--gold); }

/* Hero board */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 24px 6px;
}

.board-glow {
  position: absolute;
  inset: 12% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.22), transparent 66%);
  filter: blur(30px);
  pointer-events: none;
}

.hero-board {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 138, 61, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 138, 61, 0.06), transparent 38%),
    linear-gradient(180deg, #151d27, #0d131b);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: rotate(1.6deg);
}

.hero-board::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  pointer-events: none;
}

.board-bar,
.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.board-bar span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.board-bar i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 138, 61, 0.7);
}

.board-bar span:last-child { color: #ffb27b; }

.board-foot {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  letter-spacing: 0.03em;
}

.board-foot span:first-child { color: var(--muted); }
.board-code { color: var(--teal); }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 8px 0 2px;
}

.hero-tile {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  aspect-ratio: 1 / 1.08;
  padding: 6px 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.07), transparent 55%),
    rgba(255, 255, 255, 0.018);
  overflow: hidden;
  transition: 0.25s ease;
}

.hero-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.hero-tile img {
  width: 74%;
  max-width: 74px;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease;
}

.hero-tile span {
  position: relative;
  z-index: 1;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.46rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-tile:hover {
  border-color: rgba(255, 138, 61, 0.35);
  background: rgba(255, 138, 61, 0.06);
  transform: translateY(-3px);
}

.hero-tile:hover img { transform: scale(1.1) translateY(-2px); }

.float-chip {
  position: absolute;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 6px;
  color: #141005;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.chip-one {
  top: 1%;
  right: -1%;
  background: var(--gold);
  transform: rotate(6deg);
}

.chip-two {
  bottom: 1%;
  left: -1%;
  background: var(--teal);
  transform: rotate(-5deg);
}

.float-sprite {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: #131b25;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: bob 5s ease-in-out infinite;
}

.float-sprite img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

.float-sprite-a {
  right: -18px;
  bottom: 20%;
  transform: rotate(5deg);
}

.float-sprite-b {
  top: 15%;
  left: -22px;
  transform: rotate(-6deg);
  animation-delay: -2.2s;
}

/* ---------- Sections ---------- */

.section {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(54px, 6vw, 88px) 24px;
  scroll-margin-top: 80px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.section-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.section-head h2 {
  margin-top: 7px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.section-desc {
  max-width: 430px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.8;
  text-align: right;
}

/* Quick picks */

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

.quick-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  text-align: left;
  overflow: hidden;
  transition: 0.22s ease;
}

.quick-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--type-color, var(--accent));
  opacity: 0.75;
}

.quick-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--type-color, var(--accent)) 42%, var(--line));
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.015));
}

.quick-sprite {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-soft);
}

.quick-sprite img {
  width: 46px;
  height: 46px;
  image-rendering: pixelated;
}

.quick-info { min-width: 0; }

.quick-info strong {
  display: block;
  font-size: 0.93rem;
  line-height: 1.3;
}

.quick-info small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-arrow {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 1rem;
  transition: 0.2s ease;
}

.quick-card:hover .quick-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---------- Toolbar ---------- */

.toolbar {
  position: relative;
  z-index: 2;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 21, 29, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.search-box:focus-within {
  border-color: rgba(255, 138, 61, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.09);
}

.search-box svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.86rem;
}

.search-box input::placeholder { color: var(--muted-2); }

.search-box kbd {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-align: center;
}

.toolbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  transition: 0.18s ease;
  white-space: nowrap;
}

.chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--chip-color, var(--muted));
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 55%, transparent);
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 14%, transparent);
  color: var(--text);
}

.chip[aria-pressed="true"] i {
  box-shadow: 0 0 8px var(--chip-color, var(--accent));
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.select-wrap {
  position: relative;
  display: inline-flex;
}

.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  color: var(--muted-2);
  font-size: 0.62rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.select-wrap select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.select-wrap select:focus { border-color: var(--accent); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}

.segmented button {
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  transition: 0.18s ease;
}

.segmented button:hover { color: var(--text); }

.segmented button[aria-pressed="true"] {
  background: rgba(255, 138, 61, 0.16);
  color: #ffb27b;
}

.fav-toggle { height: 34px; border-radius: 8px; }
.fav-toggle[aria-pressed="true"] {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
}

.fav-toggle[aria-pressed="true"] .fav-count {
  background: var(--gold);
  color: #211703;
}

/* ---------- Results / grid ---------- */

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px 12px;
}

.results-bar p {
  color: var(--muted);
  font-size: 0.78rem;
}

.results-bar p strong { color: var(--text); }

.legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(86, 214, 200, 0.7);
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.char-card {
  --type-color: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 278px;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(140px 100px at 50% 30%, color-mix(in srgb, var(--type-color) 8%, transparent), transparent 72%),
    linear-gradient(165deg, #151d27 0%, #10161e 60%, #0d1219 100%);
  overflow: hidden;
  cursor: pointer;
  outline: 0;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  animation: card-in 0.4s ease both;
}

.char-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--type-color), transparent);
  opacity: 0.75;
}

.char-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px 150px at 50% 10%, color-mix(in srgb, var(--type-color) 10%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.char-card:hover,
.char-card:focus-visible {
  border-color: color-mix(in srgb, var(--type-color) 46%, var(--line));
  transform: translateY(-5px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38), 0 0 0 1px color-mix(in srgb, var(--type-color) 12%, transparent);
}

.char-card:hover::after,
.char-card:focus-visible::after { opacity: 1; }

.card-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.card-index {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

.dlc-badge {
  padding: 1px 5px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 4px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.fav-btn {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4e5a69;
  font-size: 0.95rem;
  line-height: 1;
  transition: 0.18s ease;
}

.fav-btn:hover {
  color: var(--gold);
  background: rgba(255, 209, 102, 0.1);
  transform: scale(1.12);
}

.fav-btn.is-fav {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.65);
}

.sprite-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 104px;
  margin: 2px 0 1px;
}

.sprite-wrap::after {
  content: "";
  position: absolute;
  bottom: 9px;
  left: 50%;
  width: 66px;
  height: 11px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(5px);
  transform: translateX(-50%);
}

.char-sprite {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.4));
  transition: transform 0.24s ease;
}

.char-card:hover .char-sprite {
  transform: translateY(-4px) scale(1.06);
}

.card-name {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-en {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-build {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--type-color);
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.35;
}

.card-build::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.card-tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.mini-tag {
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.5;
}

.card-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.diff-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.diff-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #33404e;
}

.diff-dots i.on { background: var(--accent); box-shadow: 0 0 6px rgba(255, 138, 61, 0.5); }

.diff-label {
  margin-right: 4px;
  color: var(--muted-2);
  font-size: 0.58rem;
}

.card-open {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.03em;
  transition: 0.2s ease;
}

.char-card:hover .card-open { color: var(--type-color); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
}

.empty-state[hidden] { display: none; }

.empty-spud {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  filter: grayscale(1);
  opacity: 0.65;
}

.empty-spud img { width: 55px; height: 55px; image-rendering: pixelated; }

.empty-state h3 { margin-top: 16px; font-size: 1.1rem; }

.empty-state p { margin: 5px 0 16px; color: var(--muted); font-size: 0.8rem; }

/* ---------- Mechanics ---------- */

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

.mechanic-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  transition: 0.2s ease;
}

.mechanic-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 138, 61, 0.07);
  filter: blur(20px);
  pointer-events: none;
}

.mechanic-card:hover {
  border-color: rgba(255, 138, 61, 0.28);
  transform: translateY(-2px);
}

.mechanic-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 138, 61, 0.25);
  border-radius: 9px;
  background: rgba(255, 138, 61, 0.08);
  font-size: 1rem;
}

.mechanic-card h3 {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 800;
}

.mechanic-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

.mechanic-card p strong { color: #d7e0ea; font-weight: 700; }

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.mini-tags span {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 0.6rem;
}

.rhythm {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.rhythm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.rhythm-head h3 { font-size: 1.1rem; font-weight: 800; }

.rhythm-head p { color: var(--muted); font-size: 0.76rem; }

.rhythm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rhythm-grid article {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.13);
}

.rhythm-wave {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.rhythm-grid h4 { margin-top: 5px; font-size: 0.9rem; }

.rhythm-grid p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.75;
}

.shop-rule {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  margin-top: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 209, 102, 0.16);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.055), rgba(255, 209, 102, 0.01));
}

.shop-rule h3 { margin-top: 5px; font-size: 1.2rem; }

.shop-rule ol {
  display: grid;
  gap: 12px;
  list-style: none;
  counter-reset: rule;
}

.shop-rule li {
  position: relative;
  padding-left: 34px;
  counter-increment: rule;
}

.shop-rule li::before {
  content: "0" counter(rule);
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
}

.shop-rule li strong {
  display: block;
  font-size: 0.86rem;
}

.shop-rule li span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- About / footer ---------- */

.about { padding-bottom: 40px; }

.about-card {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: center;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(400px 240px at 88% 20%, rgba(255, 138, 61, 0.1), transparent 65%),
    linear-gradient(150deg, #151d27, #0d1219);
}

.about-copy h2 {
  margin-top: 6px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.about-copy > p {
  max-width: 660px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.about-copy strong { color: #d9e2ec; }

.about-small {
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.76rem !important;
}

.about-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(-1.5deg);
}

.about-logo img { width: 100%; max-width: 230px; }

.about-logo span {
  color: #5c5148;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: rgba(5, 8, 11, 0.5);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.footer-inner p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.footer-inner strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.footer-links {
  flex-direction: row !important;
  gap: 18px !important;
}

.footer-links a { transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 9, 0.78);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  animation: fade-in 0.22s ease both;
}

.modal-panel {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border: 1px solid #2b3a4a;
  border-radius: 22px;
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(255, 138, 61, 0.07), transparent 65%),
    linear-gradient(160deg, #151d27, #0c1118 70%);
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7);
  overflow: auto;
  animation: modal-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  scrollbar-width: thin;
  scrollbar-color: #334253 transparent;
}

.modal-panel::-webkit-scrollbar { width: 9px; }
.modal-panel::-webkit-scrollbar-track { background: transparent; }
.modal-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #334253;
  background-clip: padding-box;
}

.modal-close {
  position: sticky;
  top: 12px;
  z-index: 8;
  float: right;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 12px 12px -50px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 21, 29, 0.9);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: 0.2s ease;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

.detail {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

.detail-aside {
  position: relative;
  padding: 30px 26px 26px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(280px 200px at 50% 16%, color-mix(in srgb, var(--type-color, var(--accent)) 12%, transparent), transparent 72%);
}

.detail-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 210px;
  margin-bottom: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.022) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.022) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.022) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.022) 75%),
    rgba(0, 0, 0, 0.16);
  background-position: 0 0, 9px 9px;
  background-size: 18px 18px;
  overflow: hidden;
}

.detail-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--type-color, var(--accent)) 18%, transparent), transparent 62%);
}

.detail-portrait img {
  position: relative;
  z-index: 1;
  width: 164px;
  height: 164px;
  image-rendering: pixelated;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.45));
}

.detail-id {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.detail-id .dlc-badge { font-size: 0.5rem; }

.detail-name {
  margin-top: 7px;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.detail-name span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.detail-chips span {
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--accent)) 35%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 10%, transparent);
  color: color-mix(in srgb, var(--chip-color, var(--accent)) 72%, white);
  font-size: 0.7rem;
  font-weight: 600;
}

.meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.78rem;
}

.meta-row:first-of-type { margin-top: 14px; }
.meta-row > span { color: var(--muted-2); white-space: nowrap; }
.meta-row > b { color: var(--text); font-weight: 600; text-align: right; font-size: 0.78rem; }

.mechanic-box {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.mechanic-box h4 {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.mechanic-box p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

.aside-actions {
  display: flex;
  gap: 7px;
  margin-top: 16px;
}

.aside-actions .btn { flex: 1; min-height: 38px; font-size: 0.72rem; }

.detail-main {
  padding: 38px 34px 26px;
  min-width: 0;
}

.build-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.build-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--type-color, var(--accent));
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.build-label::before {
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
}

.build-head h3 {
  margin-top: 6px;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.build-head p {
  max-width: 740px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.85;
}

.block { margin-top: 24px; }

.block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  font-size: 0.9rem;
  font-weight: 800;
}

.block-title span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

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

.loadout-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  transition: 0.18s ease;
}

.loadout-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.icon-box {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.icon-box img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}

.icon-fallback {
  display: none;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.icon-box.missing img { display: none; }
.icon-box.missing .icon-fallback { display: grid; place-items: center; }

.loadout-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.loadout-meta strong {
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-meta small {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-meta em {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-weapons {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed rgba(255, 138, 61, 0.3);
  border-radius: 10px;
  background: rgba(255, 138, 61, 0.045);
}

.no-weapons .no-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 138, 61, 0.35);
  border-radius: 8px;
  color: var(--accent);
  font-size: 1.1rem;
}

.no-weapons p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.no-weapons p strong {
  display: block;
  color: var(--text);
  font-size: 0.76rem;
}

/* stat bars */

.stat-bars {
  display: grid;
  gap: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
}

.stat-name {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.stat-track {
  display: block;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.stat-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--type-color, var(--accent)) 45%, #fff0), var(--type-color, var(--accent)));
  box-shadow: 0 0 12px color-mix(in srgb, var(--type-color, var(--accent)) 30%, transparent);
  transform-origin: left;
}

.stat-val {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.6rem;
  text-align: right;
}

/* phases */

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

.phase {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
}

.phase span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.phase p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.tips-list {
  display: grid;
  gap: 5px;
  list-style: none;
}

.tips-list li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.tips-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--type-color, var(--accent));
  font-size: 0.7rem;
}

.modal-nav {
  position: sticky;
  bottom: 0;
  z-index: 7;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 12, 17, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.modal-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  padding: 9px 16px;
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 999px;
  background: rgba(20, 26, 34, 0.96);
  color: var(--text);
  font-size: 0.76rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Animations ---------- */

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(86, 214, 200, 0.1); }
  50% { box-shadow: 0 0 0 8px rgba(86, 214, 200, 0.02); }
}

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { transform: translateY(20px) scale(0.985); }
  to { transform: translateY(0) scale(1); }
}

@keyframes sprite-in {
  from { opacity: 0; transform: scale(0.86) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
    max-width: 760px;
  }

  .hero-visual { order: -1; }

  .hero-board { transform: rotate(1.2deg); }

  .hero-copy { text-align: left; }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-desc { text-align: left; }

  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mechanic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .about-card { grid-template-columns: 1fr 240px; gap: 24px; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header { gap: 16px; }
  .header-actions { margin-left: auto; }

  .toolbar-row { flex-direction: column; }
  .toolbar-right { justify-content: flex-start; width: 100%; }

  .detail { grid-template-columns: 1fr; }
  .detail-aside {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 24px;
  }

  .detail-portrait {
    grid-row: 1 / span 3;
    height: 180px;
    margin-bottom: 0;
  }

  .detail-portrait img { width: 140px; height: 140px; }

  .meta-row,
  .mechanic-box,
  .aside-actions { grid-column: 1 / -1; }

  .meta-row > b { min-width: 0; }

  .detail-main { padding: 26px 24px 22px; }

  .mechanic-grid { grid-template-columns: 1fr; }

  .rhythm-grid { grid-template-columns: 1fr; }

  .shop-rule { grid-template-columns: 1fr; gap: 14px; }

  .about-card { grid-template-columns: 1fr; }
  .about-logo { max-width: 320px; }
}

@media (max-width: 640px) {
  .site-header {
    height: 62px;
    padding: 0 14px;
  }

  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand-mark img { width: 27px; height: 27px; }
  .brand-text strong { font-size: 0.9rem; }
  .brand-text small { font-size: 0.5rem; }
  .header-actions .btn { display: none; }
  .icon-btn { height: 34px; padding: 0 9px; }

  .hero { padding: 34px 16px 44px; }
  .wordmark { font-size: clamp(3.4rem, 18vw, 5rem); }
  .hero-title { margin-top: 16px; font-size: 1.5rem; }
  .hero-lead { font-size: 0.86rem; line-height: 1.8; }
  .hero-actions .btn { flex: 1; min-width: 150px; }
  .hero-stats { margin-top: 26px; }
  .hero-stats > div { padding: 0 9px; }
  .hero-stats dt { font-size: 0.55rem; }
  .hero-stats dd { font-size: 1.05rem; }

  .hero-visual { padding: 12px 0 18px; }
  .hero-board { width: 100%; padding: 10px; border-radius: 16px; }
  .hero-grid { gap: 5px; }
  .hero-tile { border-radius: 7px; padding: 4px 2px; }
  .hero-tile span { font-size: 0.38rem; }
  .float-chip { display: none; }
  .float-sprite { display: none; }

  .section { padding: 44px 16px; }
  .section-head { margin-bottom: 22px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { padding: 12px; }

  .toolbar { padding: 11px; }
  .chips {
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .segmented { flex: 0 0 auto; }
  .fav-toggle { flex: 0 0 auto; }
  .search-box { height: 44px; }
  .search-box kbd { display: none; }

  .results-bar { align-items: flex-start; flex-direction: column; gap: 4px; padding-top: 14px; }
  .legend { display: none; }

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

  .char-card {
    min-height: 236px;
    padding: 10px 10px 9px;
    border-radius: 13px;
  }

  .sprite-wrap { height: 84px; }
  .char-sprite { width: 70px; height: 70px; }
  .card-name { font-size: 0.9rem; }
  .card-en { font-size: 0.48rem; }
  .card-build { margin-top: 6px; font-size: 0.68rem; }
  .card-tags { margin-top: 6px; gap: 3px; }
  .mini-tag { font-size: 0.55rem; padding: 1px 4px; }
  .card-foot { padding-top: 7px; }
  .card-open { display: none; }
  .diff-label { display: none; }

  .mechanic-card { padding: 16px; }
  .rhythm { padding: 16px; }
  .rhythm-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .shop-rule { padding: 18px; }

  .about-card { padding: 20px; }
  .about-logo { margin: 0 auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; padding: 18px 16px; }
  .footer-links { flex-wrap: wrap; }

  .modal {
    padding: 0;
    align-items: stretch;
  }

  .modal-panel {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal-close { margin: 10px 10px -48px 0; }

  .detail-aside {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 0 14px;
    padding: 18px 16px;
  }

  .detail-portrait { height: 136px; border-radius: 12px; }
  .detail-portrait img { width: 104px; height: 104px; }
  .detail-name { font-size: 1.3rem; }
  .detail-name span { font-size: 0.54rem; }
  .meta-row { padding: 6px 0; font-size: 0.64rem; }
  .meta-row > b { font-size: 0.64rem; }
  .mechanic-box { grid-column: 1 / -1; margin-top: 12px; }
  .aside-actions { grid-column: 1 / -1; }

  .detail-main { padding: 22px 16px 18px; }
  .loadout-grid { grid-template-columns: 1fr; }
  .phases { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 70px minmax(0, 1fr) 28px; }
  .modal-nav { padding: 12px 16px; }
}

@media (max-width: 390px) {
  .char-card { min-height: 220px; }
  .sprite-wrap { height: 76px; }
  .char-sprite { width: 62px; height: 62px; }
  .card-build { font-size: 0.63rem; }
  .detail-aside { grid-template-columns: 100px minmax(0, 1fr); }
  .detail-portrait { height: 120px; }
  .detail-portrait img { width: 92px; height: 92px; }
}

@media (max-width: 340px) {
  .char-grid { grid-template-columns: 1fr; }
  .char-card { min-height: 250px; }
  .sprite-wrap { height: 96px; }
  .char-sprite { width: 80px; height: 80px; }
  .detail-aside { display: block; padding-top: 48px; }
  .detail-portrait { height: 160px; margin-bottom: 14px; }
  .detail-portrait img { width: 124px; height: 124px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.btn.is-fav { border-color: rgba(255,209,102,0.55); background: rgba(255,209,102,0.12); color: var(--gold); }
@media (max-width: 640px) { .detail-aside { padding-top: 46px; } }
