:root {
  color-scheme: dark;
  --ink: #f7f0dc;
  --muted: #b7c1cf;
  --panel: #151924;
  --panel-2: #22293a;
  --line: #465169;
  --gold: #ffd15c;
  --red: #ff5b62;
  --green: #58d68d;
  --blue: #55a7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 209, 92, 0.18), transparent 22rem),
    linear-gradient(180deg, #0b1020 0%, #171b26 54%, #0a0d12 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid #7d8aa6;
  border-radius: 7px;
  color: #07101d;
  background: linear-gradient(180deg, #ffd15c, #d58d2c);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #704a17;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #704a17;
}

select {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: #0d1320;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
}

.app {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.92;
}

.setup {
  display: grid;
  grid-template-columns: 130px 160px 160px 140px;
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.arena-card {
  overflow: hidden;
  border: 1px solid #60708c;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101522;
}

.hud {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 1px;
  background: #0b0f17;
  border-top: 1px solid var(--line);
}

.fighter-card,
.match-status {
  min-width: 0;
  padding: 12px 14px;
  background: var(--panel-2);
}

.fighter-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
}

.fighter-card span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
}

.fighter-card strong {
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.fighter-card b {
  font-size: 1.85rem;
  line-height: 1;
}

.fighter-card em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.p1 b {
  color: var(--blue);
}

.p2 b {
  color: var(--red);
}

.match-status {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.fighter-info,
.help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.fighter-info article,
.help > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 36, 0.84);
}

.fighter-info h2,
.help h2 {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 1rem;
}

.fighter-info p,
.help p {
  margin-bottom: 6px;
  color: var(--muted);
}

.fighter-info p {
  margin-bottom: 0;
}

.mobile-pad {
  display: none;
  gap: 10px;
  margin-top: 14px;
}

.pad-left,
.pad-right {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px;
  width: 100%;
}

.mobile-pad button {
  min-height: 54px;
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .setup {
    grid-template-columns: 130px 1fr 1fr 140px;
  }

  .app {
    padding: 10px;
  }
}

@media (max-width: 720px) {
  .setup,
  .hud,
  .fighter-info,
  .help {
    grid-template-columns: 1fr;
  }

  .mobile-pad {
    display: grid;
  }

  .fighter-card b {
    font-size: 1.4rem;
  }
}
