html[data-samaria-age-pending] {
  overflow: hidden;
}

html[data-samaria-age-pending] body {
  overflow: hidden;
}

html[data-samaria-age-pending]:not(:has(#samaria-age-gate[open])) #top,
html[data-samaria-age-pending] #samaria-storefront-promotions {
  visibility: hidden;
}

#samaria-age-gate[hidden],
#samaria-age-gate:not([open]) {
  display: none;
}

#samaria-age-gate {
  --samaria-age-art-limit: max(12rem, calc(100dvh - 8rem));
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: min(48rem, calc(100% - 2rem), calc(2.1 * var(--samaria-age-art-limit)));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #8b6b50;
  border-radius: 22px;
  background: #261b15;
  color: #fff6e8;
  box-shadow: 0 28px 90px #170d09a8;
}

#samaria-age-gate::backdrop,
.samaria-age-gate__noscript {
  background: rgb(32 21 15 / 91%);
  backdrop-filter: blur(5px);
}

#samaria-age-gate.is-fallback {
  outline: max(100vh, 100vw) solid rgb(32 21 15 / 93%);
}

.samaria-age-gate__art {
  position: relative;
  z-index: 1;
  isolation: isolate;
  aspect-ratio: 1.55;
  max-height: var(--samaria-age-art-limit);
  overflow: hidden;
  background: #59412e;
}

.samaria-age-gate__camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 21px 21px 0 0;
}

/* All photo layers and the hit target share the original 710 × 670 coordinate system. */
.samaria-age-gate__scene {
  --samaria-age-scene-width: min(max(190%, 51rem), 280%, calc(3.1 * var(--samaria-age-art-limit)));
  position: absolute;
  width: var(--samaria-age-scene-width);
  aspect-ratio: 710 / 670;
  /* End the crop by x=603 in the photo, before the yellow pipes. */
  left: max(50%, calc(100% - .195 * var(--samaria-age-scene-width)));
  top: 59%;
  transform: translate(-65.49%, -45.67%);
  container-type: inline-size;
}

.samaria-age-gate__door {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 52.4% 45%;
}

.samaria-age-gate__photo,
.samaria-age-gate__plate {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: fill;
}

.samaria-age-gate__photo--open,
.samaria-age-gate__interior {
  opacity: 0;
}

/* Blend the retouched hatch into the original still, keeping the surrounding pipes stationary. */
.samaria-age-gate__photo--open {
  mask-image: radial-gradient(ellipse 22% 21% at 66% 45%, #000 77%, transparent 100%);
}

/* Follow the moving flange and its locking arm in the 710 × 670 photo. */
.samaria-age-gate__lid {
  position: absolute;
  inset: 0;
  clip-path: polygon(50.8% 41.1%, 54.2% 41.1%, 54.3% 39.1%, 54.9% 36%, 54.4% 34.3%, 55.1% 32.8%, 56.6% 32.8%, 57.6% 34.1%, 60.6% 32.4%, 64.3% 31.7%, 68.8% 31.7%, 73.3% 33.2%, 77.1% 36.4%, 79.3% 41.8%, 82.3% 42.7%, 82.3% 44.5%, 80.3% 45.1%, 79% 50.7%, 76.5% 54.2%, 72.4% 56.6%, 67.8% 57.1%, 62.8% 56.3%, 58.9% 54.4%, 56.5% 51.1%, 54.4% 50.6%, 53.8% 48.2%, 54.2% 46.9%, 52.2% 46.7%, 51.4% 45%);
}

#samaria-age-gate.is-flythrough .samaria-age-gate__photo--open {
  opacity: 1;
  transition: opacity 220ms ease-out;
}

/* This crop of the photographed hatch already contains the localized lettering.
   It occupies (360, 202) through (588, 389) in the original 710 × 670 frame. */
.samaria-age-gate__lid-photo {
  position: absolute;
  left: 50.704225%;
  top: 30.149254%;
  width: 32.112676%;
  height: 27.910448%;
  max-width: none;
  margin: 0;
  display: block;
}

/* Curved engraving on the original glass for the locale-specific age threshold. */
.samaria-age-gate__engraving {
  font: 700 9px Arial, sans-serif;
  letter-spacing: .35px;
  fill: #faf3e8;
  stroke: #4b3a31;
  stroke-width: .68px;
  paint-order: stroke fill;
  pointer-events: none;
}
.samaria-age-gate__engraved-action { font-size: 15px; letter-spacing: 1.8px; }
.samaria-age-gate__door:has(.samaria-age-gate__accept:hover) .samaria-age-gate__engraved-action { fill: #fff; }

.samaria-age-gate__letter-light {
  opacity: 0;
  fill: #fff9f1;
  pointer-events: none;
  transition: opacity 130ms ease-out;
}

@media (any-hover: hover) {
  #samaria-age-gate:not(.is-opening, .has-hatch-error) .samaria-age-gate__door:has(.samaria-age-gate__hit:hover) .samaria-age-gate__letter-light {
    opacity: .35;
  }
}

#samaria-age-gate.is-flythrough .samaria-age-gate__door {
  animation: samaria-age-lid 880ms cubic-bezier(.43, .015, .19, 1) both;
}

#samaria-age-gate.is-opening-plain,
#samaria-age-gate.is-opening-plain::backdrop {
  animation: samaria-age-reveal .32s ease both;
}

#samaria-age-gate.is-flythrough,
#samaria-age-gate.is-flythrough .samaria-age-gate__art {
  overflow: visible;
}

#samaria-age-gate.is-flythrough .samaria-age-gate__art {
  background: transparent;
}

#samaria-age-gate.is-flythrough {
  animation: samaria-age-shell 470ms 170ms ease-in-out both;
}

#samaria-age-gate.is-flythrough .samaria-age-gate__content {
  animation: samaria-age-reveal 325ms 95ms ease-in-out both;
}

/* The soft opening stays registered to the photo even in the cropped mobile composition. */
#samaria-age-gate.is-flythrough .samaria-age-gate__plate {
  mask-image: radial-gradient(ellipse 9.65% 11.35% at 65.49% 45.67%, transparent 74%, #000 100%);
}

#samaria-age-gate.is-flythrough .samaria-age-gate__interior {
  opacity: 1;
  animation: samaria-age-reveal 540ms 855ms cubic-bezier(.42, 0, .36, 1) both;
}

#samaria-age-gate.is-flythrough::backdrop {
  animation: samaria-age-reveal 650ms 680ms ease-in-out both;
}

@keyframes samaria-age-lid {
  from { transform: perspective(850px) rotateY(0); filter: brightness(1); }
  to { transform: perspective(850px) rotateY(-116deg); filter: brightness(.78); }
}

@keyframes samaria-age-reveal {
  to { opacity: 0; }
}

@keyframes samaria-age-shell {
  to {
    border-color: transparent;
    outline-color: transparent;
    background-color: transparent;
    box-shadow: none;
  }
}

/* The full hatch stays clickable on touch devices. */
#samaria-age-gate .samaria-age-gate__accept {
  position: absolute;
  left: 52.676056%;
  top: 31.343284%;
  width: 28.169014%;
  height: 27.462687%;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  pointer-events: auto;
  cursor: pointer;
}

/* The SVG uses the same crop and aspect ratio as the source photograph. */
#samaria-age-gate .samaria-age-gate__word-map {
  display: block;
  position: absolute;
  left: -4.5%;
  top: -2.717391%;
  width: 109%;
  height: 103.26087%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
}

.samaria-age-gate__hit {
  fill: none;
  stroke: transparent;
  stroke-width: 37;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
}

.samaria-age-gate__underline {
  fill: none;
  stroke: white;
  stroke-linecap: round;
  stroke-width: 2.1;
  opacity: 0;
  pointer-events: none;
}

@media (any-hover: hover) {
  #samaria-age-gate:not([data-hatch-language="sk"]) .samaria-age-gate__word:hover .samaria-age-gate__underline { opacity: 1; }
}

#samaria-age-gate.is-keyboarding .samaria-age-gate__accept:focus-visible .samaria-age-gate__underline,
#samaria-age-gate:not([data-hatch-language="sk"]) .samaria-age-gate__accept:active .samaria-age-gate__underline { opacity: 1; }

#samaria-age-gate.is-opening .samaria-age-gate__underline { opacity: 0; }

.samaria-age-gate__spoken {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#samaria-age-gate .samaria-age-gate__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  padding: .45rem 1.15rem;
}

#samaria-age-description,
#samaria-age-gate .samaria-age-gate__message {
  margin: 0;
  color: #f3e6d8;
  font-size: .9rem;
  line-height: 1.45;
}

#samaria-age-gate .samaria-age-gate__decline {
  min-height: 44px;
  margin: 0;
  padding: .25rem 0;
  border: 0;
  background: transparent;
  color: #f3d9b1;
  box-shadow: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

#samaria-age-gate :focus-visible {
  outline: 2px solid #ffdfa5;
  outline-offset: 2px;
}

#samaria-age-gate .samaria-age-gate__accept:focus-visible {
  outline: 0;
}

/* Keep the native action visible if the photo cannot be decoded. */
#samaria-age-gate.has-hatch-error .samaria-age-gate__spoken {
  position: static;
  display: block;
  width: auto;
  height: auto;
  clip-path: none;
  color: white;
  background: #33271e;
}

@media (forced-colors: active) {
  #samaria-age-gate .samaria-age-gate__spoken {
    position: static;
    display: block;
    width: auto;
    height: auto;
    clip-path: none;
    color: ButtonText;
    background: ButtonFace;
  }
  #samaria-age-gate .samaria-age-gate__accept:focus-visible {
    outline: 2px solid Highlight;
  }
}

#samaria-age-gate .samaria-age-gate__message:not([hidden]) {
  flex-basis: 100%;
  margin-bottom: .5rem;
  padding: .35rem .7rem;
  border-inline-start: 2px solid #d5a169;
}

.samaria-age-gate__noscript {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.samaria-age-gate__noscript p {
  max-width: 29rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--samaria-surface);
  color: var(--samaria-ink);
  text-align: center;
}

@media (max-width: 650px) {
  #samaria-age-gate {
    width: min(28rem, calc(100% - 1.25rem), calc(2.1 * var(--samaria-age-art-limit)));
    max-height: calc(100dvh - 1.25rem);
    border-radius: 17px;
  }

  .samaria-age-gate__art {
    aspect-ratio: 1.02;
  }

  .samaria-age-gate__camera {
    border-radius: 16px 16px 0 0;
  }

  .samaria-age-gate__scene {
    top: 50%;
  }

  #samaria-age-gate .samaria-age-gate__content {
    justify-content: center;
    padding: .75rem .85rem .25rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .samaria-age-gate__letter-light { transition: none; }

  #samaria-age-gate.is-opening,
  #samaria-age-gate.is-opening::backdrop,
  #samaria-age-gate.is-opening :is(.samaria-age-gate__door, .samaria-age-gate__accept, .samaria-age-gate__camera, .samaria-age-gate__content) {
    animation: none;
  }
}
