@font-face {
  font-family: BurnheartPixel;
  src: url('/games/burnheart/fonts/fusion-pixel-12px-proportional-zh_hans.woff2')
    format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #f3ecd6;
  --ink: #182a2a;
  --panel: #223838;
  --line: #48605a;
  --muted: #c3cdb8;
  --orange: #ffae64;
  --red: #e96445;
  --mint: #b6dba3;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: var(--ink);
  color: var(--paper);
  font-synthesis: none;
  scrollbar-color: var(--line) var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.6;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 5px;
}
::selection {
  background: var(--orange);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
p {
  line-height: 1.65;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
.topbar,
main,
footer {
  width: min(1060px, calc(100% - 64px));
  margin-inline: auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.hall-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  min-height: 44px;
  padding: 8px 10px;
  text-decoration: underline;
  text-underline-offset: 5px;
  font-size: 14px;
}
.text-button:hover,
.hall-link:hover {
  color: var(--paper);
}
.game-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin: 18px 0 30px;
}
.game-heading h1 {
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-weight: 400;
  font-size: 60px;
  line-height: 1.18;
  margin: 0;
  letter-spacing: 0;
}
.game-heading h1 span {
  color: var(--orange);
}
.game-invitation p {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
}
.game-invitation .personal-best {
  font-size: 13px;
  margin-top: 18px;
  color: var(--muted);
}
.personal-best strong {
  color: var(--paper);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  margin-left: 8px;
}
.drive {
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
}
.road-screen {
  position: relative;
  background: #81abb1;
  aspect-ratio: 8/5;
  max-height: 490px;
  overflow: hidden;
}
.road-screen canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.screen-hud {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.screen-hud > span {
  background: var(--ink);
  padding: 9px 13px;
  border-radius: 5px;
}
.screen-hud strong {
  font-size: 20px;
}
.road-message {
  position: absolute;
  top: 22%;
  left: 16px;
  right: 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: auto;
  padding: 12px 22px;
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
  color: var(--ink);
  pointer-events: none;
}
.road-message span {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}
.road-message strong {
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.2;
}
.impact-label {
  position: absolute;
  top: 55%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-size: 66px;
  color: var(--ink);
  pointer-events: none;
}
.control-deck {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 45%);
  align-items: center;
  gap: 24px;
  padding: 24px;
}
.control-deck p {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.control-deck p span {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.pedal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--red);
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  min-height: 88px;
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-size: 30px;
  font-weight: 400;
  box-shadow: inset 0 -6px 0 #a74332;
  transition:
    background 0.12s,
    transform 0.12s;
}
.pedal svg:first-child {
  width: 42px;
  height: 42px;
}
.pedal span {
  white-space: nowrap;
}
.pedal > svg:last-child {
  margin-left: auto;
}
.pedal {
  padding: 14px 26px;
}
.pedal:hover:enabled {
  background: #f88059;
}
.pedal:active:enabled {
  transform: translateY(3px);
  box-shadow: inset 0 -3px 0 #a74332;
}
.start-pedal {
  background: var(--orange);
  box-shadow: inset 0 -6px 0 #b46e37;
}
.start-pedal:hover:enabled {
  background: #ffc487;
}
.pedal.is-broken svg:first-child {
  transform: rotate(25deg) translateY(4px);
}
.result {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  margin-top: 28px;
  padding: 26px 0 8px;
  border-top: 1px solid var(--line);
}
.result:focus {
  outline: none;
}
.result-context {
  color: var(--muted);
  margin: 0 0 9px;
  font-size: 13px;
}
.result h2 {
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 400;
  margin: 0;
  color: var(--mint);
}
.result[data-kind='fault'] h2,
.result[data-kind='crash'] h2,
.result[data-kind='miss'] h2 {
  color: var(--orange);
}
.reaction {
  margin: 10px 0 5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reaction strong {
  font-family: BurnheartPixel, system-ui, sans-serif;
  font-size: 72px;
  font-weight: 400;
}
.reaction span {
  color: var(--muted);
  font-size: 18px;
  margin-left: 10px;
}
.result-main > p:not(.reaction):not(.result-context) {
  margin: 12px 0 0;
  max-width: 50ch;
}
.result-detail {
  font-size: 13px;
  color: var(--muted);
}
.result-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border: 0;
  border-radius: 8px;
  min-height: 50px;
  font-weight: 650;
  text-decoration: none;
}
.primary-button {
  background: var(--orange);
  color: var(--ink);
}
.primary-button:hover {
  background: #ffc487;
}
.secondary-button {
  background: var(--paper);
  color: var(--ink);
}
.secondary-button:hover {
  background: #fff8e4;
}
.status {
  min-height: 22px;
  font-size: 13px;
  color: var(--orange);
  margin: 12px 0;
}
.about {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 14px;
  padding: 16px 0;
  font-size: 13px;
}
.about summary {
  cursor: pointer;
  min-height: 32px;
}
.about > div {
  max-width: 72ch;
}
.about a {
  color: var(--orange);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 12px;
}
.notice {
  padding: 12px;
  background: var(--panel);
}
dialog {
  width: min(480px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  border: 0;
  border-radius: 14px;
  padding: 22px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop {
  background: #0a171bc4;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dialog-heading h2 {
  font-size: 20px;
  margin: 0;
}
.dialog-heading .text-button {
  color: var(--ink);
}
dialog p,
dialog label {
  font-size: 14px;
}
dialog img {
  display: block;
  width: 100%;
  height: auto;
  margin: 16px 0;
}
dialog input {
  width: 100%;
  font-size: 13px;
  min-height: 46px;
  background: #fff8e4;
  color: var(--ink);
  border: 1px solid #a6b1a1;
  border-radius: 6px;
  padding: 10px;
  margin: 12px 0;
  caret-color: #182a2a;
}
dialog .primary-button {
  width: 100%;
}
@media (min-width: 1100px) {
  .road-screen {
    aspect-ratio: 1060/490;
  }
  .road-screen canvas {
    object-fit: cover;
  }
}
@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    width: calc(100% - 32px);
  }
  .topbar {
    padding: 10px 0;
  }
  .game-heading {
    gap: 18px;
    margin: 12px 0 20px;
  }
  .game-heading h1 {
    font-size: 36px;
    line-height: 1.2;
  }
  .game-invitation p {
    font-size: 13px;
  }
  .game-invitation .personal-best {
    margin-top: 10px;
    font-size: 11px;
  }
  .personal-best strong {
    font-size: 17px;
    margin-left: 3px;
  }
  .road-screen {
    aspect-ratio: 6/5;
    max-height: 350px;
  }
  .screen-hud {
    top: 12px;
    left: 12px;
    right: 12px;
    font-size: 10px;
  }
  .screen-hud > span {
    padding: 6px 9px;
  }
  .screen-hud strong {
    font-size: 17px;
  }
  .road-message {
    top: 25%;
  }
  .road-message span {
    font-size: 12px;
  }
  .road-message strong {
    font-size: 26px;
  }
  .control-deck {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 17px;
  }
  .control-deck p {
    text-align: center;
    font-size: 15px;
  }
  .control-deck p span {
    font-size: 12px;
    margin-top: 4px;
  }
  .pedal {
    min-height: 78px;
    font-size: 28px;
  }
  .pedal > svg:last-child {
    margin-left: 0;
  }
  .result {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 22px;
    padding-top: 22px;
  }
  .result h2 {
    font-size: 28px;
  }
  .reaction strong {
    font-size: 60px;
  }
  .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .result-actions .text-button {
    grid-column: 1/-1;
  }
  .primary-button,
  .secondary-button {
    font-size: 14px;
    padding: 13px 10px;
  }
  .impact-label {
    font-size: 48px;
  }
  footer {
    font-size: 11px;
    padding: 22px 0 28px;
  }
  .about {
    font-size: 12px;
  }
}
@media (max-width: 360px) {
  .pedal {
    padding-inline: 16px;
    gap: 10px;
    font-size: 24px;
  }
  .pedal svg:first-child {
    width: 34px;
    height: 34px;
  }
  .game-heading h1 {
    font-size: 30px;
  }
  .game-invitation p {
    font-size: 12px;
  }
  .game-heading {
    gap: 12px;
  }
  .road-screen {
    aspect-ratio: 1;
  }
  .road-message strong {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .pedal:active:enabled {
    transform: none;
  }
}
