.discover-page {
  --discover-pink: #f45f94;
  --discover-purple: #7160be;
  --discover-ink: #4e4778;
  background:
    radial-gradient(circle at 8% 19%, rgba(255,255,255,.9) 0 4px, transparent 5px),
    radial-gradient(circle at 91% 32%, rgba(255,255,255,.7) 0 6px, transparent 7px),
    linear-gradient(145deg, #fff0f6, #e8e3ff 52%, #dcf8ee);
  background-size: 54px 54px, 74px 74px, auto;
}

.discover-header,
.discover-shell {
  width: calc(100% - 28px);
  max-width: 1040px;
}

.discover-shell {
  margin: 23px auto 32px;
}

.discover-intro h1 {
  max-width: 900px;
  margin-inline: auto;
  background: linear-gradient(130deg, #544891, #ef5b92 70%, #e1aa2e);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.discover-intro > p:last-child {
  max-width: 680px;
}

.discover-game {
  overflow: hidden;
  padding: 17px;
  border: 1px solid rgba(100,79,171,.16);
  border-radius: 31px;
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 1px #fff, 0 25px 54px rgba(68,51,127,.15);
  backdrop-filter: blur(13px);
}

.discover-topbar {
  min-height: 67px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr minmax(128px, auto);
  gap: 14px;
  align-items: center;
  border-radius: 19px;
  background: linear-gradient(135deg, #fbf7ff, #fff1f7);
  box-shadow: inset 0 1px #fff, 0 8px 19px rgba(77,57,137,.08);
}

.discover-topbar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.discover-topbar span:not(.discovery-progress span) {
  color: #9c91b1;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

.discover-topbar strong {
  color: #62549e;
  font-size: 15px;
}

.discover-topbar p {
  margin: 0;
  color: #716887;
  text-align: center;
  font: 13px/1.35 Arial, sans-serif;
}

.discovery-progress {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.discovery-progress span {
  color: #ee5d91;
  font-size: 22px;
  filter: drop-shadow(0 3px 4px rgba(204,57,111,.2));
  transition: transform .2s ease, opacity .2s ease;
}

.discovery-progress span.is-empty {
  opacity: .2;
  transform: scale(.78);
}

.discover-stage {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 26px;
  aspect-ratio: 1;
  background: #e8f7ff;
  box-shadow: 0 0 0 1px rgba(96,75,163,.14), 0 18px 34px rgba(66,49,123,.14);
  isolation: isolate;
}

@supports not (aspect-ratio: 1 / 1) {
  .discover-stage::before {
    content: "";
    display: block;
    padding-top: 100%;
  }
}

.discover-stage picture,
.discover-stage picture img {
  width: 100%;
  height: 100%;
  display: block;
}

.discover-stage picture {
  position: absolute;
  inset: 0;
}

.discover-stage picture img {
  object-fit: cover;
}

.hotspot-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.discover-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 76px;
  height: 76px;
  width: clamp(58px, 9.5vw, 88px);
  height: clamp(58px, 9.5vw, 88px);
  padding: 0;
  display: grid;
  place-items: center;
  border: 4px solid rgba(255,255,255,.95);
  border-radius: 50%;
  color: #514783;
  background: rgba(255,255,255,.82);
  box-shadow: 0 0 0 4px rgba(244,95,148,.5), 0 10px 23px rgba(63,46,117,.23);
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: hotspotPulse 2s ease-in-out infinite;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.discover-hotspot:nth-child(2) { animation-delay: .35s; }
.discover-hotspot:nth-child(3) { animation-delay: .7s; }
.discover-hotspot:nth-child(4) { animation-delay: 1.05s; }

.discover-hotspot span {
  font-size: clamp(27px, 4.6vw, 43px);
  filter: drop-shadow(0 3px 4px rgba(55,39,101,.16));
  pointer-events: none;
}

.discover-hotspot:hover {
  animation: none;
  transform: translate(-50%, -50%) scale(1.08);
}

.discover-hotspot.is-found {
  color: #286d5b;
  background: rgba(225,255,244,.94);
  box-shadow: 0 0 0 5px rgba(88,210,172,.7), 0 12px 25px rgba(43,125,102,.2);
  animation: none;
}

.discover-hotspot.is-celebrating {
  animation: objectPop .55s ease both;
}

.discover-hotspot:focus-visible,
.discover-scene-button:focus-visible,
.discover-actions button:focus-visible,
.discover-celebration-card button:focus-visible {
  outline: 4px solid #332b61;
  outline-offset: 4px;
}

@keyframes hotspotPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 8px rgba(244,95,148,.22), 0 12px 25px rgba(63,46,117,.2); }
}

@keyframes objectPop {
  0% { transform: translate(-50%, -50%) scale(.75) rotate(-8deg); }
  55% { transform: translate(-50%, -50%) scale(1.23) rotate(6deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

.word-bubble {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 22px;
  min-width: min(290px, calc(100% - 32px));
  padding: 10px 17px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #584b8c;
  background: rgba(255,255,255,.95);
  box-shadow: 0 13px 27px rgba(60,42,116,.23);
  transform: translateX(-50%);
  animation: wordBubbleIn .4s ease both;
  pointer-events: none;
}

.word-bubble.is-hidden {
  display: none;
}

.word-bubble span {
  font-size: 30px;
}

.word-bubble strong {
  font-size: clamp(20px, 4vw, 30px);
}

@keyframes wordBubbleIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.9); }
}

.discover-celebration {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(64,45,119,.48);
  backdrop-filter: blur(5px);
  animation: celebrationIn .35s ease both;
}

.discover-celebration.is-hidden {
  display: none;
}

@keyframes celebrationIn {
  from { opacity: 0; }
}

.discover-celebration-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border: 3px solid #fff;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff, #fff1f7);
  box-shadow: 0 25px 55px rgba(43,29,91,.3);
  text-align: center;
}

.discover-celebration-card img {
  width: 108px;
  height: 82px;
  object-fit: contain;
}

.discover-celebration-card > span {
  display: block;
  margin: 2px 0 7px;
  color: #f0b83c;
  letter-spacing: 7px;
}

.discover-celebration-card h2 {
  margin: 0;
  color: #574a8d;
  font-size: clamp(25px, 5vw, 36px);
}

.discover-celebration-card p {
  margin: 8px 0 17px;
  color: #766c8b;
  font: 14px/1.4 Arial, sans-serif;
}

.discover-celebration-card button {
  min-height: 49px;
  padding: 11px 20px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #ff78a5, #d8457a);
  box-shadow: 0 9px 19px rgba(207,63,117,.24), inset 0 1px rgba(255,255,255,.38);
  cursor: pointer;
  font-weight: 900;
}

.discover-scenes {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.discover-scene-button {
  min-width: 0;
  min-height: 80px;
  padding: 7px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 24px;
  gap: 9px;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 16px;
  color: #675c86;
  background: #f3eff9;
  box-shadow: inset 0 1px #fff;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.discover-scene-button:hover {
  transform: translateY(-2px);
}

.discover-scene-button picture,
.discover-scene-button img {
  width: 64px;
  height: 64px;
  display: block;
}

.discover-scene-button img {
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow: 0 5px 11px rgba(58,43,115,.13);
}

.discover-scene-button span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.discover-scene-button b {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.discover-scene-button small {
  font: 10px/1.2 Arial, sans-serif;
}

.discover-scene-button.is-selected {
  border-color: #e96899;
  color: #fff;
  background: linear-gradient(145deg, #ff82ad, #d94b80);
  box-shadow: 0 8px 17px rgba(207,63,117,.22), inset 0 1px rgba(255,255,255,.42);
}

.discover-scene-button.is-complete::after {
  content: "✓";
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #45b995;
  font-size: 11px;
  font-weight: 900;
}

.discover-actions {
  margin-top: 13px;
  padding: 12px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px;
  background: #f8f5fc;
}

.discover-actions p {
  margin: 0;
  color: #756c88;
  font: 11px/1.4 Arial, sans-serif;
}

.discover-actions button {
  min-width: 160px;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 13px;
  color: #645792;
  background: #e9e3f5;
  box-shadow: inset 0 1px #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.discover-confetti {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.discover-confetti span {
  position: absolute;
  left: var(--confetti-x);
  top: -22px;
  width: 10px;
  height: 15px;
  border-radius: 3px;
  background: var(--confetti-color);
  animation: discoverConfettiFall 1.75s var(--confetti-delay) ease-in forwards;
}

@keyframes discoverConfettiFall {
  to { transform: translateX(-30px) translateY(110vh) rotate(var(--confetti-turn)); opacity: .2; }
}

.discover-page > footer {
  padding: 8px 18px 25px;
  color: #807791;
  text-align: center;
  font: 12px/1.4 Arial, sans-serif;
}

@media (max-width: 720px) {
  .discover-topbar {
    grid-template-columns: 1fr auto;
  }

  .discover-topbar p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .discover-scenes {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(235px, 72%);
    overflow-x: auto;
    padding: 2px 2px 9px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .discover-scene-button {
    grid-template-columns: 62px minmax(0, 1fr) 24px;
    scroll-snap-align: start;
  }
}

@media (max-width: 520px) {
  .discover-header > img {
    width: 82px;
    height: 48px;
  }

  .discover-shell {
    width: calc(100% - 18px);
    max-width: 1040px;
    margin-top: 14px;
  }

  .discover-intro h1 {
    font-size: clamp(34px, 12vw, 49px);
    letter-spacing: -1.7px;
  }

  .discover-intro > p:last-child {
    font-size: 15px;
  }

  .discover-game {
    padding: 9px;
    border-radius: 23px;
  }

  .discover-stage {
    margin-top: 9px;
    border-width: 3px;
    border-radius: 18px;
  }

  .discover-hotspot {
    width: 64px;
    height: 64px;
    width: clamp(54px, 17vw, 72px);
    height: clamp(54px, 17vw, 72px);
    border-width: 3px;
  }

  .discover-hotspot span {
    font-size: clamp(25px, 9vw, 36px);
  }

  .word-bubble {
    top: 10px;
    padding: 8px 13px;
  }

  .discover-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .discover-actions button {
    width: 100%;
  }

  .discover-scenes {
    grid-auto-columns: minmax(224px, 88%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
