body.arena-page {
  --accent: #6bdcff;
  --accent-rgb: 107, 220, 255;
  --accent-deep: #1a7c99;
  --danger: #ff6478;
  background:
    radial-gradient(ellipse 55% 45% at 18% -8%, rgba(107, 220, 255, 0.1), transparent 70%),
    radial-gradient(ellipse 50% 42% at 90% 8%, rgba(255, 127, 159, 0.09), transparent 72%),
    radial-gradient(ellipse 80% 65% at 50% 108%, rgba(13, 31, 36, 0.88), transparent 70%),
    linear-gradient(180deg, #070a0d 0%, #05080b 55%, #040609 100%);
}

body.arena-page [hidden] {
  display: none !important;
}

.arena-app {
  width: min(1460px, 100%);
}

.arena-mode-link {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.arena-mode-link:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.conn-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: none;
}

.conn-pill[data-state="online"] {
  border-color: rgba(105, 240, 178, 0.24);
  color: #9af3c9;
}

.conn-pill[data-state="online"] i {
  background: #69f0b2;
  box-shadow: 0 0 8px #69f0b2;
}

.conn-pill[data-state="connecting"] {
  color: var(--gold);
  border-color: rgba(216, 180, 108, 0.22);
}

.conn-pill[data-state="connecting"] i {
  background: var(--gold);
  animation: arena-blink 1.1s ease-in-out infinite;
}

.conn-pill[data-state="offline"] {
  color: #ff9aa7;
  border-color: rgba(255, 100, 120, 0.26);
}

.conn-pill[data-state="offline"] i {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes arena-blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ── layout ─────────────────────────────────────────────── */

.arena-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(18px, 2vw, 28px);
}

.arena-stage {
  width: min(calc((100dvh - 232px) * 31 / 21), 1120px);
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  margin: 0;
}

.arena-hud {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr 0.9fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 11px;
  padding: 0 3px;
}

.arena-hud-cell {
  min-width: 0;
}

.arena-hud-cell strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-hud-cell:first-child strong {
  color: var(--accent);
  letter-spacing: 0.14em;
  text-shadow: 0 0 22px rgba(var(--accent-rgb), 0.2);
}

.arena-hud-cell.hud-right {
  text-align: right;
}

.arena-hud-cell.hud-right strong span {
  color: var(--dim);
  font-size: 0.58em;
}

.arena-shell {
  aspect-ratio: 31 / 21;
}

.arena-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 32%, rgba(0, 0, 0, 0.1) 66%, rgba(0, 0, 0, 0.55) 100%);
}

.arena-shell::after {
  border-color: rgba(236, 230, 209, 0.065);
}

#arenaCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #04070a;
  touch-action: none;
}

.arena-phase-badge {
  position: absolute;
  top: 17px;
  left: 18px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(236, 230, 209, 0.09);
  border-radius: 3px;
  color: var(--dim);
  background: rgba(4, 8, 11, 0.55);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.18em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.phase-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.arena-phase-badge[data-phase="playing"] {
  color: #8bf1c2;
  border-color: rgba(105, 240, 178, 0.22);
}

.arena-phase-badge[data-phase="countdown"] {
  color: var(--gold);
  border-color: rgba(216, 180, 108, 0.24);
}

.arena-phase-badge[data-phase="results"] {
  color: #ffd171;
}

.arena-phase-badge[data-phase="lobby"] {
  color: var(--accent);
}

.arena-countdown {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background:
    radial-gradient(ellipse at center, rgba(3, 6, 8, 0.9) 0%, rgba(3, 6, 8, 0.58) 34%, rgba(3, 6, 8, 0.12) 64%, transparent 82%);
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.arena-countdown.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.arena-countdown p {
  margin: 0;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.arena-countdown strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(70px, 11vw, 128px);
  font-weight: 400;
  line-height: 0.9;
  text-shadow: 0 0 70px rgba(var(--accent-rgb), 0.3);
  animation: count-pop 0.4s var(--ease) both;
}

.arena-countdown span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

@keyframes count-pop {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

.spectator-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 100, 120, 0.3);
  border-radius: 3px;
  color: #ffb0ba;
  background: rgba(23, 7, 11, 0.82);
  font-size: 9px;
  letter-spacing: 0.11em;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}

.spectator-bar strong {
  color: var(--danger);
  font-weight: 500;
}

.arena-lock {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  color: var(--dim);
  background: rgba(3, 6, 8, 0.7);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.arena-lock[hidden] {
  display: none;
}

.arena-toast {
  top: 18px;
}

.arena-toast .toast-kicker {
  color: var(--accent);
}

/* ── bottom bar ─────────────────────────────────────────── */

.arena-bottom {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 0 3px;
}

.self-status {
  flex: 0 0 auto;
  min-width: 158px;
}

.self-status strong {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.self-status.is-dead strong {
  color: var(--danger);
}

.arena-controls {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.arena-controls span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.arena-controls .arena-muted {
  color: #525b60;
}

/* ── sidebar ────────────────────────────────────────────── */

.arena-sidebar {
  display: flex;
  flex: 0 0 300px;
  flex-direction: column;
  gap: 14px;
  width: 300px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.build-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 148px;
  padding: 7px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 209, 113, 0.22) transparent;
}

.build-list .empty-state {
  padding: 12px 10px;
  line-height: 1.7;
}

.build-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 3px;
  background: rgba(255, 209, 113, 0.025);
}

.build-item.is-defense {
  background: rgba(110, 200, 255, 0.045);
}

.build-item.is-offense {
  background: rgba(255, 127, 110, 0.045);
}

.build-item.is-cosmetic {
  background: rgba(200, 155, 255, 0.045);
}

.build-item.is-defense .build-glyph {
  border-color: rgba(110, 200, 255, 0.35);
  color: #9ddcff;
  background: rgba(110, 200, 255, 0.06);
}

.build-item.is-offense .build-glyph {
  border-color: rgba(255, 127, 110, 0.35);
  color: #ffad9b;
  background: rgba(255, 127, 110, 0.06);
}

.build-item.is-cosmetic .build-glyph {
  border-color: rgba(200, 155, 255, 0.35);
  color: #d9bcff;
  background: rgba(200, 155, 255, 0.06);
}

.build-glyph {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid rgba(255, 209, 113, 0.24);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 209, 113, 0.05);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  place-items: center;
}

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

.build-copy strong {
  display: block;
  color: var(--paper);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.build-copy span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 7px;
  line-height: 1.55;
}

.relic-count {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  color: rgba(255, 209, 113, 0.8);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.arena-player-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px;
  min-height: 92px;
}

.arena-player-row {
  --pcolor: var(--accent);
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 9px;
  border-radius: 7px;
  transition: background 0.2s ease, opacity 0.3s ease;
}

.arena-player-row.is-me {
  background: rgba(var(--accent-rgb), 0.055);
}

.arena-player-row.is-dead {
  opacity: 0.45;
}

.player-color-bar {
  width: 4px;
  height: 33px;
  border-radius: 3px;
  background: var(--pcolor);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pcolor) 35%, transparent);
}

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

.player-copy strong {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-copy strong em {
  padding: 1px 4px;
  border: 1px solid rgba(255, 209, 113, 0.24);
  border-radius: 2px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.player-copy span {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.player-copy span.is-out {
  color: var(--danger);
}

.player-score {
  text-align: right;
}

.player-score strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.player-score span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.arena-net-line code {
  color: #6e777c;
}

/* ── modals / entry ─────────────────────────────────────── */

.arena-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  padding: clamp(25px, 4.5vw, 44px);
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb), 0.07), transparent 55%),
    rgba(7, 11, 14, 0.96);
  box-shadow: 0 40px 130px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.018);
  text-align: center;
  animation: modal-in 0.55s var(--ease) both;
}

.arena-modal-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 22%;
  left: 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.7), transparent);
}

.arena-eyebrow {
  color: var(--accent);
  opacity: 0.72;
}

.arena-modal-panel h1 {
  margin: 10px 0 9px;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 70px);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-shadow: 0 0 50px rgba(var(--accent-rgb), 0.12);
}

.arena-modal-panel h2 {
  margin: 9px 0 9px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 400;
  letter-spacing: 0.13em;
  line-height: 1.03;
}

.arena-modal-lede {
  margin: 0 auto;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.09em;
  line-height: 1.9;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 30px;
  text-align: left;
}

.entry-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field-label {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.arena-input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid rgba(236, 230, 209, 0.15);
  border-radius: 4px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.arena-input::placeholder {
  color: #4e565b;
}

.arena-input:focus {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.035);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.06);
}

.arena-input:disabled {
  opacity: 0.4;
}

.entry-create {
  margin-top: 2px;
  justify-content: center;
  width: 100%;
}

.entry-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.entry-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}

.entry-divider span {
  position: relative;
  z-index: 1;
  padding: 6px 0;
  color: var(--dim);
  background: #090d10;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.code-input {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.join-row .primary-btn {
  justify-content: center;
  min-width: 86px;
}

.field-note {
  margin: 0;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.65;
}

.entry-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 18px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.entry-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: arena-blink 1.1s ease-in-out infinite;
}

.entry-status[data-state="online"] {
  color: #8ceac0;
}

.entry-status[data-state="online"] i {
  background: #69f0b2;
  animation: none;
  box-shadow: 0 0 8px #69f0b2;
}

.entry-status[data-state="offline"] {
  color: #ff9aa7;
}

.entry-status[data-state="offline"] i {
  background: var(--danger);
  animation: none;
  box-shadow: 0 0 8px var(--danger);
}

.entry-error {
  min-height: 16px;
  margin: 8px 0 0;
  color: #ff8f9e;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.entry-note {
  margin: 10px auto 0;
  max-width: 540px;
  color: #5f686d;
  font-size: 9px;
  line-height: 1.75;
}

.entry-note code {
  color: var(--accent);
  font-family: var(--font-mono);
}

.build-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 17px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.build-stamp strong {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.build-stamp span + span {
  color: #5b6367;
}

.arena-back-link {
  display: inline-block;
  margin-top: 19px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.primary-btn:disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.45;
  transform: none;
}

.primary-btn:disabled::before {
  display: none;
}

/* ── lobby ──────────────────────────────────────────────── */

.lobby-panel {
  max-width: 690px;
}

.room-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  margin: 25px auto 21px;
  padding: 15px 20px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.035);
}

.room-code-box .field-label {
  white-space: nowrap;
}

.room-code-box strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  letter-spacing: 0.23em;
  line-height: 1;
  text-shadow: 0 0 28px rgba(var(--accent-rgb), 0.28);
}

.copy-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  background: transparent;
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent);
}

.lobby-players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 296px;
  overflow-y: auto;
  gap: 9px;
  text-align: left;
}

.lobby-slot {
  --pcolor: var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 57px;
  padding: 10px 13px;
  border: 1px solid rgba(236, 230, 209, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.lobby-slot.is-empty {
  justify-content: center;
  border-style: dashed;
  color: #4e565b;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.lobby-slot-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--pcolor);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pcolor) 55%, transparent);
}

.lobby-slot-copy {
  min-width: 0;
  flex: 1;
}

.lobby-slot-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-slot-copy span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.lobby-slot.has-bot {
  padding-right: 30px;
}

.bot-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border: 1px solid rgba(255, 209, 113, 0.26);
  border-radius: 2px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.bot-remove {
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 100, 120, 0.24);
  border-radius: 50%;
  color: #d88a96;
  background: rgba(255, 100, 120, 0.04);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
}

.bot-remove:hover {
  border-color: rgba(255, 100, 120, 0.55);
  color: var(--danger);
}

.bot-add-btn {
  padding: 7px 12px;
  border: 1px solid rgba(255, 209, 113, 0.24);
  border-radius: 3px;
  color: var(--gold);
  background: rgba(255, 209, 113, 0.035);
}

.bot-add-btn:hover {
  border-color: rgba(255, 209, 113, 0.5);
  color: #ffe2a1;
}

.bot-add-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.player-copy strong .bot-badge {
  margin-left: 1px;
}

.result-name .bot-badge {
  margin-left: 5px;
}

.host-badge {
  padding: 1px 4px;
  border: 1px solid rgba(255, 209, 113, 0.25);
  border-radius: 2px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.06em;
}

.you-badge {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.12em;
}

.lobby-status {
  min-height: 18px;
  margin: 18px 0 8px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.lobby-actions,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.lobby-hint {
  min-height: 15px;
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

/* ── results ────────────────────────────────────────────── */

.result-panel {
  max-width: 650px;
}

.result-panel h2 {
  color: var(--gold);
}

.winner-card {
  --winner-color: var(--gold);
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 23px 0 15px;
  padding: 17px 20px;
  border: 1px solid color-mix(in srgb, var(--winner-color) 30%, transparent);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 15% 50%, color-mix(in srgb, var(--winner-color) 13%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.02);
  text-align: left;
}

.winner-crown {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid color-mix(in srgb, var(--winner-color) 38%, transparent);
  border-radius: 50%;
  color: var(--winner-color);
  font-family: var(--font-display);
  font-size: 21px;
  place-items: center;
  text-shadow: 0 0 20px color-mix(in srgb, var(--winner-color) 55%, transparent);
}

.winner-card div {
  flex: 1;
  min-width: 0;
}

.winner-card div span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.winner-card div strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--winner-color);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-card em {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.result-ranking {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.result-row {
  --pcolor: var(--accent);
  display: grid;
  grid-template-columns: 24px 7px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
}

.result-row.is-me {
  background: rgba(var(--accent-rgb), 0.055);
}

.result-row .rank {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
}

.result-row .result-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pcolor);
  box-shadow: 0 0 8px var(--pcolor);
}

.result-row .result-name {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row .result-state {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.result-row .result-state.is-out {
  color: var(--danger);
}

.result-row .result-score {
  min-width: 45px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.connection-panel {
  max-width: 540px;
}

/* ── responsive ─────────────────────────────────────────── */

@media (max-width: 1120px) {
  .arena-sidebar {
    flex-basis: 278px;
    width: 278px;
  }
}

@media (max-width: 960px) {
  .arena-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .arena-stage {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
  }

  .arena-sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
    width: 100%;
    flex-basis: auto;
  }

  .arena-net-line {
    grid-column: 1 / -1;
    padding-bottom: 5px;
  }
}

@media (max-width: 720px) {
  .arena-app {
    padding-top: 12px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .conn-pill {
    padding: 6px 8px;
    font-size: 7px;
  }

  .app-version {
    height: 22px;
    padding: 0 6px;
    font-size: 7px;
  }

  .arena-mode-link {
    display: none;
  }

  .arena-hud {
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-bottom: 10px;
  }

  .arena-hud-cell strong {
    font-size: 20px;
  }

  .arena-hud-cell.hud-right {
    text-align: left;
  }

  .arena-phase-badge {
    top: 11px;
    left: 12px;
    font-size: 6px;
  }

  .arena-toast {
    top: 44px;
  }

  .arena-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    align-items: center;
  }

  .self-status {
    min-width: 0;
  }

  .self-status strong {
    font-size: 12px;
  }

  .arena-controls {
    display: none;
  }

  .touch-pad {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
  }

  .arena-sidebar {
    grid-template-columns: 1fr;
  }

  .build-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 148px;
  padding: 7px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 209, 113, 0.22) transparent;
}

.build-list .empty-state {
  padding: 12px 10px;
  line-height: 1.7;
}

.build-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 3px;
  background: rgba(255, 209, 113, 0.025);
}

.build-item.is-defense {
  background: rgba(110, 200, 255, 0.045);
}

.build-item.is-offense {
  background: rgba(255, 127, 110, 0.045);
}

.build-item.is-cosmetic {
  background: rgba(200, 155, 255, 0.045);
}

.build-item.is-defense .build-glyph {
  border-color: rgba(110, 200, 255, 0.35);
  color: #9ddcff;
  background: rgba(110, 200, 255, 0.06);
}

.build-item.is-offense .build-glyph {
  border-color: rgba(255, 127, 110, 0.35);
  color: #ffad9b;
  background: rgba(255, 127, 110, 0.06);
}

.build-item.is-cosmetic .build-glyph {
  border-color: rgba(200, 155, 255, 0.35);
  color: #d9bcff;
  background: rgba(200, 155, 255, 0.06);
}

.build-glyph {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 1px solid rgba(255, 209, 113, 0.24);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 209, 113, 0.05);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  place-items: center;
}

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

.build-copy strong {
  display: block;
  color: var(--paper);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.build-copy span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 7px;
  line-height: 1.55;
}

.relic-count {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  color: rgba(255, 209, 113, 0.8);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.arena-player-list {
    min-height: 0;
  }

  .entry-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 23px;
  }

  .entry-divider {
    height: 18px;
  }

  .entry-divider::before {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
  }

  .entry-divider span {
    padding: 0 8px;
  }

  .arena-modal-panel {
    padding: 23px 17px;
  }

  .arena-modal-panel h1 {
    font-size: clamp(39px, 12vw, 56px);
    letter-spacing: 0.1em;
  }

  .arena-modal-lede {
    font-size: 10px;
    line-height: 1.8;
  }

  .room-code-box {
    gap: 12px;
    padding: 13px 14px;
    margin: 19px auto 16px;
  }

  .room-code-box strong {
    font-size: 28px;
  }

  .lobby-players {
    grid-template-columns: 1fr;
  }

  .result-row {
    grid-template-columns: 18px 7px minmax(0, 1fr) auto;
  }

  .result-row .result-state {
    display: none;
  }

  .result-ranking {
    max-height: 34vh;
    overflow-y: auto;
  }

  .arena-countdown strong {
    font-size: 76px;
  }

  .spectator-bar {
    top: 10px;
    padding: 6px 10px;
    font-size: 8px;
  }

}

@media (max-width: 480px) {
  .brand-text small {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .conn-pill span {
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .arena-hud-cell strong {
    font-size: 18px;
  }

  .arena-hud .eyebrow {
    font-size: 7px;
  }

  .arena-modal-panel h2 {
    font-size: 31px;
  }

  .winner-card {
    gap: 11px;
    padding: 13px 14px;
  }

  .winner-crown {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 17px;
  }

  .winner-card div strong {
    font-size: 20px;
  }

  .winner-card em {
    font-size: 21px;
  }

  .result-actions .primary-btn,
  .lobby-actions .primary-btn {
    padding: 11px 18px;
  }

  .side-panel .panel-head {
    padding: 13px 14px 11px;
  }
}
