:root {
  color-scheme: dark;
  --black: #020202;
  --ink: #f3f0e8;
  --muted: rgba(243, 240, 232, 0.62);
  --line: rgba(243, 240, 232, 0.2);
  --red: #f0372d;
  --panel: rgba(0, 0, 0, 0.72);
  --condensed: "DIN Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  background: #000;
}

.game-section {
  position: relative;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.game-wrap {
  position: relative;
  flex: 1;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.8) 12%, rgba(0, 0, 0, 0.15) 46%, rgba(0, 0, 0, 0.28) 100%),
    #070707;
  box-shadow: inset 0 70px 120px rgba(0, 0, 0, 0.64);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.hud,
.leaderboard,
.message-panel,
.mobile-controls {
  position: absolute;
  z-index: 3;
}

.hud-left {
  left: clamp(28px, 3.7vw, 62px);
  top: clamp(56px, 7vw, 104px);
  width: min(520px, calc(100% - 36px));
}

.eyebrow,
.tagline,
.controls-copy,
.message-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 18px;
  font-family: var(--condensed);
  font-size: clamp(76px, 10vw, 170px);
  font-weight: 500;
  line-height: 0.74;
  max-width: 9ch;
  color: #f5f4ef;
  text-shadow: 0 16px 30px rgba(0, 0, 0, 0.55);
}

.tagline {
  margin-top: 16px;
  color: rgba(245, 240, 223, 0.86);
}

.start-panel {
  width: min(430px, 100%);
  margin-top: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.start-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.start-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid rgba(243, 240, 232, 0.32);
  border-radius: 0;
  outline: 0;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--ink);
  text-transform: uppercase;
}

button {
  height: 54px;
  border: 1px solid rgba(243, 240, 232, 0.8);
  border-radius: 0;
  padding: 0 28px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: rgba(240, 55, 45, 0.92);
  color: #fff;
  border-color: var(--red);
}

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

.controls-copy {
  margin-top: 14px;
}

.game-wrap.is-running .start-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.game-wrap.is-running h1 {
  opacity: 0.76;
}

.hud-right {
  top: 24px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 0;
  width: min(520px, calc(100% - 36px));
  border: 1px solid rgba(243, 240, 232, 0.08);
  background: rgba(0, 0, 0, 0.86);
}

.stat {
  min-height: 70px;
  padding: 14px 34px;
  border: 0;
  border-right: 1px solid rgba(243, 240, 232, 0.25);
  background: transparent;
  backdrop-filter: none;
}

.stat:last-child {
  border-right: 0;
}

.stat > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat strong span {
  display: inline;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-family: var(--condensed);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.leaderboard {
  right: clamp(28px, 3.7vw, 62px);
  bottom: clamp(34px, 6vw, 88px);
  width: min(320px, calc(100% - 36px));
  padding: 24px;
  border: 1px solid rgba(243, 240, 232, 0.24);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.leaderboard-title {
  margin-bottom: 14px;
}

.leaderboard-title span {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.leaderboard ol,
.leaderboard li {
  margin: 0;
  padding: 0;
}

.leaderboard ol {
  list-style: none;
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(243, 240, 232, 0.16);
}

.leaderboard li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  color: rgba(243, 240, 232, 0.86);
  font-family: var(--condensed);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.leaderboard .score {
  color: var(--red);
}

.message-panel {
  left: 50%;
  bottom: 11%;
  width: min(520px, calc(100% - 36px));
  padding: 18px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(243, 240, 232, 0.26);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.message-panel.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.message-panel h2 {
  margin-top: 8px;
  font-family: var(--condensed);
  font-weight: 500;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 0.98;
}

.message-panel p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.mobile-controls {
  left: 18px;
  bottom: 22px;
  display: none;
  grid-template-columns: repeat(2, 104px);
  gap: 10px;
}

.mobile-controls button {
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
}

.bottom-note {
  position: absolute;
  left: clamp(28px, 3.7vw, 62px);
  bottom: clamp(28px, 5vw, 76px);
  z-index: 3;
  display: grid;
  gap: 16px;
  width: min(360px, calc(100% - 36px));
  color: rgba(243, 240, 232, 0.5);
  pointer-events: none;
}

.bottom-note strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.bottom-note strong::after {
  content: "";
  display: block;
  width: 62px;
  height: 2px;
  margin-top: 13px;
  background: var(--red);
}

.bottom-note span {
  max-width: 300px;
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .game-section {
    padding: 0;
  }

  .game-wrap {
    min-height: 100vh;
  }

  .hud-left {
    top: 34px;
    left: 18px;
  }

  .hud-right {
    top: auto;
    left: 18px;
    right: auto;
    bottom: 182px;
    transform: none;
    grid-template-columns: repeat(3, 1fr);
    width: calc(100% - 36px);
  }

  .stat {
    min-height: 56px;
    padding: 10px 12px;
  }

  .stat strong {
    font-size: 21px;
  }

  .leaderboard {
    right: 16px;
    bottom: 22px;
    width: min(330px, calc(100% - 136px));
    padding: 16px;
  }

  .message-panel {
    bottom: 130px;
  }

  .mobile-controls {
    display: grid;
  }

  .bottom-note {
    display: none;
  }

  .start-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 76px;
  }

  .game-wrap {
    min-height: 100vh;
  }

  .start-panel {
    margin-top: 20px;
  }

  .hud-right {
    display: none;
  }

  .leaderboard {
    left: 16px;
    right: auto;
    width: calc(100% - 32px);
  }

  .message-panel {
    bottom: 286px;
  }

  .game-wrap.is-running .leaderboard {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-controls {
    bottom: 24px;
  }
}
