.battle-page {
  --battle-green: #0a4937;
  --battle-green-bright: #0a7651;
  --battle-yellow: #efbd3d;
  --battle-dark: #081119;
  --battle-paper: #fffdf7;
  --battle-soft: #eee8dc;
  --battle-line: rgba(12, 18, 24, 0.14);
  background:
    linear-gradient(180deg, #0b1118 0 72px, transparent 72px),
    repeating-linear-gradient(90deg, rgba(12, 18, 24, 0.025) 0 1px, transparent 1px 88px),
    var(--page);
}

.battle-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #07111a;
  background: #fffdf7;
  border: 3px solid var(--battle-yellow);
  font-weight: 900;
  transform: translateY(-140%);
}

.battle-skip-link:focus {
  transform: translateY(0);
}

.battle-page :focus-visible {
  outline: 3px solid #1d78c1;
  outline-offset: 3px;
}

.battle-shell {
  width: min(calc(100% - 32px), 1240px);
  margin: 0 auto;
  padding: 14px 0 48px;
}

.battle-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.battle-breadcrumbs a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.battle-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 112px;
  padding: 15px 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 17, 26, 0.99), rgba(7, 58, 45, 0.98) 58%, rgba(11, 104, 73, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 78px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 4px solid var(--battle-yellow);
  box-shadow: 0 18px 42px rgba(25, 21, 13, 0.16);
}

.battle-brand-mark,
.battle-competition-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 74px;
  height: 74px;
  color: #07111a;
  background: var(--battle-yellow);
  border: 4px solid rgba(255, 255, 255, 0.16);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.battle-brand-mark {
  width: 62px;
  height: 62px;
  background: #07111a;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.battle-brand-mark img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.battle-competition-mark-large {
  width: 62px;
  height: 62px;
  border-width: 2px;
  font-size: 20px;
}

.battle-competition-mark img {
  display: block;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
}

.battle-competition-mark:has(img:not([hidden])) {
  background: #fff;
  border-color: var(--battle-yellow);
}

.battle-competition-mark-fallback {
  font: inherit;
}

.battle-kicker {
  color: currentColor;
  opacity: 0.64;
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.battle-hero-copy h1 {
  margin-top: 2px;
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.battle-hero-copy > p:last-child {
  max-width: 760px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 650;
}

.battle-hero-state {
  display: grid;
  justify-items: end;
  gap: 6px;
  max-width: 220px;
  text-align: right;
}

.battle-hero-state strong {
  color: rgba(255, 255, 255, 0.8);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.battle-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #07111a;
  background: #dfe7e2;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.battle-status-draft {
  color: rgba(255, 255, 255, 0.84);
  background: rgba(2, 8, 12, 0.34);
  border-color: rgba(255, 255, 255, 0.28);
}
.battle-status-open { color: #fff; background: #078451; }
.battle-status-locked { color: #fff; background: #8a3b2c; }
.battle-status-live { color: #fff; background: #1e73be; }
.battle-status-final { color: #fff; background: #111c25; }

.battle-panel,
.battle-section,
.battle-app-shell {
  margin-top: 20px;
  background: var(--battle-paper);
  border-top: 4px solid var(--battle-dark);
  box-shadow: 0 14px 30px rgba(13, 20, 24, 0.07);
}

.battle-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: stretch;
}

.battle-panel > div:first-child {
  padding: 28px 30px;
  border-right: 1px solid var(--battle-line);
}

.battle-panel h2,
.battle-section h2,
.battle-app-shell h2 {
  margin-top: 3px;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.battle-panel > div:first-child > p:last-child,
.battle-section-heading > p,
.battle-competition-card p,
.battle-rule-grid p,
.battle-empty-state {
  color: var(--muted);
  font-weight: 650;
}

.battle-panel > div:first-child > p:last-child {
  max-width: 760px;
  margin-top: 10px;
}

.battle-fact-grid {
  display: grid;
  align-self: stretch;
  margin: 0;
}

.battle-fact-grid > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--battle-line);
}

.battle-fact-grid > div:last-child { border-bottom: 0; }

.battle-fact-grid dt {
  color: var(--muted);
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.battle-fact-grid dd {
  font-size: 18px;
  font-weight: 900;
}

.battle-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--battle-line);
}

.battle-section-heading > p {
  max-width: 560px;
  text-align: right;
}

.battle-competition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.battle-competition-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  min-height: 310px;
  padding: 24px;
  border-right: 1px solid var(--battle-line);
}

.battle-competition-card:last-child { border-right: 0; }
.battle-competition-card h2 { font-size: 28px; }
.battle-competition-card p { margin-top: 7px; }

.battle-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--battle-line);
}

.battle-text-link {
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.battle-rules-summary > ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.battle-rules-summary li {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--battle-line);
}

.battle-rules-summary li:last-child { border-bottom: 0; }
.battle-rules-summary li strong { font-size: 16px; }
.battle-rules-summary li span { color: var(--muted); font-weight: 650; }

.battle-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.battle-rule-grid article {
  min-height: 230px;
  padding: 24px;
  border-right: 1px solid var(--battle-line);
}

.battle-rule-grid article:last-child { border-right: 0; }
.battle-rule-grid article > span { color: var(--battle-green-bright); font: 900 14px "Roboto Condensed", sans-serif; }
.battle-rule-grid h3 { margin: 38px 0 7px; font-size: 21px; }

.battle-app-shell {
  min-height: 420px;
}

.battle-app-loading,
.battle-app-error,
.battle-overview {
  padding: 28px;
}

.battle-loading-lines {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin-top: 22px;
}

.battle-loading-lines span {
  height: 18px;
  background: linear-gradient(90deg, #e8e3d8, #f7f3eb, #e8e3d8);
  background-size: 200% 100%;
  animation: battle-shimmer 1.3s linear infinite;
}

.battle-loading-lines span:nth-child(2) { width: 82%; }
.battle-loading-lines span:nth-child(3) { width: 58%; }

@keyframes battle-shimmer {
  to { background-position: -200% 0; }
}

.battle-action-row,
.battle-view-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.battle-primary-button,
.battle-secondary-button,
.battle-view-tabs button {
  min-height: 48px;
  padding: 11px 18px;
  border: 2px solid var(--battle-dark);
  border-radius: 0;
  font-family: "Roboto Condensed", Inter, Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.battle-primary-button { color: #07111a; background: var(--battle-yellow); }
.battle-secondary-button,
.battle-view-tabs button { color: var(--battle-dark); background: transparent; }
.battle-view-tabs button[aria-pressed="true"] { color: #fff; background: var(--battle-dark); }
.battle-primary-button[disabled],
.battle-secondary-button[disabled],
.battle-view-tabs button[disabled] { cursor: not-allowed; opacity: 0.52; }

.battle-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(120px, 0.34fr));
  margin-top: 24px;
  border: 1px solid var(--battle-line);
}

.battle-overview-grid > div {
  padding: 18px;
  border-right: 1px solid var(--battle-line);
}

.battle-overview-grid > div:last-child { border-right: 0; }
.battle-overview-grid span { display: block; color: var(--muted); font: 900 12px "Roboto Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.battle-overview-grid strong { display: block; margin-top: 5px; font-size: 23px; }

.battle-play-view {
  padding: 24px 28px 30px;
}

.battle-progress-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.battle-progress-heading strong {
  font: 900 18px "Roboto Condensed", sans-serif;
  text-transform: uppercase;
}

.battle-progress-track {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  background: #ded8cb;
}

.battle-progress-track span {
  display: block;
  height: 100%;
  background: var(--battle-green-bright);
  transition: width 180ms ease;
}

.battle-question {
  margin: 28px 0 18px;
  text-align: center;
}

.battle-question h2 { font-size: clamp(2rem, 5vw, 3.4rem); }

.battle-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.battle-team-button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px;
  color: var(--battle-dark);
  background: #f8f4eb;
  border: 3px solid #d6d0c4;
  text-align: left;
}

.battle-team-button:hover:not(:disabled) { border-color: var(--battle-green-bright); }
.battle-team-button[aria-pressed="true"] { border-color: var(--battle-green-bright); box-shadow: inset 0 0 0 2px var(--battle-green-bright); }
.battle-team-button:disabled { cursor: wait; opacity: 0.64; }
.battle-read-only .battle-team-button:disabled { cursor: default; opacity: 1; }

.battle-team-logo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--battle-line);
  font: 900 20px "Roboto Condensed", sans-serif;
}

.battle-team-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.battle-team-name { font-size: clamp(18px, 2.2vw, 27px); font-weight: 900; line-height: 1.05; }
.battle-team-choice { display: block; margin-top: 7px; color: var(--battle-green-bright); font: 900 12px "Roboto Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }

.battle-vs {
  display: grid;
  place-items: center;
  width: 52px;
  color: #fff;
  background: var(--battle-dark);
  font: 900 17px "Roboto Condensed", sans-serif;
}

.battle-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  margin-top: 14px;
}

.battle-save-status { color: var(--muted); font-weight: 750; }
.battle-save-status.is-failed { color: #a33428; }

.battle-review-view { padding: 26px 28px 30px; }
.battle-review-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.battle-review-list { display: grid; gap: 10px; margin-top: 24px; }

.battle-review-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--battle-line);
}

.battle-review-number,
.battle-review-vs {
  display: grid;
  place-items: center;
  color: var(--muted);
  font: 900 12px "Roboto Condensed", sans-serif;
}

.battle-review-choice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 9px 12px;
  color: var(--battle-dark);
  background: transparent;
  border: 0;
  text-align: left;
}

.battle-review-choice[aria-pressed="true"] { background: #dff2e7; box-shadow: inset 0 -4px 0 var(--battle-green-bright); }
.battle-review-choice:disabled { cursor: default; color: inherit; opacity: 1; }
.battle-review-choice .battle-team-logo { width: 38px; height: 38px; font-size: 12px; }
.battle-review-choice .battle-team-logo img { width: 30px; height: 30px; }
.battle-review-choice strong { line-height: 1.08; }

.battle-leaderboard-frame { overflow: hidden; }
.battle-leaderboard-scroll { max-width: 100%; overflow-x: auto; }
.battle-leaderboard-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.battle-leaderboard-table th,
.battle-leaderboard-table td { padding: 13px 16px; border-bottom: 1px solid var(--battle-line); text-align: right; }
.battle-leaderboard-table th { color: rgba(255,255,255,.72); background: var(--battle-dark); font: 900 12px "Roboto Condensed", sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.battle-leaderboard-table th:nth-child(2),
.battle-leaderboard-table td:nth-child(2) { text-align: left; }
.battle-leaderboard-table td { font-weight: 750; }
.battle-leaderboard-table a { text-decoration: underline; text-underline-offset: 3px; }
.battle-empty-state { padding: 30px; }

.battle-competition-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  background: var(--battle-dark);
}

.battle-competition-switcher a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px;
  color: rgba(255,255,255,.74);
  border-right: 1px solid rgba(255,255,255,.14);
  font-family: "Roboto Condensed", Inter, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.battle-competition-switcher a:last-child { border-right: 0; }
.battle-competition-switcher a[aria-current="page"] { color: var(--battle-yellow); box-shadow: inset 0 -4px 0 var(--battle-yellow); }
.battle-competition-mark-switcher {
  width: 36px;
  height: 36px;
  border-width: 2px;
  font-size: 10px;
  letter-spacing: 0;
}

.battle-competition-mark-switcher img {
  width: 32px;
  height: 32px;
}

@media (max-width: 980px) {
  .battle-hero { grid-template-columns: auto minmax(0, 1fr); }
  .battle-hero-state { grid-column: 1 / -1; justify-items: start; max-width: none; text-align: left; }
  .battle-panel { grid-template-columns: 1fr; }
  .battle-panel > div:first-child { border-right: 0; border-bottom: 1px solid var(--battle-line); }
  .battle-competition-grid { grid-template-columns: 1fr; }
  .battle-competition-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; min-height: 0; border-right: 0; border-bottom: 1px solid var(--battle-line); }
  .battle-competition-card:last-child { border-bottom: 0; }
  .battle-card-footer { display: grid; justify-items: end; padding-top: 0; border-top: 0; }
  .battle-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .battle-rule-grid article:nth-child(2n) { border-right: 0; }
  .battle-rule-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--battle-line); }
  .battle-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .battle-overview-grid > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--battle-line); }
}

@media (max-width: 640px) {
  .battle-page { background: var(--page); }
  .battle-shell { width: min(calc(100% - 20px), 1240px); padding-top: 10px; }
  .battle-breadcrumbs { min-height: 34px; font-size: 11px; }
  .battle-hero { grid-template-columns: 1fr; gap: 16px; min-height: 0; padding: 20px; }
  .battle-brand-mark,
  .battle-competition-mark-large { width: 62px; height: 62px; font-size: 18px; }
  .battle-brand-mark img { width: 50px; height: 50px; }
  .battle-competition-mark-large img { width: 54px; height: 54px; }
  .battle-hero-copy h1 { font-size: 1.72rem; }
  .battle-hero-copy > p:last-child { font-size: 15px; }
  .battle-panel > div:first-child,
  .battle-section-heading,
  .battle-app-loading,
  .battle-app-error,
  .battle-overview,
  .battle-play-view,
  .battle-review-view { padding: 20px; }
  .battle-section-heading { display: grid; }
  .battle-section-heading > p { text-align: left; }
  .battle-fact-grid > div { grid-template-columns: 78px minmax(0, 1fr); min-height: 64px; padding: 12px 18px; }
  .battle-fact-grid dd { font-size: 15px; }
  .battle-competition-card { grid-template-columns: 54px minmax(0, 1fr); gap: 13px; padding: 18px; }
  .battle-competition-card .battle-competition-mark { width: 54px; height: 54px; font-size: 15px; }
  .battle-competition-card h2 { font-size: 22px; }
  .battle-card-footer { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: end; width: 100%; }
  .battle-rules-summary li { grid-template-columns: 1fr; gap: 4px; }
  .battle-rule-grid { grid-template-columns: 1fr; }
  .battle-rule-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--battle-line); }
  .battle-rule-grid article:last-child { border-bottom: 0; }
  .battle-rule-grid h3 { margin-top: 20px; }
  .battle-overview-grid { grid-template-columns: 1fr; }
  .battle-overview-grid > div,
  .battle-overview-grid > div:first-child { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--battle-line); }
  .battle-overview-grid > div:last-child { border-bottom: 0; }
  .battle-progress-heading { align-items: start; }
  .battle-pair { gap: 7px; }
  .battle-team-button { grid-template-columns: 1fr; justify-items: center; gap: 10px; min-height: 166px; padding: 14px 8px; text-align: center; }
  .battle-team-logo { width: 58px; height: 58px; }
  .battle-team-logo img { width: 47px; height: 47px; }
  .battle-team-name { font-size: 16px; }
  .battle-vs { width: 34px; font-size: 13px; }
  .battle-save-row { align-items: flex-start; flex-direction: column; }
  .battle-review-intro { display: grid; }
  .battle-review-row { grid-template-columns: 32px minmax(0, 1fr) 26px minmax(0, 1fr); }
  .battle-review-choice { grid-template-columns: 1fr; justify-items: center; min-height: 92px; padding: 8px 4px; text-align: center; }
  .battle-review-choice strong { font-size: 12px; }
  .battle-competition-switcher { grid-template-columns: 1fr; }
  .battle-competition-switcher a { justify-content: flex-start; min-height: 52px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .battle-competition-switcher a:last-child { border-bottom: 0; }
}

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