:root {
  color-scheme: dark;
  background: #07090e;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #07090e;
}

body {
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.experience {
  position: relative;
  container-type: inline-size;
  width: min(100vw, 576px);
  height: max(100dvh, min(177.7778vw, 1024px), 568px);
  min-height: 568px;
  overflow: hidden;
  isolation: isolate;
  background: #07090e url("assets/v2/bg.webp?v=1") center top / 100% 100% no-repeat;
}

.experience[data-kind="photo"][data-lang="zh"] { background-image: url("assets/v2/photo-bg-zh.webp?v=1"); }
.experience[data-kind="photo"][data-lang="en"] { background-image: url("assets/v2/photo-bg-en.webp?v=1"); }
.experience[data-kind].is-unavailable { background-image: url("assets/v2/bg.webp?v=1"); }
.experience.is-unavailable .photo-instruction,
.experience.is-unavailable .actions { display: none !important; }

.language {
  position: absolute;
  z-index: 5;
  top: calc(5.57cqw + env(safe-area-inset-top));
  right: 6.35%;
  width: 7.65%;
  min-width: 30px;
}

.language img, .image-button img, .photo-instruction img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.content { position: absolute; inset: 0; }

.photo-stack { display: contents; }

.media-frame {
  position: absolute;
  top: 16.74cqw;
  left: 50%;
  width: 62.68%;
  aspect-ratio: 1898 / 1068;
  overflow: hidden;
  transform: translateX(-50%);
  background: transparent;
}

.experience[data-kind="photo"][data-lang="en"] .media-frame { left: 50.76%; }

.media-frame-secondary {
  position: absolute;
  top: 67.07cqw;
  left: 50%;
  width: 68.49%;
  aspect-ratio: 2074 / 2339;
  overflow: hidden;
  transform: translateX(-50%);
  background: #07090e;
}

.experience[data-kind="photo"][data-lang="en"] .media-frame-secondary { left: 50.76%; }

/* The delivered Photobooth files already include the complete grey card and logo.
   Once media is loaded, render those finished cards directly and keep only the
   vertical spacing from the design instead of adding another frame layer. */
.experience[data-kind="photo"].has-media {
  height: auto;
  min-height: max(100dvh, 177.7778cqw, 568px);
  overflow: hidden;
  background-image: url("assets/v2/bg.webp?v=1");
}

.experience[data-kind="photo"].has-media .content {
  position: relative;
  display: flex;
  min-height: max(100dvh, 177.7778cqw, 568px);
  padding: 21.5cqw 0 12cqw;
  flex-direction: column;
  align-items: center;
}

.experience[data-kind="photo"].has-media .photo-stack {
  position: static;
  display: flex;
  width: 68.49%;
  flex-direction: column;
  gap: 2.7cqw;
  transform: none;
}

.experience[data-kind="photo"].has-media .media-frame,
.experience[data-kind="photo"].has-media .media-frame-secondary {
  position: relative;
  inset: auto;
  width: 100%;
  aspect-ratio: auto;
  overflow: visible;
  transform: none;
  background: transparent;
}

.experience[data-kind="photo"].has-media .guest-media {
  position: static;
  width: 100%;
  height: auto;
  background: transparent;
  object-fit: contain;
}

.experience[data-kind="video"] .media-frame {
  top: 28.98cqw;
  width: 64.59%;
  aspect-ratio: 697.571 / 911.925;
  background: #35383c;
  box-shadow: 0 8px 8px rgba(0, 0, 0, .4);
}

.experience[data-kind="video"] .media-frame-secondary { display: none; }

.experience[data-kind="video"] .guest-media { background: #35383c; }

.guest-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #35383c;
  object-fit: contain;
  object-position: center;
}

.guest-media.is-loading { opacity: 0; }

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8%;
  color: #fff;
  text-align: center;
}

.empty-state span {
  font-size: clamp(11px, 2.2vw, 15px);
  letter-spacing: .3em;
}

.empty-state p {
  margin: 1rem 0 0;
  color: #d4d4d4;
  font-family: Arial, "PingFang SC", sans-serif;
  font-size: clamp(11px, 2.4vw, 14px);
  line-height: 1.6;
}

.status-icon {
  width: 12cqw;
  height: 12cqw;
  color: rgba(255, 255, 255, .86);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-instruction { display: none; }

.experience[data-kind="photo"].has-media .photo-instruction {
  position: static;
  display: block;
  width: 67cqw;
  height: 4cqw;
  margin-top: calc(3.2cqw + 15px);
  transform: none;
  transition: opacity .16s ease;
}

.experience[data-kind="photo"].has-media .photo-instruction img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.actions {
  position: absolute;
  top: 131.73cqw;
  left: 50%;
  display: flex;
  width: 83.6%;
  justify-content: center;
  gap: 4.55%;
  transform: translateX(-50%);
  transition: opacity .16s ease;
}

.experience.is-language-changing .photo-instruction,
.experience.is-language-changing .actions { opacity: 0; }

.image-button {
  display: block;
  flex: 0 0 25.1%;
}

.experience[data-kind="photo"] #download { display: none; }
.experience[data-kind="photo"] #more {
  flex: 0 0 auto;
  width: 26.35cqw;
  height: auto;
}

.experience[data-kind="photo"] #more img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.experience[data-kind="photo"] .actions { top: 150.1cqw; }
.experience[data-kind="photo"].has-media .actions {
  position: static;
  width: 83.6%;
  margin-top: calc(2.6cqw + 15px);
  transform: none;
}
.experience[data-kind="photo"][data-lang="en"] .actions { left: 51.14%; }
.experience[data-kind="photo"][data-lang="en"] #more { width: 35.01cqw; }

.experience[data-kind="video"] .actions {
  top: 131.86cqw;
  gap: 8.6cqw;
}

.experience[data-kind="video"] .image-button {
  width: 24.95cqw;
  flex: 0 0 24.95cqw;
  height: 7.6cqw;
}

.experience[data-kind="video"] .image-button img {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.image-button.is-disabled { opacity: .48; cursor: default; }
#more { cursor: pointer; }

.expiry {
  position: absolute;
  top: 149.33cqw;
  right: 8%;
  left: 8%;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font: 11px/1.5 Arial, "PingFang SC", sans-serif;
  text-align: center;
}

.toast {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: 78%;
  margin: 0;
  padding: 12px 18px;
  border-radius: 6px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font: 14px/1.55 Arial, "PingFang SC", sans-serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.toast.is-visible { opacity: 1; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

@media (min-width: 577px) {
  .experience { box-shadow: 0 0 50px rgba(0, 0, 0, .75); }
}

@media (orientation: landscape) and (max-height: 700px) {
  .experience {
    width: min(56.25vh, 576px);
    height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
