:root {
  color-scheme: dark;
  --asphalt: #080909;
  --paper: #e7e5dc;
  --concrete: #a7a89f;
  --yellow: #f2c400;
  --cyan: #46aeda;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  background: var(--asphalt);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--asphalt);
}

button,
a { font: inherit; }

button { color: inherit; }

#player,
.menu,
.handoff {
  position: fixed;
  inset: 0;
}

#player {
  isolation: isolate;
  container-type: size;
}

.menu,
.handoff {
  overflow: hidden;
  color: var(--paper);
  background: var(--asphalt);
}

.menu { z-index: 3; }

.menu-scene,
.handoff-scene {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(8, 9, 9, .14), rgba(8, 9, 9, .02) 60%, rgba(8, 9, 9, .2)),
    linear-gradient(0deg, rgba(8, 9, 9, .72), rgba(8, 9, 9, 0) 52%),
    url("/port-carverton.jpg");
  background-position: center, center, 58% center;
  background-size: cover;
  filter: saturate(.72) contrast(1.08) brightness(.78);
  transform: scale(1.015);
}

.menu::after,
.handoff::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, transparent 36%, rgba(0, 0, 0, .26) 100%);
}

.menu-identity {
  position: absolute;
  z-index: 1;
  top: clamp(18px, 4.2cqh, 28px);
  left: clamp(18px, 4cqw, 28px);
}

.wordmark {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #fff;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .38));
}

.wordmark span {
  font-size: clamp(42px, 10cqw, 62px);
  line-height: .78;
  font-weight: 900;
  letter-spacing: -.075em;
  text-transform: lowercase;
}

.wordmark b {
  min-width: .8em;
  padding: .06em .16em .08em;
  background: var(--yellow);
  color: var(--asphalt);
  font-size: clamp(24px, 6cqw, 38px);
  line-height: .8;
  font-weight: 900;
  transform: rotate(4deg) translateY(-4px);
}

.menu-identity p {
  margin: 7px 0 0;
  font-size: clamp(10px, 2.4cqw, 14px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: .1em;
}

.session-ready {
  position: absolute;
  z-index: 1;
  top: clamp(20px, 4.4cqh, 30px);
  right: clamp(18px, 4cqw, 28px);
  padding: 6px 9px 5px;
  border: 1px solid rgba(231, 229, 220, .62);
  font-size: clamp(10px, 2.3cqw, 13px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
}

.menu-options {
  position: absolute;
  z-index: 2;
  top: 41.5%;
  left: clamp(18px, 4cqw, 28px);
  right: clamp(18px, 4cqw, 28px);
}

.menu-options > p {
  margin: 0 0 10px;
  color: rgba(231, 229, 220, .66);
  font-size: clamp(10px, 2.2cqw, 13px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .16em;
}

.menu-option {
  width: 100%;
  height: clamp(40px, 10.5cqh, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border: 0;
  border-left: 3px solid rgba(231, 229, 220, .28);
  background: rgba(8, 9, 9, .3);
  color: rgba(231, 229, 220, .72);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.menu-option + .menu-option { margin-top: 3px; }

.menu-option span {
  font-size: clamp(21px, 5.5cqw, 31px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: .025em;
}

.menu-option small {
  font-size: clamp(10px, 2.2cqw, 13px);
  font-weight: 700;
  letter-spacing: .12em;
}

.menu-option--play {
  height: clamp(58px, 14cqh, 76px);
  border: 0;
  background: var(--paper);
  color: var(--asphalt);
  box-shadow: 7px 7px 0 var(--cyan);
}

.menu-option--play span {
  font-size: clamp(30px, 7.5cqw, 42px);
  font-weight: 900;
}

.menu-option--play kbd {
  width: clamp(31px, 7cqw, 40px);
  height: clamp(31px, 7cqw, 40px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--asphalt);
  color: #fff;
  font: 800 clamp(15px, 3.6cqw, 20px)/1 "Barlow Condensed", sans-serif;
}

.menu-option--play:hover,
.menu-option--play:focus-visible { box-shadow: 7px 7px 0 var(--yellow); outline: 0; }
.menu-option:not(.menu-option--play):hover,
.menu-option:not(.menu-option--play):focus-visible { color: #fff; background: rgba(8, 9, 9, .72); outline: 0; }

.load-status {
  position: absolute;
  z-index: 1;
  left: clamp(18px, 4cqw, 28px);
  right: clamp(18px, 4cqw, 28px);
  bottom: clamp(18px, 4cqh, 28px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.load-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.load-copy > div { display: flex; flex-direction: column; gap: 1px; }
.load-copy strong { font-size: clamp(12px, 2.7cqw, 16px); line-height: 1; font-weight: 800; letter-spacing: .09em; }
.load-copy span { color: var(--concrete); font-size: clamp(9px, 2.2cqw, 12px); line-height: 1.2; font-weight: 700; letter-spacing: .08em; }
.load-copy output { color: var(--cyan); font-size: clamp(24px, 6cqw, 34px); line-height: .8; font-weight: 900; }
.load-track { height: 5px; overflow: hidden; background: rgba(231, 229, 220, .28); }
.load-track div { width: 0; height: 100%; background: var(--cyan); transition: width 180ms ease; }
.menu.is-ready .load-copy output { color: var(--yellow); }
.menu.is-ready .load-track div { background: var(--yellow); }

.controls-panel {
  position: absolute;
  z-index: 6;
  top: 21%;
  right: clamp(18px, 4cqw, 28px);
  width: min(68%, 300px);
  padding: 18px;
  border-left: 4px solid var(--yellow);
  background: rgba(8, 9, 9, .96);
  box-shadow: -8px 8px 0 rgba(70, 174, 218, .34);
}

.controls-panel > button {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.panel-kicker { margin: 0 0 14px; color: var(--yellow); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.controls-panel dl { margin: 0; }
.controls-panel dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(231, 229, 220, .14); }
.controls-panel dt { color: var(--concrete); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.controls-panel dd { margin: 0; color: var(--paper); font-size: 11px; font-weight: 700; text-align: right; }

.menu.is-leaving {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 240ms ease, transform 380ms cubic-bezier(.22, 1, .36, 1);
}

.handoff {
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.handoff.is-visible { opacity: 1; }
.handoff-scene { filter: saturate(.65) contrast(1.12) brightness(.48); }

.game-hud {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 4cqh, 26px);
  left: clamp(18px, 4cqw, 28px);
  right: clamp(18px, 4cqw, 28px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  text-shadow: 0 1px 4px #000;
}

.game-hud > div { display: flex; flex-direction: column; gap: 2px; }
.game-hud strong { font-size: clamp(14px, 3.4cqw, 19px); line-height: 1; letter-spacing: .08em; }
.game-hud span { color: var(--paper); font-size: clamp(9px, 2.1cqw, 12px); font-weight: 700; letter-spacing: .11em; }
.game-hud > b { padding: 5px 8px; background: rgba(8, 9, 9, .8); font-size: clamp(9px, 2.1cqw, 12px); line-height: 1; letter-spacing: .1em; }

.loading-card {
  position: absolute;
  z-index: 2;
  left: clamp(18px, 4cqw, 28px);
  right: clamp(18px, 4cqw, 28px);
  bottom: clamp(20px, 4.5cqh, 30px);
  min-height: clamp(116px, 29cqh, 160px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 18px;
  padding: clamp(15px, 3.4cqw, 22px);
  border-left: 6px solid var(--cyan);
  background: rgba(8, 9, 9, .94);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .52);
}

.loading-card__copy { display: flex; flex-direction: column; justify-content: center; }
.loading-card__copy strong { font-size: clamp(26px, 7cqw, 40px); line-height: .9; font-weight: 900; letter-spacing: -.02em; }
.loading-card__copy span { margin-top: 5px; color: var(--concrete); font-size: clamp(10px, 2.4cqw, 13px); line-height: 1; font-weight: 700; letter-spacing: .1em; }
.loading-card output { align-self: center; color: var(--cyan); font-size: clamp(42px, 11cqw, 62px); line-height: .8; font-weight: 900; }
.loading-card__track { grid-column: 1 / -1; height: 6px; margin-top: 18px; overflow: hidden; background: rgba(231, 229, 220, .26); }
.loading-card__track div { width: 0; height: 100%; background: var(--cyan); transition: width 160ms ease-out; }
.loading-card footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: clamp(9px, 2cqw, 11px); line-height: 1; font-weight: 700; letter-spacing: .09em; }
.loading-card footer strong { color: var(--yellow); }

.ready-card,
.ready-prompt,
.ready-footer { display: none; }

.handoff.is-ready .handoff-scene { filter: saturate(.72) contrast(1.08) brightness(.68); }
.handoff.is-ready .loading-card { display: none; }
.handoff.is-ready .game-hud > b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--yellow); }
.handoff.is-ready .ready-card {
  position: absolute;
  z-index: 2;
  left: clamp(18px, 4cqw, 28px);
  bottom: clamp(40px, 9cqh, 58px);
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-shadow: 0 2px 4px #000;
}

.ready-card strong { font-size: clamp(54px, 15cqw, 82px); line-height: .72; font-weight: 900; letter-spacing: -.04em; }
.ready-card span { font-size: clamp(10px, 2.4cqw, 13px); font-weight: 800; letter-spacing: .1em; }
.handoff.is-ready .ready-prompt { position: absolute; z-index: 2; right: clamp(18px, 4cqw, 28px); bottom: clamp(42px, 9.5cqh, 62px); display: block; margin: 0; font-size: clamp(10px, 2.4cqw, 13px); font-weight: 800; letter-spacing: .11em; text-shadow: 0 1px 4px #000; }
.handoff.is-ready .ready-footer { position: absolute; z-index: 2; left: clamp(18px, 4cqw, 28px); right: clamp(18px, 4cqw, 28px); bottom: clamp(14px, 3cqh, 20px); display: flex; justify-content: space-between; font-size: clamp(9px, 2.1cqw, 12px); font-weight: 700; letter-spacing: .09em; }

@media (max-height: 390px) {
  .menu-options { top: 35%; }
  .load-status { display: none; }
  .menu-option { height: 34px; }
  .menu-option--play { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
