/* Barn Buddy-inspired achievements window, adapted to DaleBloom. */
.achievements-modal {
  z-index: 33;
  padding: 18px;
  background: rgba(28, 39, 28, 0.58);
  backdrop-filter: blur(7px);
}

.achievements-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 5px solid #b9782f;
  border-radius: 26px;
  color: #55391d;
  background: linear-gradient(180deg, #fff4d5, #ffe6ab);
  box-shadow: 0 24px 80px rgba(31, 29, 17, 0.52), inset 0 0 0 3px rgba(255, 253, 226, 0.78);
}

.achievements-head {
  position: relative;
  min-height: 100px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  padding: 18px 82px 8px 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(180deg, #fff8e2, #ffe9b8);
}

.achievements-ribbon {
  position: relative;
  justify-self: center;
  min-width: min(390px, 60vw);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 10px 42px 13px;
  color: #173f51;
  background: linear-gradient(180deg, #76d2ed, #49b3dc);
  box-shadow: inset 0 -5px 0 rgba(28, 126, 169, 0.24), 0 5px 0 rgba(126, 84, 31, 0.15);
  clip-path: polygon(0 0, 10% 14%, 90% 14%, 100% 0, 94% 52%, 100% 100%, 77% 87%, 23% 87%, 0 100%, 6% 52%);
  font-family: "Trebuchet MS", Inter, sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.45);
}

.achievements-ribbon > span {
  color: #ffc83d;
  filter: drop-shadow(0 2px 0 #8d6721);
  font-size: 1.15rem;
}

.achievements-page-text {
  align-self: center;
  color: #5a4024;
  font-size: 1rem;
  white-space: nowrap;
}

.achievements-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 54px;
  height: 54px;
  border: 4px solid #1c727d;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #71d1e6, #38a7c9);
  box-shadow: inset 0 -5px 0 rgba(19, 102, 128, 0.3), 0 4px 8px rgba(53, 75, 52, 0.26);
  cursor: pointer;
  font-size: 2.15rem;
  font-weight: 950;
  line-height: 0.8;
  text-shadow: 0 2px 0 #24798e;
}

.achievements-close:hover { filter: brightness(1.07); transform: translateY(-1px); }

.achievements-tabs {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 0 74px 0;
  background: linear-gradient(180deg, #ffe9b8, #f3ce82);
}

.achievement-tab {
  min-width: 94px;
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 7px 12px 5px;
  border: 3px solid #d1a14f;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  color: #6a4a25;
  background: linear-gradient(180deg, #fff6d4, #f4d28d);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.achievement-tab-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 1px rgba(73, 47, 21, 0.2));
}

.achievement-tab-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-tab small { font-size: 0.63rem; font-weight: 950; }
.achievement-tab:hover { filter: brightness(1.04); }
.achievement-tab.active {
  border-color: #b87d2e;
  color: #315829;
  background: linear-gradient(180deg, #f4f7bd, #cfe585);
  transform: translateY(-4px);
}

.achievements-content {
  min-height: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 50px;
  align-items: center;
  gap: 10px;
  padding: 15px 16px 13px;
  border: 3px solid rgba(200, 145, 54, 0.34);
  border-right: 0;
  border-left: 0;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 226, 118, 0.22), transparent 26%),
    linear-gradient(180deg, #ffe7ad, #f3cb79);
}

.achievements-list {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 2px 4px;
}

.achievement-row {
  display: grid;
  grid-template-columns: 88px minmax(180px, 1fr) 300px;
  align-items: center;
  gap: 14px;
  min-height: 106px;
  padding: 10px 13px;
  border: 3px solid #d7aa58;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff5d2, #ffe6aa);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.78), 0 4px 0 rgba(154, 98, 35, 0.14);
}

.achievement-row.completed {
  border-color: #c79a2d;
  background: linear-gradient(180deg, #fff7bd, #f5d66d);
}

.achievement-art {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 3px solid #8f784d;
  border-radius: 14px;
  background:
    radial-gradient(circle at 33% 24%, rgba(255, 255, 255, 0.88), transparent 28%),
    linear-gradient(145deg, #eaf3d2, #bbd58d);
  box-shadow: inset 0 -5px 0 rgba(95, 111, 61, 0.15);
  font-size: 2.7rem;
}

.achievement-cup-mini {
  position: absolute;
  right: -9px;
  bottom: -7px;
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 1px rgba(83, 48, 12, 0.3));
}

.achievement-copy { min-width: 0; }
.achievement-copy h3 {
  margin: 0;
  overflow: hidden;
  color: #4d351d;
  font-size: clamp(0.93rem, 1.7vw, 1.15rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-copy p {
  margin: 4px 0 7px;
  color: #80623e;
  font-size: 0.68rem;
  font-weight: 750;
}

.achievement-progress {
  position: relative;
  height: 27px;
  overflow: hidden;
  border: 3px solid #6d4826;
  border-radius: 999px;
  background: #64411f;
  box-shadow: inset 0 3px 5px rgba(38, 23, 10, 0.34);
}

.achievement-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #cfe958, #8fbd32);
  box-shadow: inset 0 3px 0 rgba(244, 255, 166, 0.58);
}

.achievement-row.completed .achievement-progress > span {
  background: linear-gradient(180deg, #fff44f, #edbf20);
}

.achievement-progress strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-size: 0.68rem;
  font-weight: 950;
  text-shadow: 0 2px 0 #5e3e20;
}

.achievement-awards {
  display: grid;
  grid-template-columns: repeat(4, 68px);
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.achievement-award {
  width: 68px;
  height: 72px;
  display: grid;
  place-items: center;
}

.achievement-award img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(70, 40, 12, 0.18));
}

.achievement-award.award-4 {
  width: 62px;
  height: 62px;
  padding: 0;
  color: #f9e7b7;
  background: transparent;
  filter: grayscale(1);
  font-size: 3.1rem;
  opacity: 0.34;
  text-shadow: 0 1px 0 rgba(75, 44, 12, 0.5);
}
.achievement-award.award-4.earned { filter: none; opacity: 1; }

.achievements-arrow {
  width: 44px;
  height: 78px;
  border: 3px solid #1d7185;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(180deg, #68cbe3, #3599c2);
  box-shadow: inset 0 -5px 0 rgba(25, 101, 135, 0.3), 0 4px 7px rgba(59, 74, 49, 0.2);
  cursor: pointer;
  font-size: 2.4rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 0 #216d86;
}

.achievements-arrow:disabled {
  opacity: 0.28;
  cursor: default;
  filter: grayscale(0.7);
}

.achievements-foot {
  padding: 8px 16px 11px;
  color: #7b5b34;
  background: #f4cf85;
  font-size: 0.65rem;
  font-weight: 750;
  text-align: center;
}

@media (max-width: 800px) {
  .achievements-modal { padding: 7px; }
  .achievements-dialog { max-height: calc(100vh - 14px); max-height: calc(100dvh - 14px); border-width: 3px; border-radius: 17px; }
  .achievements-head { min-height: 84px; grid-template-columns: 1fr; padding: 13px 58px 6px 10px; }
  .achievements-ribbon { min-width: min(330px, 76vw); gap: 16px; padding: 9px 24px 12px; font-size: 1.25rem; }
  .achievements-page-text { justify-self: center; margin-top: 2px; font-size: 0.76rem; }
  .achievements-close { top: 7px; right: 7px; width: 44px; height: 44px; border-width: 3px; font-size: 1.75rem; }
  .achievements-tabs { gap: 6px; overflow-x: auto; padding: 0 8px; }
  .achievement-tab { flex: 1 0 70px; min-width: 70px; min-height: 58px; padding: 5px; border-width: 2px; }
  .achievement-tab-icon { width: 38px; height: 38px; }
  .achievement-tab small { font-size: 0.55rem; }
  .achievements-content { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 4px; padding: 8px 5px; }
  .achievements-arrow { width: 30px; height: 60px; border-width: 2px; border-radius: 9px; font-size: 1.75rem; }
  .achievement-row { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; min-height: 112px; padding: 7px; border-width: 2px; border-radius: 13px; }
  .achievement-art { width: 54px; height: 54px; border-width: 2px; border-radius: 10px; font-size: 1.9rem; }
  .achievement-cup-mini { right: -6px; bottom: -5px; font-size: 1.2rem; }
  .achievement-copy h3 { font-size: 0.82rem; }
  .achievement-copy p { margin: 3px 0 5px; font-size: 0.58rem; }
  .achievement-progress { height: 23px; border-width: 2px; }
  .achievement-awards { grid-column: 1 / -1; justify-content: end; grid-template-columns: repeat(4, 52px); gap: 4px; padding-right: 3px; }
  .achievement-award { width: 52px; height: 56px; }
  .achievement-award.award-4 { width: 52px; height: 52px; font-size: 2.3rem; }
  .achievements-foot { padding: 6px 9px 8px; font-size: 0.56rem; }
}

@media (max-width: 430px) {
  .achievements-list { gap: 6px; }
  .achievement-row { min-height: 105px; }
  .achievement-copy h3 { max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .achievement-tab,
  .achievements-close { transition: none; }
}
/* End achievements window. */

@media (max-width: 380px) {
  .shop-modal { padding-left: 4px; padding-right: 4px; }
  .shop-category-tabs { left: 16px; right: 16px; gap: 3px; }
}

.stage-zoom-menu {
  position: absolute;
  right: clamp(9px, 1vw, 18px);
  bottom: 90px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.35vw, 6px);
  pointer-events: auto;
}

.stage-zoom-button {
  position: relative;
  width: clamp(34px, 2.6vw, 42px);
  height: clamp(34px, 2.6vw, 42px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid #7a5230;
  border-radius: 24%;
  background: linear-gradient(180deg, #bb9264 0%, #a9804f 48%, #7d5535 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 232, 196, 0.5), inset -1px -2px 0 rgba(58, 33, 14, 0.5), 0 2px 2px rgba(30, 20, 10, 0.3);
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease;
}

.stage-zoom-button svg {
  display: block;
  width: 84%;
  height: 84%;
  pointer-events: none;
}

.stage-zoom-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.stage-zoom-button:active:not(:disabled) {
  transform: translateY(1px);
  background: linear-gradient(180deg, #a98050 0%, #986f43 48%, #6f4a2e 100%);
}

.stage-zoom-button:disabled {
  opacity: 0.55;
  filter: saturate(0.6);
  cursor: default;
}

.stage-zoom-button:focus-visible {
  outline: 3px solid rgba(255, 243, 144, 0.96);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .stage-zoom-menu {
    right: max(7px, env(safe-area-inset-right));
    bottom: calc(140px + env(safe-area-inset-bottom));
  }

  .stage-zoom-button {
    width: 44px;
    height: 44px;
  }
}
