* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
  background: #F4F1EC;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

.fit {
  position: relative;
  width: 520px;
  height: 300px;
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 520px;
  height: 300px;
  background: #CF743D;
  outline: 3px solid #1A1210;
  overflow: hidden;
  transform-origin: top left;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  animation: fade 0.45s ease-out both;
}

.hint {
  position: absolute;
  top: 16px;
  left: 20px;
  width: 112px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.5px;
  color: #1A1210;
}

.car {
  position: absolute;
  top: 181px;
  width: 109px;
  height: 80px;
  cursor: pointer;
  transition: left 0.12s ease-out, transform 0.09s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.car:active {
  transform: scale(0.94);
}

.car svg {
  display: block;
  width: 100%;
  height: 100%;
}

.car-pink {
  left: 7px;
}

.car-blue {
  left: 394px;
}

.car-blue svg {
  transform: scaleX(-1);
}

.ad {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.ad-text {
  position: absolute;
  top: 100px;
  left: 149px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1px;
  color: #1A1210;
}

.warn {
  position: absolute;
  top: 50px;
  left: 308px;
  width: 84px;
  height: 74px;
}

.is-crashed .ad {
  opacity: 1;
}

.is-crashed .warn {
  animation: blink 0.72s steps(1, end) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.18;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.rotate-tip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  margin: 0;
  display: none;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: #9C8474;
}

.page-title {
  position: fixed;
  top: calc(28px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  margin: 0;
  display: none;
  text-align: center;
  font-size: 13px;
  letter-spacing: 3px;
  color: #9C8474;
}

@media (orientation: portrait) and (max-width: 900px) {
  .rotate-tip,
  .page-title {
    display: block;
  }
}
