:root {
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  color: #e9f0f7;
  background: #10151e;
  font-synthesis: none;
  line-height: 1.5;
  --muted: #93a4b8;
  --border: #293548;
  --green: #6ce3b0;
  --panel: #18212e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #415169;
  border-radius: 8px;
  background: #243246;
  color: #e9f0f7;
  padding: 10px 16px;
  font-weight: 600;
}
button:not(:where(.m8-shell *)):hover:not(:disabled) {
  background: #33465e;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #0b3526;
}
button.primary:not(:where(.m8-shell *)):hover:not(:disabled) {
  background: #91efc9;
}
input {
  min-width: 0;
  border: 1px solid #43516a;
  border-radius: 8px;
  padding: 11px 12px;
  background: #101925;
  color: #e9f0f7;
  outline: none;
}
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px #6ce3b026;
}
input::placeholder {
  color: #8192a8;
}
a {
  color: var(--green);
}
.shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--green);
  border-radius: 12px;
  font-size: 22px;
  font-weight: 900;
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 21px;
  letter-spacing: 1px;
}
h1 span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--green);
  margin-left: 8px;
}
.brand p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.milestone {
  font-size: 12px;
  color: #c4d6e9;
  border: 1px solid #37465c;
  border-radius: 20px;
  padding: 7px 12px;
  white-space: nowrap;
}
main {
  display: grid;
  gap: 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.eyebrow {
  font-size: 11px;
  color: var(--green);
  letter-spacing: 1.8px;
  font-weight: 700;
  margin-bottom: 4px;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  font-weight: 650;
}
.badge {
  background: #273345;
  border: 1px solid #3b495f;
  border-radius: 20px;
  font-size: 12px;
  padding: 6px 10px;
  color: #b9c9dc;
  white-space: nowrap;
}
.badge.ready {
  color: var(--green);
  background: #153e31;
  border-color: #2d755a;
}
.badge.error {
  color: #ffb7b7;
  background: #4b262d;
  border-color: #86404a;
}
#status-message {
  color: #bbc9da;
  min-height: 24px;
}
.stages {
  display: flex;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 22px 0;
}
.stages li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
}
.stages li > span {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  background: #2b384b;
  color: #cad5e2;
  font-size: 11px;
}
.stages li.done {
  color: #b9edda;
  border-color: #376451;
  background: #192d29;
}
.stages li.done > span {
  background: var(--green);
  color: #113929;
}
form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px;
}
form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #b6c4d5;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.actions button {
  font-size: 12px;
  padding: 8px 12px;
}
.note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #93a5ba;
}
.subtle {
  font-size: 12px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--border);
}
.stats div {
  display: grid;
  gap: 4px;
}
.stats span {
  font-size: 12px;
  color: var(--muted);
}
.stats strong {
  font-size: 20px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.garage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 22px 0 18px;
}
h3 {
  font-size: 17px;
}
.search-label input {
  font-size: 12px;
  width: 250px;
  padding: 8px 11px;
}
.tank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 450px;
  overflow: auto;
  scrollbar-color: #45566e #18212e;
}
.tank-card {
  padding: 13px;
  border: 1px solid #303f54;
  border-radius: 9px;
  background: #141e2b;
  min-height: 92px;
}
.tank-card.active {
  border-color: #599b7f;
  background: #19332c;
}
.tank-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.tank-card p {
  color: #9fb0c4;
  font-size: 11px;
}
.tank-card .active-label {
  color: var(--green);
  font-size: 10px;
  margin-top: 4px;
  display: block;
}
.empty {
  padding: 38px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed #3b495f;
  border-radius: 9px;
}
.empty[hidden] {
  display: none;
}
.inventory-summary {
  font-size: 12px;
  color: #9fb0c4;
  line-height: 1.9;
  margin-top: 16px;
}
.diagnostics {
  padding: 18px 24px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
summary span {
  float: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.diagnostics p {
  margin-top: 13px;
  font-size: 12px;
  color: var(--muted);
}
.table-wrap {
  max-height: 260px;
  overflow: auto;
  margin-top: 16px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
  text-align: left;
}
th {
  color: #9eb4cc;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--panel);
}
td,
th {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}
td {
  color: #bdd0e3;
}
footer {
  padding: 22px 0 28px;
  text-align: center;
  color: #74869e;
  font-size: 11px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  .shell {
    width: calc(100% - 24px);
  }
  .topbar {
    padding: 20px 0;
    align-items: flex-start;
  }
  .milestone {
    font-size: 10px;
  }
  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  h1 {
    font-size: 17px;
  }
  h1 span {
    display: block;
    margin: 0;
    font-size: 10px;
  }
  .brand p {
    font-size: 10px;
  }
  .panel {
    padding: 18px;
  }
  .stages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stages li {
    padding: 9px;
    font-size: 11px;
  }
  form {
    grid-template-columns: 1fr;
  }
  form button {
    margin-top: 5px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .section-heading {
    align-items: flex-start;
  }
  h2 {
    font-size: 20px;
  }
  .garage-header {
    align-items: center;
  }
  .search-label input {
    width: 180px;
  }
  .tank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .diagnostics {
    padding: 16px;
  }
  .badge {
    font-size: 10px;
  }
}

[hidden] {
  display: none !important;
}
select {
  font: inherit;
  min-width: 0;
  border: 1px solid #43516a;
  border-radius: 8px;
  padding: 10px;
  background: #101925;
  color: #e9f0f7;
}
select:focus {
  outline: 2px solid #6ce3b055;
  outline-offset: 1px;
}
.bot-form {
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  margin: 20px 0 10px;
}
.hall-list {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.hall-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #141e2b;
  border: 1px solid #33445b;
  border-radius: 10px;
  padding: 14px;
}
.hall-card strong {
  display: block;
  font-size: 14px;
}
.hall-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.map-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 12px;
}
.map-strip img {
  width: 154px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.roster-wrap {
  max-height: 300px;
}
.roster-wrap table {
  font-size: 12px;
}
.selection-panel {
  position: relative;
  margin-top: 22px;
  padding: 20px;
  background: #18392e;
  border: 1px solid #35785b;
  border-radius: 12px;
}
.selection-panel h3 {
  padding-right: 60px;
}
.selection-panel .subtle {
  color: #b3d1c2;
}
.selection-panel #selection-countdown {
  position: absolute;
  top: 15px;
  right: 22px;
  font-size: 34px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.selection-panel #selection-current {
  margin-top: 16px;
  font-size: 14px;
}
.scene-panel {
  margin-top: 20px;
  padding: 20px;
  background: #132638;
  border: 1px solid #315779;
  border-radius: 12px;
}
.scene-panel h3 {
  color: #a7dcff;
}
.scene-panel .subtle {
  margin-top: 8px;
}
.error-message {
  padding: 12px 14px;
  background: #48252c;
  border: 1px solid #8c3c4d;
  color: #ffbdc7;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13px;
}
.tank-card .tank-icon {
  width: 24px;
  height: 24px;
  image-rendering: auto;
  float: right;
  margin: 0 0 5px 5px;
}
.tank-card.selected-match {
  outline: 2px solid #7abbef;
  outline-offset: -2px;
}
.tank-card button {
  font-size: 11px;
  width: 100%;
  padding: 6px 8px;
  margin-top: 10px;
}
.tank-card .match-label {
  display: block;
  color: #a7dcff;
  font-size: 11px;
  margin-top: 4px;
}
.team-label {
  font-weight: 700;
}
.team-1 {
  color: #8dceff;
}
.team-2 {
  color: #ffb1ab;
}
#play-message {
  font-size: 14px;
  color: #c0cddd;
}
#scene-summary {
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .bot-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bot-form button {
    grid-column: 1/-1;
  }
}
@media (max-width: 560px) {
  .hall-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .hall-card button {
    width: 100%;
  }
  .map-strip {
    gap: 12px;
  }
  .map-strip img {
    width: 110px;
    height: 50px;
  }
  .selection-panel,
  .scene-panel {
    padding: 15px;
  }
  .selection-panel #selection-countdown {
    right: 14px;
    font-size: 28px;
  }
  .roster-wrap {
    max-height: 280px;
  }
  #room-roster td {
    padding: 7px 5px;
    font-size: 11px;
  }
}
