:root {
  --bg: #0d0a1a;
  --bg-elevated: #16122a;
  --surface: #1e1838;
  --border: #3d3570;
  --text: #f4f2ff;
  --muted: #a89fd4;
  --accent-hot: #ff2d6a;
  --accent-cool: #00d4ff;
  --accent-gold: #ffd23c;
  --vanguard: #4ec4ff;
  --duelist: #ff7b4a;
  --strategist: #7dff9a;
  --radius: 12px;
  --font: "Outfit", system-ui, sans-serif;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --fx-glow: 0 0 40px rgba(120, 80, 220, 0.15);
  --fx-duration: 0.35s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(138, 80, 255, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 20%, rgba(255, 60, 120, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 45% at 0% 70%, rgba(0, 220, 200, 0.14), transparent 45%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(255, 200, 60, 0.1), transparent 40%),
    linear-gradient(180deg, #120c24 0%, var(--bg) 35%, #0a0818 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(100, 200, 255, 0.09), transparent 52%),
    radial-gradient(ellipse 60% 45% at 100% 30%, rgba(180, 100, 255, 0.06), transparent 45%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(255, 80, 140, 0.05), transparent 40%);
  animation: fx-ambient-drift 22s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

a {
  color: #9ae8ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid rgba(120, 100, 200, 0.35);
  background: linear-gradient(
    180deg,
    rgba(40, 25, 80, 0.55) 0%,
    rgba(13, 10, 26, 0.3) 100%
  );
  box-shadow:
    0 4px 24px rgba(100, 60, 200, 0.15),
    0 1px 0 rgba(0, 212, 255, 0.12) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
}

.site-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
}

.site-title a {
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    115deg,
    var(--accent-gold) 0%,
    #ff6b9d 25%,
    #b967ff 55%,
    var(--accent-cool) 85%,
    #7dffec 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  text-decoration: none;
  filter: drop-shadow(0 2px 12px rgba(180, 100, 255, 0.35));
  transition: filter 0.2s ease, transform 0.2s ease;
  animation: fx-title-shimmer 12s ease-in-out infinite;
}

.site-title a:hover {
  filter: drop-shadow(0 4px 24px rgba(100, 220, 255, 0.55));
  transform: scale(1.02);
  animation-play-state: paused;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.nav a {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.18s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(180, 160, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.nav a[aria-current="page"] {
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent-cool), #a855f7);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.35);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  animation: fx-main-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-heading {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-cool), #e8a0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 0 1.75rem;
}

.lead::after {
  content: "";
  display: block;
  width: min(14rem, 70%);
  height: 2px;
  margin-top: 1.1rem;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.45),
    rgba(185, 103, 255, 0.5),
    transparent
  );
  opacity: 0.85;
}

.panel {
  background: linear-gradient(145deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid rgba(130, 100, 220, 0.35);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
  transition:
    transform var(--fx-duration) ease,
    box-shadow var(--fx-duration) ease,
    border-color var(--fx-duration) ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(160, 140, 240, 0.5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 16px 48px rgba(0, 0, 0, 0.4),
    var(--fx-glow);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.count-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.count-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(10, 8, 24, 0.65);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.count-field input:focus {
  outline: none;
  border-color: var(--accent-cool);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.count-field--vanguard label {
  color: var(--vanguard);
  text-shadow: 0 0 20px rgba(78, 196, 255, 0.35);
}

.count-field--duelist label {
  color: var(--duelist);
  text-shadow: 0 0 20px rgba(255, 123, 74, 0.35);
}

.count-field--strategist label {
  color: var(--strategist);
  text-shadow: 0 0 20px rgba(125, 255, 154, 0.25);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.teamup-controls {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.8rem 1.1rem;
}

.teamup-controls__check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.teamup-controls__check input {
  accent-color: var(--accent-cool);
}

.teamup-controls__select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.teamup-controls__select {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(10, 8, 24, 0.65);
  color: var(--text);
  padding: 0.35rem 0.55rem;
}

#count-total {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

#count-total.is-valid {
  color: var(--strategist);
  text-shadow: 0 0 14px rgba(125, 255, 154, 0.45);
  animation: fx-count-glow 2.8s ease-in-out infinite;
}

#count-total.is-invalid {
  color: #ffc46b;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: scale(0.97) translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-hot) 0%, #ff5e9c 40%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(255, 45, 106, 0.45);
}

.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(255, 45, 106, 0.55);
}

.btn--teamup {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 46%, #4f6ae8 100%);
  color: #fff;
  box-shadow:
    0 5px 18px rgba(30, 100, 200, 0.5),
    0 0 30px rgba(40, 150, 255, 0.4),
    0 0 52px rgba(30, 120, 220, 0.28);
}

.btn--teamup:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 6px 22px rgba(35, 110, 220, 0.55),
    0 0 38px rgba(55, 165, 255, 0.48),
    0 0 60px rgba(40, 140, 240, 0.32);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(160, 140, 220, 0.4);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--accent-cool);
  background: rgba(0, 212, 255, 0.1);
}

.lineup-error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 45, 106, 0.12);
  border: 1px solid rgba(255, 100, 140, 0.45);
  border-radius: 8px;
  color: #ffb8d4;
  font-size: 0.95rem;
}

.lineup-output {
  margin-top: 0.5rem;
}

.lineup-empty {
  margin: 0 0 1rem;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: 1px dashed rgba(130, 100, 200, 0.35);
  background: rgba(0, 0, 0, 0.15);
}

.lineup-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.lineup-teamups {
  margin: 1rem auto 0;
  max-width: 44rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 255, 154, 0.35);
  background: rgba(125, 255, 154, 0.08);
}

.lineup-teamups__title {
  margin: 0 0 0.35rem;
  color: var(--strategist);
  font-weight: 700;
}

.lineup-teamups__section-title {
  margin: 0.85rem 0 0.4rem;
  color: var(--accent-cool);
  font-weight: 700;
  font-size: 0.95rem;
}

.lineup-teamups__section-title:first-of-type {
  margin-top: 0.35rem;
}

.lineup-teamups__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.lineup-teamups__anchor-item {
  margin-bottom: 0.55rem;
}

.lineup-teamups__anchor-item:last-child {
  margin-bottom: 0;
}

.lineup-teamups__anchor-label {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--strategist);
  font-weight: 700;
}

.lineup-teamups__tethers {
  margin: 0.15rem 0 0 0.35rem;
  padding-left: 1rem;
  list-style: circle;
  list-style-position: outside;
  color: var(--text);
  font-weight: 600;
}

.lineup-teamups__tethers li {
  margin: 0.1rem 0;
  color: var(--text);
}

.lineup-teamups__meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.lineup-teamups__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
}

.lineup-teamups__controls-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.2rem;
}

.btn.is-active {
  border-color: rgba(0, 212, 255, 0.6);
  color: var(--text);
  background: rgba(0, 212, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.22) inset;
}

.lineup-teamups__section-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.lineup-teamups__section-toggle:hover {
  filter: brightness(1.08);
}

.lineup-teamups__counter-block {
  margin-bottom: 0.85rem;
  list-style: none;
  margin-left: -0.25rem;
}

.lineup-teamups__counter-block:last-child {
  margin-bottom: 0;
}

.lineup-teamups__counter-title {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.lineup-teamups__counter-title strong {
  color: var(--strategist);
  font-weight: 700;
}

.lineup-teamups__counter-confidence {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.lineup-teamups__counter-confidence--high {
  color: #9ef7ff;
  border-color: rgba(0, 212, 255, 0.45);
  background: rgba(0, 212, 255, 0.13);
}

.lineup-teamups__counter-confidence--medium {
  color: #c6dfff;
  border-color: rgba(109, 161, 255, 0.42);
  background: rgba(109, 161, 255, 0.14);
}

.lineup-teamups__counter-confidence--low {
  color: #a8c0d8;
  border-color: rgba(140, 150, 185, 0.36);
  background: rgba(120, 130, 160, 0.12);
}

.lineup-teamups__counter-reasons {
  margin: 0;
  padding-left: 1rem;
  list-style: disc;
}

.lineup-teamups__counter-reasons > li {
  margin: 0.35rem 0;
  color: var(--text);
}

.lineup-teamups__counter-enemy {
  font-weight: 700;
  color: var(--text);
}

.lineup-teamups__counter-reason {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.45;
}

.lineup-teamups__counter-block > .lineup-teamups__counter-reason {
  margin: 0.25rem 0 0.35rem;
}

.lineup-teamups__counter-targets {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Counter page analysis — blue theme (nav / vanguard / teamup button family) */
#counter-analysis.lineup-teamups {
  font-family: var(--font);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(
    160deg,
    rgba(15, 40, 75, 0.55) 0%,
    rgba(22, 18, 42, 0.92) 42%,
    rgba(12, 45, 68, 0.45) 100%
  );
  box-shadow:
    0 0 32px rgba(30, 120, 200, 0.18),
    inset 0 1px 0 rgba(56, 189, 248, 0.12);
}

#counter-analysis .lineup-teamups__title--spectrum {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: transparent;
  background: linear-gradient(
    120deg,
    #7dd3fc 0%,
    var(--vanguard) 28%,
    var(--accent-cool) 58%,
    #38bdf8 88%,
    #bae6fd 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 16px rgba(56, 189, 248, 0.35));
}

#counter-analysis .lineup-teamups__title--teamups-accent {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: transparent;
  background: linear-gradient(95deg, #60a5fa, var(--accent-cool), #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
}

#counter-analysis .lineup-teamups__meta--spectrum {
  color: #93c5fd;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.45rem 0 0.45rem 0.75rem;
  border-left: 3px solid #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.85rem;
}

#counter-analysis .lineup-teamups__meta--empty {
  color: #7eb8e8;
  font-style: italic;
  font-size: 0.92rem;
}

#counter-analysis .lineup-teamups__section-title--dive {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

#counter-analysis .lineup-teamups__section-title--dive:first-of-type {
  margin-top: 0.35rem;
}

#counter-analysis .lineup-teamups__section-title--flyer {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cool);
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.3);
}

#counter-analysis .lineup-teamups__section-title--default {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bae6fd;
}

#counter-analysis .lineup-teamups__counter-title strong {
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: transparent;
  background: linear-gradient(105deg, #e0f2fe 0%, var(--vanguard) 45%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

#counter-analysis .lineup-teamups__counter-block--dive {
  border-left: 3px solid #0ea5e9;
  padding: 0.35rem 0 0.35rem 0.65rem;
  margin-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(14, 165, 233, 0.07);
}

#counter-analysis .lineup-teamups__counter-block--flyer {
  border-left: 3px solid var(--accent-cool);
  padding: 0.35rem 0 0.35rem 0.65rem;
  margin-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(0, 212, 255, 0.06);
}

#counter-analysis .lineup-teamups__counter-enemy {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  color: #bae6fd;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.2);
}

#counter-analysis .lineup-teamups__counter-reason {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  color: #a8c9e8;
}

#counter-analysis .lineup-teamups__counter-reasons {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
}

#counter-analysis .lineup-teamups__counter-reasons > li {
  margin: 0.4rem 0;
  padding-left: 0.15rem;
}

#counter-analysis .lineup-teamups__counter-reasons ::marker {
  color: #38bdf8;
  font-size: 0.75em;
}

#counter-analysis .lineup-teamups__counter-block > .lineup-teamups__counter-reason {
  font-size: 0.89rem;
  color: #b0d0ec;
}

#counter-analysis .lineup-teamups__counter-targets {
  font-family: var(--font);
  font-size: 0.84rem;
  line-height: 1.45;
  color: #7eb3d9;
  border-top: 1px solid rgba(56, 189, 248, 0.22);
  padding-top: 0.45rem;
  margin-top: 0.35rem;
}

#counter-analysis .lineup-teamups__anchor-label {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  color: transparent;
  background: linear-gradient(90deg, #93c5fd, var(--accent-cool));
  -webkit-background-clip: text;
  background-clip: text;
}

#counter-analysis .lineup-teamups__tethers {
  list-style: circle;
}

#counter-analysis .lineup-teamups__tethers ::marker {
  color: #38bdf8;
}

#counter-analysis .lineup-teamups__tethers li {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  color: #dbeafe;
  line-height: 1.4;
}

#counter-analysis .lineup-teamups__list {
  color: #e8f4fc;
}

.btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
}

.btn:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent-cool);
  outline-offset: 2px;
}

.lineup-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem 1.25rem;
  justify-content: center;
}

.lineup-role-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.lineup-role-group[data-role="vanguard"] {
  border-color: rgba(78, 196, 255, 0.55);
  box-shadow: 0 0 24px rgba(78, 196, 255, 0.12);
}

.lineup-role-group[data-role="duelist"] {
  border-color: rgba(255, 123, 74, 0.55);
  box-shadow: 0 0 24px rgba(255, 123, 74, 0.12);
}

.lineup-role-group[data-role="strategist"] {
  border-color: rgba(125, 255, 154, 0.45);
  box-shadow: 0 0 24px rgba(125, 255, 154, 0.1);
}

.hero-card {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 18, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  min-width: 132px;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1),
    box-shadow 0.22s ease,
    filter 0.22s ease,
    border-color 0.22s ease;
}

.hero-card:hover {
  transform: translateY(-5px);
  filter: brightness(1.06);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.hero-card[data-role="vanguard"] {
  border-left: 4px solid var(--vanguard);
  box-shadow: 0 4px 16px rgba(78, 196, 255, 0.15);
}

.hero-card[data-role="duelist"] {
  border-left: 4px solid var(--duelist);
  box-shadow: 0 4px 16px rgba(255, 123, 74, 0.15);
}

.hero-card[data-role="strategist"] {
  border-left: 4px solid var(--strategist);
  box-shadow: 0 4px 16px rgba(125, 255, 154, 0.12);
}

.hero-card__role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.hero-card__name {
  font-weight: 700;
  font-size: 1rem;
}

@keyframes hero-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-card--enter {
  animation: hero-card-enter 0.38s ease backwards;
  animation-delay: calc(var(--stagger, 0) * 45ms);
}

@media (prefers-reduced-motion: reduce) {
  .hero-card--enter {
    animation: none;
  }
}

.page-tools {
  margin-bottom: 2rem;
}

.filter-row {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-row--heroes {
  align-items: center;
  gap: 1rem 1.25rem;
}

.filter-cluster {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.filter-cluster--grow {
  flex: 1 1 220px;
  min-width: min(100%, 200px);
}

.filter-cluster__label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

.filter-cluster__control {
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1.25;
}

.filter-cluster .hero-search-input,
.filter-cluster select.filter-cluster__control {
  min-width: 0;
}

.filter-cluster--grow .filter-cluster__control {
  flex: 1 1 auto;
  width: 100%;
  min-width: 12rem;
}

.filter-row label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.filter-row select,
.filter-row .hero-search-input,
.filter-row input[type="search"],
.filter-row input[type="text"] {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Inline “Show” dropdown should size to content, not stretch like full-width rows */
.filter-row--heroes .filter-cluster:not(.filter-cluster--grow) select.filter-cluster__control {
  width: auto;
  min-width: 11.5rem;
  max-width: 100%;
}

.filter-row .hero-search-input::placeholder,
.filter-row input[type="search"]::placeholder,
.filter-row input[type="text"]::placeholder {
  color: rgba(168, 159, 212, 0.65);
}

.filter-row select:focus,
.filter-row .hero-search-input:focus,
.filter-row input[type="search"]:focus,
.filter-row input[type="text"]:focus,
.filter-cluster__control:focus {
  outline: none;
  border-color: var(--accent-cool);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.hero-search-empty {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.enemy-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.enemy-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.enemy-pick__select {
  width: 100%;
}

.enemy-builder {
  margin-bottom: 0.8rem;
}

.enemy-builder__controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.enemy-builder__search {
  display: grid;
  gap: 0.45rem;
}

.enemy-builder__input {
  flex: 1 1 18rem;
  min-width: 12rem;
}

.enemy-list {
  width: 100%;
  min-height: 11rem;
  max-height: 15rem;
  overflow-y: auto;
}

.enemy-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.enemy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 14, 36, 0.82);
}

.enemy-pill .hero-media {
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 1.9rem;
}

.enemy-pill__name {
  font-size: 0.88rem;
  font-weight: 700;
}

.enemy-pill__remove {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  width: 1.4rem;
  height: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.role-section {
  margin-bottom: 2rem;
}

.role-section--live {
  animation: role-section-in 0.55s ease backwards;
  animation-delay: calc(var(--section-i, 0) * 70ms);
}

@keyframes role-section-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .role-section--live {
    animation: none;
  }
}

.role-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid rgba(130, 100, 220, 0.25);
}

.role-section__name {
  letter-spacing: 0.02em;
}

.role-section__count {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.role-section[data-role="vanguard"] .role-section__title {
  color: var(--vanguard);
  border-color: rgba(78, 196, 255, 0.35);
  box-shadow: 0 0 24px rgba(78, 196, 255, 0.08);
}

.role-section[data-role="vanguard"] .role-section__count {
  color: var(--vanguard);
  border-color: rgba(78, 196, 255, 0.35);
  background: rgba(78, 196, 255, 0.1);
}

.role-section[data-role="duelist"] .role-section__title {
  color: var(--duelist);
  border-color: rgba(255, 123, 74, 0.35);
  box-shadow: 0 0 24px rgba(255, 123, 74, 0.08);
}

.role-section[data-role="duelist"] .role-section__count {
  color: var(--duelist);
  border-color: rgba(255, 123, 74, 0.35);
  background: rgba(255, 123, 74, 0.1);
}

.role-section[data-role="strategist"] .role-section__title {
  color: var(--strategist);
  border-color: rgba(125, 255, 154, 0.3);
  box-shadow: 0 0 24px rgba(125, 255, 154, 0.06);
}

.role-section[data-role="strategist"] .role-section__count {
  color: var(--strategist);
  border-color: rgba(125, 255, 154, 0.35);
  background: rgba(125, 255, 154, 0.1);
}

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

.hero-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.hero-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 14, 36, 0.75);
  font-size: 0.95rem;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    filter 0.2s ease;
  animation: hero-row-in 0.42s ease backwards;
  animation-delay: calc(var(--i, 0) * 38ms + var(--section-i, 0) * 70ms);
  cursor: pointer;
}

@keyframes hero-row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-list__item {
    animation: none;
  }
}

.hero-list__item:hover {
  transform: translateY(-3px);
  background: rgba(30, 24, 56, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  filter: brightness(1.05);
}

.hero-list__item:focus-visible {
  outline: 2px solid var(--accent-cool);
  outline-offset: 2px;
}

.hero-list__item.is-selected {
  border-color: rgba(0, 212, 255, 0.65) !important;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 212, 255, 0.35) inset;
  background: rgba(20, 30, 58, 0.92);
}

.hero-list__item[data-role="vanguard"] {
  border-left: 3px solid var(--vanguard);
}

.hero-list__item[data-role="vanguard"]:hover {
  border-color: rgba(78, 196, 255, 0.45);
  box-shadow: 0 8px 28px rgba(78, 196, 255, 0.12);
}

.hero-list__item[data-role="duelist"] {
  border-left: 3px solid var(--duelist);
}

.hero-list__item[data-role="duelist"]:hover {
  border-color: rgba(255, 123, 74, 0.45);
  box-shadow: 0 8px 28px rgba(255, 123, 74, 0.12);
}

.hero-list__item[data-role="strategist"] {
  border-left: 3px solid var(--strategist);
}

.hero-list__item[data-role="strategist"]:hover {
  border-color: rgba(125, 255, 154, 0.4);
  box-shadow: 0 8px 28px rgba(125, 255, 154, 0.1);
}

.hero-media {
  position: relative;
  flex: 0 0 2.35rem;
  width: 2.35rem;
  height: 2.35rem;
}

.hero-media--card {
  width: 3.5rem;
  height: 3.5rem;
  flex-basis: 3.5rem;
}

.hero-portrait {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

.hero-media--has-photo .hero-portrait {
  display: block;
}

.hero-media--has-photo .hero-initial {
  display: none;
}

.hero-media--no-photo .hero-portrait {
  display: none;
}

.hero-media--no-photo .hero-initial {
  display: flex;
}

.hero-media .hero-initial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hero-media--card .hero-initial {
  font-size: 1.05rem;
}

.hero-card[data-role="vanguard"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(78, 196, 255, 0.55),
    rgba(78, 196, 255, 0.15)
  );
  box-shadow:
    0 0 0 1px rgba(78, 196, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-card[data-role="duelist"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(255, 123, 74, 0.55),
    rgba(255, 123, 74, 0.15)
  );
  box-shadow:
    0 0 0 1px rgba(255, 123, 74, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-card[data-role="strategist"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(125, 255, 154, 0.45),
    rgba(125, 255, 154, 0.12)
  );
  box-shadow:
    0 0 0 1px rgba(125, 255, 154, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-list__item[data-role="vanguard"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(78, 196, 255, 0.55),
    rgba(78, 196, 255, 0.15)
  );
  box-shadow:
    0 0 0 1px rgba(78, 196, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-list__item[data-role="duelist"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(255, 123, 74, 0.55),
    rgba(255, 123, 74, 0.15)
  );
  box-shadow:
    0 0 0 1px rgba(255, 123, 74, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-list__item[data-role="strategist"] .hero-initial {
  background: linear-gradient(
    145deg,
    rgba(125, 255, 154, 0.45),
    rgba(125, 255, 154, 0.12)
  );
  box-shadow:
    0 0 0 1px rgba(125, 255, 154, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero-name {
  min-width: 0;
  line-height: 1.3;
  flex: 1;
}

.hero-open-hint {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(159, 221, 255, 0.86);
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.28);
  background: rgba(0, 212, 255, 0.08);
}

.hero-bio-panel {
  margin-top: 1.2rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(
    160deg,
    rgba(14, 30, 58, 0.88) 0%,
    rgba(20, 18, 42, 0.95) 55%,
    rgba(8, 40, 66, 0.82) 100%
  );
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.45),
    0 0 26px rgba(56, 189, 248, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-bio-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}

.hero-bio-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.5vw, 1.7rem);
  letter-spacing: 0.05em;
  color: transparent;
  background: linear-gradient(100deg, #7dd3fc, var(--accent-cool), #bae6fd);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-bio-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.95rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--hero-role-color) 38%, transparent);
  background: color-mix(in srgb, var(--hero-role-color) 14%, rgba(20, 18, 42, 0.8));
  margin-bottom: 0.8rem;
}

.hero-bio-media .hero-media--card {
  width: 4.1rem;
  height: 4.1rem;
  flex-basis: 4.1rem;
}

.hero-bio-role {
  margin: 0 0 0.1rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fdcff;
  font-weight: 700;
}

.hero-bio-name {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}

.hero-bio-text {
  margin: 0.22rem 0;
  color: #c6dfff;
  line-height: 1.5;
}

.hero-bio-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hero-bio-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.hero-bio-body {
  display: grid;
  gap: 0.45rem;
}

.hero-bio-row {
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(159, 221, 255, 0.2);
  background: rgba(8, 20, 42, 0.45);
}

.hero-bio-label {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ec6ef;
  font-weight: 700;
}

.hero-bio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hero-bio-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.78rem;
  color: #dbeafe;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
}

@supports not (color: color-mix(in srgb, white 50%, black)) {
  .hero-bio-head {
    border-color: rgba(125, 200, 255, 0.35);
    background: rgba(14, 34, 62, 0.72);
  }
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1.25rem 1.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: linear-gradient(180deg, transparent 0%, rgba(12, 8, 28, 0.65) 100%);
  border-top: 1px solid rgba(100, 180, 255, 0.15);
  box-shadow: 0 -12px 40px rgba(80, 60, 160, 0.08);
}

.site-footer::before {
  content: "";
  display: block;
  width: min(10rem, 50%);
  height: 1px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
  opacity: 0.9;
}

.site-footer a {
  color: #b8acf0;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent-cool);
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

::selection {
  background: rgba(0, 212, 255, 0.28);
  color: var(--text);
}

::-moz-selection {
  background: rgba(0, 212, 255, 0.28);
  color: var(--text);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 180, 255, 0.45) rgba(15, 10, 30, 0.8);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 8, 24, 0.6);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.45), rgba(180, 100, 255, 0.4));
  border-radius: 100px;
  border: 2px solid rgba(10, 8, 24, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.65), rgba(180, 100, 255, 0.55));
}

@keyframes fx-ambient-drift {
  from {
    opacity: 0.88;
    filter: hue-rotate(0deg);
  }
  to {
    opacity: 1;
    filter: hue-rotate(18deg);
  }
}

@keyframes fx-title-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes fx-main-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fx-count-glow {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(125, 255, 154, 0.35);
  }
  50% {
    text-shadow:
      0 0 20px rgba(125, 255, 154, 0.55),
      0 0 32px rgba(78, 196, 255, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before {
    animation: none;
  }

  .site-title a {
    animation: none;
    background-size: 120% auto;
  }

  main {
    animation: none;
  }

  #count-total.is-valid {
    animation: none;
  }

  .panel:hover {
    transform: none;
  }

  .hero-card:hover {
    transform: none;
    filter: none;
  }

  .nav a:hover {
    transform: none;
  }
}
