.secret-dialog {
  --night: #1b3c33;
  --ground: url("assets/map-forest.webp");
  width: min(94vw, 610px);
  max-height: 89dvh;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 2px solid #5b442c;
  border-radius: 22px;
  background: #fff7dd;
  color: #38291e;
  box-shadow: 0 18px 70px #11241d87;
}
.secret-dialog::backdrop {
  background: #142a23b8;
}
.secret-dialog[data-world="desert"] {
  --ground: url("assets/map-desert.webp");
  --night: #503425;
}
.secret-dialog[data-world="crystals"] {
  --ground: url("assets/map-crystals.webp");
  --night: #392d50;
}
.secret-dialog[data-world="islands"] {
  --ground: url("assets/map-islands.webp");
  --night: #193d49;
}
.secret-dialog[data-world="sky"] {
  --ground: url("assets/map-sky.webp");
  --night: #292d52;
}
.secret-dialog[data-world="void"] {
  --ground: url("assets/map-void.webp");
  --night: #332747;
}
.secret-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 14px 54px 14px 17px;
  min-height: 94px;
  background: linear-gradient(90deg, var(--night) 30%, #17271bf0 56%, #16231b50), var(--ground) 60% 48% /
    cover;
  color: #fff7d9;
  border-bottom: 3px solid #d5ad68;
}
.secret-host {
  width: clamp(50px,12vw,80px);
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px #0f2017);
}
.secret-name {
  font-size: .8rem;
  color: #ffe5a7;
  font-weight: 750;
}
.secret-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.4rem,4vw,2.1rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.secret-close {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff5da;
  color: #3b3226;
  font-size: 1.6rem;
  line-height: 1;
}
.secret-body {
  padding: clamp(12px,3vw,20px);
}
.secret-goal {
  margin: 0 0 10px;
  font-size: 1.06rem;
  font-weight: 820;
}
.secret-stage {
  display: grid;
  justify-items: stretch;
  align-content: center;
  gap: 10px;
  min-height: 156px;
  position: relative;
  isolation: isolate;
  border-radius: 16px;
  padding: clamp(10px,2.3vw,16px);
  background: linear-gradient(0deg,#112a2bef,#192927b8),var(--ground) center / cover;
  color: #fff2cb;
  text-align: center;
}
.secret-stage button,
.secret-tools button,
.secret-finish {
  touch-action: manipulation;
  font: inherit;
  font-weight: 800;
}
.secret-stage button:focus-visible,
.secret-dialog button:focus-visible {
  outline: 3px solid white;
  box-shadow: 0 0 0 6px #493637;
}
.secret-instrument-label {
  margin: 0;
  color: #fff5d5;
  font-size: .83rem;
  font-weight: 750;
}
.secret-posts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
  align-items: end;
}
.secret-stump {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 2px;
  min-height: 120px;
  padding: 8px 2px 2px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #1a3e3712;
  color: #fff4cb;
}
.secret-stump[data-selected="true"] {
  border-color: #ffdc7f;
  background: #fff3af19;
}
.secret-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.secret-crate {
  display: block;
  height: 15px;
  border: 1px solid #603e28;
  border-radius: 4px;
  background: linear-gradient(90deg,#d9a968 9%,#f6dd91 10% 18%,#ab6a35 19% 73%,#ffe4a0 74% 84%,#cb9452
    85%);
  box-shadow: inset 0 2px #f7d8a4;
}
.secret-crate[data-size="1"] {
  width: 31%;
}
.secret-crate[data-size="2"] {
  width: 49%;
}
.secret-crate[data-size="3"] {
  width: 67%;
}
.secret-crate[data-size="4"] {
  width: 87%;
}
.stump-base {
  display: grid;
  place-items: center;
  min-height: 44px;
  background: repeating-linear-gradient(86deg,#61422c 0 13px,#754a31 14px 17px,#62432a 18px 22px);
  border: 2px solid #a4774d;
  border-top: 6px solid #e6b278;
  border-radius: 45% 28% 16% 18% / 15% 13% 17% 18%;
  line-height: 1.05;
  font-size: .81rem;
}
.secret-mini,
.secret-finish {
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #936d38;
  border-radius: 9px;
  background: #ffe8b3;
  color: #412d1d;
  box-shadow: 0 2px 0 #8e653c;
  font-weight: 800;
}
.secret-mini:disabled {
  opacity: .58;
  box-shadow: none;
}
.secret-dialog button[disabled] {
  cursor: default;
}
.secret-stage button:enabled:hover,
.secret-tools button:enabled:hover {
  filter: brightness(1.09);
}
.secret-jars {
  display: flex;
  justify-content: center;
  gap: clamp(16px,5vw,34px);
}
.secret-jar-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  justify-items: stretch;
  gap: 4px;
  max-width: 45%;
}
.secret-jar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-column: span 2;
  justify-self: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 78%;
  height: 100px;
  border: 4px solid #d7bc83;
  border-radius: 19% 19% 32% 32%;
  background: #294345b3;
}
.secret-jar-group:nth-child(2) .secret-jar {
  width: 92%;
  height: 128px;
}
.secret-jar strong {
  position: relative;
  z-index: 2;
  background: #152f33de;
  border-radius: 8px;
  color: #ffefb4;
  padding: 1px 5px;
  margin-bottom: 5px;
}
.secret-water {
  position: absolute;
  inset: auto 0 0;
  background: linear-gradient(#66dade 0 5%,#2b8a9d 6% 85%,#267888);
}
.secret-waterline {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  color: #ffdc74;
  font-size: .75rem;
  line-height: 1;
  text-align: right;
  border-bottom: 2px dashed #ffdc74;
}
.secret-transfer,
.secret-tools {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.secret-prisms,
.secret-frogs,
.secret-stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.secret-prism,
.secret-pad,
.secret-star {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: inherit;
}
.secret-prism {
  gap: 10px;
}
.secret-reflection {
  color: #eee0ff;
  border: 1px dashed #dec7fc;
  border-radius: 50%;
  min-width: 25px;
  line-height: 24px;
}
.secret-facet {
  display: grid;
  place-content: center;
  width: 42px;
  height: 51px;
  clip-path: polygon(47% 0,95% 27%,86% 74%,49% 100%,6% 73%,5% 29%);
  background: linear-gradient(120deg,#eee2ff 14%,#aa79ee 32% 49%,#6752bd 50% 77%,#bc8adf 78%);
  color: #271646;
  font-size: 1.25rem;
}
.secret-prism[data-match="true"] .secret-facet {
  background: linear-gradient(125deg,#f9ffe4 10%,#a7f5e1 35%,#58b9b4 60%,#9defe0);
}
.secret-pad {
  min-width: 44px;
  min-height: 49px;
  flex: 0 0 auto;
  border: 2px solid #6aab88;
  border-radius: 50% 44% 42% 52%;
  background: #315c43;
  box-shadow: 0 4px #164c4b;
  color: #ffdf91;
}
.secret-pad[data-crew="moon"] {
  color: #dcf7fe;
  background: #3d6c70;
}
.secret-pad[data-crew="empty"] {
  border-style: dashed;
  font-size: 1.7rem;
  color: #d0ffdb;
}
.secret-scales {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.secret-scales span {
  font-size: 2.55rem;
  line-height: 1.2;
  color: #f5cf76;
}
.secret-scales[data-tilt="1"] span {
  rotate: -8deg;
}
.secret-scales[data-tilt="2"] span {
  rotate: 8deg;
}
.secret-star {
  min-width: 46px;
  min-height: 48px;
  line-height: 1;
  gap: 3px;
  border: 1px solid #a7a4be;
  border-radius: 58% 47% 57% 43%;
  background: linear-gradient(135deg,#9593a6,#484860 45%,#353448);
  color: white;
}
.secret-star[data-tray="1"] {
  background: #a36536;
}
.secret-star[data-tray="2"] {
  background: #427184;
}
.secret-star small {
  font-size: .67rem;
}
.secret-scale-log {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
}
.secret-scale-log li {
  background: #1b273d;
  color: #fff2d6;
  padding: 3px 6px;
  border-radius: 5px;
}
.secret-loom {
  display: grid;
  position: relative;
  grid-template-columns: repeat(var(--loom-size),1fr);
  aspect-ratio: 1;
  width: min(64%,190px);
  justify-self: center;
  border: 1px solid #d5aee9;
  border-radius: 5px;
  overflow: hidden;
  background: #272943;
}
.secret-stitch {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #aaa2c85c;
}
.secret-stitch i,
.secret-stitch b {
  grid-area: 1/1;
  line-height: 1;
}
.secret-stitch i {
  border: 1px dashed #fff6cf;
  border-radius: 5px;
  color: #f5f0d7;
  font: normal 1.27rem/1.05 serif;
}
.secret-stitch b {
  font-size: clamp(.95rem,3vw,1.3rem);
  color: #ffca66;
  text-shadow: 0 0 4px #906332;
}
.secret-stitch[data-align="true"] {
  background: #427f68;
}
.secret-stitch small {
  position: absolute;
  inset: auto auto 0 1px;
  color: #e3def2;
  font-size: .56rem;
}
.secret-message {
  margin: 8px 0 4px;
  min-height: 1em;
  font-size: .86rem;
  color: #4b3325;
  font-weight: 700;
  line-height: 1.3;
}
.secret-tools {
  justify-content: flex-start;
}
.secret-rule {
  margin-top: 12px;
  font-size: .89rem;
}
.secret-rule summary {
  cursor: pointer;
  font-weight: 780;
  min-height: 44px;
  display: list-item;
  align-content: center;
}
.secret-rule p {
  margin: 0 0 .45rem;
}
.secret-win {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .8rem;
  margin: .5rem 0;
  border-radius: 14px;
  background: #dfebbe;
  color: #273d26;
}
.secret-win > div,
.secret-trophy > span {
  display: grid;
  gap: 2px;
}
.secret-win strong {
  font-size: 1.1rem;
}
.secret-token-art {
  object-fit: contain;
  width: 45px;
  height: 45px;
}
.secret-finish {
  background: #234c38;
  color: #fff4cf;
}
.secret-book {
  margin: 1rem 0 1.5rem;
  padding: 0 1rem;
  border: 1px solid #cec89e;
  border-radius: 14px;
  background: #fff9e6;
  color: #423520;
}
.secret-book > summary {
  cursor: pointer;
  font-weight: 800;
  min-height: 48px;
  align-content: center;
}
.secret-cabinet {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(185px,100%),1fr));
  gap: 7px;
  padding: 0 0 1rem;
}
.secret-trophy {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 4px 8px;
  padding: 10px;
  background: #f0e9ce;
  border-radius: 10px;
  font-size: .8rem;
}
.secret-trophy .secret-token-art {
  grid-row: 1 / 3;
  width: 37px;
  height: 37px;
}
.secret-trophy[data-unlocked="true"] {
  background: #dcebbf;
}
.secret-trophy h3,.secret-shelf-count { margin: 0; }
.secret-trophy h3 { font-size: .94rem; line-height: 1.2; }
.secret-keepsakes { grid-column: 1 / -1; display:flex; flex-wrap:wrap; gap:4px; }
.secret-replay { min-height:44px; padding:4px 8px; border:1px solid #867855; border-radius:8px; background:#fff8df; color:#41351c; font-weight:750; }
.secret-replay:focus-visible { outline:3px solid #304734; }
@media (max-width:420px) {
  .secret-jar-group {
    grid-template-columns: 1fr;
  }
  .secret-jar {
    grid-column: auto;
    width: 77px;
  }
  .secret-jar-group:nth-child(2) .secret-jar {
    width: 90px;
  }
  .secret-header {
    gap: 7px;
    padding-left: 9px;
  }
}
@media (min-width:620px) {
  .secret-posts {
    gap: 14px;
  }
  .secret-stage {
    min-height: 188px;
  }
}
@media (prefers-reduced-motion:no-preference) {
  .secret-water {
    transition: height 180ms ease-out;
  }
  .secret-facet {
    transition: filter 160ms ease;
  }
}
.secret-pad small {
  font-size: .64rem;
  line-height: 1;
  color: #f5efd0;
}
.secret-crate {
  height: 20px;
  border: 0;
  border-radius: 0;
  background: url("assets/secret-parcel.webp") center / 100% 100% no-repeat;
  box-shadow: none;
}
.secret-jar {
  border: 0;
  border-radius: 0;
  background: url("assets/secret-vessel.webp") center / 100% 100% no-repeat;
}
.secret-jar-glass {
  position: absolute;
  inset: 0;
  clip-path: polygon(34% 22%, 66% 22%, 68% 28%, 83% 36%, 94% 50%, 96% 66%, 92% 78%, 82% 91%, 72% 96%, 28% 96%, 18% 91%, 8% 78%, 4% 66%, 6% 50%, 17% 36%, 32% 28%);
  mix-blend-mode: multiply;
}
.secret-water {
  bottom: 7%;
  inset-inline: 11%;
  border-radius: 0 0 28% 28%;
  background: linear-gradient(#8ceef9 3%,#008bb3bd 7%,#12699cc9);
}
.secret-waterline {
  inset-inline: 13%;
  border-color: #8f5a00;
  color: #462b11;
  text-shadow: 0 0 3px #fff;
}
.secret-jar strong {
  margin-bottom: 10px;
}
.secret-facet,
.secret-prism[data-match="true"] .secret-facet {
  clip-path: none;
  background: url("assets/secret-prism.webp") center / contain no-repeat;
  color: #fff9eb;
  text-shadow: 0 1px 3px #332052,1px 0 2px #332052,-1px 0 2px #332052;
}
.secret-prism[data-match="true"] .secret-facet {
  filter: hue-rotate(119deg);
}
.secret-pad {
  position: relative;
  min-width: 49px;
  min-height: 60px;
  padding: 0 3px 1px;
  align-content: end;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: white;
  text-shadow: 0 1px 3px #203522;
}
.secret-pad[data-crew="sun"] {
  background: url("assets/secret-sun-frog.webp") center top / 46px 46px no-repeat;
}
.secret-pad[data-crew="moon"] {
  background: transparent url("assets/secret-moon-frog.webp") center top / 46px 46px no-repeat;
  color: #fff4d1;
}
.secret-pad[data-crew="empty"] {
  background: radial-gradient(ellipse at 50% 56%,#608a48 20%,#368062 40%,transparent 42%);
  color: white;
  min-height: 60px;
  align-content: center;
}
.secret-pad small {
  font-size: .64rem;
  line-height: 1;
  align-self: end;
}
.secret-star {
  background: transparent url("assets/secret-meteor.webp") center / contain no-repeat;
  border: 0;
  border-radius: 8px;
  color: #292b41;
  text-shadow: 0 0 3px #fff;
}
.secret-star[data-tray="1"],
.secret-star[data-tray="2"] {
  background: transparent url("assets/secret-meteor.webp") center / contain no-repeat;
}
.secret-star small {
  padding: 2px 6px;
  border-radius: 5px;
  background: #fff2cc;
  color: #392c23;
  text-shadow: none;
}
.secret-star[data-tray="1"] small {
  background: #ffe5a0;
}
.secret-star[data-tray="2"] small {
  background: #b4edec;
}
