body.title-open {
  overflow: hidden;
  background: #000;
}
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: white;
  font-family: 'Comarca Pixel', monospace;
  padding: max(12px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.title-stage {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  isolation: isolate;
  width: min(100%, 1050px, calc((100svh - 130px) * 1.5));
  aspect-ratio: 3 / 2;
  container-type: inline-size;
  background: #000;
  image-rendering: pixelated;
}
.title-band {
  position: absolute;
  left: 0;
  right: 0;
  height: 5%;
  background: #f85800;
  border-top: 3px solid #ff9828;
  border-bottom: 3px solid #903000;
}
.title-band-top {
  top: 5%;
}
.title-band-bottom {
  top: 97%;
  height: 3%;
  background: #980f00;
  border-color: #5e1000;
}
.title-field {
  position: absolute;
  inset: 32% 0 24%;
  background: #48b8a0;
  border-top: 4px solid #208878;
  border-bottom: 4px solid #d8f8b0;
}
.title-field::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 5%,
    #a0e0b018 5% 6%,
    transparent 6% 11%
  );
  animation: title-breeze 10s linear infinite;
}
.title-screen .title-logo {
  position: absolute;
  top: 3%;
  left: 28%;
  width: 44%;
  margin: 0;
  z-index: 3;
  line-height: 1;
  animation: title-logo-in 0.7s steps(8) both;
}
.title-logo-image {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.title-version {
  position: absolute;
  top: 25.5%;
  left: 25%;
  width: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5cqw;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 0.6cqw #172027;
  paint-order: stroke fill;
  text-shadow: 0.3cqw 0.4cqw #000;
}
.title-version #title-edition {
  font-size: 2.8cqw;
}
.title-zarza {
  font-size: 4.6cqw;
  letter-spacing: 0.03em;
}
.title-swarm {
  pointer-events: none;
}
.title-beedrill {
  position: absolute;
  z-index: 4;
  width: 15%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0.4cqw 0.5cqw #0008);
  animation:
    title-swarm-in 0.9s var(--delay) steps(8) both,
    title-flight 1.8s calc(var(--delay) + 0.9s) steps(3) infinite;
}
.title-beedrill-one {
  left: 6%;
  top: 36%;
  --delay: 0.2s;
}
.title-beedrill-two {
  left: 18%;
  top: 54%;
  width: 13%;
  --delay: 0.4s;
}
.title-beedrill-three {
  right: 18%;
  top: 54%;
  width: 13%;
  --delay: 0.6s;
}
.title-beedrill-four {
  right: 6%;
  top: 36%;
  --delay: 0.8s;
}
.title-encinaris {
  position: absolute;
  left: 29%;
  top: 32%;
  width: 42%;
  height: 44%;
  object-fit: contain;
  z-index: 5;
  image-rendering: pixelated;
  filter: drop-shadow(0.4cqw 0.7cqw #141020aa);
  animation:
    title-reveal 1.2s steps(10) both,
    title-flight 2.4s 1.2s steps(4) infinite;
}
.title-screen .title-start {
  position: absolute;
  top: 78%;
  left: 15%;
  width: 70%;
  z-index: 6;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #fff;
  font-family: 'Comarca Pixel', monospace;
  font-size: clamp(18px, 4.6cqw, 48px);
  line-height: 1;
  letter-spacing: 0.05em;
  text-align: center;
  text-shadow: 2px 3px #555;
  cursor: pointer;
  animation: title-blink 1.4s steps(1) infinite;
}
.title-screen .title-start:hover {
  background: transparent;
  color: #fff4a8;
}
.title-screen button:focus-visible {
  outline: 2px dashed #ffed8a;
  outline-offset: 3px;
}
.title-screen .title-start:disabled {
  visibility: hidden;
}
.title-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 1050px, calc((100svh - 130px) * 1.5));
  min-height: 58px;
}
.title-hint {
  margin: 15px 0;
  color: #a0aaa8;
  font-size: 18px;
  line-height: 1.2;
}
.title-screen .title-sound {
  flex-shrink: 0;
  border: 1px solid #505856;
  border-radius: 0;
  background: #101412;
  box-shadow: none;
  color: #dde5df;
  padding: 8px 12px;
  min-height: 44px;
  font-family: 'Comarca Pixel', monospace;
  font-size: 17px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.title-pollen {
  position: absolute;
  inset: 55% 0 24%;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.title-pollen i {
  position: absolute;
  bottom: -35%;
  left: calc(var(--i) * 6.7%);
  width: 4%;
  height: 63%;
  background: #ffe878;
  clip-path: polygon(
    35% 0,
    65% 0,
    65% 16%,
    85% 16%,
    85% 45%,
    100% 45%,
    100% 100%,
    0 100%,
    0 45%,
    20% 45%,
    20% 20%,
    35% 20%
  );
  box-shadow: inset 1cqw 0 #ffb830;
  animation: title-sparks calc(0.9s + var(--i) * 0.07s) steps(4) infinite;
  animation-delay: calc(var(--i) * -0.13s);
}
.title-entering .title-beedrill {
  animation: title-swarm-intro 5.2s steps(24) both;
}
.title-entering .title-encinaris {
  animation: title-encinaris-intro 5.2s steps(24) both;
}
.title-entering .title-field {
  animation: title-field-intro 5.2s ease-out both;
}
@keyframes title-breeze {
  to {
    transform: translateX(11%);
  }
}
@keyframes title-logo-in {
  from {
    transform: translateY(-35%);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes title-flight {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2%);
  }
}
@keyframes title-blink {
  0%,
  65% {
    opacity: 1;
  }
  66%,
  100% {
    opacity: 0.35;
  }
}
@keyframes title-sparks {
  0%,
  100% {
    transform: translateY(5%);
  }
  50% {
    transform: translateY(-30%);
  }
}
@keyframes title-swarm-in {
  from {
    opacity: 0;
    transform: translateY(60%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes title-reveal {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes title-swarm-intro {
  0%,
  65% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-60%);
  }
}
@keyframes title-encinaris-intro {
  0% {
    transform: scale(1);
  }
  65% {
    transform: scale(1.12) translateY(-2%);
    filter: drop-shadow(0 0 2cqw #da80ff);
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}
@keyframes title-field-intro {
  0% {
    background: #48b8a0;
  }
  45% {
    background: #80d8a0;
  }
  100% {
    background: #10382c;
  }
}
@media (max-width: 650px) and (min-height: 560px) {
  .title-screen {
    padding-left: 0;
    padding-right: 0;
  }
  .title-stage {
    width: 100%;
  }
  .title-options {
    width: 90%;
    flex-direction: column;
    gap: 0;
    margin-top: 16px;
    text-align: center;
  }
  .title-hint {
    font-size: 16px;
  }
  .title-screen .title-sound {
    font-size: 16px;
  }
}
@media (max-height: 560px) {
  .title-screen {
    padding: 0;
  }
  .title-stage {
    width: min(100%, calc((100svh - 48px) * 1.5));
  }
  .title-options {
    width: min(100%, calc((100svh - 48px) * 1.5));
    min-height: 44px;
    gap: 10px;
  }
  .title-hint {
    font-size: 14px;
    margin: 0;
  }
  .title-screen .title-sound {
    font-size: 14px;
    min-height: 40px;
    padding: 5px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .title-screen *,
  .title-screen *::before {
    animation: none !important;
    transition: none !important;
  }
}

.title-pollen i:nth-child(1) {
  --i: 0;
}
.title-pollen i:nth-child(2) {
  --i: 1;
}
.title-pollen i:nth-child(3) {
  --i: 2;
}
.title-pollen i:nth-child(4) {
  --i: 3;
}
.title-pollen i:nth-child(5) {
  --i: 4;
}
.title-pollen i:nth-child(6) {
  --i: 5;
}
.title-pollen i:nth-child(7) {
  --i: 6;
}
.title-pollen i:nth-child(8) {
  --i: 7;
}
.title-pollen i:nth-child(9) {
  --i: 8;
}
.title-pollen i:nth-child(10) {
  --i: 9;
}
.title-pollen i:nth-child(11) {
  --i: 10;
}
.title-pollen i:nth-child(12) {
  --i: 11;
}
.title-pollen i:nth-child(13) {
  --i: 12;
}
.title-pollen i:nth-child(14) {
  --i: 13;
}
.title-pollen i:nth-child(15) {
  --i: 14;
}
.title-pollen i:nth-child(16) {
  --i: 15;
}
