@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../typefaces/fraunces-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../typefaces/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../typefaces/ibm-plex-sans-600.woff2") format("woff2");
}

html, body {
  margin: 0;
  padding: 0;
  background: #e7e2d8;
  color: #2a2722;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.title {
  margin: 0 auto 8px;
  text-align: center;
}
.title img {
  width: min(100%, 420px);
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.game-intro {
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 24px;
  color: #5a5248;
}

.court-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 28px;
}

#racer {
  position: relative;
  width: min(100%, 1024px);
  margin: 0 auto;
  background: #1a1814;
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(42, 39, 34, 0.28);
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #1a1814;
}

#loading {
  display: none;
  margin: 0;
  padding: 24px 16px 28px;
  text-align: center;
  color: #efe8dc;
  font-size: 14px;
}
body:not(.is-ready) #loading { display: block; }
body:not(.is-ready) #canvas { display: none; }
body:not(.is-ready) #hud { display: none; }

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #efe8dc;
  background: linear-gradient(to bottom, rgba(26, 24, 20, 0.55), rgba(26, 24, 20, 0));
  pointer-events: none;
}
#hud .value { color: #c4a46a; }
#last_lap_time.is-hidden { display: none; }
#last_lap_time.is-shown,
#last_lap_time.is-inline { display: inline; }
#last_lap_time.fastest .value { color: #efe8dc; }

.pads {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(26, 24, 20, 0.7), rgba(26, 24, 20, 0));
}
.pads button {
  flex: 1;
  min-height: 48px;
  border: 1px solid #c4a46a;
  border-radius: 8px;
  background: rgba(26, 24, 20, 0.82);
  color: #efe8dc;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  touch-action: none;
}
@media (pointer: coarse), (max-width: 720px) {
  .pads { display: flex; }
}

.game-explanation {
  font-size: 14px;
  line-height: 1.6;
  color: #2a2722;
  margin: 0 0 16px;
}
.game-explanation .important { font-weight: 600; }
hr {
  border: 0;
  border-top: 1px solid #d4c8b8;
  margin: 24px 0;
}
.game-credit {
  font-size: 13px;
  line-height: 1.6;
  color: #5a5248;
}
.game-credit a { color: #2a2722; }
