.title-screen {
  display: block;
  visibility: hidden;
}

.title-screen.is-ready {
  visibility: visible;
}

.title-screen:not(.is-ready) .character,
.title-screen:not(.is-ready) .title-effect {
  animation-play-state: paused;
}

.layer {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.title-background {
  left: 0;
  top: 0;
  z-index: 0;
}

.character-shadow {
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.character {
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  transform-origin: 50% 65%;
  z-index: 20;
  animation: characterFloat 4.8s ease-in-out infinite;
}

.title-effect {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center;
  z-index: 45;
  animation-name: effectScale;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-wrap {
  position: absolute;
  left: 50%;
  top: 15%;
  width: 660px;
  height: 220px;
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  place-items: center;
}

.logo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: #444;
  font-family: "Kaisei Decol", serif;
  font-size: clamp(26px, 4vw, 64px);
  letter-spacing: 0.08em;
  text-align: center;
}

.logo-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.high-score {
  position: absolute;
  left: 82%;
  top: 7%;
  z-index: 70;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #333;
  font-family: "Kiwi Maru", serif;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.high-score-label {
  font-size: 28px;
}

.high-score-value {
  font-size: 28px;
}

.start-button-area {
  position: absolute;
  left: 50%;
  top: 84%;
  width: 360px;
  height: 116px;
  transform: translate(-50%, -50%);
  z-index: 50;
}

.start-button-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 50;
  pointer-events: none;
}

.start-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 45ms ease-out;
  font-family: "Kiwi Maru", serif;
}

.start-button.is-pressed {
  transform: translateY(4%);
}

.start-button-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  color: #333;
  font-family: "Kiwi Maru", serif;
  font-size: clamp(18px, 2.2vw, 38px);
  letter-spacing: 0.12em;
}

.start-button-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@keyframes characterFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-1.2%) scale(1.018);
  }
}

@keyframes effectScale {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(var(--effect-scale-min, 0.96));
  }

  50% {
    transform: translate(-50%, -50%) scale(var(--effect-scale-max, 1.04));
  }
}
