

/* --------------------------------------------------------------------------
   AR
   -------------------------------------------------------------------------- */

body.is-ar { overflow: hidden; background: #050504; }
body.is-ar .tomb-stage {
  position: fixed;
  inset: 0;
  z-index: 20;
  min-height: 0;
  height: 100svh;
  background: transparent;
}
body.is-ar .tomb-topbar,
body.is-ar .tomb-intro,
body.is-ar .tomb-spec,
body.is-ar .tomb-dock,
body.is-ar .tomb-footnote,
body.is-ar .tomb-wash,
body.is-ar .tomb-grain {
  display: none !important;
}

.tomb-ar {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
body.is-ar .tomb-ar { display: block; }

.tomb-ar-video {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  background: #050504;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
body.is-camera-live .tomb-ar-video { opacity: 1; }

.tomb-ar-sim {
  position: fixed;
  inset: 0;
  z-index: 9;
  overflow: hidden;
  pointer-events: none;
  display: none;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(219, 181, 124, 0.12), transparent 50%),
    linear-gradient(180deg, #11120e 0%, #0c0d0a 42%, #1b1912 48.2%, #463b2b 49%, #2b251b 68%, #0b0c09 100%);
}
body.is-ar .tomb-ar-video,
body.is-ar .tomb-ar-sim { display: block; }
body.is-camera-live .tomb-ar-sim,
body.is-ar-xr .tomb-ar-sim,
body.is-ar-xr .tomb-ar-video { display: none; }

.tomb-ar-sim-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 60vw;
  height: 48vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(218, 168, 92, 0.1), transparent 67%);
  filter: blur(26px);
  transform: translateX(-50%);
}
.tomb-ar-sim-floor {
  position: absolute;
  right: -24%;
  bottom: -30%;
  left: -24%;
  height: 80%;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(208, 169, 104, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 169, 104, 0.05) 1px, transparent 1px);
  background-size: 12% 16%;
  mask-image: radial-gradient(ellipse at 50% 16%, #000, transparent 66%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 16%, #000, transparent 66%);
  transform: perspective(650px) rotateX(58deg);
  transform-origin: top center;
}

.tomb-ar-head {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 22px 0;
  pointer-events: none;
}
.tomb-ar-exit,
.tomb-ar-help { pointer-events: auto; }
.tomb-ar-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 37px;
  padding: 0 13px 0 10px;
  border: 1px solid rgba(236, 227, 211, 0.24);
  background: rgba(6, 7, 5, 0.45);
  color: rgba(236, 227, 211, 0.74);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.tomb-ar-exit:hover { border-color: rgba(184, 139, 82, 0.8); color: var(--paper); }
.tomb-ar-exit span { color: var(--red-bright); font-size: 13px; }
.tomb-ar-help {
  display: grid;
  width: 33px;
  height: 33px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(236, 227, 211, 0.22);
  border-radius: 50%;
  background: rgba(6, 7, 5, 0.42);
  color: rgba(236, 227, 211, 0.66);
  font-family: var(--en);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.tomb-ar-title {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  left: 50%;
  text-align: center;
  transform: translateX(-50%);
}
.tomb-ar-title p {
  margin: 0 0 5px;
  color: rgba(236, 227, 211, 0.35);
  font-family: var(--en);
  font-size: 6px;
  letter-spacing: 0.22em;
}
.tomb-ar-title strong {
  color: rgba(236, 227, 211, 0.8);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.tomb-ar-banner {
  position: absolute;
  top: calc(72px + env(safe-area-inset-top));
  left: 50%;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(236, 227, 211, 0.16);
  background: rgba(7, 8, 6, 0.46);
  color: rgba(236, 227, 211, 0.54);
  font-size: 7px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}
.tomb-ar-banner::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 7px rgba(184, 139, 82, 0.8);
  content: "";
}

.tomb-ar-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(420px, calc(100vw - 40px));
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.3s;
}
body.is-ar-placed .tomb-ar-status {
  top: auto;
  bottom: calc(155px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
.tomb-ar-status strong {
  color: rgba(236, 227, 211, 0.82);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.tomb-ar-status span {
  color: rgba(236, 227, 211, 0.36);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.tomb-ar-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 24;
  display: none;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border: 1px solid rgba(184, 139, 82, 0.6);
  border-radius: 50%;
  pointer-events: none;
}
body.is-ar-xr .tomb-ar-reticle.is-visible { display: block; }
.tomb-ar-reticle::before,
.tomb-ar-reticle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(184, 139, 82, 0.7);
  content: "";
  transform: translate(-50%, -50%);
}
.tomb-ar-reticle::before { width: 130%; height: 1px; }
.tomb-ar-reticle::after { width: 1px; height: 130%; }
.tomb-ar-reticle i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.tomb-ar-reticle span {
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  color: rgba(236, 227, 211, 0.5);
  font-size: 7px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.tomb-ar-console {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 30;
  width: min(600px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(236, 227, 211, 0.16);
  background: rgba(7, 8, 6, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  backdrop-filter: blur(16px);
  transition: opacity 0.3s, transform 0.3s;
}
.tomb-ar-console.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.tomb-ar-console-label {
  margin: 0 0 7px;
  color: rgba(236, 227, 211, 0.38);
  font-size: 7px;
  letter-spacing: 0.06em;
}
.tomb-ar-console-label span {
  float: right;
  color: rgba(236, 227, 211, 0.23);
}
.tomb-ar-tools {
  display: flex;
  gap: 4px;
}
.tomb-ar-tools button {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(236, 227, 211, 0.1);
  background: rgba(236, 227, 211, 0.03);
  color: rgba(236, 227, 211, 0.55);
  cursor: pointer;
}
.tomb-ar-tools button:hover { border-color: rgba(184, 139, 82, 0.45); color: var(--paper); }
.tomb-ar-tools button span { font-family: var(--en); font-size: 14px; line-height: 1; }
.tomb-ar-tools button em {
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.03em;
}
.tomb-ar-shutter {
  position: absolute;
  right: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  display: none;
  width: 51px;
  height: 51px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(236, 227, 211, 0.7);
  border-radius: 50%;
  background: rgba(7, 8, 6, 0.3);
  color: var(--paper);
  cursor: pointer;
  backdrop-filter: blur(10px);
}
body.is-ar-placed .tomb-ar-shutter { display: grid; }
.tomb-ar-shutter i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(236, 227, 211, 0.92);
}
.tomb-ar-shutter em {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  color: rgba(236, 227, 211, 0.5);
  font-size: 6px;
  font-style: normal;
  white-space: nowrap;
  transform: translateX(-50%);
}

.tomb-ar-toast {
  position: absolute;
  bottom: calc(145px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 35;
  max-width: calc(100vw - 40px);
  padding: 8px 14px;
  border: 1px solid rgba(184, 139, 82, 0.35);
  background: rgba(7, 8, 6, 0.84);
  color: rgba(236, 227, 211, 0.85);
  font-size: 8px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  backdrop-filter: blur(12px);
  transition: opacity 0.25s, transform 0.25s;
}
.tomb-ar-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.tomb-ar-help-sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 40;
  display: none;
  width: min(430px, calc(100vw - 34px));
  max-height: calc(100% - 40px);
  padding: 32px 30px 26px;
  overflow-y: auto;
  border: 1px solid rgba(184, 139, 82, 0.35);
  background: linear-gradient(180deg, rgba(22, 21, 16, 0.96), rgba(8, 9, 6, 0.97));
  opacity: 0;
  transform: translate(-50%, -48%);
  backdrop-filter: blur(24px);
  transition: opacity 0.25s, transform 0.25s;
}
.tomb-ar-help-sheet.is-open { display: block; opacity: 1; transform: translate(-50%, -50%); }
.tomb-ar-help-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(236, 227, 211, 0.4);
  font-size: 19px;
  cursor: pointer;
}
.tomb-ar-help-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.12em;
}
.tomb-ar-help-sheet h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
}
.tomb-ar-help-sheet p {
  margin: 0 0 12px;
  color: rgba(236, 227, 211, 0.48);
  font-size: 10px;
  line-height: 1.9;
}
.tomb-ar-help-sheet b { color: var(--gold-pale); font-weight: 400; }

html.is-embed .tomb-ar-head,
html.is-embed .tomb-ar-banner { display: none !important; }
html.is-embed .tomb-ar-status { top: auto; bottom: calc(155px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
html.is-embed .tomb-ar-console { bottom: 14px; }
html.is-embed .tomb-ar-shutter { bottom: calc(84px + env(safe-area-inset-bottom)); }

@media (max-width: 760px) {
  .tomb-ar-head { padding: calc(14px + env(safe-area-inset-top)) 14px 0; }
  .tomb-ar-title { top: calc(17px + env(safe-area-inset-top)); }
  .tomb-ar-title strong { font-size: 14px; }
  .tomb-ar-banner { top: calc(64px + env(safe-area-inset-top)); }
  .tomb-ar-console { width: calc(100vw - 20px); padding: 8px 9px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .tomb-ar-console-label span { display: none; }
  .tomb-ar-tools { gap: 3px; }
  .tomb-ar-tools button { height: 35px; }
  .tomb-ar-tools button span { font-size: 13px; }
  .tomb-ar-shutter { right: 14px; bottom: calc(68px + env(safe-area-inset-bottom)); width: 47px; height: 47px; }
  .tomb-ar-shutter i { width: 31px; height: 31px; }
  .tomb-ar-status { top: 48%; }
  body.is-ar-placed .tomb-ar-status { bottom: calc(114px + env(safe-area-inset-bottom)); }
  .tomb-ar-status strong { font-size: 13px; }
  .tomb-ar-toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
  html.is-embed .tomb-ar-console { bottom: 9px; }
  html.is-embed .tomb-ar-shutter { bottom: calc(62px + env(safe-area-inset-bottom)); }
}
