/* V6.6: Collection 2, Maths Buddy and roomier optional working space. */

.sticker-collection-tabs {
  width: min(560px, 100%);
  margin: 0 auto 16px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  border: 2px solid rgba(112, 71, 220, .13);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
}

.sticker-collection-tabs button {
  min-width: 0;
  min-height: 52px;
  padding: 7px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.sticker-collection-tabs button strong,
.sticker-collection-tabs button small {
  display: block;
}

.sticker-collection-tabs button strong {
  color: var(--ink);
  font-size: 14px;
}

.sticker-collection-tabs button small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
}

.sticker-collection-tabs button.selected {
  background: #eee8ff;
  color: #6841d8;
  box-shadow: inset 0 0 0 2px #8e6cf0;
}

.sticker-detail-image {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sticker-detail-image:focus-visible,
.buddy-result-button:focus-visible {
  outline: 4px solid rgba(112, 71, 220, .22);
  outline-offset: 2px;
  border-radius: 18px;
}

.sticker-buddy-message {
  min-height: 22px;
  margin: 8px 0 0;
  color: #5e438c;
  font-size: 13px;
  font-weight: 850;
}

.sticker-detail-actions {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.sticker-detail-actions button {
  min-width: 0;
  margin-top: 0;
}

.sticker-detail-actions .selected {
  color: #5d3ac7;
  background: #eee8ff;
}

.sticker-action .sticker-home-thumb img {
  object-fit: contain;
}

.buddy-result-zone {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 170px;
  display: grid;
  grid-template-rows: minmax(0, 142px) 24px;
  place-items: center;
  overflow: hidden;
}

.buddy-result-button {
  z-index: 1;
  width: min(190px, 76%);
  height: 138px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.buddy-result-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(45, 29, 80, .16));
  pointer-events: none;
}

.buddy-result-message {
  z-index: 1;
  width: 100%;
  min-height: 22px;
  padding: 0 8px;
  overflow: hidden;
  color: #55466b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buddy-pop {
  animation: buddy-pop .55s ease;
}

@keyframes buddy-pop {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-5px) scale(1.04); }
}

.scratch-pad {
  width: min(980px, 100%);
}

.scratch-canvas-wrap {
  height: clamp(250px, 34vh, 380px);
}

@media (max-width: 760px) {
  .buddy-result-zone {
    height: 145px;
    grid-template-rows: minmax(0, 119px) 22px;
  }

  .buddy-result-button {
    width: min(165px, 72%);
    height: 116px;
  }

  .scratch-canvas-wrap {
    height: clamp(230px, 32vh, 320px);
  }
}

@media (max-width: 520px) {
  .sticker-detail-actions {
    grid-template-columns: 1fr;
  }

  .scratch-canvas-wrap {
    height: clamp(210px, 30vh, 270px);
  }
}

@media (max-width: 390px), (max-height: 650px) {
  .buddy-result-zone {
    height: 120px;
    grid-template-rows: minmax(0, 98px) 20px;
  }

  .buddy-result-button {
    width: min(142px, 68%);
    height: 96px;
  }

  .buddy-result-message {
    font-size: 9px;
  }

  .scratch-canvas-wrap {
    height: clamp(185px, 29vh, 240px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .buddy-pop {
    animation: none;
  }
}
