body[data-page="game"] {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

.game-layout {
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.game-main {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.game-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.8fr);
  align-items: end;
  column-gap: 24px;
  padding: 10px clamp(0px, 3vw, 46px) 12px;
}

.game-intro .eyebrow {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.game-intro h1 {
  grid-column: 1;
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.game-intro h1 br {
  display: none;
}

.game-intro h1 span {
  color: var(--emerald);
  margin-left: 0.16em;
}

.game-intro > p:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 400px;
  justify-self: end;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.runner {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin: 0 clamp(0px, 3vw, 46px);
  overflow: hidden;
  border: 1px solid rgb(89 99 79 / 24%);
  border-radius: 14px;
  background: #eee8dc;
  box-shadow: 0 24px 70px rgb(83 69 48 / 12%);
}

.runner-scoreboard {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
  padding: 8px 18px;
  border-bottom: 1px solid rgb(89 99 79 / 18%);
  background: linear-gradient(135deg, #f6f1e7, #e7e2d5);
}

.runner-scoreboard > div {
  display: grid;
  gap: 5px;
  text-align: right;
}

.runner-scoreboard span {
  color: #687060;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.runner-scoreboard strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.runner-screen {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #101512;
}

#runner-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: manipulation;
}

.runner-jump {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgb(89 99 79 / 38%);
  border-radius: 9px;
  background: linear-gradient(135deg, #8f9978, #69755a);
  color: #252720;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.runner-jump > span:last-child {
  color: var(--coral);
  font-size: 17px;
}

.runner-jump:hover {
  border-color: #59634f;
  background: linear-gradient(135deg, #8f9978, #69755a);
}

.runner-jump:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.runner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(9 11 10 / 65%);
  text-align: center;
  backdrop-filter: blur(4px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.runner-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.runner-overlay-eyebrow {
  margin: 0 0 12px;
  color: var(--moss);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.runner-overlay h2 {
  margin: 0;
  color: #f6f1e7;
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: -0.04em;
}

.runner-overlay > p:not(.runner-overlay-eyebrow) {
  margin: 10px 0 18px;
  color: #d3dbd4;
  font-size: 13px;
}

.runner-start {
  min-height: 44px;
  background: linear-gradient(135deg, #8f9978, #69755a);
  color: #252720;
  cursor: pointer;
}

.runner-start:hover {
  background: linear-gradient(135deg, #8f9978, #69755a);
}

.runner-help {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 18px;
  border-top: 1px solid rgb(89 99 79 / 18%);
  background: linear-gradient(135deg, #f6f1e7, #e7e2d5);
  color: #62685e;
  font-size: 11px;
}

.runner-help p {
  margin: 0;
}

.runner-live-status {
  text-align: right;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: auto clamp(0px, 3vw, 46px) 0;
  padding: 12px 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.game-footer .text-link {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .game-main {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .game-layout {
    width: calc(100% - 24px);
    height: calc(100vh - 70px);
    height: calc(100svh - 70px);
    height: calc(100dvh - 70px);
  }

  .game-intro {
    grid-template-columns: 1fr;
    row-gap: 5px;
    padding: 10px 0 9px;
  }

  .game-intro > p:last-child {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    justify-self: start;
    margin: 0;
    font-size: 11px;
  }

  .game-intro h1 {
    margin-top: 0;
    font-size: clamp(23px, 6vw, 30px);
  }

  .runner {
    flex: 1 1 0;
    margin: 0;
    border-radius: 11px;
  }

  .runner-screen {
    flex: 1 1 0;
  }

  #runner-canvas {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .runner-scoreboard {
    min-height: 48px;
    padding: 7px 12px;
  }

  .runner-jump {
    right: 10px;
    bottom: 10px;
    min-height: 42px;
    padding: 0 12px;
  }

  .runner-help {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 9px;
  }

  .runner-live-status {
    text-align: right;
  }

  .game-footer {
    margin: auto 0 0;
    padding: 9px 0 7px;
    font-size: 9px;
  }
}

@media (max-width: 500px) {
  .runner-help {
    justify-content: center;
  }

  .runner-live-status {
    display: none;
  }

  .runner-overlay {
    padding: 8px;
  }

  .runner-overlay-eyebrow,
  .runner-overlay > p:not(.runner-overlay-eyebrow) {
    display: none;
  }

  .runner-overlay h2 {
    font-size: 22px;
  }

  .runner-start {
    min-height: 38px;
    margin-top: 8px;
  }
}

@media (max-height: 700px) {
  .game-intro {
    padding-top: 5px;
    padding-bottom: 6px;
  }

  .runner-scoreboard {
    min-height: 44px;
  }

  .runner-help {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .game-footer {
    padding-top: 6px;
    padding-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .runner-overlay {
    transition: none;
  }
}
