:root { --page: #fdfdfc; --navy: #1b2648; --gold: #b39a6b; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--page);
  color: var(--navy);
  font-family: "Lato", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  display: grid;
  place-items: center;
}
main { text-align: center; padding: 24px; width: 100%; animation: arrive .9s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

#chest {
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 16px;
  position: relative;
  transition: transform .25s ease;
}
/* A soft band of light that crosses the chest on hover, clipped to the chest's own shape. */
#chest::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(112deg, transparent 42%, rgba(255, 244, 214, .55) 50%, transparent 58%) no-repeat;
  background-size: 260% 100%; background-position: 130% 0;
  -webkit-mask: url("/chest.webp") center / 100% 100% no-repeat;
          mask: url("/chest.webp") center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  transition: background-position 0s;
}
#chest:hover::after, #chest:focus-visible::after {
  background-position: -30% 0; transition: background-position 1.1s ease;
}
#chest img { display: block; width: min(362px, 70vw); height: auto; }
#chest:hover { transform: translateY(-3px); }
#chest:active { transform: translateY(0); }
#chest:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }

hr {
  width: min(470px, 80vw); height: 2px; border: 0; margin: 18px auto 26px; opacity: .8;
  background: linear-gradient(to right, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
}
.label {
  margin: 0; font-size: clamp(15px, 2.4vw, 22px); font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase; padding-left: .26em;
}

dialog {
  border: 1px solid var(--gold); border-radius: 10px; background: #fff; color: var(--navy);
  padding: 28px 32px 22px; width: min(340px, calc(100vw - 48px)); text-align: center;
  box-shadow: 0 18px 50px rgba(27, 38, 72, .18);
}
dialog::backdrop { background: rgba(27, 38, 72, .28); }
dialog p { margin: 0 0 20px; font-size: 17px; letter-spacing: .02em; }
dialog button {
  font: inherit; font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  color: #fff; background: var(--navy); border: 0; border-radius: 6px;
  padding: 10px 22px; cursor: pointer;
}
dialog button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  #chest { transition: none; } #chest:hover { transform: none; }
  #chest::after { display: none; }
}
