:root {
  color-scheme: dark;
  --graphite: #181917;
  --graphite-soft: #242522;
  --paper: #eee3cf;
  --paper-muted: #cbbfa9;
  --yellow: #f2b705;
  --yellow-deep: #c88f00;
  --blue: #2f6f8d;
  --blue-dark: #24536a;
  --brick: #9f4025;
  --line: #4b4c45;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--graphite);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.035), transparent 25rem),
    var(--graphite);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
kbd {
  font: inherit;
}

button {
  color: inherit;
}

.hazard-line {
  height: 10px;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 20px, #141512 20px 40px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-shell {
  width: min(1380px, calc(100% - 64px));
  min-height: calc(100vh - 98px);
  margin: 0 auto;
  padding: 36px 0 28px;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(500px, 1.08fr);
  align-items: start;
  gap: clamp(34px, 5vw, 84px);
}

.intro {
  min-height: 820px;
  padding: 4px 0 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.brand {
  margin: 0 auto 78px 0;
  color: var(--paper);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: clamp(1.45rem, 2.35vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.015em;
}

.brand::after {
  content: "";
  display: block;
  width: 58px;
  height: 5px;
  margin-top: 17px;
  background: var(--yellow);
}

h1 {
  margin: 0 0 32px;
  font-family: "Open Sans Condensed", "DejaVu Sans Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(4rem, 6.4vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 0.84;
  text-transform: uppercase;
}

h1 span {
  display: block;
}

h1 .accent {
  color: var(--yellow);
}

.lead {
  max-width: 490px;
  margin: 0;
  color: #e8e0d2;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 650;
  line-height: 1.45;
}

.lead strong {
  color: var(--yellow);
}

.build-mark {
  display: flex;
  gap: 8px;
  margin-top: 42px;
  align-items: end;
}

.build-mark span {
  display: block;
  width: 48px;
  height: 16px;
  border: 2px solid #6d553d;
  background: var(--brick);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15);
}

.build-mark span:nth-child(2) {
  transform: translateY(-16px);
}

.game-area {
  width: min(100%, 545px);
  justify-self: end;
}

.game-frame {
  overflow: hidden;
  border: 3px solid var(--yellow);
  border-radius: 17px;
  background: var(--paper);
  box-shadow: 0 18px 0 #0e0f0d, 0 28px 60px var(--shadow);
}

.stage {
  position: relative;
  overflow: hidden;
  background: #efe4cf;
}

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

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

#overlay.hidden,
.hidden {
  display: none;
}

.start-panel {
  display: grid;
  place-items: center;
}

.start-button,
.panel-button {
  border: 3px solid #10110f;
  border-radius: 9px;
  background: var(--blue);
  color: #f8efe1;
  box-shadow: 0 7px 0 #10110f, inset 0 1px 0 rgba(255, 255, 255, 0.24);
  cursor: pointer;
  font-family: "Open Sans Condensed", "DejaVu Sans Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(2.1rem, 6vw, 4.25rem);
  letter-spacing: 0.025em;
  line-height: 1;
  padding: 18px 38px 16px;
  text-transform: uppercase;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.start-button:hover,
.panel-button:hover {
  background: var(--blue-dark);
}

.start-button:active,
.panel-button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #10110f;
}

.panel {
  width: min(420px, 86%);
  padding: 26px;
  border: 3px solid #171814;
  border-radius: 11px;
  background: rgba(238, 227, 207, 0.96);
  box-shadow: 0 9px 0 rgba(23, 24, 20, 0.85);
  color: var(--graphite);
  text-align: center;
}

.panel-symbol {
  margin: 0;
  color: var(--yellow-deep);
  font-size: 2rem;
}

.panel h2 {
  margin: 4px 0 14px;
  font-family: "Open Sans Condensed", "DejaVu Sans Condensed", "Arial Narrow", sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.panel p {
  margin: 7px 0;
  font-weight: 650;
  line-height: 1.45;
}

.panel-button {
  margin-top: 16px;
  font-size: 1.25rem;
  padding: 13px 22px 11px;
}

.hud {
  min-height: 94px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  border-top: 2px solid rgba(24, 25, 23, 0.28);
  color: var(--graphite);
}

.hud p {
  min-height: 52px;
  margin: 0;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Open Sans Condensed", "DejaVu Sans Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.hud p + p {
  border-left: 1px solid rgba(24, 25, 23, 0.38);
}

.hud p:nth-child(1) span {
  color: var(--blue);
}

.hud p:nth-child(2) span {
  color: var(--brick);
}

.hud p:nth-child(3) span {
  color: var(--yellow-deep);
}

.hud p span {
  font-size: 1.65em;
}

.controls {
  min-height: 88px;
  margin-top: 24px;
  padding: 12px 14px 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #686962;
  border-radius: 12px;
  background: var(--graphite-soft);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.instruction {
  min-width: 0;
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #eee5d6;
  font-weight: 650;
  line-height: 1.35;
}

.instruction svg,
.control-button svg {
  width: 30px;
  height: 30px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

kbd {
  padding: 2px 6px;
  border: 1px solid #7a7b73;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #373833;
  color: #fff8e8;
  font-size: 0.78em;
  white-space: nowrap;
}

.control-actions {
  display: flex;
  gap: 10px;
}

.control-button {
  min-width: 126px;
  min-height: 58px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--yellow-deep);
  border-radius: 8px;
  background: #1b1c19;
  cursor: pointer;
  font-family: "Open Sans Condensed", "DejaVu Sans Condensed", "Arial Narrow", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.control-button:hover {
  background: var(--yellow);
  color: var(--graphite);
}

#muteIcon {
  color: var(--yellow);
  font-family: ui-monospace, monospace;
  font-size: 1.05rem;
}

.control-button:hover #muteIcon {
  color: var(--graphite);
}

.start-button:focus-visible,
.panel-button:focus-visible,
.control-button:focus-visible {
  outline: 4px solid #78cdf4;
  outline-offset: 4px;
}

.site-footer {
  min-height: 88px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  border-top: 10px solid transparent;
  border-image: repeating-linear-gradient(135deg, var(--yellow) 0 20px, #141512 20px 40px) 10;
  background: var(--paper);
  color: var(--graphite);
}

.site-footer p {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.site-footer span {
  width: 66px;
  height: 1px;
  background: var(--graphite);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1040px) {
  .site-shell {
    width: min(760px, calc(100% - 40px));
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 26px;
  }

  .intro {
    min-height: auto;
    padding-bottom: 0;
  }

  .brand {
    margin-bottom: 52px;
  }

  h1 {
    max-width: 720px;
    margin-top: 0;
    font-size: clamp(4rem, 12vw, 7rem);
  }

  .game-area {
    width: min(100%, 680px);
    justify-self: center;
  }
}

@media (max-width: 620px) {
  .hazard-line {
    height: 8px;
  }

  .site-shell {
    width: min(100% - 24px, 480px);
    min-height: auto;
    padding: 22px 0 32px;
    gap: 28px;
  }

  .brand {
    margin-bottom: 38px;
    font-size: 1.4rem;
  }

  .brand::after {
    width: 44px;
    height: 4px;
    margin-top: 12px;
  }

  h1 {
    margin-bottom: 24px;
    font-size: clamp(3.15rem, 17vw, 5rem);
  }

  .lead {
    font-size: 1.08rem;
  }

  .build-mark {
    margin-top: 28px;
  }

  .game-frame {
    border-width: 2px;
    border-radius: 12px;
    box-shadow: 0 10px 0 #0e0f0d, 0 20px 38px var(--shadow);
  }

  #overlay {
    padding: 14px;
  }

  .start-button {
    padding: 14px 24px 12px;
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .hud {
    min-height: 74px;
  }

  .hud p {
    min-height: 42px;
    padding: 7px 5px;
    flex-direction: column;
    gap: 1px;
    font-size: 0.79rem;
  }

  .hud p span {
    font-size: 1.35rem;
  }

  .controls {
    min-height: 0;
    margin-top: 18px;
    padding: 16px;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .instruction {
    font-size: 0.92rem;
  }

  .control-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-button {
    min-width: 0;
    min-height: 52px;
  }

  .site-footer {
    min-height: 76px;
    gap: 14px;
  }

  .site-footer span {
    width: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.brand a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.brand a:hover,
.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.brand a:focus-visible,
.site-footer a:focus-visible {
  outline: 4px solid #78cdf4;
  outline-offset: 4px;
}
