/* The chest borrows the site's Mediterranean palette and local typefaces. */
.chest-layout {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 65px;
  align-items: start;
  padding: 35px 0 75px;
}
.chest-intro {
  padding-top: 20px;
}
.chest-intro h1 {
  font-size: clamp(65px, 7vw, 100px);
  line-height: 1.02;
  margin: 20px 0 25px;
}
.chest-intro h1 em {
  color: var(--orange);
}
.chest-intro .eyebrow i {
  margin-right: 9px;
  color: var(--orange);
}
.chest-intro .big-copy {
  font-size: 26px;
  margin-bottom: 24px;
}
.chest-intro > p:not(.eyebrow) {
  max-width: 425px;
}
.chest-intro-note {
  display: flex;
  align-items: start;
  gap: 15px;
  border-block: 1px solid var(--line);
  padding: 22px 0;
  margin: 30px 0 24px;
  max-width: 425px;
}
.chest-intro-note > i {
  font-size: 24px;
  color: var(--orange);
  margin-top: 5px;
}
.chest-intro-note p {
  font-size: 15px;
}
.chest-intro > .text-link {
  min-height: 48px;
}
.chest-play-column {
  min-width: 0;
}
.chest-game {
  position: relative;
  isolation: isolate;
  background: var(--sky);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 0 #113e5007;
  scroll-margin-top: 15px;
  overflow: hidden;
}
.chest-site [hidden] {
  display: none !important;
}
.chest-game button,
.chest-preparation button,
.chest-photo-dialog button,
.chest-reset-dialog button {
  min-height: 48px;
  font: inherit;
  cursor: pointer;
}
.chest-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 19px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
}
.chest-topline > #chest-progress-label {
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
}
.chest-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 368px;
  padding-top: 25px;
}
.chest-screen h2 {
  font-size: clamp(30px, 3.1vw, 43px);
  line-height: 1.08;
  letter-spacing: -1.3px;
  margin: 9px 0 18px;
  max-width: 440px;
}
.chest-screen h2:focus {
  outline: none;
}
.chest-kicker {
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 750;
  line-height: 1.6;
  margin: 0;
}
.cofre-art {
  width: 320px;
  height: 224px;
  max-width: 100%;
  flex-shrink: 0;
  display: block;
  margin: -3px auto 0;
}
.cofre-treasure {
  opacity: 0;
  transform: translateY(20px);
  transform-origin: center;
  transition:
    transform 0.6s,
    opacity 0.6s;
}
.cofre-lid {
  transform-origin: 65px 130px;
  transition: transform 0.7s;
}
.chest-game[data-phase="opened"] .cofre-lid {
  transform: translateY(-28px) rotate(-12deg);
}
.chest-game[data-phase="opened"] .cofre-treasure {
  opacity: 1;
  transform: translateY(-10px);
}
.chest-prize {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0 0 14px;
  max-width: 380px;
  overflow-wrap: anywhere;
}
.chest-wait-copy {
  font-size: 15px;
  line-height: 1.6;
  max-width: 360px;
  margin: 0 0 14px;
}
.chest-code-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 23px;
  position: relative;
  z-index: 1;
}
.chest-digit {
  display: grid;
  place-items: center;
  width: 68px;
  height: 76px;
  border: 1px solid #113e5030;
  border-radius: 10px;
  background: #fffaf1b0;
  font-size: 38px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 0 #113e5009;
  color: #52676c;
}
.chest-digit[data-revealed="true"] {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.chest-game[data-phase="final"] .chest-digit,
.chest-game[data-phase="opened"] .chest-digit {
  font-size: 45px;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--orange);
}
.chest-actions {
  position: relative;
  z-index: 1;
}
.chest-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px !important;
  padding: 14px 17px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px !important;
  font-weight: 750 !important;
  line-height: 1.5;
  border: 1px solid transparent;
}
.chest-primary:hover {
  background: var(--blue);
}
.chest-primary:disabled {
  opacity: 0.45;
  cursor: default;
}
.chest-ariel-action > p {
  text-align: center;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 750;
  margin: 0 0 10px;
}
.chest-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.5;
}
.chest-rebus {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 15px 0 25px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.25;
}
.chest-question {
  font-size: 22px;
  line-height: 1.45;
  max-width: 405px;
  margin: 3px auto 17px;
}
.chest-support {
  font-size: 18px;
  line-height: 1.55;
  max-width: 410px;
  margin: 15px auto 0;
}
.chest-audio-resource {
  margin-top: 8px;
  max-width: 395px;
}
.chest-audio-resource p {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
}
.chest-audio-resource p:empty {
  display: none;
}
.chest-mime {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 55px;
  margin: 15px 0 25px;
  color: var(--blue);
}
.chest-mime > span {
  font-family: var(--serif);
  font-style: italic;
  color: var(--orange);
}
.chest-photo-resource {
  width: 100%;
  margin: 5px 0 10px;
}
.chest-photo-resource > button {
  padding: 0;
  display: block;
  width: 100%;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid #113e5030;
  overflow: hidden;
}
.chest-photo-slot {
  display: block;
}
.chest-photo-slot img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
}
.chest-photo-zoom {
  min-height: 48px;
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 650;
  border-top: 1px solid var(--line);
}
.chest-missing-photo {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 22px 20px;
  border-radius: 10px;
  margin: 10px 0;
  max-width: 400px;
}
.chest-missing-photo > i {
  font-size: 28px;
  color: var(--orange);
}
.chest-missing-photo p {
  font-size: 16px;
  line-height: 1.6;
  margin: 15px 0;
}
.chest-earned-icon {
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--orange);
  font-size: 43px;
  margin: 5px auto 20px;
  transform: rotate(-12deg);
  box-shadow: 7px 7px 0 #113e5010;
}
.chest-screen > #chest-earned-caption {
  font-size: 19px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.chest-game[data-phase="earned"] {
  background: var(--peach);
}
.chest-game[data-phase="final"],
.chest-game[data-phase="opened"] {
  background: #f5e4be;
}
#chest-final .cofre-art {
  height: 180px;
  width: 270px;
  margin-top: -8px;
}
#chest-final-note {
  font-size: 17px;
  line-height: 1.6;
  max-width: 405px;
}
.chest-game[data-celebrate="digit"] .chest-digit[data-new="true"] {
  animation: chest-digit-pop 0.7s ease-out;
}
.chest-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.chest-confetti-piece {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 18px;
  border-radius: 2px;
  background: var(--orange);
}
.chest-confetti-piece:nth-child(3n) {
  background: var(--blue);
  width: 13px;
  height: 9px;
}
.chest-confetti-piece:nth-child(3n + 1) {
  background: #e4b45d;
}
.chest-game[data-celebrate="digit"] .chest-confetti-piece:nth-child(-n + 10),
.chest-game[data-celebrate="open"] .chest-confetti-piece {
  display: block;
  animation: chest-confetti 1.25s ease-out both;
}
.chest-confetti-piece:nth-child(4n) {
  animation-delay: 0.1s !important;
}
.chest-confetti-piece:nth-child(5n) {
  animation-delay: 0.2s !important;
}
.chest-confetti-1,
.chest-confetti-13 {
  --x: -180px;
  --r: 210deg;
}
.chest-confetti-2,
.chest-confetti-14 {
  --x: 130px;
  --r: -240deg;
}
.chest-confetti-3,
.chest-confetti-15 {
  --x: -80px;
  --r: 160deg;
}
.chest-confetti-4,
.chest-confetti-16 {
  --x: 210px;
  --r: 300deg;
}
.chest-confetti-5,
.chest-confetti-17 {
  --x: -240px;
  --r: -200deg;
}
.chest-confetti-6,
.chest-confetti-18 {
  --x: 55px;
  --r: 260deg;
}
.chest-confetti-7,
.chest-confetti-19 {
  --x: 165px;
  --r: -180deg;
}
.chest-confetti-8,
.chest-confetti-20 {
  --x: -140px;
  --r: 310deg;
}
.chest-confetti-9,
.chest-confetti-21 {
  --x: 15px;
  --r: -320deg;
}
.chest-confetti-10,
.chest-confetti-22 {
  --x: -30px;
  --r: 240deg;
}
.chest-confetti-11,
.chest-confetti-23 {
  --x: 250px;
  --r: 360deg;
}
.chest-confetti-12,
.chest-confetti-24 {
  --x: -210px;
  --r: -280deg;
}
.chest-preparation {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 12px;
  margin-top: 35px;
  scroll-margin-top: 15px;
}
.chest-preparation > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  min-height: 58px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  list-style: none;
}
.chest-preparation > summary::-webkit-details-marker {
  display: none;
}
.chest-preparation > summary > span {
  display: flex;
  gap: 10px;
  align-items: center;
}
.chest-preparation > summary > i {
  font-size: 10px;
}
.chest-preparation[open] > summary {
  border-bottom: 1px solid var(--line);
}
.chest-prep-content {
  padding: 23px;
}
.chest-prep-intro {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 22px;
}
.chest-prep-content > label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin: 22px 0 9px;
}
.chest-prep-content input {
  min-height: 49px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  border-radius: 7px;
  padding: 12px;
  font-size: 16px;
}
.chest-code-input {
  display: flex;
  gap: 9px;
}
.chest-code-input > input {
  flex: 1;
  min-width: 0;
  letter-spacing: 9px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  padding: 8px 15px;
}
.chest-code-input > button {
  flex-shrink: 0;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--sky);
  border-radius: 7px;
  font-size: 13px;
}
.chest-code-input > input:disabled {
  background: #113e5008;
  opacity: 1;
  color: var(--muted);
}
.chest-prep-content input[type="file"] {
  font-size: 12px;
  padding: 7px;
  width: 100%;
  min-height: 54px;
}
.chest-prep-content input[type="file"]::file-selector-button {
  border: 0;
  min-height: 48px;
  background: var(--sky);
  color: var(--ink);
  border-radius: 5px;
  font: inherit;
  font-weight: 650;
  padding: 8px 10px;
  margin-right: 10px;
  cursor: pointer;
}
.chest-field-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0 16px;
}
.chest-prep-content > #chest-save {
  margin-top: 23px;
}
.chest-prep-status {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.6;
  margin: 15px 0 0;
  color: var(--blue);
}
.chest-prep-status:empty {
  display: none;
}
.chest-prep-status[data-error="true"] {
  color: #9c391a;
}
.chest-storage-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 13px;
}
.chest-prep-checklist {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 23px;
}
.chest-prep-checklist h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 15px;
}
.chest-prep-checklist ol {
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
}
.chest-prep-checklist li + li {
  margin-top: 10px;
}
.chest-envelope {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 20px 0;
}
.chest-envelope > summary {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 13px;
  font-size: 13px;
  line-height: 1.6;
  min-height: 48px;
  cursor: pointer;
}
.chest-envelope > p,
.chest-envelope > blockquote {
  font-size: 14px;
  line-height: 1.7;
  padding: 0 15px;
  margin: 15px 0;
}
.chest-envelope > blockquote {
  border-left: 3px solid var(--orange);
  background: var(--peach);
  padding: 15px;
  margin: 15px;
}
.chest-reset {
  display: flex;
  gap: 9px;
  align-items: center;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
  width: 100%;
  font-size: 13px !important;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.chest-bottom {
  background: var(--peach);
  padding: 35px 0;
}
.chest-bottom > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.chest-bottom p {
  font-size: 15px;
  max-width: 700px;
}
.chest-bottom p > i {
  margin-right: 10px;
  color: var(--blue);
}
.chest-bottom a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.chest-photo-dialog,
.chest-reset-dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--cream);
  color: var(--ink);
  padding: 22px;
  max-width: calc(100vw - 24px);
}
.chest-photo-dialog::backdrop,
.chest-reset-dialog::backdrop {
  background: #082832da;
}
.chest-photo-dialog {
  width: min(1000px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
}
.chest-photo-dialog > #chest-close-photo {
  display: flex;
  margin: 0 0 15px auto;
}
.chest-photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 135px);
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
}
.chest-reset-dialog {
  width: 440px;
}
.chest-reset-dialog h2 {
  font-size: 33px;
  line-height: 1.1;
  margin: 4px 0 18px;
}
.chest-reset-dialog p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 23px;
}
.chest-reset-dialog > div {
  display: grid;
  gap: 12px;
}
.chest-reset-dialog button {
  width: 100%;
}
.chest-photo-dialog .dialog-close,
.chest-reset-dialog .dialog-close {
  position: static;
  width: auto;
  height: auto;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
}
@keyframes chest-digit-pop {
  0% {
    transform: scale(0.6) rotate(-9deg);
  }
  45% {
    transform: scale(1.13) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
@keyframes chest-confetti {
  0% {
    transform: translate(0, -25px) rotate(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), 570px) rotate(var(--r));
    opacity: 0;
  }
}
@media (max-width: 1050px) {
  .chest-layout {
    gap: 35px;
  }
  .chest-game {
    padding: 20px;
  }
  .chest-intro h1 {
    font-size: 70px;
  }
  .chest-rebus {
    gap: 10px;
  }
  .chest-digit {
    width: 60px;
    height: 70px;
  }
  .chest-code-row {
    gap: 10px;
  }
  .chest-topline {
    font-size: 9px;
    letter-spacing: 0.7px;
  }
  .chest-primary {
    padding-inline: 10px;
    font-size: 13px !important;
  }
}
@media (max-width: 750px) {
  .chest-layout {
    grid-template-columns: 1fr;
    gap: 27px;
    padding: 12px 0 50px;
  }
  .chest-intro {
    padding: 0;
  }
  .chest-intro h1 {
    font-size: 60px;
    margin: 13px 0 17px;
  }
  .chest-intro .eyebrow {
    font-size: 10px;
  }
  .chest-intro .big-copy {
    font-size: 23px;
    margin-bottom: 15px;
  }
  .chest-intro > p:not(.eyebrow) {
    font-size: 16px;
  }
  .chest-intro-note,
  .chest-intro > .text-link {
    display: none;
  }
  .chest-game {
    padding: 17px;
    border-radius: 16px;
  }
  .chest-screen {
    min-height: 330px;
    padding-top: 23px;
  }
  .chest-screen h2 {
    font-size: 33px;
    line-height: 1.1;
    letter-spacing: -1px;
  }
  .cofre-art {
    width: 280px;
    height: 196px;
  }
  .chest-topline {
    padding-bottom: 16px;
  }
  .chest-prize {
    font-size: 19px;
  }
  .chest-wait-copy {
    font-size: 15px;
  }
  .chest-question {
    font-size: 21px;
  }
  .chest-support {
    font-size: 18px;
  }
  .chest-code-row {
    margin: 19px 0 22px;
    gap: 11px;
  }
  .chest-digit {
    width: 58px;
    height: 66px;
    font-size: 35px;
  }
  .chest-primary {
    font-size: 13px !important;
    min-height: 55px !important;
  }
  .chest-rebus {
    font-size: 53px;
    gap: 12px;
    margin: 17px 0 27px;
  }
  .chest-photo-slot img {
    max-height: 380px;
  }
  .chest-preparation {
    margin-top: 28px;
  }
  .chest-prep-content {
    padding: 18px;
  }
  .chest-prep-intro {
    font-size: 14px;
  }
  .chest-prep-content input[type="file"] {
    font-size: 11px;
  }
  .chest-bottom > .wrap {
    display: block;
  }
  .chest-bottom a {
    margin-top: 15px;
  }
  #chest-final .cofre-art {
    height: 165px;
    width: 235px;
  }
  #chest-final-title {
    font-size: 29px;
    line-height: 1.13;
  }
  #chest-final-note {
    font-size: 16px;
  }
}
@media (max-width: 350px) {
  .chest-game {
    padding: 13px;
  }
  .chest-topline {
    font-size: 8px;
    gap: 5px;
  }
  .chest-digit {
    width: 52px;
    height: 61px;
  }
  .chest-code-row {
    gap: 8px;
  }
  .chest-primary {
    font-size: 12px !important;
  }
  .chest-screen h2 {
    font-size: 30px;
  }
  .chest-prep-content {
    padding: 15px;
  }
  .chest-code-input > button {
    font-size: 12px;
  }
  .chest-rebus {
    font-size: 48px;
    gap: 8px;
  }
}
.chest-sound-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 10px;
}
.chest-sound-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: 0;
  padding: 8px 2px;
  font-size: 12px !important;
  min-height: 48px;
}
.chest-sound-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}
.chest-sound-controls label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  min-height: 48px;
}
.chest-sound-controls input {
  width: 75px;
  min-height: 48px;
  accent-color: var(--ink);
}
.chest-sound-controls output {
  font-size: 11px;
  font-weight: 650;
  min-width: 27px;
  font-variant-numeric: tabular-nums;
}
.chest-sound-note {
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  margin-top: 10px;
}
.chest-sound-note:empty {
  display: none;
}
@media (max-width: 750px) {
  .chest-sound-controls {
    gap: 5px;
    margin-top: 17px;
  }
  .chest-sound-controls input {
    width: 56px;
  }
  .chest-sound-controls label {
    gap: 4px;
  }
  .chest-sound-controls button {
    font-size: 11px !important;
    gap: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cofre-lid,
  .cofre-treasure {
    transition: none;
  }
  .chest-game .chest-confetti-piece {
    display: none !important;
  }
  .chest-game .chest-digit {
    animation: none !important;
  }
}
