.entry-01-page .tooth-puzzle {
  margin: 1.5em var(--content-side-space);
}

.entry-01-page .tooth-puzzle__stage {
  position: relative;
  width: min(100%, 800px, calc(100dvh - 12rem));
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  opacity: 0;
  transition: opacity 0.35s linear;
}

.entry-01-page .tooth-puzzle__stage.is-ready {
  opacity: 1;
}

.entry-01-page .tooth-puzzle__tooth,
.entry-01-page .tooth-puzzle__skull {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.entry-01-page .tooth-puzzle__tooth {
  z-index: 1;
  opacity: 1;
  transform: translateY(0);
  transform-origin: center;
  transition:
    transform 180ms ease-out,
    opacity 180ms linear,
    filter 120ms linear;
}

.entry-01-page .tooth-puzzle__skull {
  z-index: 2;
}

.entry-01-page .tooth-puzzle__tooth--upper.is-selected {
  transform: translateY(-2.4%);
}

.entry-01-page .tooth-puzzle__tooth--lower.is-selected {
  transform: translateY(2.4%);
}

.entry-01-page .tooth-puzzle__tooth--upper.is-removing {
  opacity: 0;
  transform: translateY(-11%);
  transition-duration: 650ms;
  transition-timing-function: ease-in;
}

.entry-01-page .tooth-puzzle__tooth--lower.is-removing {
  opacity: 0;
  transform: translateY(11%);
  transition-duration: 650ms;
  transition-timing-function: ease-in;
}

.entry-01-page .tooth-puzzle__tooth.is-removed {
  display: none;
}

.entry-01-page .tooth-puzzle__tooth.is-wrong {
  animation: entry-01-wrong-tooth 0.18s steps(2, end) 4;
}

.entry-01-page .tooth-puzzle__hitboxes {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.entry-01-page .tooth-puzzle__hitbox {
  position: absolute;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent;
  cursor: pointer;
  opacity: 1;
  touch-action: manipulation;
  transform: none !important;
}

.entry-01-page .tooth-puzzle__hitbox:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: -2px;
}

.entry-01-page .tooth-puzzle__hitbox:disabled {
  cursor: default;
}

.entry-01-page .entry-01-reset-form {
  margin: 0;
}

.entry-01-page .tooth-puzzle__answer {
  width: min(100%, 800px);
  margin: 1.5em auto 0;
}

.entry-01-page .tooth-puzzle__answer > p {
  margin-inline: 0;
}

.entry-01-page .tooth-puzzle__feedback {
  margin: 0.6em 0;
  padding: 0;
  color: var(--red-bright);
  white-space: pre-line;
}

.entry-01-page .tooth-puzzle__actions {
  display: flex;
  align-items: stretch;
  gap: 0.8em;
  width: 100%;
}

.entry-01-page .tooth-puzzle__actions > button,
.entry-01-page .tooth-puzzle__actions > form {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.entry-01-page .tooth-puzzle__actions button {
  width: 100%;
  height: 100%;
  margin: 0;
  padding-inline: clamp(0.35em, 2vw, 1em);
  white-space: normal;
  overflow-wrap: anywhere;
}

.entry-01-page .tooth-puzzle.is-checking #tooth-puzzle-check {
  opacity: 1;
  cursor: wait;
  animation: entry-01-checking-pulse 0.8s ease-in-out infinite alternate;
}

.entry-01-page .entry-01-solved {
  margin: 1.5em var(--content-side-space);
  text-align: center;
}

.entry-01-page .entry-01-solved__stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 800px, calc(100dvh - 12rem));
  aspect-ratio: 1;
  margin: 0 auto;
  background: #000;
}

.entry-01-page .entry-01-solved__base,
.entry-01-page .entry-01-solved__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.entry-01-page .entry-01-solved__base {
  z-index: 1;
}

.entry-01-page .entry-01-solved__image {
  z-index: 2;
}

.entry-01-page .entry-01-solved__image--reveal {
  opacity: 0;
}

.entry-01-page .entry-01-solved__image--reveal.is-visible {
  animation: entry-01-solved-reveal 2.4s ease-out both;
}

.entry-01-page .entry-01-solved__image--static {
  opacity: 1;
}

.entry-01-page .entry-01-reset-form {
  margin-top: 1.5em;
  text-align: center;
}

@media (max-width: 520px) {
  .entry-01-page .tooth-puzzle,
  .entry-01-page .entry-01-solved {
    margin-inline: 2%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-01-page .tooth-puzzle__tooth {
    transition: none;
  }

  .entry-01-page .tooth-puzzle__stage {
    transition: none;
  }

  .entry-01-page .tooth-puzzle__tooth.is-wrong,
  .entry-01-page .tooth-puzzle.is-checking #tooth-puzzle-check,
  .entry-01-page .entry-01-solved__image--reveal {
    animation: none;
  }

  .entry-01-page .entry-01-solved__image--reveal.is-visible {
    opacity: 1;
  }
}

@keyframes entry-01-wrong-tooth {
  0%,
  100% {
    filter: none;
  }

  50% {
    filter:
      sepia(1)
      saturate(8)
      hue-rotate(315deg)
      brightness(0.85)
      drop-shadow(0 0 0.7em rgba(196, 53, 67, 0.95));
  }
}

@keyframes entry-01-checking-pulse {
  from {
    box-shadow: 0 0 0 rgba(196, 53, 67, 0);
  }

  to {
    box-shadow: 0 0 1.1em rgba(196, 53, 67, 0.9);
  }
}

@keyframes entry-01-solved-reveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Отключение общих декоративных фонов на странице загадки. */
html {
  background: #000 !important;
  background-image: none !important;
}

html::before,
body.entry-01-page::before,
body.entry-01-page::after {
  content: none !important;
  display: none !important;
}

body.entry-01-page {
  background: #000 !important;
  background-image: none !important;
}
