:root {
  color-scheme: dark;
  --bg: #070b1a;
  --bg-soft: #0d1426;
  --panel: #111a2d;
  --panel-strong: #172238;
  --line: #28344d;
  --line-hot: #56343b;
  --ink: #f8fafc;
  --muted: #9aa7bd;
  --muted-2: #6f7d96;
  --gold: #f8c33a;
  --orange: #ff9f32;
  --red: #e04444;
  --green: #31d37d;
  --blue: #3f7dff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 159, 50, 0.13), transparent 32%),
    linear-gradient(180deg, #080b18 0%, var(--bg) 46%, #050814 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 40px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #111827;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(248, 195, 58, 0.2);
}

.nav-links {
  display: flex;
  gap: 10px;
}

.nav-links a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-links a:hover {
  border-color: var(--line);
  color: var(--ink);
}

.menu-button {
  display: none;
  width: 42px;
  height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 4px;
  background: var(--muted);
}

.hero {
  max-width: 680px;
  margin: 0 auto 34px;
  text-align: center;
}

.announcement {
  margin: 8px 0 14px;
  color: var(--gold);
  font-size: 1.02rem;
  font-weight: 900;
}

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

h1 {
  background: linear-gradient(90deg, #fff4cb 0%, var(--orange) 62%, #ffcf66 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(2.55rem, 7vw, 5.3rem);
  font-weight: 950;
  line-height: 0.9;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  padding: 11px 18px;
  border: 1px solid rgba(248, 195, 58, 0.26);
  border-radius: 999px;
  background: rgba(255, 159, 50, 0.13);
  color: var(--gold);
  font-weight: 900;
}

.badge-icon {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--bg);
}

.hero-copy {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.32rem);
  font-weight: 700;
  line-height: 1.5;
}

.verified-chip {
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #dbe5f4;
  font-size: 0.9rem;
  font-weight: 750;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 18px;
  align-items: start;
}

.battle-panel,
.movement-panel,
.leaderboard-panel,
.tools-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 26, 45, 0.88);
  box-shadow: var(--shadow);
}

.battle-panel {
  position: sticky;
  top: 16px;
  min-height: 620px;
  padding: 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--muted);
  font-weight: 850;
}

.back-link:hover {
  color: var(--ink);
}

.battle-title-row,
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 950;
  line-height: 1.02;
}

.battle-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.round-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-weight: 750;
}

.round-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #22304b;
}

.round-track span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--orange));
}

.matchup-wrap {
  position: relative;
  margin-top: 28px;
}

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

.vs-badge {
  position: absolute;
  top: 45%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid #35415a;
  border-radius: 50%;
  background: #1a2538;
  color: var(--gold);
  font-weight: 950;
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.profile-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 430px;
  padding: 0;
  overflow: hidden;
  border: 2px solid #2c3852;
  border-radius: 18px;
  background: var(--panel-strong);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.profile-card:hover,
.profile-card:focus-visible {
  border-color: rgba(248, 195, 58, 0.7);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
  outline: none;
}

.photo-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  overflow: hidden;
  background: #20283a;
}

.photo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 16px 6px;
}

.card-rank {
  color: #7f8ca5;
  font-size: 0.92rem;
  font-weight: 850;
}

.profile-name {
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 950;
  line-height: 1.05;
}

.profile-title,
.profile-dept {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.32;
}

.rating-badge {
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 10px 16px 16px;
  padding: 7px 10px;
  border: 1px solid rgba(248, 195, 58, 0.22);
  border-radius: 999px;
  background: rgba(248, 195, 58, 0.12);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
}

.status-line {
  min-height: 24px;
  margin-top: 24px;
  color: var(--muted-2);
  font-weight: 750;
  text-align: center;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.movement-panel,
.leaderboard-panel,
.tools-panel {
  padding: 18px;
}

.movement-panel h2 {
  font-size: 1.25rem;
}

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

.move-columns h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.move-list,
.leaderboard {
  margin: 0;
  padding: 0;
  list-style: none;
}

.move-list {
  display: grid;
  gap: 8px;
}

.move-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.move-rank,
.rank {
  color: var(--muted-2);
  font-weight: 950;
  text-align: center;
}

.move-name,
.leader-name {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-delta,
.movement {
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
  text-align: center;
}

.move-delta.up,
.movement.up {
  background: rgba(49, 211, 125, 0.14);
  color: var(--green);
}

.move-delta.down,
.movement.down {
  background: rgba(224, 68, 68, 0.14);
  color: #ff7777;
}

.move-delta.flat,
.movement.flat {
  background: rgba(154, 167, 189, 0.12);
  color: var(--muted);
}

.pill {
  min-width: 96px;
  padding: 7px 10px;
  border: 1px solid rgba(63, 125, 255, 0.32);
  border-radius: 999px;
  background: rgba(63, 125, 255, 0.12);
  color: #9bb8ff;
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
}

.search-box {
  display: block;
  margin-top: 14px;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: #0b1120;
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(248, 195, 58, 0.55);
}

.leaderboard {
  display: grid;
  gap: 10px;
  max-height: 690px;
  margin-top: 14px;
  overflow: auto;
}

.leader-row {
  display: grid;
  grid-template-columns: 34px 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #10192b;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.leader-row:hover {
  background: #17243c;
  border-color: #2a3a5c;
  transform: translateY(-2px);
}

.mini-photo {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 12px;
  background: #20283a;
}

.mini-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leader-meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-rating {
  color: var(--gold);
  font-weight: 950;
}

.leader-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.tools-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
}

.text-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121d31;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.text-button.light {
  min-width: 104px;
  background: #f8fafc;
  color: #1f2937;
}

.text-button.danger {
  border-color: rgba(224, 68, 68, 0.35);
  color: #ff8585;
}

.text-button:hover {
  border-color: rgba(248, 195, 58, 0.58);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

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

@media (max-width: 960px) {
  .app-shell {
    width: min(100% - 24px, 700px);
  }

  .site-nav {
    margin-bottom: 46px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 16px;
    right: 16px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 100;
  }

  .nav-links.is-open {
    display: flex;
  }

  .menu-button {
    display: block;
  }

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

  .battle-panel {
    position: static;
    min-height: 0;
    padding: 18px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .battle-title-row {
    align-items: end;
  }

  .matchup-grid {
    gap: 80px;
  }

  .profile-card {
    min-height: 0;
  }

  .profile-name {
    font-size: 1.25rem;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 32px, 430px);
  }

  .hero {
    margin-bottom: 30px;
  }

  .announcement {
    font-size: 0.98rem;
  }

  .battle-title-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .text-button.light {
    min-width: 92px;
    padding: 0 12px;
  }

  .matchup-grid {
    gap: 62px;
  }

  .profile-card {
    border-radius: 16px;
  }

  .profile-copy {
    padding: 12px 12px 4px;
  }

  .profile-dept {
    display: none;
  }

  .rating-badge {
    margin: 8px 12px 12px;
  }

  .vs-badge {
    width: 56px;
    height: 56px;
  }

  .tools-panel {
    grid-template-columns: 1fr;
  }

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

  .mini-photo {
    width: 48px;
    height: 48px;
  }
}
