@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  --bg: #101820;
  --panel: #18232d;
  --line: #30414f;
  --ink: #eaf1f4;
  --muted: #9bb0be;
  --blue: #5dacf2;
  --coral: #f07868;
  --amber: #e5bb64;
  --font: "DM Sans", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  border-radius: 5px;
  padding: 10px 15px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  background: #2b3c4b;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
input {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #0d151c;
  padding: 11px 12px;
  min-width: 0;
}
input::placeholder {
  color: #8da2b0;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
.masthead {
  height: 86px;
  max-width: 1460px;
  padding: 0 40px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-weight: 700;
  font-size: 29px;
  letter-spacing: 0.5px;
}
.brandmark {
  width: 23px;
  height: 23px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  transform: rotate(-8deg);
}
.brandmark i {
  background: var(--blue);
  border-radius: 1px;
}
.brandmark i:nth-child(n + 3) {
  background: var(--coral);
}
.alpha {
  font: 11px var(--font);
  letter-spacing: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 6px;
  margin-left: 5px;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 7px;
}
nav span {
  border: 1px solid var(--line);
  padding: 1px 5px;
  margin-left: 8px;
}
.welcome {
  max-width: 1240px;
  margin: 0 auto;
  min-height: calc(100vh - 154px);
  padding: 80px 35px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 0 0 16px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  margin: 0 9px 2px 0;
}
.intro h1 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-weight: 700;
  letter-spacing: -1px;
  font-size: clamp(68px, 7.5vw, 112px);
  line-height: 0.91;
  margin: 24px 0;
}
.intro em {
  font-style: normal;
  color: var(--blue);
}
.lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--muted);
  margin: 26px 0 32px;
}
.entry {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.primary {
  background: var(--blue);
  color: #0d1c2b;
  border-color: var(--blue);
  font-weight: 700;
}
.primary:hover:not(:disabled) {
  background: #83c5ff;
}
.primary span,
.secondary span {
  margin-left: 16px;
}
.join {
  margin-top: 35px;
}
.join label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.join > div {
  display: flex;
  gap: 8px;
}
.join input {
  width: 210px;
  text-transform: uppercase;
}
.entry-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 18px;
}
.demo {
  background: linear-gradient(135deg, #1c2c37, #15212b);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transform: rotate(2deg);
  box-shadow: 20px 22px 0 #0b131a;
}
.demo-label {
  padding: 20px 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.machine {
  height: 270px;
  position: relative;
  background-image:
    linear-gradient(#30414f55 1px, transparent 1px),
    linear-gradient(90deg, #30414f55 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: 22px 15px;
  overflow: hidden;
}
.machine > span {
  position: absolute;
  display: grid;
  place-content: center;
  width: 36px;
  height: 36px;
  border-radius: 5px;
  font-size: 24px;
  color: #102333;
  background: var(--blue);
  box-shadow: 0 3px 0 #3579af;
}
.demo-source {
  left: 110px;
  top: 66px;
}
.demo-spawn {
  left: 110px;
  top: 110px;
}
.demo-spawn small {
  position: absolute;
  left: 48px;
  top: 10px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.demo-mover {
  left: 66px;
  top: 154px;
}
.demo-stream {
  top: 154px;
}
.s1 {
  left: 110px;
}
.s2 {
  left: 154px;
}
.s3 {
  left: 198px;
}
.machine .demo-relay {
  left: 330px;
  top: 154px;
  color: var(--amber);
  background: #e5bb641a;
  border: 1px solid var(--amber);
  box-shadow: none;
}
.demo-caption {
  padding: 22px 24px;
}
.demo-caption p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.loop {
  display: flex;
  border-top: 1px solid var(--line);
}
.loop span {
  flex: 1;
  padding: 15px;
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.loop b {
  color: var(--ink);
  margin-left: 8px;
  font-size: 13px;
}
#game {
  max-width: 1380px;
  padding: 30px 40px;
  margin: auto;
}
.match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.match-top .eyebrow {
  margin-bottom: 7px;
}
.match-top h1 {
  font:
    600 42px/1.1 "Barlow Condensed",
    Impact,
    sans-serif;
  margin: 0;
}
.match-top p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 13px;
}
.clock-wrap {
  text-align: right;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 16px;
}
.clock-wrap strong {
  grid-row: span 2;
  font:
    600 46px "Barlow Condensed",
    Impact,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.clock-wrap span {
  font-size: 12px;
  color: var(--muted);
}
#connection {
  font-size: 11px;
}
.invite-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e5bb6410;
  border: 1px solid #e5bb6444;
  padding: 10px 16px;
  border-radius: 5px;
  margin: 0 0 18px;
  color: var(--amber);
}
.invite-bar button {
  font-size: 12px;
  padding: 7px 12px;
}
.arena-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
}
.workbench {
  padding-top: 14px;
}
.bench-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
h2 {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}
.bench-heading span {
  font-size: 12px;
  color: var(--blue);
}
.parts {
  display: grid;
  gap: 6px;
}
.parts button {
  display: flex;
  gap: 10px;
  text-align: left;
  align-items: center;
  padding: 12px 10px;
  background: transparent;
}
.parts button[aria-pressed="true"] {
  border-color: var(--blue);
  background: #5dacf213;
}
.part-icon {
  font-size: 25px;
  min-width: 23px;
  text-align: center;
  color: var(--blue);
}
.parts b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.parts small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
}
.parts i {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  font-style: normal;
}
.facing {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.facing > span {
  font-size: 12px;
  color: var(--muted);
}
#directions {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
#directions button {
  flex: 1;
  padding: 6px;
}
#directions button[aria-pressed="true"] {
  color: var(--blue);
  border-color: var(--blue);
}
#turn {
  font-size: 11px;
  padding-left: 0;
  margin-top: 7px;
}
.part-help {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  min-height: 58px;
}
.bench-actions {
  display: flex;
  gap: 5px;
}
.bench-actions button {
  font-size: 11px;
  flex: 1;
  padding: 8px;
}
.selection {
  width: 100%;
  margin-top: 7px;
  font-size: 11px;
}
.selection.active {
  color: var(--amber);
  border-color: var(--amber);
}
.keyboard {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 14px;
}
.scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.player span {
  display: block;
  font-size: 11px;
}
.player b {
  display: block;
  margin: 5px 0;
  letter-spacing: 4px;
  font-size: 18px;
}
.blue b {
  color: var(--blue);
}
.coral b {
  color: var(--coral);
}
.player small {
  font-size: 10px;
  color: var(--muted);
}
.coral {
  text-align: right;
}
.score-center {
  text-align: center;
}
.score-center span {
  font-size: 10px;
  color: var(--amber);
}
.score-center strong {
  display: block;
  font:
    600 27px "Barlow Condensed",
    Impact,
    sans-serif;
  margin-top: 5px;
  color: var(--amber);
}
.board-shell {
  position: relative;
  border: 1px solid var(--line);
  background: #121e28;
  line-height: 0;
}
canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.board-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #101820da;
  color: var(--muted);
  font-size: 10px;
  padding: 6px 9px;
  border-radius: 3px;
  pointer-events: none;
  line-height: 1;
}
.board-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.board-footer > span {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.board-footer > div {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.board-footer button {
  font-size: 11px;
  padding: 7px 9px;
}
.battle-bar {
  padding: 15px 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.battle-bar strong {
  display: block;
  font-size: 13px;
}
.battle-bar > div > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.battle-bar .primary {
  white-space: nowrap;
  font-size: 13px;
}
.history {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.history span {
  font-size: 10px;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding: 3px 9px;
}
.history span.win {
  border-color: var(--blue);
}
.history span.loss {
  border-color: var(--coral);
}
.presets {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.presets-header p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
}
.presets-header > div:last-child {
  display: flex;
  gap: 7px;
}
.presets-header input {
  font-size: 12px;
  width: 175px;
}
.presets-header button {
  font-size: 12px;
}
.preset-list {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.preset-card {
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  min-width: 180px;
  overflow: hidden;
}
.preset-card > button:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  text-align: left;
}
.preset-card.selected {
  border-color: var(--amber);
}
.preset-card canvas {
  width: 42px;
  height: 38px;
  pointer-events: none;
}
.preset-card b {
  display: block;
  font-size: 12px;
}
.preset-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.preset-card .delete-preset {
  padding: 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
}
.below-game {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 0;
}
.below-game p {
  font-size: 11px;
  color: var(--muted);
}
.below-game button {
  font-size: 11px;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  max-width: 1460px;
  padding: 22px 40px;
  margin: auto;
  border-top: 1px solid var(--line);
  color: #8096a5;
  font-size: 10px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #eaf1f4;
  color: #102333;
  border-radius: 5px;
  padding: 12px 20px;
  box-shadow: 0 5px 30px #0008;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 20;
  max-width: 90%;
  font-size: 13px;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 650px;
  width: calc(100% - 30px);
  padding: 35px;
  line-height: 1.6;
}
dialog::backdrop {
  background: #061019c9;
}
dialog h2 {
  font:
    600 38px "Barlow Condensed",
    Impact,
    sans-serif;
  margin: 10px 0 20px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
dialog h3 {
  font-size: 15px;
  margin-bottom: 0;
}
.dialog-close {
  float: right;
  font-size: 23px;
  padding: 0 8px;
  background: transparent;
  border: 0;
}
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 22px;
}
.rules-grid b {
  color: var(--blue);
}
dialog .muted {
  font-size: 11px;
}
dialog .primary {
  margin-top: 15px;
}
body.team-coral {
  --blue: #f07868;
  --coral: #5dacf2;
}
body.team-coral .brandmark i {
  background: #5dacf2;
}
body.team-coral .brandmark i:nth-child(n + 3) {
  background: #f07868;
}
@media (max-width: 1050px) {
  .welcome {
    gap: 40px;
    padding: 55px 30px;
  }
  .demo {
    box-shadow: 10px 12px 0 #0b131a;
  }
  .entry {
    flex-direction: column;
  }
  .entry button {
    width: fit-content;
  }
  .arena-layout {
    grid-template-columns: 175px minmax(0, 1fr);
    gap: 15px;
  }
  #game {
    padding: 25px;
  }
  .parts small {
    font-size: 9px;
  }
  .parts button {
    padding: 10px 7px;
  }
  .board-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .battle-bar > div > span {
    max-width: 200px;
  }
  .parts i {
    display: none;
  }
}
@media (max-width: 740px) {
  .masthead {
    height: 68px;
    padding: 0 18px;
  }
  .brand {
    font-size: 25px;
    gap: 8px;
  }
  .alpha {
    display: none;
  }
  nav {
    gap: 0;
  }
  nav button {
    font-size: 11px;
    padding: 9px;
  }
  .welcome {
    grid-template-columns: 1fr;
    gap: 45px;
    padding: 45px 24px;
  }
  .intro h1 {
    font-size: 80px;
  }
  .lede {
    font-size: 17px;
  }
  .entry {
    flex-direction: row;
  }
  .entry button {
    font-size: 12px;
  }
  .demo {
    max-width: 470px;
    transform: none;
  }
  .machine {
    height: 225px;
  }
  .site-footer {
    padding: 20px;
  }
  .site-footer span:first-child {
    max-width: 200px;
  }
  #game {
    padding: 24px 14px;
  }
  .match-top h1 {
    font-size: 32px;
  }
  .match-top p {
    font-size: 11px;
    max-width: 250px;
  }
  .clock-wrap {
    gap: 2px 8px;
  }
  .clock-wrap strong {
    font-size: 38px;
  }
  .clock-wrap span {
    font-size: 10px;
  }
  .arena-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .workbench {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0;
  }
  .bench-heading {
    width: 100%;
    margin: 0;
  }
  .parts {
    display: flex;
    gap: 4px;
    flex: 1;
  }
  .parts button {
    padding: 7px;
    gap: 5px;
  }
  .parts .part-icon {
    font-size: 20px;
    min-width: 18px;
  }
  .parts b {
    font-size: 10px;
  }
  .parts small {
    display: none;
  }
  .facing {
    padding: 0;
    margin: 0;
    border: 0;
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .facing > span {
    display: none;
  }
  #directions {
    margin: 0;
    gap: 3px;
  }
  #directions button {
    padding: 6px 9px;
  }
  #turn {
    margin: 0;
    padding: 5px;
  }
  .part-help,
  .keyboard {
    display: none;
  }
  .bench-actions {
    margin-left: auto;
  }
  .selection {
    width: auto;
    margin: 0;
    padding: 7px;
  }
  .scoreboard {
    padding: 10px 12px;
  }
  .player b {
    font-size: 15px;
  }
  .score-center strong {
    font-size: 23px;
  }
  .battle-bar {
    padding: 13px 12px;
  }
  .battle-bar > div > span {
    font-size: 10px;
  }
  .battle-bar .primary {
    padding: 11px;
    font-size: 11px;
  }
  .battle-bar .primary span {
    margin-left: 7px;
  }
  .presets-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .presets-header > div:last-child {
    width: 100%;
  }
  .presets-header input {
    flex: 1;
  }
  .below-game {
    gap: 15px;
  }
  .below-game p {
    max-width: 260px;
    font-size: 10px;
  }
  .invite-bar {
    font-size: 11px;
    padding: 10px;
    gap: 8px;
  }
  .invite-bar button {
    font-size: 10px;
    white-space: nowrap;
  }
  .board-footer {
    gap: 8px;
  }
  .board-badge {
    font-size: 8px;
    bottom: 4px;
    left: 4px;
  }
  .rules-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 24px;
  }
  .toast {
    width: max-content;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Original beveled Blockrieg PNGs, also used by the canvas renderer. */
.part-icon img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.machine > span:has(img) {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.machine > span > img {
  width: 36px;
  height: 36px;
  display: block;
}
@media (max-width: 740px) {
  .part-icon img {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 740px) {
  .parts {
    flex: 1 0 100%;
    width: 100%;
  }
  .parts button {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 7px 3px;
  }
}
