:root {
  color-scheme: dark;
  --ink: #f5f7f3;
  --muted: #9faea7;
  --quiet: #6f7e77;
  --page: #06100d;
  --panel: #0b1814;
  --panel-raised: #10211b;
  --line: rgba(226, 239, 232, 0.12);
  --line-strong: rgba(226, 239, 232, 0.22);
  --lime: #c6ff43;
  --lime-soft: rgba(198, 255, 67, 0.12);
  --orange: #ff825c;
  --aqua: #65e7d4;
  --home: #c6ff43;
  --away: #ff825c;
  --danger: #ff8f82;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  font-family:
    "Avenir Next", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--page);
  background-size: 72px 72px;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

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

.page-glow {
  position: fixed;
  z-index: -1;
  top: -30vw;
  right: -20vw;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(198, 255, 67, 0.09),
    rgba(101, 231, 212, 0.025) 42%,
    transparent 68%
  );
  pointer-events: none;
}

.topbar {
  width: min(1440px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: inherit;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 255, 67, 0.42);
  border-radius: 13px 13px 5px 13px;
  color: #07100d;
  background: var(--lime);
  font-size: 21px;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(198, 255, 67, 0.14);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.server-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(11, 24, 20, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.launcher-top-download {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(124, 108, 255, 0.28);
  border-radius: 11px;
  color: #c8c2ff;
  background: rgba(124, 108, 255, 0.09);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.launcher-top-download:hover:not([aria-disabled="true"]) {
  border-color: rgba(151, 139, 255, 0.65);
  background: rgba(124, 108, 255, 0.16);
}

.launcher-top-download[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.lab-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(101, 231, 212, 0.3);
  border-radius: 999px;
  color: var(--aqua);
  background: rgba(101, 231, 212, 0.07);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.lab-button:hover {
  border-color: rgba(101, 231, 212, 0.58);
  background: rgba(101, 231, 212, 0.12);
}

.session-logout-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.session-logout-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.operator-capability-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(101, 231, 212, 0.22);
  border-radius: 16px;
  background: rgba(101, 231, 212, 0.055);
}

.operator-capability-panel label {
  display: grid;
  gap: 4px;
}

.operator-capability-panel label span,
.operator-capability-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.operator-capability-panel input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.24);
}

.operator-capability-panel input:focus {
  outline: 2px solid rgba(101, 231, 212, 0.35);
  outline-offset: 2px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(198, 255, 67, 0.09);
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.setup-layout {
  min-height: calc(100vh - 89px);
  padding: 56px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.75fr);
  align-items: center;
  gap: clamp(54px, 8vw, 132px);
}

.eyebrow,
.step-label {
  margin: 0 0 16px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hero-copy h1,
.lobby-sidebar h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(56px, 6.6vw, 104px);
  line-height: 0.93;
  letter-spacing: -0.068em;
  text-wrap: balance;
}

.hero-copy h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 247, 243, 0.58);
}

.hero-lead {
  max-width: 650px;
  margin: 32px 0 38px;
  color: #b7c3bd;
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.55;
}

.formation-strip {
  max-width: 690px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.formation-strip div {
  padding: 20px 20px 20px 0;
}

.formation-strip div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.formation-strip span,
.formation-strip strong {
  display: block;
}

.formation-strip span {
  margin-bottom: 4px;
  color: var(--lime);
  font-size: 13px;
  font-weight: 800;
}

.formation-strip strong {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.build-note {
  max-width: 620px;
  margin-top: 30px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.build-note-index {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
}

.build-note p {
  margin: 1px 0 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.6;
}

.entry-card {
  position: relative;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 46%),
    rgba(11, 24, 20, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 86px;
  height: 5px;
  background: var(--lime);
}

.card-heading h2 {
  margin: 0 0 26px;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.choice-group {
  padding: 0;
  margin: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.switcher {
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 10, 8, 0.45);
}

.switcher input,
.mode-card input,
.team-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switcher span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: 160ms ease;
}

.switcher input:checked + span {
  color: var(--ink);
  background: var(--panel-raised);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.field {
  margin-top: 22px;
  display: block;
}

.field > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: rgba(3, 12, 9, 0.62);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: #617068;
}

.field input:focus {
  border-color: rgba(198, 255, 67, 0.7);
  box-shadow: 0 0 0 4px rgba(198, 255, 67, 0.08);
}

.launch-panel {
  margin: 18px 22px 22px;
  padding: 22px;
  border: 1px solid rgba(101, 231, 212, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(
      135deg,
      rgba(101, 231, 212, 0.08),
      transparent 56%
    ),
    rgba(3, 12, 9, 0.58);
}

.training-control-panel {
  margin: 0 22px 22px;
  padding: 22px;
  border: 1px solid rgba(198, 255, 67, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(198, 255, 67, 0.07), transparent 58%),
    rgba(3, 12, 9, 0.62);
}

.training-control-heading {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: space-between;
}

.training-control-heading .step-label {
  margin-bottom: 8px;
  color: var(--lime);
}

.training-control-heading h3 {
  margin: 0;
  font-size: 22px;
}

.training-control-heading p:not(.step-label) {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.training-repeat-toggle {
  min-height: 42px;
  padding: 0 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(0, 6, 4, 0.45);
  font-size: 10px;
  font-weight: 800;
}

.training-repeat-toggle input {
  accent-color: var(--lime);
}

.training-control-section {
  margin-top: 18px;
}

.training-control-section > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--quiet);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.training-control-grid.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.training-control-grid button {
  min-width: 0;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(0, 6, 4, 0.34);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}

.training-control-grid button:hover:not(:disabled),
.training-control-grid button.active {
  border-color: rgba(198, 255, 67, 0.58);
  background: rgba(198, 255, 67, 0.09);
}

.training-control-grid button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.training-control-grid b,
.training-control-grid span {
  display: block;
}

.training-control-grid b {
  font-size: 12px;
}

.training-control-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.training-control-footer {
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed rgba(198, 255, 67, 0.2);
}

.training-control-footer > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.training-control-footer .danger {
  color: #ffb2a8;
}

.training-control-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.launch-heading {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.launch-heading .step-label {
  margin-bottom: 8px;
  color: var(--aqua);
}

.launch-heading h3 {
  margin: 0;
  font-size: 22px;
}

.launch-heading p:not(.step-label) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.secondary-button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(101, 231, 212, 0.35);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(101, 231, 212, 0.1);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.secondary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.launch-result {
  margin-top: 18px;
}

.launch-result label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.launch-result textarea {
  width: 100%;
  padding: 13px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  color: var(--lime);
  background: rgba(0, 6, 4, 0.72);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.launch-result textarea:focus {
  border-color: rgba(198, 255, 67, 0.55);
}

.launch-actions {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.launch-actions small {
  color: var(--quiet);
  font-size: 10px;
}

.launch-copy-detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.launch-actions .launch-copy-status {
  min-height: 1.35em;
  color: var(--muted);
  line-height: 1.35;
}

.launch-actions .launch-copy-status[data-copy-state="success"] {
  color: var(--lime);
}

.launch-actions .launch-copy-status[data-copy-state="manual"] {
  color: var(--orange);
}

.field small {
  display: block;
  margin-top: 7px;
  color: var(--quiet);
  font-size: 10px;
}

.mode-choice {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mode-choice legend {
  grid-column: 1 / -1;
}

.mode-card {
  position: relative;
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(3, 12, 9, 0.45);
  cursor: pointer;
  transition: 160ms ease;
}

.mode-card:has(input:checked) {
  border-color: rgba(198, 255, 67, 0.52);
  background: var(--lime-soft);
}

.mode-check {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.mode-card input:checked + .mode-check {
  border: 5px solid var(--lime);
}

.mode-card strong {
  margin-bottom: 4px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.mode-card small {
  color: var(--muted);
  font-size: 11px;
}

.mode-card em {
  margin-top: auto;
  color: var(--lime);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.training-lab-help {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(101, 231, 212, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(101, 231, 212, 0.08), transparent 64%),
    rgba(3, 12, 9, 0.5);
}

.match-rehearsal-help {
  border-color: rgba(198, 255, 67, 0.32);
  background: rgba(198, 255, 67, 0.055);
}

.match-rehearsal-help .training-lab-icon {
  width: 34px;
  font-size: 9px;
}

.training-lab-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.training-lab-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(101, 231, 212, 0.45);
  border-radius: 8px;
  color: var(--aqua);
  background: rgba(101, 231, 212, 0.1);
  font-size: 15px;
  font-weight: 900;
}

.training-lab-heading strong {
  display: block;
  font-size: 13px;
}

.training-lab-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.training-lab-help kbd,
.training-lab-help code {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--lime);
  background: rgba(0, 6, 4, 0.7);
  font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.training-lab-help kbd {
  padding: 3px 5px;
}

.training-command-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.training-command-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 6, 4, 0.32);
}

.training-command-grid code {
  display: inline-block;
  padding: 3px 5px;
}

.training-command-grid span {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.training-slash-note {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(198, 255, 67, 0.22);
  color: var(--quiet);
  font-size: 9px;
  line-height: 1.55;
}

.training-slash-note strong {
  color: var(--ink);
}

.training-slash-note code {
  padding: 2px 4px;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  margin-top: 24px;
  padding: 0 10px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 13px;
  color: #07100d;
  background: var(--lime);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(198, 255, 67, 0.1);
  transition: transform 160ms ease, opacity 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary-button[aria-busy="true"] {
  cursor: wait;
}

.button-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--lime);
  background: #07100d;
  font-size: 18px;
}

.form-error {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 143, 130, 0.25);
  border-radius: 10px;
  color: #ffb2a8;
  background: rgba(255, 93, 77, 0.08);
  font-size: 12px;
  line-height: 1.45;
}

.lobby-view {
  padding: 28px 0 72px;
}

.lobby-topline {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-button,
.join-code,
.icon-button {
  border: 0;
  cursor: pointer;
}

.text-button {
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.text-button:hover {
  color: var(--ink);
}

.lobby-identity {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lobby-identity > span {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.join-code {
  min-height: 42px;
  padding: 0 8px 0 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
}

.join-code strong {
  color: var(--lime);
  font-size: 15px;
  letter-spacing: 0.14em;
}

.join-code span {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 8px;
  font-weight: 900;
}

.lobby-layout {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(280px, 0.52fr) minmax(600px, 1.35fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 20, 16, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lobby-sidebar {
  padding: clamp(28px, 3.2vw, 48px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.025), transparent 40%),
    var(--panel);
}

.lobby-sidebar h1 {
  font-size: clamp(42px, 4.3vw, 66px);
}

.muted {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.lobby-stats {
  margin: 32px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lobby-stats div {
  padding: 18px 4px;
}

.lobby-stats div + div {
  border-left: 1px solid var(--line);
  text-align: center;
}

.lobby-stats span,
.lobby-stats strong {
  display: block;
}

.lobby-stats span {
  margin-bottom: 3px;
  color: var(--quiet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lobby-stats strong {
  font-size: 18px;
}

.team-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.team-choice legend {
  grid-column: 1 / -1;
}

.team-choice label > span {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.team-choice input:checked + span {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.home-dot {
  background: var(--home);
}

.away-dot {
  background: var(--away);
}

.legend {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--quiet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.available-key {
  background: var(--lime);
}

.bot-key {
  border: 1px solid var(--quiet);
}

.taken-key {
  background: var(--orange);
}

.status-panel {
  margin-top: auto;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.status-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 18px;
}

.status-panel strong,
.status-panel p {
  display: block;
}

.status-panel strong {
  font-size: 11px;
}

.status-panel p {
  margin: 3px 0 0;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.35;
}

.pitch-card {
  padding: clamp(24px, 3vw, 42px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 80% 5%, rgba(198, 255, 67, 0.045), transparent 25%),
    #091712;
}

.pitch-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pitch-heading .step-label {
  margin-bottom: 5px;
}

.pitch-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
  font-size: 20px;
}

.icon-button:hover {
  color: var(--lime);
  border-color: rgba(198, 255, 67, 0.3);
}

.pitch {
  position: relative;
  flex: 1;
  min-height: 525px;
  border: 1px solid rgba(215, 255, 223, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 50%,
      transparent 50%
    ),
    linear-gradient(180deg, #174c35, #103d2b);
  background-size: 22% 100%, 100% 100%;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.26),
    0 24px 46px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.pitch::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.pitch-markings {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
}

.halfway-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #d8efdd;
}

.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 126px;
  height: 126px;
  border: 1px solid #d8efdd;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.center-circle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d8efdd;
  transform: translate(-50%, -50%);
}

.penalty-box,
.goal-box {
  position: absolute;
  left: 50%;
  bottom: -1px;
  border: 1px solid #d8efdd;
  border-bottom: 0;
  transform: translateX(-50%);
}

.penalty-box {
  width: 52%;
  height: 18%;
}

.goal-box {
  width: 24%;
  height: 7%;
}

.role-grid {
  position: absolute;
  z-index: 1;
  inset: 26px 30px;
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  grid-template-rows: repeat(4, 1fr);
  align-items: center;
  justify-items: center;
}

.role-slot {
  position: relative;
  width: clamp(62px, 6.2vw, 84px);
  min-height: clamp(76px, 7.2vw, 94px);
  padding: 10px 5px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px 18px 9px 9px;
  color: var(--ink);
  background: rgba(5, 20, 14, 0.86);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: 150ms ease;
}

.role-slot:hover:not(:disabled) {
  border-color: var(--lime);
  transform: translateY(-4px);
}

.role-slot:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.role-slot.selected {
  border-color: var(--lime);
  color: #07100d;
  background: var(--lime);
  box-shadow: 0 12px 26px rgba(198, 255, 67, 0.18);
  transform: translateY(-3px);
}

.role-slot.mine {
  border-color: var(--aqua);
  background: #123c34;
  box-shadow: 0 0 0 4px rgba(101, 231, 212, 0.08);
}

.role-slot.taken {
  border-color: rgba(255, 130, 92, 0.3);
  background: rgba(44, 24, 20, 0.9);
}

.role-slot.bot-only {
  border-style: dashed;
  color: #91a098;
  background: rgba(5, 17, 13, 0.72);
}

.role-slot:disabled {
  cursor: not-allowed;
}

.shirt-number {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.role-name {
  max-width: 100%;
  margin-top: 5px;
  color: inherit;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.slot-state {
  max-width: 68px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected .slot-state {
  color: rgba(7, 16, 13, 0.7);
}

.slot-8 { grid-column: 2; grid-row: 1; }
.slot-9 { grid-column: 4; grid-row: 1; }
.slot-10 { grid-column: 6; grid-row: 1; }
.slot-5 { grid-column: 1; grid-row: 2; }
.slot-6 { grid-column: 3; grid-row: 2; }
.slot-7 { grid-column: 5; grid-row: 2; }
.slot-11 { grid-column: 7; grid-row: 2; }
.slot-2 { grid-column: 2; grid-row: 3; }
.slot-3 { grid-column: 4; grid-row: 3; }
.slot-4 { grid-column: 6; grid-row: 3; }
.slot-1 { grid-column: 4; grid-row: 4; }

.selection-bar {
  min-height: 78px;
  margin-top: 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

#selection-summary span,
#selection-summary strong {
  display: block;
}

#selection-summary span {
  margin-bottom: 5px;
  color: var(--quiet);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#selection-summary strong {
  font-size: 15px;
}

.primary-button.compact {
  width: min(230px, 46%);
  min-height: 50px;
  margin: 0;
}

.tuning-view {
  padding: 28px 0 72px;
}

.tuning-topline {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tuning-revision-chip {
  min-height: 40px;
  padding: 0 13px;
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--quiet);
  background: var(--panel);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tuning-revision-chip strong {
  color: var(--lime);
  font-size: 12px;
}

.tuning-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.45fr) minmax(620px, 1.25fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 20, 16, 0.76);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tuning-intro {
  padding: clamp(30px, 3.2vw, 52px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(101, 231, 212, 0.07), transparent 42%),
    var(--panel);
}

.tuning-intro h1 {
  margin: 0;
  font-size: clamp(44px, 4.8vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.tuning-intro h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 247, 243, 0.58);
}

.tuning-intro > p {
  margin: 26px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.tuning-legend {
  padding: 18px 0;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tuning-legend span {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tuning-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tuning-guide {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.tuning-guide strong {
  color: var(--ink);
  font-size: 11px;
}

.tuning-guide p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.evidence-verified {
  background: var(--lime);
}

.evidence-replacement {
  background: var(--aqua);
}

.evidence-unknown {
  background: var(--orange);
}

.tuning-apply-note {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(101, 231, 212, 0.2);
  border-radius: 13px;
  background: rgba(101, 231, 212, 0.05);
}

.tuning-apply-note strong {
  font-size: 11px;
}

.tuning-apply-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.calibration-panel {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(198, 255, 67, 0.2);
  border-radius: 13px;
  background: rgba(198, 255, 67, 0.035);
}

.calibration-panel > strong {
  font-size: 11px;
}

.calibration-panel > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.calibration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.calibration-actions .secondary-button,
.calibration-actions .text-button {
  width: auto;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 8px;
}

.calibration-actions .danger {
  color: #ff9b85;
}

.calibration-status {
  overflow-wrap: anywhere;
}

.calibration-output {
  max-height: 310px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #c9e8dd;
  background: rgba(0, 0, 0, 0.22);
  font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

.copy-target {
  position: fixed;
  inset: 0 auto auto -9999px;
}

.tuning-editor {
  min-width: 0;
  padding: clamp(24px, 3vw, 42px);
  background:
    radial-gradient(circle at 90% 0, rgba(198, 255, 67, 0.04), transparent 24%),
    #091712;
}

.tuning-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.tuning-heading .step-label {
  margin-bottom: 6px;
}

.tuning-heading h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.tuning-heading p:not(.step-label) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.tuning-search {
  width: min(300px, 44%);
}

.tuning-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: rgba(2, 10, 8, 0.68);
}

.tuning-search input:focus {
  border-color: rgba(198, 255, 67, 0.58);
}

.tuning-filter-row {
  margin: 20px 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tuning-filter-row label {
  position: relative;
}

.tuning-filter-row input {
  position: absolute;
  opacity: 0;
}

.tuning-filter-row span,
.tuning-filter-row button {
  min-height: 32px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--quiet);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.tuning-filter-row button {
  font-family: inherit;
}

.tuning-filter-row button:hover,
.tuning-filter-row button[aria-pressed="true"] {
  border-color: rgba(101, 231, 212, 0.42);
  color: var(--aqua);
  background: rgba(101, 231, 212, 0.07);
}

.tuning-filter-row input:checked + span {
  border-color: rgba(198, 255, 67, 0.36);
  color: var(--lime);
  background: var(--lime-soft);
}

.tuning-groups {
  display: grid;
  gap: 12px;
}

.tuning-group {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(3, 12, 9, 0.48);
  overflow: hidden;
}

.tuning-group summary {
  min-height: 54px;
  padding: 0 17px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 900;
}

.tuning-group summary::-webkit-details-marker {
  display: none;
}

.tuning-group summary span {
  color: var(--quiet);
  font-size: 9px;
  font-weight: 800;
}

.tuning-field-list {
  border-top: 1px solid var(--line);
}

.tuning-field {
  padding: 16px 17px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(145px, 0.42fr);
  gap: 20px;
  align-items: start;
}

.tuning-field + .tuning-field {
  border-top: 1px solid var(--line);
}

.tuning-field.changed {
  background: rgba(198, 255, 67, 0.045);
}

.tuning-field-name {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.tuning-field-name strong {
  font-size: 12px;
}

.tuning-badge {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tuning-badge.verified {
  color: var(--lime);
}

.tuning-badge.replacement-design,
.tuning-badge.replacementDesign {
  color: var(--aqua);
}

.tuning-badge.unknown,
.tuning-badge.weakly-inferred,
.tuning-badge.weaklyInferred {
  color: var(--orange);
}

.tuning-field-copy code {
  display: block;
  margin-top: 5px;
  color: var(--quiet);
  font: 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tuning-field-copy > p {
  margin: 7px 0 0;
  color: var(--quiet);
  font-size: 9px;
  line-height: 1.45;
}

.tuning-field-copy > .tuning-field-purpose {
  max-width: 760px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.tuning-field-help {
  margin-top: 10px;
  border: 1px solid rgba(101, 231, 212, 0.16);
  border-radius: 10px;
  background: rgba(101, 231, 212, 0.025);
  overflow: hidden;
}

.tuning-field-help > summary {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--aqua);
  font-size: 9px;
  font-weight: 900;
  list-style-position: inside;
}

.tuning-field-help[open] > summary {
  border-bottom: 1px solid rgba(101, 231, 212, 0.13);
}

.tuning-help-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tuning-help-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 10, 8, 0.36);
}

.tuning-help-item.wide {
  grid-column: 1 / -1;
}

.tuning-help-item strong {
  display: block;
  color: var(--ink);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tuning-help-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.tuning-evidence-note {
  margin: 0;
  padding: 0 10px 11px;
  color: var(--quiet);
  font-size: 8px;
  line-height: 1.55;
}

.tuning-value-wrap {
  position: relative;
}

.tuning-value-wrap input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: rgba(0, 6, 4, 0.72);
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tuning-value-wrap input:focus {
  border-color: rgba(198, 255, 67, 0.58);
}

.tuning-value-wrap input:disabled {
  color: var(--quiet);
  cursor: not-allowed;
  opacity: 0.72;
}

.tuning-boolean {
  min-height: 42px;
  padding: 0 11px;
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tuning-value-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--quiet);
  font-size: 8px;
}

.tuning-field-reset {
  width: 100%;
  min-height: 32px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid rgba(101, 231, 212, 0.24);
  border-radius: 8px;
  color: var(--aqua);
  background: rgba(101, 231, 212, 0.055);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease;
}

.tuning-field-reset:hover:not(:disabled) {
  border-color: rgba(101, 231, 212, 0.5);
  background: rgba(101, 231, 212, 0.11);
}

.tuning-field-reset:disabled {
  color: var(--quiet);
  cursor: not-allowed;
  opacity: 0.42;
}

.tuning-actions {
  position: sticky;
  z-index: 2;
  bottom: 14px;
  margin-top: 18px;
  padding: 14px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(11, 24, 20, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.tuning-actions > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tuning-actions > div:first-child {
  display: block;
}

.tuning-actions strong,
.tuning-actions small {
  display: block;
}

.tuning-actions strong {
  font-size: 11px;
}

.tuning-actions small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 8px;
}

.tuning-actions .secondary-button,
.tuning-actions .primary-button {
  width: auto;
  min-width: 165px;
}

.toast {
  position: fixed;
  z-index: 5;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(198, 255, 67, 0.28);
  border-radius: 12px;
  color: var(--ink);
  background: #10251d;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
}

button:focus-visible,
input:focus-visible,
label:has(input:focus-visible) > span,
.mode-card:has(input:focus-visible) {
  outline: 3px solid rgba(198, 255, 67, 0.86);
  outline-offset: 3px;
}

@media (max-width: 1050px) {
  .setup-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-copy {
    padding-top: 22px;
  }

  .entry-card {
    width: min(620px, 100%);
  }

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

  .lobby-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-panel {
    margin-top: 28px;
  }

  .tuning-shell {
    grid-template-columns: 1fr;
  }

  .tuning-intro {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar,
  main {
    width: min(100% - 28px, 1440px);
  }

  .topbar {
    min-height: 72px;
  }

  .server-chip {
    padding: 8px 10px;
    font-size: 10px;
  }

  .lab-button {
    padding: 0 10px;
    font-size: 9px;
  }

  .setup-layout {
    min-height: auto;
    padding: 46px 0 48px;
  }

  .hero-copy h1 {
    font-size: clamp(49px, 16vw, 76px);
  }

  .formation-strip {
    grid-template-columns: 1fr 1fr;
  }

  .formation-strip div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .formation-strip div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .entry-card {
    padding: 24px 18px;
  }

  .mode-choice {
    grid-template-columns: 1fr;
  }

  .training-command-grid {
    grid-template-columns: 1fr;
  }

  .lobby-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 14px 0 20px;
  }

  .lobby-layout {
    border-radius: 20px;
  }

  .lobby-sidebar,
  .pitch-card {
    padding: 24px 16px;
  }

  .launch-panel {
    margin: 18px 0 0;
    padding: 18px;
  }

  .training-control-panel {
    margin: 0 0 18px;
    padding: 18px;
  }

  .training-control-heading,
  .training-control-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .training-control-footer > div {
    align-items: stretch;
    flex-direction: column;
  }

  .training-control-grid,
  .training-control-grid.compact-grid {
    grid-template-columns: 1fr;
  }

  .launch-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .launch-heading > div {
    min-width: 0;
  }

  .launch-heading .secondary-button {
    width: 100%;
  }

  .launch-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .launch-actions .text-button {
    width: 100%;
  }

  .pitch {
    min-height: 490px;
  }

  .role-grid {
    inset: 24px 8px;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
  }

  .role-slot {
    width: clamp(51px, 14vw, 68px);
    min-height: 72px;
    border-radius: 14px 14px 8px 8px;
  }

  .shirt-number {
    font-size: 23px;
  }

  .role-name {
    font-size: 7px;
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button.compact {
    width: 100%;
  }

  .tuning-topline {
    min-height: 74px;
  }

  .tuning-shell {
    border-radius: 20px;
  }

  .tuning-intro,
  .tuning-editor {
    padding: 24px 16px;
  }

  .tuning-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tuning-search {
    width: 100%;
  }

  .tuning-field {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tuning-help-grid {
    grid-template-columns: 1fr;
  }

  .tuning-help-item.wide {
    grid-column: auto;
  }

  .tuning-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .tuning-actions > div {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .tuning-actions .secondary-button,
  .tuning-actions .primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Legacy ICF lobby shell. Gameplay/tuning controls keep their existing
   semantics; this layer only recreates the compact room-browser language. */
:root {
  --legacy-red: #df2343;
  --legacy-gold: #cba64c;
  --legacy-orange: #dc8748;
  --legacy-purple: #8858ce;
  --legacy-chrome: #222528;
  --legacy-silver: #d7d9d9;
  --legacy-pitch: #4b981f;
  --legacy-pitch-dark: #367819;
  --radius-lg: 8px;
  --radius-md: 5px;
}

body {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.06), transparent 42%),
    linear-gradient(180deg, #1c2124 0, #101416 420px, #0c1012 100%);
  font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
}

.page-glow { display: none; }

.topbar,
main {
  width: min(1540px, calc(100% - 28px));
}

.topbar {
  min-height: 70px;
  padding: 0 12px;
  gap: 18px;
  border: 1px solid #34383b;
  border-top: 4px solid var(--legacy-red);
  border-bottom-color: #020303;
  background: linear-gradient(#2d3033, #111315 64%, #050607);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48);
}

.brand { min-width: 170px; }
.brand-mark {
  width: 54px;
  height: 40px;
  border: 0;
  border-radius: 2px;
  color: #fff;
  background: linear-gradient(120deg, #e42a46, #931328);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22);
  font-size: 16px;
  letter-spacing: -0.05em;
}
.brand strong { font-size: 23px; letter-spacing: 0.02em; }
.brand small { color: #c6c8c9; font-size: 9px; }

.legacy-main-nav {
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}
.legacy-main-nav button {
  min-width: 126px;
  padding: 0 20px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid #050606;
  color: #d5d7d8;
  background: linear-gradient(#3a3e41, #17191b);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px #000;
  white-space: nowrap;
}
.legacy-main-nav button:hover:not(:disabled),
.legacy-main-nav button.active {
  color: #fff;
  background: linear-gradient(#f33b5a, #c41433 62%, #8d0c22);
}
.legacy-main-nav button:disabled { cursor: default; opacity: 0.58; }
.legacy-main-nav small { display: block; font-size: 8px; font-weight: 600; }

.topbar-actions { flex: 0 0 auto; }
.server-chip {
  border-radius: 3px;
  border-color: #464b4d;
  color: #d4d6d6;
  background: #151819;
}
.pulse { background: #75c934; box-shadow: 0 0 0 4px rgba(117, 201, 52, 0.12); }
.lab-button {
  border-radius: 3px;
  border-color: #50565a;
  color: #d8d9d9;
  background: linear-gradient(#35393c, #181a1c);
}

.setup-layout {
  min-height: auto;
  padding: 22px 0 64px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.58fr);
  align-items: start;
  gap: 22px;
}

.match-browser {
  grid-column: 1 / -1;
  border: 5px solid var(--legacy-silver);
  border-top-width: 2px;
  border-radius: 4px;
  color: #191b1d;
  background: #eceeee;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}
.legacy-breadcrumb {
  min-height: 42px;
  padding: 0 16px;
  display: flex;
  gap: 11px;
  align-items: center;
  color: #d7d9da;
  background: linear-gradient(#2e3134, #101214);
  font-size: 13px;
}
.legacy-breadcrumb i { color: #fff; font-size: 22px; font-style: normal; }
.legacy-breadcrumb strong { color: #fff; }
.match-browser-heading {
  padding: 15px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #b8bbbd;
  background: linear-gradient(#fafafa, #d8dadb);
}
.match-browser-heading h1 { margin: 0; font-size: 25px; letter-spacing: -0.03em; }
.match-browser-heading .step-label { margin-bottom: 4px; color: #a4132b; }
.match-browser-heading .muted { margin: 3px 0 0; color: #62676a; font-size: 12px; }
.match-browser .secondary-button {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 3px;
  border-color: #aeb2b4;
  color: #303336;
  background: linear-gradient(#fff, #cfd2d4);
  font-size: 12px;
}
.match-browser .form-error { margin: 10px 18px 0; }

.active-room-grid {
  min-height: 226px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
  background: #c9cdcf;
  overflow-x: auto;
}
.active-room-card {
  min-width: 220px;
  padding: 0 11px 10px;
  border: 1px solid #151719;
  border-radius: 4px;
  color: #ededee;
  background: linear-gradient(145deg, #34373a, #1d2022 58%, #151719);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14), 0 3px 8px rgba(0, 0, 0, 0.25);
}
.active-room-card header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #4b4e50;
}
.active-room-card header strong { color: #d8d7e8; font-size: 20px; }
.active-room-card header span { color: #aeb2b4; font-size: 9px; letter-spacing: 0.12em; }
.room-card-score {
  min-height: 50px;
  display: grid;
  grid-template-columns: 1fr 20px 48px 20px 1fr;
  gap: 3px;
  align-items: center;
  text-align: center;
}
.room-card-score span { color: var(--legacy-gold); font-size: 8px; font-weight: 800; }
.room-card-score b { color: #ef9c42; font-size: 19px; }
.room-card-score time { color: #eee; font-size: 13px; }
.room-card-occupancy {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  font-size: 10px;
}
.room-card-occupancy span b { color: #fff; font-size: 16px; }
.room-card-occupancy em { color: #d3d5d6; font-size: 9px; font-style: normal; }
.room-card-actions { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-card-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-shadow: 0 1px rgba(0, 0, 0, 0.5);
}
.room-play-button { background: linear-gradient(#f2a15d, #cf6f32); }
.room-watch-button { background: linear-gradient(#a276e4, #7243b8); }
.room-card-actions button:disabled { cursor: not-allowed; filter: grayscale(0.72); opacity: 0.48; }
.active-room-card > p { margin: 8px 0 0; color: #aeb2b4; font-size: 9px; text-align: center; }
.active-room-card.status-inProgress { border-color: #7650b9; }
.active-room-card.status-ready { border-color: #b58d3a; }
.active-room-empty {
  grid-column: 1 / -1;
  min-height: 190px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed #8c9295;
  color: #505558;
  text-align: center;
}
.active-room-empty strong { color: #282c2e; font-size: 22px; }

.hero-copy,
.entry-card {
  border: 1px solid #484d50;
  border-radius: 4px;
  background: linear-gradient(150deg, #2c3032, #151819 58%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.hero-copy { min-height: 100%; padding: 30px; }
.hero-copy h1 { font-size: clamp(44px, 5vw, 72px); line-height: 0.98; }
.hero-copy h1 span { color: #f4f4f4; -webkit-text-stroke: 0; }
.hero-lead { margin: 22px 0 26px; font-size: 16px; }
.eyebrow, .step-label { color: var(--legacy-gold); }
.formation-strip span { color: var(--legacy-gold); }
.entry-card { padding: 28px; }
.entry-card::before { width: 100%; height: 4px; background: var(--legacy-red); }
.switcher { border-radius: 4px; background: #101213; }
.switcher span, .field input, .mode-card { border-radius: 3px; }
.switcher input:checked + span { background: linear-gradient(#4b4f52, #292c2e); }
.mode-card input:checked + .mode-check { border-color: var(--legacy-gold); background: var(--legacy-gold); }
.entry-card .primary-button { border-radius: 3px; background: linear-gradient(#f13b59, #b3112d); color: #fff; }

.lobby-view { padding: 12px 0 60px; }
.lobby-topline {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #383d3f;
  background: linear-gradient(#303438, #111315);
}
.join-code { border-radius: 3px; background: #070809; }
.join-code strong { color: var(--legacy-gold); }

.legacy-room-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 300px minmax(360px, 1fr);
  gap: 8px;
  padding: 8px;
  border: 5px solid var(--legacy-silver);
  border-bottom: 0;
  color: #17191a;
  background: #f1f2f2;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
}
.team-room-panel {
  min-width: 0;
  border: 1px solid #8b8f91;
  background: #e5e7e7;
}
.team-room-panel > header {
  min-height: 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #111;
  color: #fff;
  background: linear-gradient(#323537, #151719);
}
.team-room-panel header span { color: var(--legacy-gold); font-size: 11px; font-weight: 900; }
.team-room-panel header h2 { margin: 1px 0 0; font-size: 15px; }
.team-room-panel header > strong { color: #d8dada; font-size: 11px; }
.team-pitch-hint { margin: 0; padding: 7px 10px; color: #555b5e; font-size: 10px; text-align: center; }

.pitch.legacy-pitch {
  min-height: 390px;
  margin: 8px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 44px, rgba(0, 0, 0, 0.04) 44px 88px),
    linear-gradient(180deg, #58a82a, var(--legacy-pitch-dark));
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.2);
}
.legacy-pitch .halfway-line { top: 0; bottom: 0; left: 50%; width: 1px; height: auto; }
.legacy-pitch .center-circle { width: 92px; height: 92px; }
.legacy-pitch .penalty-box,
.legacy-pitch .goal-box {
  top: 50%;
  right: auto;
  bottom: auto;
  left: -1px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 0;
  transform: translateY(-50%);
}
.legacy-pitch .penalty-box { width: 16%; height: 48%; }
.legacy-pitch .goal-box { width: 7%; height: 23%; }
.legacy-pitch .pitch-markings::after {
  content: "";
  position: absolute;
  top: 26%;
  right: -1px;
  width: 16%;
  height: 48%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-right: 0;
}
.legacy-pitch .role-grid { inset: 8px; display: block; }
.legacy-pitch .role-slot {
  position: absolute;
  width: 58px;
  min-height: 70px;
  padding: 5px 2px 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: translate(-50%, -50%);
}
.legacy-pitch .role-slot::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 1px;
  left: 10px;
  width: 38px;
  height: 43px;
  background: linear-gradient(90deg, #183d65 0 58%, #e0c62e 59%);
  clip-path: polygon(25% 0, 39% 8%, 61% 8%, 75% 0, 100% 19%, 82% 34%, 78% 100%, 22% 100%, 18% 34%, 0 19%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.48));
}
.away-team-panel .role-slot::before { background: linear-gradient(90deg, #ca241f 0 62%, #1c1d1e 63%); }
.legacy-pitch .role-slot:hover:not(:disabled),
.legacy-pitch .role-slot.selected { transform: translate(-50%, calc(-50% - 3px)); }
.legacy-pitch .role-slot.selected::after,
.legacy-pitch .role-slot.mine::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 5px;
  width: 48px;
  height: 51px;
  border: 3px solid #72efff;
  border-radius: 16px;
  box-shadow: 0 0 10px rgba(114, 239, 255, 0.75);
}
.legacy-pitch .role-slot.selected::after { border-color: #ffe063; box-shadow: 0 0 10px rgba(255, 224, 99, 0.7); }
.legacy-pitch .role-slot.taken::before { filter: grayscale(0.55) drop-shadow(0 2px 3px #000); }
.legacy-pitch .role-slot.bot-only { color: #d6d8d8; opacity: 0.82; }
.legacy-pitch .shirt-number { position: relative; font-size: 15px; line-height: 33px; text-shadow: 0 1px 2px #000; }
.legacy-pitch .role-name { display: none; }
.legacy-pitch .slot-state {
  max-width: 58px;
  margin-top: 6px;
  color: #fff;
  font-size: 9px;
  text-shadow: 0 1px 2px #000;
}

.home-team-panel .slot-1 { left: 6%; top: 50%; }
.home-team-panel .slot-2 { left: 28%; top: 17%; }
.home-team-panel .slot-3 { left: 28%; top: 50%; }
.home-team-panel .slot-4 { left: 28%; top: 83%; }
.home-team-panel .slot-5 { left: 52%; top: 10%; }
.home-team-panel .slot-6 { left: 52%; top: 36%; }
.home-team-panel .slot-7 { left: 52%; top: 64%; }
.home-team-panel .slot-11 { left: 52%; top: 90%; }
.home-team-panel .slot-8 { left: 78%; top: 18%; }
.home-team-panel .slot-9 { left: 82%; top: 50%; }
.home-team-panel .slot-10 { left: 78%; top: 82%; }
.away-team-panel .slot-1 { left: 94%; top: 50%; }
.away-team-panel .slot-2 { left: 72%; top: 17%; }
.away-team-panel .slot-3 { left: 72%; top: 50%; }
.away-team-panel .slot-4 { left: 72%; top: 83%; }
.away-team-panel .slot-5 { left: 48%; top: 10%; }
.away-team-panel .slot-6 { left: 48%; top: 36%; }
.away-team-panel .slot-7 { left: 48%; top: 64%; }
.away-team-panel .slot-11 { left: 48%; top: 90%; }
.away-team-panel .slot-8 { left: 22%; top: 18%; }
.away-team-panel .slot-9 { left: 18%; top: 50%; }
.away-team-panel .slot-10 { left: 22%; top: 82%; }

.match-console {
  padding: 13px;
  color: #f3f3f3;
  background: linear-gradient(#24272a, #08090a 65%);
}
.match-console-head { display: flex; justify-content: space-between; gap: 10px; }
.match-console h1 { margin: 0; font-size: 27px; letter-spacing: -0.04em; }
.match-console .muted { margin: 5px 0 0; font-size: 11px; }
.match-console .icon-button { flex: 0 0 auto; }
.legacy-scoreboard {
  margin: 14px -4px 0;
  padding: 12px 6px;
  border-top: 1px solid #45484a;
  border-bottom: 1px solid #45484a;
  text-align: center;
}
.legacy-scoreboard > strong { color: var(--legacy-gold); font-size: 24px; }
.legacy-scoreboard > div {
  margin: 7px 0;
  display: grid;
  grid-template-columns: 1fr 18px 54px 18px 1fr;
  align-items: center;
}
.legacy-scoreboard span { color: var(--legacy-gold); font-size: 8px; font-weight: 800; }
.legacy-scoreboard time { font-size: 14px; }
.legacy-scoreboard em { color: #fff; font-size: 13px; font-style: normal; font-weight: 900; }
.match-console .lobby-stats { margin: 12px 0; }
.match-console .lobby-stats div { padding: 10px 2px; }
.match-console .legend { margin-top: 8px; font-size: 9px; }
.match-console .status-panel { margin-top: 12px; padding: 10px; border-radius: 3px; }
.match-console .status-panel p { font-size: 10px; }
.match-console .selection-bar { min-height: 0; margin-top: 12px; flex-direction: column; align-items: stretch; gap: 9px; }
.match-console .primary-button.compact { width: 100%; min-height: 44px; border-radius: 3px; }
.match-console .launch-panel {
  margin: 13px 0 0;
  padding: 12px;
  border-radius: 3px;
  border-color: #676b6e;
  background: #151819;
}
.match-console .launch-heading h3 { margin: 0; font-size: 18px; }
.match-console .launch-heading p:not(.step-label) { margin: 4px 0 0; font-size: 10px; line-height: 1.4; }
.match-start-button {
  width: 100%;
  min-height: 54px;
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #fff;
  border-radius: 2px;
  color: #1d1e1f;
  background: linear-gradient(#fff, #c6c8c9);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 1px #fff;
}
.match-start-button:disabled { cursor: not-allowed; opacity: 0.45; }
.launcher-result {
  margin-top: 10px;
  padding: 9px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid #4e8658;
  background: rgba(74, 143, 85, 0.14);
}
.launcher-result-icon { color: #8cdf92; font-size: 22px; }
.launcher-result strong, .launcher-result small { display: block; }
.launcher-result strong { font-size: 11px; }
.launcher-result small { margin-top: 2px; color: #b7c1ba; font-size: 9px; }
.launcher-help { margin-top: 9px; color: #aeb4b0; font-size: 9px; line-height: 1.45; }
.launcher-help summary { color: #d4d6d5; cursor: pointer; font-weight: 800; }
.launcher-help p { margin: 7px 0 0; }
.launcher-install-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #676b6e;
  background: #090b0c;
}
.launcher-install-card > div {
  margin-bottom: 8px;
}
.launcher-install-card strong,
.launcher-install-card small {
  display: block;
}
.launcher-install-card strong {
  color: var(--legacy-gold);
  font-size: 11px;
}
.launcher-install-card small {
  margin-top: 2px;
  color: #aeb4b0;
  font-size: 9px;
}
.launcher-download-link {
  margin-top: 9px;
  padding: 8px 10px;
  display: block;
  border: 1px solid #777c7f;
  border-radius: 2px;
  color: #fff;
  background: linear-gradient(#3c4144, #202326);
  text-align: center;
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
}
.launcher-download-link:hover { border-color: var(--legacy-gold); }
.launcher-download-link[aria-disabled="true"] {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.62;
}
.launcher-download-status {
  margin: 7px 2px 0;
  color: #9da4a0;
  font-size: 9px;
  line-height: 1.45;
}
.launcher-help > small {
  margin-top: 7px;
  display: block;
  color: #969c98;
  line-height: 1.45;
}

.room-lower-deck {
  min-height: 165px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 8px;
  padding: 8px;
  border: 5px solid var(--legacy-silver);
  border-top: 1px solid #aeb1b2;
  background: #eef0f0;
}
.room-lower-deck > div { border: 1px solid #8c9092; background: #d9dcdd; }
.room-lower-deck header {
  min-height: 34px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(#34383b, #151718);
  font-size: 11px;
}
.room-lower-deck header span { color: var(--legacy-gold); font-size: 9px; }
.room-system-feed > div { padding: 8px 11px; }
.room-system-feed p { margin: 0 0 6px; color: #454a4c; font-size: 11px; }
.room-player-directory > div { max-height: 128px; overflow: auto; }
.room-player-row {
  min-height: 36px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1.2fr auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #b8bcbe;
  color: #373b3d;
  font-size: 10px;
}
.room-player-row.mine { background: rgba(77, 180, 193, 0.13); }
.room-player-row em { color: #4c8650; font-size: 8px; font-style: normal; font-weight: 900; }
.room-list-empty { margin: 0; padding: 14px; color: #62676a; font-size: 10px; }
.lobby-view > .training-control-panel { margin: 12px 0 0; }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; padding-top: 7px; }
  .legacy-main-nav { order: 3; width: 100%; min-height: 46px; }
  .legacy-main-nav button { flex: 1 0 130px; }
  .active-room-grid { grid-template-columns: repeat(4, 230px); scroll-snap-type: x mandatory; }
  .active-room-card { scroll-snap-align: start; }
  .legacy-room-shell { grid-template-columns: 1fr 1fr; }
  .match-console { grid-column: 1 / -1; grid-row: 1; }
  .home-team-panel { grid-column: 1; }
  .away-team-panel { grid-column: 2; }
  .pitch.legacy-pitch { min-height: 360px; }
}

@media (max-width: 760px) {
  .topbar, main { width: min(100% - 14px, 1540px); }
  .topbar-actions .server-chip { display: none; }
  .brand { min-width: 128px; }
  .legacy-main-nav button { min-width: 116px; padding: 0 12px; }
  .setup-layout { grid-template-columns: 1fr; padding-top: 10px; }
  .match-browser, .hero-copy, .entry-card { grid-column: 1; }
  .match-browser-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .active-room-grid { grid-template-columns: repeat(4, 84vw); }
  .hero-copy { padding: 22px 18px; }
  .hero-copy h1 { font-size: 44px; }
  .entry-card { padding: 22px 16px; }
  .legacy-room-shell { grid-template-columns: 1fr; padding: 5px; }
  .match-console, .home-team-panel, .away-team-panel { grid-column: 1; }
  .home-team-panel { grid-row: 1; }
  .away-team-panel { grid-row: 2; }
  .match-console { grid-row: 3; }
  .pitch.legacy-pitch { min-height: 355px; }
  .room-lower-deck { grid-template-columns: 1fr; }
  .room-player-row { grid-template-columns: 1fr auto; }
  .room-player-row span { grid-column: 1 / -1; }
}

/* -------------------------------------------------------------------------
   Sobee Arena UI — modern lobby presentation
   The legacy client remains untouched; this layer only refines the browser UI.
   ------------------------------------------------------------------------- */

.arena-ui {
  --page: #070910;
  --panel: rgba(16, 19, 31, 0.76);
  --panel-raised: rgba(24, 28, 44, 0.92);
  --ink: #f7f8fc;
  --muted: #969db0;
  --quiet: #697084;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --lime: #7c6cff;
  --lime-soft: rgba(124, 108, 255, 0.13);
  --aqua: #54d8ff;
  --home: #71ddff;
  --away: #ff7f9f;
  --danger: #ff8799;
  --radius-lg: 22px;
  --radius-md: 15px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -12%, rgba(72, 184, 255, 0.16), transparent 34%),
    radial-gradient(circle at 92% 2%, rgba(124, 108, 255, 0.2), transparent 31%),
    linear-gradient(145deg, #080a12, #090c17 52%, #060810);
  background-attachment: fixed;
  font-family: Inter, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
}

.arena-ui::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}

.arena-ui .page-glow {
  display: block;
  top: -340px;
  right: -180px;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.18), transparent 67%);
  filter: blur(8px);
}

.arena-ui button,
.arena-ui a,
.arena-ui input,
.arena-ui .mode-card,
.arena-ui .role-slot {
  transition:
    transform 180ms cubic-bezier(.2, .8, .2, 1),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.arena-ui .topbar,
.arena-ui main {
  width: min(1480px, calc(100% - 40px));
}

.arena-ui .topbar {
  position: sticky;
  z-index: 50;
  top: 14px;
  min-height: 64px;
  margin-top: 14px;
  padding: 8px 10px 8px 14px;
  gap: 18px;
  flex-wrap: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(10, 12, 20, 0.76);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(22px) saturate(140%);
}

.arena-ui .brand {
  min-width: 158px;
  gap: 11px;
}

.arena-ui .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #8f7fff, #6352ef);
  box-shadow: 0 9px 24px rgba(91, 72, 227, 0.34), inset 0 1px rgba(255, 255, 255, 0.28);
  font-size: 18px;
  letter-spacing: 0;
}

.arena-ui .brand strong {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.arena-ui .brand small {
  margin-top: 1px;
  color: #7d8498;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.arena-ui .legacy-main-nav {
  order: 0;
  width: auto;
  align-self: auto;
  min-height: 46px;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  overflow: visible;
}

.arena-ui .legacy-main-nav button {
  min-width: auto;
  min-height: 36px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  color: #858ca0;
  background: transparent;
  text-shadow: none;
  font-size: 13px;
  font-weight: 680;
}

.arena-ui .legacy-main-nav button:hover:not(:disabled) {
  color: #e9ebf5;
  background: rgba(255, 255, 255, 0.055);
}

.arena-ui .legacy-main-nav button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(130, 114, 255, 0.96), rgba(92, 75, 228, 0.96));
  box-shadow: 0 8px 22px rgba(91, 72, 227, 0.27);
}

.arena-ui .legacy-main-nav button:disabled {
  display: none;
}

.arena-ui .topbar-actions {
  order: 0;
  margin-left: auto;
}

.arena-ui .launcher-top-download {
  color: #c8c2ff;
  text-shadow: none;
}

.arena-ui .lab-button,
.arena-ui .server-chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #939aac;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  text-shadow: none;
}

.arena-ui .lab-button:hover {
  color: #fff;
  border-color: rgba(124, 108, 255, 0.38);
  background: rgba(124, 108, 255, 0.1);
}

.arena-ui .server-chip {
  color: #b7bdca;
}

.arena-ui .pulse {
  width: 7px;
  height: 7px;
  background: #59e6a7;
  box-shadow: 0 0 0 5px rgba(89, 230, 167, 0.09), 0 0 14px rgba(89, 230, 167, 0.5);
}

.arena-ui .setup-layout {
  min-height: auto;
  padding: 16px 0 40px;
  display: grid;
  grid-template-columns: minmax(350px, 420px) minmax(0, 1fr);
  grid-template-areas:
    "hero hero"
    "entry rooms";
  gap: 16px;
  align-items: stretch;
}

.arena-ui .hero-copy {
  grid-area: hero;
  min-height: 88px;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: minmax(108px, .3fr) minmax(340px, 1fr) minmax(260px, .72fr);
  column-gap: 24px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 20%, rgba(84, 216, 255, 0.1), transparent 34%),
    linear-gradient(120deg, rgba(124, 108, 255, 0.16), rgba(17, 20, 33, 0.8) 44%, rgba(17, 20, 33, 0.68));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.arena-ui .hero-copy .eyebrow {
  margin: 0;
  color: #8f82ff;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.arena-ui .hero-copy h1 {
  max-width: 620px;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 2.7vw, 42px);
  line-height: 1;
  letter-spacing: -0.052em;
}

.arena-ui .hero-lead {
  max-width: 520px;
  margin: 0;
  color: #b2b8c8;
  font-size: 15px;
  line-height: 1.55;
}

.arena-ui .formation-strip,
.arena-ui .build-note {
  display: none;
}

.arena-ui .entry-card {
  grid-area: entry;
  min-width: 0;
  padding: 19px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(24, 28, 43, 0.91), rgba(11, 14, 24, 0.87));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.arena-ui .entry-card::before {
  top: 19px;
  right: 19px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7c6cff;
  box-shadow: 0 0 0 6px rgba(124, 108, 255, 0.1), 0 0 24px rgba(124, 108, 255, 0.45);
}

.arena-ui .step-label,
.arena-ui .eyebrow {
  margin: 0 0 7px;
  color: #8d80ff;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.arena-ui .card-heading h2 {
  margin: 0 0 13px;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.arena-ui .switcher {
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 13, 0.55);
}

.arena-ui .switcher span {
  min-height: 38px;
  border-radius: 9px;
  color: #7f8799;
  font-size: 12px;
  font-weight: 680;
}

.arena-ui .switcher input:checked + span {
  color: #fff;
  background: rgba(124, 108, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(124, 108, 255, 0.22);
}

.arena-ui .field {
  margin-top: 12px;
}

.arena-ui .field > span,
.arena-ui .choice-group legend {
  margin-bottom: 7px;
  color: #8e95a6;
  font-size: 12px;
  font-weight: 650;
}

.arena-ui .field input {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #fff;
  background: rgba(5, 7, 13, 0.55);
  font-size: 13px;
}

.arena-ui .field input:focus {
  border-color: rgba(124, 108, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.1);
}

.arena-ui .field small {
  display: none;
}

.arena-ui .mode-choice {
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.arena-ui .mode-choice legend {
  grid-column: 1 / -1;
}

.arena-ui .mode-card {
  min-height: 68px;
  padding: 9px 10px 8px 34px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.arena-ui .mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 108, 255, 0.34);
  background: rgba(124, 108, 255, 0.06);
}

.arena-ui .mode-card:has(input:checked) {
  border-color: rgba(124, 108, 255, 0.7);
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.17), rgba(84, 216, 255, 0.045));
  box-shadow: 0 10px 26px rgba(55, 43, 161, 0.14);
}

.arena-ui .mode-check {
  top: 13px;
  left: 11px;
  width: 14px;
  height: 14px;
  border: 1px solid #555d71;
  border-radius: 50%;
}

.arena-ui .mode-card input:checked + .mode-check {
  border: 4px solid #7564f6;
  background: #fff;
}

.arena-ui .mode-card strong {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.arena-ui .mode-card small {
  margin-top: 3px;
  color: #858da0;
  font-size: 11px;
  line-height: 1.2;
}

.arena-ui .mode-card em {
  margin-top: 4px;
  color: #9589ff;
  font-size: 10px;
}

.arena-ui .primary-button,
.arena-ui .entry-card .primary-button {
  min-height: 46px;
  margin-top: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #826fff, #6553ea 62%, #5140d1);
  box-shadow: 0 14px 30px rgba(74, 57, 205, 0.24), inset 0 1px rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 740;
}

.arena-ui .primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(74, 57, 205, 0.34), inset 0 1px rgba(255, 255, 255, 0.24);
}

.arena-ui .button-arrow {
  font-size: 19px;
}

.arena-ui .training-lab-help {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border-color: rgba(124, 108, 255, 0.22);
  background: rgba(124, 108, 255, 0.06);
}

.arena-ui .training-command-grid,
.arena-ui .training-slash-note {
  display: none;
}

.arena-ui .match-browser {
  grid-area: rooms;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 22px;
  color: var(--ink);
  background: linear-gradient(155deg, rgba(19, 23, 37, 0.88), rgba(10, 13, 22, 0.84));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.arena-ui .legacy-breadcrumb {
  display: none;
}

.arena-ui .match-browser-heading {
  min-height: 76px;
  padding: 18px 20px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.arena-ui .match-browser-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.arena-ui .match-browser-heading .step-label {
  color: #8d80ff;
}

.arena-ui .match-browser-heading .muted {
  margin: 3px 0 0;
  color: #7f8799;
  font-size: 12px;
}

.arena-ui .match-browser .secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #aab0be;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.arena-ui .match-browser .secondary-button:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(124, 108, 255, 0.35);
}

.arena-ui .active-room-grid {
  min-height: 350px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  align-content: start;
  gap: 11px;
  background: transparent;
  overflow: auto;
}

.arena-ui .active-room-card {
  min-width: 0;
  padding: 0 14px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #edf0f7;
  background:
    radial-gradient(circle at 90% 0, rgba(124, 108, 255, 0.13), transparent 40%),
    rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.arena-ui .active-room-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 108, 255, 0.38);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.arena-ui .active-room-card.joinable {
  cursor: pointer;
}

.arena-ui .active-room-card header {
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.arena-ui .active-room-card header strong {
  color: #fff;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.arena-ui .active-room-card header span,
.arena-ui .room-card-score span,
.arena-ui .room-card-occupancy em {
  color: #7f8799;
  font-size: 10px;
}

.arena-ui .room-card-score b {
  color: #8e82ff;
}

.arena-ui .room-card-actions {
  grid-template-columns: 1fr;
}

.arena-ui .room-card-actions button,
.arena-ui .room-play-button {
  min-height: 39px;
  border: 1px solid rgba(124, 108, 255, 0.36);
  border-radius: 10px;
  color: #fff;
  background: rgba(124, 108, 255, 0.13);
  text-shadow: none;
  font-size: 12px;
}

.arena-ui .room-play-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(124, 108, 255, 0.24);
}

.arena-ui .active-room-card > p {
  color: #747c8e;
  font-size: 11px;
}

.arena-ui .active-room-empty {
  min-height: 315px;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #777f91;
}

.arena-ui .active-room-empty i {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 108, 255, 0.26);
  border-radius: 15px;
  color: #998eff;
  background: rgba(124, 108, 255, 0.08);
  font-size: 25px;
  font-style: normal;
}

.arena-ui .active-room-empty strong {
  color: #e8eaf2;
  font-size: 18px;
}

.arena-ui .active-room-empty span {
  font-size: 11px;
}

.arena-ui .active-room-empty button {
  min-height: 38px;
  margin: 8px auto 0;
  padding: 0 15px;
  border: 1px solid rgba(124, 108, 255, 0.28);
  border-radius: 10px;
  color: #c5c0ff;
  background: rgba(124, 108, 255, 0.1);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

/* Room flow: one clear action at a time. */
.arena-ui .lobby-view {
  padding: 18px 0 50px;
}

.arena-ui .lobby-topline {
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 19, 31, 0.72);
  backdrop-filter: blur(18px);
}

.arena-ui .text-button {
  color: #9da4b5;
}

.arena-ui .join-code {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.arena-ui .join-code strong {
  color: #a298ff;
}

.arena-ui .legacy-room-shell {
  margin-top: 12px;
  padding: 12px;
  gap: 12px;
  grid-template-columns: minmax(330px, 1fr) 330px minmax(330px, 1fr);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: rgba(13, 16, 27, 0.72);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.arena-ui .team-room-panel {
  border: 1px solid var(--line);
  border-radius: 17px;
  color: #fff;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.arena-ui .team-room-panel > header {
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.arena-ui .team-room-panel header span {
  color: #798194;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.arena-ui .team-room-panel header h2 {
  margin-top: 3px;
  font-size: 14px;
}

.arena-ui .team-room-panel header > strong {
  color: #8a92a4;
}

.arena-ui .pitch.legacy-pitch {
  min-height: 390px;
  margin: 10px;
  border: 1px solid rgba(191, 255, 222, 0.33);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(105, 234, 174, 0.08), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 44px, rgba(0, 0, 0, 0.025) 44px 88px),
    linear-gradient(145deg, #173e32, #0e2b24);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.23), 0 12px 28px rgba(0, 0, 0, 0.17);
  overflow: hidden;
}

.arena-ui .legacy-pitch .role-slot::before {
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.32));
}

.arena-ui .legacy-pitch .role-slot:hover:not(:disabled) {
  transform: translate(-50%, calc(-50% - 5px)) scale(1.06);
}

.arena-ui .legacy-pitch .role-slot.selected::after,
.arena-ui .legacy-pitch .role-slot.mine::after {
  border-color: #62dcff;
  box-shadow: 0 0 18px rgba(98, 220, 255, 0.52);
}

.arena-ui .legacy-pitch .role-slot.selected::after {
  border-color: #a399ff;
  box-shadow: 0 0 18px rgba(163, 153, 255, 0.58);
}

.arena-ui .team-pitch-hint {
  padding: 8px 10px 10px;
  color: #727b8e;
  background: transparent;
}

.arena-ui .match-console {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(124, 108, 255, 0.11), transparent 36%),
    rgba(8, 10, 17, 0.74);
}

.arena-ui .match-console h1 {
  font-size: 25px;
}

.arena-ui .match-console .muted {
  color: #858da0;
  line-height: 1.45;
}

.arena-ui .icon-button {
  border-radius: 10px;
}

.arena-ui .legacy-scoreboard {
  margin: 14px 0 0;
  padding: 14px 5px;
  border-color: var(--line);
}

.arena-ui .legacy-scoreboard > strong,
.arena-ui .legacy-scoreboard span {
  color: #9d93ff;
}

.arena-ui .match-console .lobby-stats {
  border-color: var(--line);
}

.arena-ui .match-console .status-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.arena-ui .match-console .selection-bar {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(124, 108, 255, 0.16);
  border-radius: 13px;
  background: rgba(124, 108, 255, 0.055);
}

.arena-ui .match-console .primary-button.compact {
  min-height: 48px;
  border-radius: 12px;
}

.arena-ui .match-console .launch-panel {
  margin: 13px 0 0;
  padding: 14px;
  border: 1px solid rgba(124, 108, 255, 0.2);
  border-radius: 14px;
  background: rgba(124, 108, 255, 0.055);
}

.arena-ui .match-start-button {
  min-height: 52px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #826fff, #5d4ae0);
  box-shadow: 0 14px 30px rgba(72, 54, 204, 0.24);
  text-shadow: none;
  font-size: 15px;
}

.arena-ui .match-start-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(72, 54, 204, 0.33);
}

.arena-ui .launcher-install-card {
  margin-top: 9px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.arena-ui .launcher-install-card > div {
  margin: 0;
}

.arena-ui .launcher-install-card strong {
  color: #c4c0ff;
  font-size: 11px;
}

.arena-ui .launcher-install-card small {
  color: #727a8c;
  font-size: 10px;
}

.arena-ui .launcher-download-link {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(124, 108, 255, 0.24);
  border-radius: 9px;
  color: #bbb4ff;
  background: rgba(124, 108, 255, 0.08);
  font-size: 10px;
}

.arena-ui .launcher-download-link[aria-disabled="true"] {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.62;
}

.arena-ui .launcher-download-status {
  margin: 7px 2px 0;
  color: #747c8f;
  font-size: 9px;
}

.arena-ui .launcher-help {
  margin: 8px 2px 0;
  color: #747c8f;
  font-size: 10px;
}

.arena-ui .launcher-result {
  border: 1px solid rgba(89, 230, 167, 0.2);
  border-radius: 11px;
  background: rgba(89, 230, 167, 0.07);
}

.arena-ui .room-lower-deck {
  min-height: 150px;
  margin-top: 12px;
  padding: 12px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(13, 16, 27, 0.72);
}

.arena-ui .room-lower-deck > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.arena-ui .room-lower-deck header {
  color: #e9ebf2;
  background: rgba(255, 255, 255, 0.035);
}

.arena-ui .room-lower-deck header span {
  color: #9388ff;
}

.arena-ui .room-system-feed p,
.arena-ui .room-player-row,
.arena-ui .room-list-empty {
  color: #8790a3;
}

.arena-ui .room-player-row {
  border-color: var(--line);
}

.arena-ui .room-player-row.mine {
  background: rgba(84, 216, 255, 0.07);
}

@keyframes arena-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.arena-ui .hero-copy,
.arena-ui .entry-card,
.arena-ui .match-browser,
.arena-ui .lobby-topline,
.arena-ui .legacy-room-shell {
  animation: arena-rise 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.arena-ui .entry-card,
.arena-ui .legacy-room-shell { animation-delay: 55ms; }
.arena-ui .match-browser { animation-delay: 90ms; }

@media (max-width: 1120px) {
  .arena-ui .topbar {
    top: 8px;
    margin-top: 8px;
  }

  .arena-ui .legacy-main-nav {
    order: 0;
    width: auto;
    flex: 0 1 auto;
  }

  .arena-ui .legacy-main-nav button {
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .arena-ui .server-chip {
    display: none;
  }

  .arena-ui .setup-layout {
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  }

  .arena-ui .legacy-room-shell {
    grid-template-columns: 1fr 1fr;
  }

  .arena-ui .match-console {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(300px, 1.2fr);
    gap: 12px 20px;
  }

  .arena-ui .match-console-head,
  .arena-ui .legacy-scoreboard,
  .arena-ui .match-console .lobby-stats,
  .arena-ui .match-console .legend {
    grid-column: 1;
  }

  .arena-ui .match-console .status-panel,
  .arena-ui .match-console .selection-bar,
  .arena-ui .match-console .launch-panel,
  .arena-ui .match-console .form-error {
    grid-column: 2;
  }

  .arena-ui .match-console .status-panel {
    grid-row: 1 / span 2;
  }

  .arena-ui .home-team-panel { grid-column: 1; }
  .arena-ui .away-team-panel { grid-column: 2; }
}

@media (max-width: 820px) {
  .arena-ui .topbar,
  .arena-ui main {
    width: min(100% - 20px, 1480px);
  }

  .arena-ui .topbar {
    position: relative;
    top: 0;
    min-height: 60px;
  }

  .arena-ui .brand {
    min-width: auto;
  }

  .arena-ui .brand > span:last-child,
  .arena-ui .topbar-actions {
    display: none;
  }

  .arena-ui .legacy-main-nav {
    margin-left: auto;
  }

  .arena-ui .legacy-main-nav button {
    min-width: auto;
    padding: 0 11px;
    font-size: 10px;
  }

  .arena-ui .setup-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "entry"
      "rooms";
    padding-top: 14px;
  }

  .arena-ui .hero-copy {
    min-height: 118px;
    padding: 21px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .arena-ui .hero-copy h1 {
    font-size: 34px;
  }

  .arena-ui .hero-lead {
    font-size: 12px;
  }

  .arena-ui .active-room-grid {
    min-height: 280px;
    grid-template-columns: repeat(4, minmax(250px, 78vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .arena-ui .active-room-card {
    scroll-snap-align: start;
  }

  .arena-ui .active-room-empty {
    min-height: 250px;
  }

  .arena-ui .match-console {
    display: block;
  }
}

@media (max-width: 580px) {
  .arena-ui .topbar,
  .arena-ui main {
    width: min(100% - 14px, 1480px);
  }

  .arena-ui .topbar {
    padding: 7px;
    border-radius: 15px;
  }

  .arena-ui .brand-mark {
    width: 38px;
    height: 38px;
  }

  .arena-ui .legacy-main-nav {
    min-height: 42px;
    overflow-x: auto;
  }

  .arena-ui .legacy-main-nav button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .arena-ui .setup-layout {
    gap: 11px;
  }

  .arena-ui .hero-copy {
    border-radius: 18px;
  }

  .arena-ui .hero-copy h1 {
    font-size: 29px;
  }

  .arena-ui .entry-card,
  .arena-ui .match-browser {
    padding: 0;
    border-radius: 18px;
  }

  .arena-ui .entry-card {
    padding: 19px 15px;
  }

  .arena-ui .mode-choice {
    grid-template-columns: 1fr 1fr;
  }

  .arena-ui .mode-card {
    min-height: 72px;
    padding-right: 7px;
  }

  .arena-ui .match-browser-heading {
    padding: 16px;
    align-items: center;
    flex-direction: row;
  }

  .arena-ui .match-browser-heading h1 {
    font-size: 21px;
  }

  .arena-ui .match-browser-heading .muted {
    max-width: 210px;
  }

  .arena-ui .active-room-grid {
    grid-template-columns: repeat(4, minmax(246px, 86vw));
  }

  .arena-ui .legacy-room-shell {
    grid-template-columns: 1fr;
    padding: 8px;
    border-radius: 18px;
  }

  .arena-ui .home-team-panel,
  .arena-ui .away-team-panel,
  .arena-ui .match-console {
    grid-column: 1;
  }

  .arena-ui .home-team-panel { grid-row: 1; }
  .arena-ui .away-team-panel { grid-row: 2; }
  .arena-ui .match-console { grid-row: 3; }

  .arena-ui .pitch.legacy-pitch {
    min-height: 350px;
  }

  .arena-ui .launcher-install-card {
    align-items: stretch;
    flex-direction: column;
  }

  .arena-ui .launcher-download-link {
    text-align: center;
  }

  .arena-ui .room-lower-deck {
    grid-template-columns: 1fr;
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arena-ui .hero-copy,
  .arena-ui .entry-card,
  .arena-ui .match-browser,
  .arena-ui .lobby-topline,
  .arena-ui .legacy-room-shell {
    animation: none;
  }
}

.arena-ui button:focus-visible,
.arena-ui input:focus-visible,
.arena-ui label:has(input:focus-visible) > span,
.arena-ui .mode-card:has(input:focus-visible) {
  outline: 2px solid rgba(143, 130, 255, 0.94);
  outline-offset: 3px;
}

.arena-ui .setup-layout[data-section="rooms"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "rooms";
}

.arena-ui .setup-layout[data-section="rooms"] .match-browser {
  min-height: calc(100vh - 130px);
}

.arena-ui .setup-layout[data-section="rooms"] .active-room-grid {
  align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.arena-ui .setup-layout[data-section="training"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hero"
    "entry";
}

.arena-ui .setup-layout[data-section="training"] .entry-card {
  width: min(720px, 100%);
  justify-self: center;
}

.arena-ui .setup-layout[data-section="training"] .mode-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arena-ui .setup-layout[data-section="training"] .mode-card:has(input[value="oneVersusZero"]),
.arena-ui .setup-layout[data-section="training"] .mode-card:has(input[value="sixVersusSix"]) {
  display: none;
}

@media (max-width: 580px) {
  .arena-ui .setup-layout[data-section="rooms"] .match-browser {
    min-height: calc(100vh - 88px);
  }

  .arena-ui .setup-layout[data-section="training"] .mode-choice {
    grid-template-columns: 1fr;
  }
}
