:root {
  color-scheme: dark;
  --ink: #211a24;
  --panel: #2d242e;
  --line: #57434c;
  --paper: #fff0d8;
  --muted: #d4bbae;
  --gold: #f8cb4a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: "Microsoft YaHei UI","PingFang SC",system-ui,sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.arcade {
  width: min(100% - 64px,1064px);
  margin: 0 auto;
  padding-bottom: 48px;
}

.masthead {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: "Arial Black","Arial",sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .035em;
}

.brand img {
  object-fit: contain;
  image-rendering: pixelated;
}

.back {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #856c72;
  color: var(--muted);
}

.back:hover {
  color: var(--paper);
  border-color: var(--gold);
}

.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px,5vh,52px) 0 24px;
}

.english {
  font: 700 14px/1.1 'Courier New',monospace;
  letter-spacing: .2em;
  color: var(--gold);
  margin: 0 0 9px;
}

h1 {
  margin: 0;
  font-size: clamp(35px,4.1vw,58px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.intro {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 1px;
  line-height: 1.65;
}

.cabinet {
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.telemetry {
  display: flex;
  align-items: baseline;
  gap: clamp(14px,3vw,32px);
  min-height: 47px;
  padding: 10px clamp(14px,2.7vw,28px);
  color: var(--muted);
  font-size: 14px;
}

.status {
  margin-right: auto;
  color: var(--gold);
  font-weight: 700;
}

.reading {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.reading strong,.unit {
  font-family: 'Courier New',monospace;
  font-variant-numeric: tabular-nums;
}

.reading strong {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: .04em;
  color: var(--paper);
}

.reading .unit {
  font-size: 13px;
  margin-left: -5px;
}

.stage {
  position: relative;
  background: #854e5d;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
}

canvas {
  width: 100%;
  display: block;
  height: auto;
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: #21122326;
}

.overlay[hidden] {
  display: none;
}

.card {
  max-width: 92%;
  padding: 13px 20px 12px;
  text-align: center;
  background: #2b202ae8;
  color: var(--paper);
  box-shadow: 3px 3px 0 #482e37;
  border-top: 3px solid var(--gold);
}

.card strong,.card span {
  display: block;
}

.card strong {
  font-size: clamp(17px,2.4vw,28px);
  line-height: 1.3;
}

.card span {
  font-size: 14px;
  color: #e5cbb9;
  margin-top: 4px;
}

.console {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(14px,2.7vw,28px);
}

button {
  line-height: 1.1;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 44px;
  border: 1px solid #795f68;
  border-radius: 2px;
  color: var(--paper);
  background: transparent;
  padding: 9px 18px;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .5;
  cursor: default;
}

button:hover:enabled {
  border-color: var(--gold);
}

button:active:enabled {
  transform: translateY(1px);
}

.action {
  min-width: 138px;
  background: var(--gold);
  color: #29202b;
  border-color: var(--gold);
  box-shadow: 0 3px 0 #966338;
}

.action:hover {
  background: #ffda66;
}

.tools {
  display: flex;
  gap: 9px;
}

:focus-visible {
  outline: 3px solid #95e6c7;
  outline-offset: 3px;
}

.guide {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.95;
  margin: 16px 0;
}

kbd {
  font: 600 13px/1.2 'Courier New',monospace;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media(max-width:700px) {
  .arcade {
    width: calc(100% - 32px);
  }
  .masthead {
    min-height: 64px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 26px 0 19px;
  }
  .intro {
    font-size: 16px;
  }
  .brand {
    gap: 7px;
  }
  .brand img {
    width: 33px;
    height: 33px;
  }
  .guide {
    margin-top: 12px;
  }
}

@media(max-width:440px) {
  .arcade {
    width: calc(100% - 22px);
  }
  .telemetry {
    gap: 10px;
    padding: 9px 10px;
    min-height: 38px;
  }
  .reading {
    gap: 5px;
  }
  .reading strong {
    font-size: 15px;
  }
  .reading .unit {
    margin-left: -3px;
  }
  .card {
    padding: 6px 12px;
  }
  .card span {
    font-size: 13px;
  }
  .console {
    padding: 11px 10px;
  }
  .tools {
    gap: 5px;
  }
  button {
    padding: 9px 12px;
  }
  .action {
    min-width: 115px;
  }
  .brand {
    font-size: 14px;
  }
}

@media(prefers-reduced-motion:reduce) {
  button:active:enabled {
    transform: none;
  }
}
