:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111315;
  color: #f7f2e8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(235, 86, 63, 0.2), transparent 40%),
    #111315;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #f4c84a;
  color: #17140b;
  box-shadow: 0 3px 0 #936b1c;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

button:active,
button.active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #936b1c;
}

.app {
  display: grid;
  grid-template-columns: auto minmax(280px, 360px);
  justify-content: center;
  align-items: start;
  gap: 16px;
  width: min(1160px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
}

.game-shell {
  position: relative;
  width: auto;
  height: min(calc(100vh - 32px), 920px);
  min-height: 640px;
  aspect-ratio: 720 / 1000;
  overflow: hidden;
  border: 2px solid rgba(247, 242, 232, 0.16);
  border-radius: 8px;
  background: #191d20;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr)) auto;
  gap: 8px;
  pointer-events: none;
}

.hud > div,
.hud button {
  border: 1px solid rgba(247, 242, 232, 0.15);
  border-radius: 8px;
  background: rgba(8, 10, 11, 0.76);
  backdrop-filter: blur(8px);
}

.hud > div {
  min-width: 0;
  padding: 7px 9px;
}

.hud span {
  display: block;
  color: #a7afac;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud button {
  min-width: 44px;
  padding: 0;
  color: #f7f2e8;
  pointer-events: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: rgba(8, 10, 11, 0.74);
  text-align: center;
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  margin: 0;
  color: #f4c84a;
  font-size: clamp(44px, 8vw, 94px);
  line-height: 0.92;
}

.overlay p {
  max-width: 560px;
  margin: 0;
  font-size: 18px;
}

.overlay .eyebrow {
  color: #64d7bd;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.launch-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: 52px 100px 52px;
  gap: 8px;
}

.launch-controls button {
  min-height: 48px;
  padding: 0;
}

.instructions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: min(calc(100vh - 32px), 920px);
  min-height: 640px;
  overflow-y: auto;
  border: 2px solid rgba(247, 242, 232, 0.16);
  border-radius: 8px;
  padding: 20px;
  background: rgba(15, 18, 20, 0.82);
}

.instructions h2 {
  margin: 0;
  color: #64d7bd;
  font-size: 27px;
  line-height: 1.05;
}

.instructions p {
  margin: 8px 0 0;
  color: #ccd1ce;
  line-height: 1.5;
}

dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

dl div {
  border-top: 1px solid rgba(247, 242, 232, 0.12);
  padding-top: 10px;
}

dt {
  color: #f4c84a;
  font-weight: 900;
}

dd {
  margin: 3px 0 0;
}

.instructions .shelf {
  margin: auto 0 0;
  font-size: 13px;
  text-align: left;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .instructions {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow-y: visible;
  }

  .game-shell {
    align-self: start;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 720 / 1000;
  }

  canvas {
    height: auto;
    aspect-ratio: 720 / 1000;
  }

  dl {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .instructions .shelf {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .hud {
    top: 6px;
    left: 6px;
    right: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 30px;
    gap: 4px;
  }

  .hud > div {
    padding: 4px 5px;
  }

  .hud span {
    font-size: 7px;
    line-height: 1;
  }

  .hud button {
    position: static;
    min-width: 30px;
    min-height: 32px;
    font-size: 12px;
  }

  .hud strong {
    font-size: 11px;
    line-height: 1;
  }

  .launch-controls {
    left: auto;
    right: 7px;
    bottom: 7px;
    grid-template-columns: 38px 82px 38px;
    gap: 5px;
  }

  .launch-controls button {
    min-height: 36px;
    font-size: 12px;
  }

  .overlay {
    gap: 9px;
    padding: 16px;
  }

  .overlay h1 {
    font-size: 38px;
  }

  .overlay p {
    max-width: 320px;
    font-size: 13px;
    line-height: 1.3;
  }

  .overlay .eyebrow {
    font-size: 9px;
  }

  .overlay button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
