/* Find It! - hunt for hidden things in a picture wider than the screen.
   Shared shell, buttons and colours come from kids-common.css. */

.scene-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 0 auto;
}

/* Two tiles across on all but the narrowest phones, so the pictures fit without much scrolling. */
.scene-list .game-btn {
  max-width: none;
  padding: 14px;
  gap: 10px;
  font-size: 1.05rem;
  text-align: left;
}

.scene-list .surprise {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 340px;
}

.scene-list .stars {
  margin-left: auto;
  font-size: 0.95rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.swipe-hint {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--kids-ink-soft);
  margin-bottom: 6px;
  transition: opacity 0.4s;
}

.swipe-hint.gone {
  opacity: 0;
}

/* The picture is twice as wide as it is tall and fills the height, so it
   always runs off the side and has to be swiped around. Flex items won't
   shrink below their content by default, which would let the wide picture
   stretch the whole page instead of scrolling inside its frame. */
#app,
#scr-play {
  min-width: 0;
}

.scene-view {
  width: 100%;
  min-width: 0;
  height: 52vh;
  min-height: 260px;
  max-height: 460px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 18px;
  border: 3px solid var(--kids-border);
  background: #fff;
  flex-shrink: 0;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.scene-view.dragging {
  cursor: grabbing;
}

#scene {
  display: block;
  height: 100%;
  aspect-ratio: 2 / 1;
  user-select: none;
  -webkit-user-select: none;
}

.fi-fg {
  pointer-events: none;
}

.fi-item {
  cursor: pointer;
}

.fi-item text {
  pointer-events: none;
}

/* The inner group carries the animations, centred on the thing itself. */
.fi-pop {
  transform-box: fill-box;
  transform-origin: center;
}

.fi-item.found .fi-pop {
  animation: fi-found 0.7s ease-out;
}

@keyframes fi-found {
  0% { transform: scale(1); }
  40% { transform: scale(1.5) rotate(-8deg); }
  70% { transform: scale(0.95) rotate(4deg); }
  100% { transform: scale(1); }
}

.fi-item.hint .fi-pop {
  animation: fi-hint 0.6s ease-in-out 5;
}

@keyframes fi-hint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}

.fi-item.nope .fi-pop {
  animation: fi-nope 0.5s ease-in-out;
}

@keyframes fi-nope {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

/* The list of things to find. Tap one to hear its name. */
.find-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.find-tray button {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 3px solid var(--kids-border);
  background: var(--kids-card);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.find-tray button:active {
  transform: scale(0.94);
}

.find-tray button.found {
  border-color: var(--kids-green);
  background: #e8f7ef;
}

.find-tray button.found::after {
  content: "✔";
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--kids-green);
  color: #fff;
  font-size: 0.95rem;
  line-height: 26px;
  font-weight: 900;
}

.play-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.play-actions .big-btn {
  max-width: 260px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

@media (max-width: 380px) {
  .find-tray button {
    width: 56px;
    height: 56px;
    font-size: 1.9rem;
  }
}
