html:has(body.title-active) {
  height: 100%;
  overflow: hidden;
  background: #afe8f8;
}

body.title-active {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #afe8f8;
}

.title-screen[hidden],
.game-shell[hidden] {
  display: none;
}

.title-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: clip;
  background: #f9fdfe;
}

/* Fit the height without zooming into the artwork; crop only the sides. */
.title-screen-art {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

.title-start {
  position: absolute;
  left: 50%;
  bottom: max(8%, calc(env(safe-area-inset-bottom) + 16px));
  display: grid;
  place-items: center;
  width: min(380px, calc(100% - 20px));
  aspect-ratio: 520 / 148;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  filter: drop-shadow(0 4px 5px rgba(100, 23, 42, 0.25));
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-shadow: 0 2px 2px rgba(86, 13, 29, 0.45);
  transform: translateX(-50%);
  cursor: pointer;
  touch-action: manipulation;
}

.title-start::before,
.title-start::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.title-start::before {
  inset: 26.35% 6.54% 27.7%;
  clip-path: polygon(4.87% 0, 95.13% 0, 100% 50%, 95.13% 100%, 4.87% 100%, 0 50%);
  background: linear-gradient(#ee4058, #bd1738);
}

.title-start::after {
  inset: 0;
  background: url("start-button-frame.svg?v=20261010") center / 100% 100% no-repeat;
}

.title-start-label {
  position: relative;
  z-index: 1;
  margin-top: -2px;
}

.title-start:hover::before {
  background: linear-gradient(#f25368, #d12040);
}

.title-start:active::before {
  background: #bd1738;
}

.title-start:focus-visible {
  outline: 3px solid #75132a;
  outline-offset: 5px;
}

@media (max-width: 920px) {
  body:not(.title-active):not(.route-active) .game-shell {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

@media (max-height: 480px) {
  .title-start {
    width: min(290px, calc(100% - 20px));
    font-size: 22px;
  }
}
