:root {
  color-scheme: dark;
  --bg: #101312;
  --panel: #242825;
  --line: #40413a;
  --text: #e6e6db;
  --muted: #a0a79c;
  --amber: #edb65b;
  --field-height: min(100dvh, calc((100vw - 307px) * 1.3333333));
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    linear-gradient(90deg, #090d0ded, #111716df 40%, #0c1010e8),
    url("./assets/machine-interior.png") center / cover fixed,
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  min-height: 100dvh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 46% 0, #b1956030, transparent 60%),
    repeating-linear-gradient(0deg, #e4e0b902 0 1px, transparent 1px 4px);
  z-index: -1;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 5px;
}
button:disabled {
  opacity: 0.3;
  cursor: default;
}
button {
  border: 0;
}
kbd {
  font:
    10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  border: 1px solid #515a5c;
  border-radius: 3px;
  padding: 2px 4px;
  color: #cbd1cc;
  background: linear-gradient(#313632, #1b201f);
  box-shadow:
    inset 0 1px #ffffff0d,
    0 2px 0 #080c0c;
}
a {
  color: inherit;
  text-decoration: none;
}
.machine {
  max-width: 1440px;
  margin: auto;
  padding: 0 18px;
}
.masthead {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding-bottom: 16px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 800;
  line-height: 1;
}
.brand svg {
  width: 33px;
  height: 37px;
  color: var(--amber);
  filter: drop-shadow(0 1px 0 #ffe5a333) drop-shadow(0 3px 2px #0009);
}
.brand small {
  display: block;
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 9px;
}
.header-right {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 9px;
  color: var(--muted);
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 0.8px;
  text-shadow: 0 1px #000;
}
.header-right #system-label {
  grid-column: 2 / 4;
}
.header-right #mute-button {
  grid-column: 1 / 3;
  margin-left: 0;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow:
    0 0 0 3px #070b0c,
    0 0 8px #efb75f77;
}
.icon-button {
  background: linear-gradient(#373c36, #242924 48%, #191e1b);
  border: 1px solid #596055;
  border-radius: 3px;
  padding: 9px 11px;
  margin-left: 17px;
  color: #d5dbd5;
  font-size: 9px;
  letter-spacing: 0.6px;
  box-shadow:
    inset 0 1px #c2c9ac20,
    0 3px 0 #060a09,
    0 4px 6px #0007;
}
.fullscreen-button {
  margin-left: 0;
  padding: 8px;
}
.fullscreen-button svg {
  display: block;
  width: 15px;
  height: 15px;
}
.console-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}
.cabinet {
  width: calc(var(--field-height) * 0.75 + 2px);
  flex: none;
  border: 1px solid #738074;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow:
    0 0 0 2px #111814,
    0 0 0 5px #454b41,
    0 0 0 6px #697060,
    0 1px 0 7px #080d0b,
    0 18px 50px #000a,
    0 0 65px #0006;
  overflow: hidden;
  background: #151b1e;
}
.hud {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 8px 7px;
  margin: 0 -7px;
  flex-shrink: 0;
  background:
    repeating-linear-gradient(0deg, #d9ddbd04 0 1px, transparent 1px 3px),
    linear-gradient(110deg, #343c33, #242b26 34%, #32392f 72%, #1c251f);
  border-bottom: 1px solid #0b100d;
  box-shadow:
    inset 0 1px #d4d9b736,
    inset 0 -2px #0005;
  line-height: 1;
}
.hud > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hud::before,
.hud::after,
.cabinet-footer::before,
.cabinet-footer::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: linear-gradient(
    130deg,
    #a2aa92,
    #56604f 44%,
    #131b17 45% 62%,
    #69725e 63%
  );
  box-shadow:
    0 0 0 1px #0a100d,
    0 1px 1px #000;
  pointer-events: none;
}
.hud::before,
.cabinet-footer::before {
  left: 5px;
}
.hud::after,
.cabinet-footer::after {
  right: 5px;
}
.hud span {
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 1.3px;
  color: #b4baa7;
  text-shadow: 0 1px #050a08;
}
.hud strong {
  font:
    17px ui-monospace,
    SFMono-Regular,
    monospace;
  letter-spacing: 1px;
  background: linear-gradient(#060d0b, #151e17);
  color: #d4ded0;
  padding: 4px 7px 3px;
  margin: -2px -7px -3px;
  border-radius: 2px;
  box-shadow:
    0 1px #ccd5b21a,
    inset 0 1px 3px #000c,
    0 0 0 1px #080d09;
  text-shadow: 0 0 7px #bbd2ab33;
}
.hud .high {
  text-align: center;
}
.hud .high strong {
  color: var(--amber);
  text-shadow: 0 0 9px #edb65b55;
}
.hud-wave {
  text-align: right;
}
.playfield {
  position: relative;
  width: 100%;
  height: var(--field-height);
  overflow: hidden;
  background: #141b17;
}
.playfield::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 0 1px #020603,
    inset 0 0 15px 4px #020805aa;
  pointer-events: none;
  z-index: 3;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: crosshair;
}
body.playing,
body.playing * {
  cursor: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(
    #09120c38,
    #0a120dca 38%,
    #0a120dce 72%,
    #09110b55
  );
}
.overlay[hidden] {
  display: none;
}
.overlay-content {
  text-align: center;
  width: 88%;
  max-width: 370px;
  padding: 18px 8px;
  filter: drop-shadow(0 3px 8px #0008);
}
.eyebrow {
  color: var(--amber);
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.7px;
  margin-bottom: 24px;
}
h1 {
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  font-size: 82px;
  letter-spacing: 2px;
  line-height: 0.85;
  margin: 0;
  color: #e5e4d5;
  text-shadow:
    0 1px #ffffec,
    0 4px 0 #333b2d,
    0 7px 18px #000c;
  font-weight: 900;
}
.overlay h1.game-name {
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
}
h1 span {
  color: var(--amber);
  text-shadow:
    0 1px #ffe0a1,
    0 4px 0 #624a26,
    0 7px 18px #000c;
}
.title-rule {
  width: 62px;
  height: 3px;
  background: repeating-linear-gradient(
    125deg,
    var(--amber) 0 7px,
    #473e28 7px 11px
  );
  margin: 25px auto 19px;
}
.overlay p {
  font-size: 14px;
  line-height: 1.6;
  color: #bcc5c4;
  margin: 0 0 27px;
}
.primary-button {
  width: 230px;
  max-width: 100%;
  padding: 16px 20px;
  color: #242713;
  background: linear-gradient(#f6ca78, #d9a246 72%, #bc842c);
  font:
    800 12px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  border-radius: 2px;
  border: 1px solid #f5d18b;
  box-shadow:
    inset 0 1px #fff6c680,
    inset 0 -3px #a2742b,
    0 4px 0 #352b18,
    0 6px 15px #0009;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
}
.overlay .playfield-note {
  margin: -8px 0 22px;
  color: #b6cbc1;
  font: 9px ui-monospace, monospace;
  letter-spacing: 1.3px;
}
.primary-button:hover {
  background: linear-gradient(#ffda8e, #ecb857 72%, #d1963b);
}
.primary-button:active,
.icon-button:active,
.capture-button:active {
  transform: translateY(1px);
}
.overlay .start-hint {
  font:
    10px ui-monospace,
    monospace;
  margin: 17px 0 0;
  color: #879594;
}
.overlay.compact h1 {
  font-size: 55px;
  line-height: 1.05;
  letter-spacing: 1px;
}
.overlay.compact .eyebrow {
  margin-bottom: 17px;
}
.announcement {
  position: absolute;
  inset: 40% 5% auto;
  text-align: center;
  pointer-events: none;
  color: var(--amber);
  font:
    700 23px ui-monospace,
    monospace;
  letter-spacing: 2px;
  text-shadow: 0 2px 5px #000;
}
.announcement[hidden] {
  display: none;
}
.cabinet-footer {
  position: relative;
  height: 33px;
  flex-shrink: 0;
  margin: 0 -7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border-top: 1px solid #68705b;
  background:
    repeating-linear-gradient(125deg, #ad914529 0 7px, #060b0929 7px 14px) top /
      100% 3px no-repeat,
    linear-gradient(#353d31, #232c23 38%, #1b241d);
  box-shadow: inset 0 1px #ded6a42b;
}
.lives {
  display: flex;
  align-items: center;
  gap: 6px;
  font:
    7px ui-monospace,
    monospace;
  letter-spacing: 0.5px;
}
.lives #lives-icons {
  font-size: 14px;
  color: var(--amber);
  letter-spacing: 3px;
}
.text-button {
  background: transparent;
  color: #9da9a9;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  padding: 0;
}
.text-button kbd {
  font-size: 8px;
  margin-left: 5px;
}
.sidebar {
  position: relative;
  width: 245px;
  flex: none;
  display: flex;
  flex-direction: column;
  height: var(--cabinet-height, auto);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 16px 15px 14px;
  border: 1px solid #51584a;
  border-radius: 3px;
  background:
    linear-gradient(105deg, #d8d4a708, transparent 25%, #0002 65%, #c9ceae06),
    repeating-linear-gradient(0deg, #d9dec004 0 1px, transparent 1px 3px),
    linear-gradient(#2a3228, #1c251e 38%, #20291f 92%, #323a2d);
  box-shadow:
    inset 0 1px #cad1ad25,
    inset 1px 0 #c1ccaa12,
    0 2px 0 2px #080e0a,
    0 12px 26px #0006;
}
.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 4px;
  pointer-events: none;
  background:
    linear-gradient(135deg, #85917d, #142015 45% 60%, #697661 62%) left / 4px
      4px no-repeat,
    linear-gradient(135deg, #85917d, #142015 45% 60%, #697661 62%) right / 4px
      4px no-repeat;
}
.sidebar::before {
  top: 5px;
}
.sidebar::after {
  bottom: 5px;
}
.side-heading {
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1.1px;
  color: #c0c8b4;
  text-shadow: 0 1px #030a04;
}
.index {
  color: var(--amber);
  margin-right: 5px;
}
.control-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  box-shadow: 0 1px #02080288;
}
.control-section h2 {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.7px;
  margin: 20px 0 13px;
  font-weight: 600;
  color: #e0e1cf;
  text-shadow: 0 2px 1px #030b0466;
}
.control-section > p {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 22px;
}
.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 13px;
  font-size: 10px;
  color: #a5afad;
}
.control-row strong {
  font:
    9px ui-monospace,
    monospace;
  color: #d2d7d1;
}
.settings {
  padding: 23px 0 21px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px #02080288;
}
.setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 0.65px;
}
.setting-label label {
  color: #acb6b2;
}
.setting-label output {
  color: var(--amber);
  font-size: 10px;
  background: #0c160e;
  padding: 3px 4px;
  margin: -3px -4px;
  border-radius: 1px;
  box-shadow:
    inset 0 1px 3px #0009,
    0 1px #bdc7a51a;
  text-shadow: 0 0 5px #edb65b35;
}
.volume-label {
  margin-top: 20px;
}
input[type="range"] {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: #111b12;
  margin: 14px 0 9px;
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--amber);
  box-shadow:
    inset 0 1px #000,
    0 1px #aab79840;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #8e7135,
    #e2bd70 25%,
    #b38f49 48%,
    #0d1c104f 50% 60%,
    #d5b064 62%,
    #7e632e
  );
  border: 1px solid #d8be82;
  box-shadow: 0 2px 4px #0009;
}
input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #8e7135,
    #e2bd70 25%,
    #b38f49 48%,
    #0d1c104f 50% 60%,
    #d5b064 62%,
    #7e632e
  );
  border: 1px solid #d8be82;
  box-shadow: 0 2px 4px #0009;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font:
    7px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: #788584;
}
.capture-button {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(#3a4434, #273222 52%, #1d271b);
  border: 1px solid #596650;
  border-radius: 2px;
  color: #bfc8c3;
  padding: 10px 11px;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 0.7px;
  width: 100%;
  margin-top: 22px;
  box-shadow:
    inset 0 1px #d4deba15,
    0 2px 0 #091307,
    0 4px 5px #0003;
}
.capture-button:hover {
  border-color: var(--amber);
  color: var(--amber);
}
.capture-note {
  font-size: 9px;
  color: #98a38f;
  line-height: 1.5;
  margin-top: 8px;
}
.field-guide {
  padding: 23px 0 15px;
}
.guide-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 19px;
  position: relative;
}
.guide-row > div {
  flex: 1;
}
.guide-row strong {
  display: block;
  font:
    8px ui-monospace,
    monospace;
  letter-spacing: 0.45px;
  color: #bbc5bd;
}
.guide-row p {
  font-size: 9px;
  line-height: 1.5;
  color: #9ca891;
  margin: 4px 0 0;
}
.guide-symbol {
  display: block;
  width: 24px;
  flex: none;
  text-align: center;
}
.tread-symbol svg {
  display: block;
  width: 28px;
  height: 18px;
}
.gear-symbol {
  font-size: 28px;
  line-height: 22px;
  color: #b7a275;
}
.electric-symbol {
  font-size: 29px;
  color: #a3d9e7;
}
.points {
  position: absolute;
  right: 0;
  top: 0;
  font:
    7px ui-monospace,
    monospace;
  color: #73817d;
}
.side-bottom {
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #8b987e;
  font:
    7px ui-monospace,
    monospace;
  letter-spacing: 0.7px;
}
@media (max-height: 820px) and (min-width: 761px) {
  .masthead {
    padding-bottom: 12px;
  }
  .control-section h2 {
    font-size: 23px;
    margin-top: 15px;
  }
  .control-section > p {
    margin-bottom: 13px;
  }
  .control-row {
    margin-top: 9px;
  }
  .control-section {
    padding-bottom: 13px;
  }
  .settings {
    padding: 16px 0 14px;
  }
  .field-guide {
    padding: 16px 0 7px;
  }
  .guide-row {
    margin-top: 14px;
  }
  .capture-button {
    margin-top: 16px;
  }
  .side-bottom {
    font-size: 6px;
  }
  .overlay h1 {
    font-size: 70px;
  }
}
@media (max-width: 760px) {
  :root {
    --field-height: min(100dvh, calc((100vw - 2px) * 1.3333333));
  }
  .machine {
    padding: 0;
  }
  .masthead {
    padding-bottom: 18px;
  }
  .brand {
    font-size: 17px;
    gap: 8px;
  }
  .brand small {
    font-size: 6px;
  }
  .icon-button {
    font-size: 8px;
    margin-left: 0;
  }
  .console-layout {
    display: block;
  }
  .cabinet {
    margin: auto;
  }
  .sidebar {
    width: calc(100% - 32px);
    max-width: 500px;
    height: auto;
    overflow: visible;
    margin: 27px auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 16px 15px 14px;
  }
  .sidebar > .side-heading {
    grid-column: 1/-1;
  }
  .sidebar > .masthead,
  .sidebar > .hud,
  .sidebar > .cabinet-footer {
    grid-column: 1 / -1;
  }
  .sidebar > .masthead {
    padding-bottom: 0;
  }
  .sidebar > .cabinet-footer {
    margin-bottom: 0;
  }
  .control-section {
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  .control-section h2 {
    margin-top: 0;
    font-size: 23px;
  }
  .settings {
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  .field-guide,
  .side-bottom {
    display: none;
  }
  .overlay h1 {
    font-size: 66px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .overlay p {
    font-size: 12px;
  }
  .overlay.compact h1 {
    font-size: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}

.window-controls {
  display: block;
  margin: 20px auto 0;
  font-size: 9px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.overlay.compact #overlay-title {
  font-size: clamp(29px, 4.5vw, 49px);
}
/* Pausing leaves the machine visible, with only a small resume control. */
.overlay.paused {
  inset: 12px 12px auto auto;
  display: block;
  max-width: calc(100% - 24px);
  background: none;
  z-index: 4;
}
.overlay.paused[hidden] {
  display: none;
}
.overlay.paused .overlay-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 14px;
  width: max-content;
  max-width: 100%;
  padding: 12px;
  text-align: left;
  background: #111b1ded;
  border: 1px solid #65716b;
  border-radius: 3px;
  filter: none;
  box-shadow: 0 3px 10px #0006;
}
.overlay.paused .eyebrow {
  grid-column: 1;
  align-self: end;
  margin: 0;
  font-size: 8px;
  letter-spacing: 0.7px;
}
.overlay.paused h1,
.overlay.paused .title-rule,
.overlay.paused:not(.capture-notice) #overlay-description,
.overlay.paused:not(.capture-notice) .window-controls {
  display: none;
}
.overlay.paused .primary-button {
  grid-column: 2;
  grid-row: 1 / 3;
  width: auto;
  padding: 10px 12px;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.8px;
}
.overlay.paused .start-hint {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 9px;
  color: #b2bebb;
}
.overlay.paused #overlay-description,
.overlay.paused .window-controls {
  grid-column: 1 / -1;
  max-width: 280px;
  margin: 5px 0 0;
  font-size: 11px;
}
body.paused canvas {
  cursor: default;
}
body.playing {
  user-select: none;
  -webkit-user-select: none;
}
