@property --opening-radius {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

#game-intro {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html[data-game-intro] #game-intro {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
}

#game-intro::backdrop {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.intro-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 43%, #eeffd060, transparent 67%),
    linear-gradient(155deg, #4f809761, #193e3299);
  backdrop-filter: blur(21px) saturate(1.16);
  -webkit-backdrop-filter: blur(21px) saturate(1.16);
}

.intro-content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3.6vmin, 34px);
  padding: 16px;
}

.intro-content img {
  display: block;
  width: min(81vw, 660px, 120dvh);
  height: auto;
  filter: drop-shadow(0 12px 15px #23472f54);
}

#enter-game {
  --edge: #934313;
  --shadow: #7f421c;
  min-height: clamp(58px, 11vmin, 84px);
  min-width: clamp(174px, 26vmin, 234px);
  padding: 10px clamp(29px, 6vmin, 58px);
  border: 3px solid #fff5bf;
  border-radius: 23px;
  background: radial-gradient(ellipse at 50% -13%, #ffefac 0 37%, #fff0 38%),
    linear-gradient(#ffbc3c 0 46%, #ff8b20 50%, #e76c17 100%);
  box-shadow: 0 0 0 2px #9e4f26, 0 8px var(--shadow),
    0 13px 24px #2f4b2e70, inset 0 -4px #b04c1877;
  font-size: clamp(31px, 6vmin, 49px);
  letter-spacing: .055em;
  text-shadow: 0 2px 0 #934313, 0 3px 3px #93431388;
  cursor: pointer;
  transition: translate .16s ease, filter .16s ease, box-shadow .16s ease;
}

@media (hover: hover) {
  #enter-game:hover { translate: 0 -3px; filter: brightness(1.08); }
}

#enter-game:active {
  translate: 0 5px;
  box-shadow: 0 0 0 2px #9e4f26, 0 3px var(--shadow),
    0 7px 12px #2f4b2e70, inset 0 -4px #b04c1877;
}

#enter-game:focus-visible { outline: 3px solid #fffde3; outline-offset: 7px; }
#game-intro[aria-busy="true"] #enter-game { cursor: progress; }

.intro-wave {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--opening-radius) * 2);
  height: calc(var(--opening-radius) * 2);
  transform: translate(-50%, -50%);
  border: 2px solid #fbffdb;
  border-radius: 50%;
  box-shadow: 0 0 24px 8px #f8ffb9d0, 0 0 75px 20px #feeb7c90, inset 0 0 22px #fff9bcbc;
  pointer-events: none;
}

#game-intro.is-opening {
  pointer-events: none;
  animation: open-city 1.15s both;
}

.is-opening .intro-veil {
  mask-image: radial-gradient(circle at center,
    transparent max(0px, calc(var(--opening-radius) - 5px)),
    #000 calc(var(--opening-radius) + 5px));
}

.is-opening .intro-content { animation: intro-press .30s ease-in both; }
.is-opening .intro-wave { display: block; animation: intro-glow 1.15s ease-out both; }

@keyframes open-city {
  0% { --opening-radius: 0px; animation-timing-function: ease-out; }
  32% { --opening-radius: 18vmin; animation-timing-function: ease-in-out; }
  46% { --opening-radius: 13vmin; animation-timing-function: cubic-bezier(.32,.05,.28,1); }
  100% { --opening-radius: 90vmax; }
}

@keyframes intro-press {
  24% { scale: .97; }
  100% { opacity: 0; scale: 1.06; }
}

@keyframes intro-glow {
  0% { opacity: 0; }
  24%, 45% { opacity: .94; }
  90%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #game-intro.is-opening, .is-opening .intro-content, .is-opening .intro-wave { animation: none; }
  #enter-game { transition: none; }
}
