@font-face {
  font-family: Roboto;
  src: url("assets/roboto-black.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --asphalt: #151818;
  --white: #faf7ed;
  --amber: #f8ac43;
  --header-height: 6.5rem;
  --gutter: clamp(1.25rem, 4.6vw, 6rem);
  font-family: Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--asphalt); color: var(--white); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
  padding: .4rem var(--gutter);
}
.company-logo { display: block; width: 11.25rem; max-width: 49%; height: auto; }
.location { display: flex; align-items: center; gap: .55rem; font: 500 .9rem/1.3 Arial, sans-serif; }
.location svg { flex: none; color: var(--amber); }
.splash {
  position: relative;
  isolation: isolate;
  min-height: 30rem;
  height: calc(100vh - var(--header-height));
  height: calc(100svh - var(--header-height));
  display: flex;
  align-items: end;
}
.photo, .photo img, .photo::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo { z-index: -1; overflow: hidden; }
.photo img { display: block; object-fit: cover; object-position: 50% 52%; }
.photo::after {
  content: "";
  background: linear-gradient(0deg, rgba(13,16,16,.94) 0%, rgba(13,16,16,.57) 14%, transparent 39%);
}
.announcement { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 1rem var(--gutter) clamp(1.8rem, 5vh, 4.25rem); }
h1 { margin: 0; font-size: clamp(2.5rem, 4.25vw, 4.5rem); line-height: .94; letter-spacing: -.057em; font-weight: 900; }
h1 > span { white-space: nowrap; }
.period { color: var(--amber); }

@media (max-aspect-ratio: 1/1) {
  .splash { min-height: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; height: auto; }
  .photo { position: relative; width: 100%; height: auto; aspect-ratio: 1.2; z-index: auto; }
  .photo img { object-position: 68% 50%; }
  .photo::after { background: linear-gradient(0deg, var(--asphalt), rgba(21,24,24,.1) 19%, transparent 35%); }
  .announcement { position: relative; padding: 0 var(--gutter) 2.5rem; margin-top: -1.25rem; }
  h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); }
}
@media (max-width: 36rem) {
  :root { --header-height: 5.5rem; }
  .masthead { gap: .5rem; }
  .company-logo { width: 9.5rem; }
  .location { gap: .3rem; font-size: .825rem; }
  .location svg { width: .75rem; }
  .photo { aspect-ratio: 1 / 1.09; }
  .announcement { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
}
@media (max-height: 35rem) and (min-aspect-ratio: 1/1) {
  .splash { min-height: 19rem; }
  .announcement { padding-bottom: 1.4rem; }
  h1 { font-size: clamp(2.4rem, 4.4vw, 3.2rem); }
}

[hidden] { display: none !important; }
button { font: 650 .9375rem/1.2 Arial, sans-serif; cursor: pointer; }
button:focus-visible { outline: 3px solid #fff2c9; outline-offset: 4px; }
.play-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 2.85rem; padding: .65rem 1.15rem; border-radius: 2rem;
  border: 1px solid #b19e7a; background: rgba(20,23,23,.89); color: var(--white);
}
.play-link svg { color: var(--amber); }
.play-link:hover { border-color: var(--amber); background: #302b21; }
#game {
  width: min(47rem, calc(100% - 1.5rem)); margin: auto; padding: 0;
  max-height: calc(100dvh - 1rem); overflow: auto; overscroll-behavior: contain;
  color: var(--white); background: #1a201f; border: 1px solid #68716b;
  border-radius: 1rem; box-shadow: 0 1.5rem 7rem #0009;
}
#game::backdrop { background: #080e10cf; }
.game-heading, .scoreboard, .game-controls { padding-inline: clamp(1rem, 3.4vw, 1.8rem); }
.game-heading { display: flex; align-items: center; justify-content: space-between; padding-block: .8rem .45rem; }
.game-heading h2 { font-size: clamp(1.8rem, 4vw, 2.35rem); line-height: 1; letter-spacing: -.055em; margin: 0; }
.icon-button { min-width: 44px; height: 44px; border: 0; background: transparent; color: #edeadf; font: 400 1.85rem/1 Arial,sans-serif; }
.icon-button:hover { color: var(--amber); }
.scoreboard { display: flex; gap: 1.6rem; padding-block: .2rem .85rem; }
.scoreboard span { display: inline-flex; align-items: baseline; gap: .45rem; color: #c8c8b7; font: .875rem/1.2 Arial,sans-serif; }
.scoreboard strong { font: bold 1rem/1.2 ui-monospace,monospace; color: #ffce78; }
.track { position: relative; border-block: 1px solid #555c57; }
#road { display: block; width: 100%; height: auto; aspect-ratio: 3.05; image-rendering: pixelated; touch-action: manipulation; user-select: none; cursor: pointer; }
.track-message { position: absolute; top: 12%; inset-inline: 0; margin: auto; width: fit-content; padding: .4rem .8rem; border-radius: .35rem; background: #171d1aeb; color: var(--white); font: bold 1.05rem/1.25 Arial,sans-serif; pointer-events: none; }
.game-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1.1rem; padding-block: 1rem; }
.game-controls p { margin: 0; color: #dddcd2; font: .9375rem/1.5 Arial,sans-serif; }
.game-controls kbd { font: inherit; font-weight: bold; }
.game-actions { display: flex; gap: .55rem; }
.game-actions button { min-height: 44px; min-width: 5.6rem; padding: .6rem 1rem; border: 1px solid transparent; border-radius: .5rem; color: #241a0c; background: var(--amber); }
.game-actions .secondary { color: var(--white); border-color: #63706b; background: transparent; }
.game-actions button:hover { filter: brightness(1.1); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 36rem) {
  #road { aspect-ratio: 1.9; }
  .game-controls { align-items: flex-start; }
  .game-actions { width: 100%; }
  #drive { flex: 1; }
}
