/* The picnic on the meadow: Fuchswald's riddles, one animal at a time, ten levels each. Builds on wald.css. */

html, body { overflow: auto; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 246, 214, 0.9), transparent 40%),
    linear-gradient(180deg, #9fd4ee 0%, #c5e39a 55%, #a9d98a 100%);
  background-attachment: fixed;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

body[data-view="play"] { height: 100dvh; overflow: hidden; }

.pk-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pk-top h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--moss-dark);
}

.pk-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: var(--moss);
  color: var(--cream);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--moss-dark);
}
.pk-icon svg { width: 26px; height: 26px; fill: currentColor; }
.pk-icon[aria-pressed="false"] { opacity: 0.55; }

.pk-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
}

.pk-card {
  border: none;
  border-radius: 22px;
  background: var(--card);
  padding: 10px 10px 12px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(30, 70, 52, 0.35);
}
.pk-card .animal-svg { width: 92px; height: 92px; }
.pk-card strong { font-size: 0.98rem; line-height: 1.15; text-align: center; }
.pk-card.done { background: #fff3c4; }

.pk-dots {
  display: flex;
  gap: 3px;
}
.pk-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(58, 36, 24, 0.18);
}
.pk-dots i.on { background: var(--amber); box-shadow: inset 0 0 0 1.5px #c4921a; }

.pk-play {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.pk-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 0;
}
.pk-animal .animal-svg { width: 130px; height: 130px; }

.pk-levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.pk-levels button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  padding: 0;
  font-size: 0.8rem;
  color: var(--ink);
  background: rgba(255, 250, 243, 0.7);
}
.pk-levels button.done { background: var(--amber); }
.pk-levels button.now { background: var(--moss); color: var(--cream); transform: scale(1.15); }
.pk-levels button:disabled { opacity: 0.45; cursor: default; }

.pk-play .task {
  height: 100%;
  min-height: 0;
}

.pk-say {
  margin: 0;
  min-height: 2.6em;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--card);
  font-weight: 800;
  font-size: 1.05rem;
}

@media (max-width: 700px), (orientation: portrait) {
  .pk-play {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .pk-side { flex-direction: row; justify-content: center; }
  .pk-animal .animal-svg { width: 72px; height: 72px; }
  .pk-levels button { width: 24px; height: 24px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .pk-play { grid-template-columns: 120px minmax(0, 1fr); }
  .pk-animal .animal-svg { width: 70px; height: 70px; }
  .pk-levels button { width: 20px; height: 20px; font-size: 0.7rem; }
  .pk-say { min-height: 0; font-size: 0.95rem; padding: 6px 12px; }
}

/* Sizes the fitter in main.js works out for the later levels. */
.pk-play .task .tile,
.pk-play .task .choice.picture,
.pk-play .task .shadow-picture { width: var(--tile, 104px); }
.pk-play .task .choice { min-width: min(104px, var(--tile, 104px)); min-height: min(108px, var(--tile, 108px)); }
.pk-play .task .size-row, .pk-play .task .choices, .pk-play .task .pattern-row { gap: 10px; flex-wrap: nowrap; }
.pk-play .task .acorns { gap: 6px 10px; }
.pk-play .task .acorns svg { width: var(--acorn, 68px); height: calc(var(--acorn, 68px) * 1.12); }
.pk-play .task .choice .num { font-size: min(2.3rem, calc(var(--tile, 104px) * 0.4)); }
.pk-play .task.pk-wrap .size-row, .pk-play .task.pk-wrap .choices, .pk-play .task.pk-wrap .pattern-row {
  flex-wrap: wrap;
  max-width: calc((var(--tile) + 10px) * var(--per, 3));
  margin-inline: auto;
}
