/* Alpha audit UI: do not modify the production/shared stylesheet. */
body.play-ar-page .ar-screen:has(.is-outdoor-ar) {
  display: block !important;
  width: 100%;
  height: 100dvh;
}

body.play-ar-page .ar-screen .ar-stage.is-outdoor-ar {
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  aspect-ratio: auto;
  margin: 0 !important;
}

body.play-ar-page .ar-stage > .align-brand {
  display: block !important;
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(60%, 17rem);
  z-index: 10;
  pointer-events: none;
}
body.play-ar-page .ar-stage > .align-brand img {
  display: block;
  width: 100%;
  height: auto;
}

/* Entry handoff 2026-09-11: consent gate and legal overlays. */
.entry-consent {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  max-width: 22.5rem;
  margin-inline: auto;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.7;
  color: #b5b5b5;
  text-align: left;
}
.entry-consent-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.entry-consent-box {
  position: relative;
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--color-light-gold);
  border-radius: 2px;
  background: rgba(8, 8, 8, .62);
  cursor: pointer;
}
.entry-consent-text label { cursor: pointer; }
.entry-consent-box::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #1a1610;
  mask: url("./assets/icons/icon-check.svg") center / contain no-repeat;
  opacity: 0;
}
.entry-consent-input:checked + .entry-consent-box { background: var(--color-light-gold); }
.entry-consent-input:checked + .entry-consent-box::after { opacity: 1; }
.entry-consent-input:focus-visible + .entry-consent-box {
  outline: 1px solid var(--color-light-gold);
  outline-offset: 2px;
}
.entry-consent-text { min-width: 0; }
.entry-consent-link {
  display: inline;
  margin: 0;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-light-gold) 50%, transparent);
  background: none;
  color: var(--color-light-gold);
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  cursor: pointer;
}
.entry-window-button.is-disabled,
.entry-window-button[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
}
.entry-window-content .entry-guide-copy,
.entry-guide-copy {
  flex-shrink: 0;
  margin: .85rem 0 0;
  color: #8a8a8a;
  font-size: var(--text-xs);
  line-height: 2.05;
  text-align: center;
}
.entry-guide-copy .icon-help {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 .2rem 0 .45rem;
  vertical-align: -3px;
  color: var(--color-text-gold);
  background-color: currentColor;
  -webkit-mask: url("./assets/icons/icon-help.svg") center / contain no-repeat;
          mask: url("./assets/icons/icon-help.svg") center / contain no-repeat;
}
.entry-guide-copy .entry-guide-link {
  display: inline;
  margin: 0;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text-gold) 50%, transparent);
  background: none;
  color: var(--color-text-gold);
  font: inherit;
  text-decoration: none;
}
.short-terms-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(5, 5, 5, .62);
}
.short-terms-overlay[hidden] { display: none !important; }
.short-terms-overlay .permission-layout {
  width: min(100%, 22rem);
  min-height: 100%;
  height: 100%;
  max-height: 100%;
  justify-content: flex-end;
  padding-top: max(2.75rem, calc(env(safe-area-inset-top) + 1.5rem));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.short-terms-overlay .permission-layout .modal.permission {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.short-terms-overlay .permission-scroll { min-height: 12rem; }
.short-terms-overlay .permission-header { gap: var(--spacing-2xs); }
.short-terms-overlay .logo-sm-fallenwar { max-width: min(9.5rem, 58vw); }
.short-terms-overlay .permission-actions { margin-bottom: max(1.75rem, env(safe-area-inset-bottom)); }
.short-terms-overlay .permission-actions > * {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

/* Safety / Before Start handoff 2026-09-11. */
.icon-guide      { -webkit-mask-image: url("./assets/icons/icon-guide.svg");      mask-image: url("./assets/icons/icon-guide.svg"); }
.icon-donotenter { -webkit-mask-image: url("./assets/icons/icon-donotenter.svg"); mask-image: url("./assets/icons/icon-donotenter.svg"); }
.icon-restricted { -webkit-mask-image: url("./assets/icons/icon-restricted.svg"); mask-image: url("./assets/icons/icon-restricted.svg"); }
.icon-fall       { -webkit-mask-image: url("./assets/icons/icon-fall.svg");       mask-image: url("./assets/icons/icon-fall.svg"); }
.icon-badweather { -webkit-mask-image: url("./assets/icons/icon-badweather.svg"); mask-image: url("./assets/icons/icon-badweather.svg"); }

.guide-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #c9b28f !important;
}
.guide-title .icon { color: #c9b28f; }
.guide-icon-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.guide-icon-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.guide-icon-list .icon {
  color: #c9b28f;
  margin-top: .12rem;
}
.guide-icon-list p { margin: 0; }
.beforestart-card .permission-item-head .icon,
.beforestart-card .permission-item-head .h2-sm { color: #c9b28f; }
.beforestart-card .permission-item-head .icon { margin-top: 0; }
.beforestart-card .permission-item-head { gap: .55rem; }
.beforestart-card .permission-list .permission-item > .p-body-sm {
  padding-left: calc(var(--icon-sm) + .55rem);
}
.beforestart-card .beforestart-privacy > .p-body-sm { padding-left: 0; }

.ar-screen .ar-stage.is-outdoor-ar.is-compass-anchored .giant-video {
  transform:
    translate3d(
      var(--world-anchor-x, 0px),
      var(--world-anchor-y, 0px),
      0
    )
    scale(var(--water-proximity-scale, 1.08));
  transform-origin: center center;
  will-change: transform;
}

/* The giant stays fully visible over the detected water. */
.ar-screen .ar-stage .ar-foreground-camera {
  display: none;
}

/* Reset flow: reuse the existing modal/button/loader tokens with the static UI layout. */
.cooldown-screen {
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}

.cooldown-screen > .screen-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.cooldown-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.42));
  pointer-events: none;
  z-index: 1;
}

.restart-logo {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  left: 50%;
  width: min(64vw, 17rem);
  height: auto;
  transform: translateX(-50%);
  z-index: 3;
}

.restart-panel {
  position: relative;
  z-index: 3;
  width: min(100%, 21rem);
  color: var(--color-text-headline);
  text-align: center;
}

.restart-waiting {
  display: grid;
  gap: 1.35rem;
  margin-top: 4rem;
}

.restart-share-card {
  padding: 1.2rem 1.35rem;
  border: 1px solid rgba(204, 178, 127, 0.14);
  background: rgba(8, 8, 8, 0.68);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(3px);
}
.restart-dots { margin: 1.15rem 0 0.35rem; }
.restart-countdown {
  display: block;
  color: rgba(208, 180, 124, 0.86);
  font-family: var(--font-quattro);
  font-size: 0.8rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}
.restart-share-card { padding-block: 0.9rem 1rem; }
.restart-share-card .modal-body { margin-bottom: 0.65rem; }
.restart-share-card .btn-md { width: min(100%, 15.5rem); margin-inline: auto; }

.restart-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.58);
  z-index: 20;
}
.restart-ornament { margin: 0 auto 1.1rem; }
.restart-attempts {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
  width: fit-content;
  margin: 1rem auto 1.25rem;
  color: var(--color-text-muted);
}
.restart-attempts small { grid-column: 1 / -1; justify-self: end; font-size: 0.78rem; }
.restart-attempts .plays-left-count { font-size: 2.25rem; }
.restart-attempts .plays-left-text { font-size: 1.1rem; }
.restart-auto-caption { margin: 0.75rem 0 0; color: var(--color-text-muted); font-size: 0.75rem; }

.restart-error { margin-top: 4rem; }
.restart-error > .modal-icon { margin: 0 auto 0.75rem; color: var(--color-accent); }
.restart-error > .modal-hl { margin-bottom: 0.7rem; }
.restart-error > .modal-body { line-height: 1.8; }
.restart-help-box {
  margin: 1.4rem 0;
  padding: 1rem;
  border: 1px solid rgba(202, 166, 95, 0.72);
  border-radius: 0.3rem;
  background: rgba(5, 5, 5, 0.72);
  text-align: left;
}
.restart-help-box > strong { display: block; margin-bottom: 0.7rem; color: var(--color-accent); text-align: center; }
.restart-help-box ol { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; counter-reset: restart-help; font-size: 0.76rem; }
.restart-help-box li { display: grid; grid-template-columns: 1.35rem 1fr; gap: 0.45rem; align-items: start; line-height: 1.5; counter-increment: restart-help; }
.restart-help-box li::before {
  content: counter(restart-help);
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  color: var(--color-accent);
  font-size: 0.68rem;
}
.restart-error-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.restart-error-actions .btn-md { width: 100%; min-width: 0; }

@media (max-height: 720px) {
  .restart-logo { top: 0.8rem; width: min(52vw, 13rem); }
  .restart-error { margin-top: 3rem; }
  .restart-share-card { padding-block: 0.75rem; }
  .restart-help-box { margin-block: 0.8rem; }
}
/* Keep the same brand geometry in red, orange and found states, independent of body route classes. */
#heading-align-stage .align-brand {
  display: flex !important;
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(60%, 17rem);
  z-index: 10;
  pointer-events: none;
}
#heading-align-stage .align-brand img { width: 100%; height: auto; }
#share-x { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
#retry-ar-load[hidden], #video-fallback[hidden] { display: none !important; }
.ar-stage #video-fallback:not([hidden]) {
  display: grid !important;
  place-items: center;
  position: absolute;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  z-index: 30;
  gap: 0;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ar-stage #video-fallback .modal { position: relative; z-index: 1; }
.ar-stage:has(#video-fallback:not([hidden])) .ar-guide { display: none !important; }
.ar-stage #video-fallback .action-primary { width: 100%; margin-bottom: var(--spacing-xs); }
.ar-stage #video-fallback .action-secondary .icon { color: var(--color-icon-primary); }
.align-stage[data-band="green"] .align-message,
.align-stage[data-band="pause"] .align-message {
  display: grid !important;
  align-content: start;
  align-items: center;
  justify-items: center;
  width: max-content;
  height: fit-content !important;
  max-height: none;
  min-height: 0;
}
.align-stage[data-band="green"] .align-message #align-copy,
.align-stage[data-band="pause"] .align-message #align-copy {
  align-self: center;
  height: fit-content !important;
  max-height: none;
}
.align-stage[data-band="green"] .align-message #align-copy {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0;
  white-space: normal;
  text-align: center;
  color: #00ff97 !important;
}

.align-stage[data-band="green"] .align-message #align-copy::before,
#align-copy.has-align-mark::before,
#align-copy:has(.align-copy-mark)::before {
  content: none !important;
  display: none !important;
}

.align-copy-mark {
  display: block;
  width: auto;
  height: 24px;
  pointer-events: none;
  user-select: none;
}

.align-stage[data-band="red"] #align-copy.has-align-mark,
.align-stage[data-band="orange"] #align-copy.has-align-mark {
  padding-inline: 1.25rem;
}

.align-stage[data-band="green"] .align-message {
  padding-inline: 1.5rem;
}

.align-stage[data-band="green"] .align-copy-mark {
  height: 46px;
}
.align-stage[data-band="pause"] .align-message #align-copy {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  white-space: normal;
}

/* 2026-09-11 error-screen handoff (L1, L2, M1, M2 + reset timeout). */
.location-screen,
.motion-screen,
.permission-screen,
.out-area-screen,
.cm-tap-screen,
.ending-screen {
  align-content: center;
}

.modal.modal-error {
  background-color: #09090b;
  background-image:
    linear-gradient(171deg, #4e272a, #09090b 30%),
    linear-gradient(171deg, #e76f78, #61262d 30%, #56242a)
}

.modal.modal-gold {
  background-color: #1a140f;
  background-image:
    linear-gradient(171deg, #ad9774, #1a140f 30%),
    linear-gradient(171deg, #f8f3e4, #9f8b68 30%, #4f4430);
}

.modal-error .modal-hl { color: #d1d1d1; }
.modal-gold .modal-hl { color: #ffffff; }
.modal-hl-sm,
.modal-hl-sub {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: color-mix(in srgb, #f8f3e4 78%, transparent);
}

.error-icon {
  display: block;
  width: auto;
  height: 64px;
  margin-inline: auto;
}

/* Locked layout for the four gate error cards. */
.modal-s.modal-error {
  box-sizing: border-box;
  width: 100%;
  max-width: 19rem;
  height: 29rem;
  min-height: 29rem;
  padding: 2rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid transparent;
}

.modal-s.modal-gold {
  box-sizing: border-box;
  width: 100%;
  max-width: 19rem;
  height: 22rem;
  min-height: 22rem;
  padding: 2rem 1.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid transparent;
}

.modal-s.modal-error .error-icon {
  flex: 0 0 64px;
  width: auto;
  height: 64px;
  margin: 0 0 1.5rem;
}

.modal-s.modal-gold .error-icon {
  flex: 0 0 56px;
  width: auto;
  height: 56px;
  margin: 0 0 1.5rem;
}

.modal-s.modal-gold.restart-waiting-card .error-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
}

.modal-s.modal-error .error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
}

.modal-s.modal-gold .error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
}

.modal-s.modal-error .error-content .modal-hl {
  width: 100%;
  margin: 0 0 0.5rem !important;
}

.modal-s.modal-gold .error-content .modal-hl {
  width: 100%;
  margin: 0 0 1rem !important;
}

.modal-s.modal-error .error-content .modal-body,
.modal-s.modal-gold .error-content .modal-hl-sm,
.modal-s.modal-gold .error-content .modal-hl-sub {
  width: 100%;
  margin: 0;
}

.modal-s.modal-error .error-footer,
.modal-s.modal-gold .error-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  margin-top: 0;
}

.modal-s.modal-error .error-footer .divider-xs {
  width: 100%;
  margin: 1rem 0 0.85rem;
  opacity: 0.35;
}

.icon-help {
  -webkit-mask-image: url("./assets/icons/icon-help.svg");
  mask-image: url("./assets/icons/icon-help.svg");
}

.icon-ext {
  -webkit-mask-image: url("./assets/icons/icon-ext.svg");
  mask-image: url("./assets/icons/icon-ext.svg");
}

.error-help-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline: auto;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, #b5b5b5 50%, transparent);
  background: none;
  color: #b5b5b5;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  text-decoration: none;
  margin: var(--spacing-4xs) 0;
}

.error-help-link .icon {
  width: 14px;
  height: 14px;
  color: #b5b5b5;
}

.action-error-home {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  box-shadow: 0 10px 7px rgba(0, 0, 0, .9);
  background-color: var(--color-action-primary-bg, #70634B);
  background-image: url("./assets/images/btn-gold.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  background-origin: padding-box;
  background-clip: padding-box;
  color: #fff;
  font-size: 20px !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: var(--spacing-4xs);
}

.action-error-home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-light-gold, #C9B28F) 80%, transparent),
    color-mix(in srgb, var(--color-surface-border, #61503B) 50%, transparent)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.action-error-home .icon {
  width: 23px;
  height: 23px;
  color: #fff;
  margin-bottom: 2px;
}

.restart-error-actions .action-error-home {
  width: 100%;
  height: 42px;
  min-height: 42px;
  background-color: #2a2a30;
  background-image: url("./assets/images/btn-silver.webp");
  color: #d1d1d1;
  font-size: var(--text-sm);
  letter-spacing: 0;
}

.restart-error-actions .action-error-home::before {
  inset: -1px;
  background: linear-gradient(to bottom, rgba(209, 209, 209, .42), rgba(58, 58, 64, .65));
}

.restart-error-actions .action-error-home .icon,
.restart-error-actions .action-error-home .error-btn-icon {
  width: 18px;
  height: 18px;
  color: #d1d1d1;
}

.restart-error-card {
  width: min(100%, 18.5rem);
  max-width: 18.5rem;
  margin-inline: auto;
  padding: 1.5rem 1.15rem 1.35rem;
  gap: 1rem;
}

.restart-error-card .error-icon {
  height: 36px;
  margin: 0 auto .1rem;
}

.restart-error-card .modal-hl,
.restart-error-card .modal-body { margin: 0; }
.restart-error-card .modal-body { line-height: 1.8; }
.restart-error-card .divider-xs { width: 100%; margin: .2rem 0 .15rem; opacity: .35; }

.restart-help-title {
  margin: 0;
  color: #d1d1d1;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: .04em;
}

.restart-error-card .restart-help-box {
  width: 100%;
  margin: 0;
  padding: .95rem 1rem;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: rgba(10, 8, 10, .78);
  text-align: left;
}

.restart-error-card .restart-help-box ol {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: restart-help;
  color: #b5b5b5;
  font-size: .6875rem;
  line-height: 1.55;
}

.restart-error-card .restart-help-box li {
  display: grid;
  grid-template-columns: .95rem 1fr;
  gap: .4rem;
  align-items: start;
}

.restart-error-card .restart-help-box li::before {
  width: .78rem;
  height: .78rem;
  margin-top: .12rem;
  border-color: #8a8a8a;
  color: #b5b5b5;
  font-size: .45rem;
}

.restart-error-card .restart-error-actions {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  width: 100%;
  margin: .75rem 0 .5rem;
}

.restart-error-card .restart-error-actions .btn-md {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
}

.restart-error-card .error-btn-icon { width: 18px; height: 18px; }

.cooldown-screen:has(#restart-error:not([hidden])) {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0 1.25rem;
  background: #000;
}

.cooldown-screen:has(#restart-error:not([hidden])) > .screen-bg { display: none; }

.cooldown-screen:has(#restart-error:not([hidden])) > .restart-logo {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: min(9.5rem, 58vw);
  margin: max(1.5rem, env(safe-area-inset-top)) auto 0;
}

#restart-error:not([hidden]) {
  display: flex !important;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin-top: 0;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* 06 Camera / 08 Motion UI handoff. The card is centered in the live viewport;
   app.js aligns its action button with the native permission prompt action row. */
.cm-tap-screen.flow-permission-screen {
  min-height: 100svh;
  min-height: 100dvh;
  height: 100dvh;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  place-items: center;
  padding:
    max(12px, env(safe-area-inset-top))
    24px
    max(12px, env(safe-area-inset-bottom));
}

.cm-tap-screen .modal.modal-xs {
  box-sizing: border-box;
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-width: 19rem;
  height: 24rem;
  min-height: 24rem;
  margin: 0;
  padding: 2.5rem 1.75rem 2.5rem;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cm-tap-screen .modal-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  color: var(--color-light-gold);
  opacity: 1;
}

.cm-tap-screen .cm-tap-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
}

.cm-tap-screen .cm-tap-content .modal-hl {
  width: 100%;
  margin: 0;
}

.cm-tap-screen .cm-tap-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
}

.cm-tap-screen .cm-tap-footer .permission-try-button {
  flex: 0 0 auto;
}

/* 01 Reset Waiting / 02 Reset Ready — 2026-09-11 UI handoff. */
.cooldown-screen:has(#restart-waiting:not([hidden])),
.cooldown-screen:has(#restart-success:not([hidden])) {
  background: #000;
}

.cooldown-screen:has(#restart-waiting:not([hidden])) > .screen-bg,
.cooldown-screen:has(#restart-success:not([hidden])) > .screen-bg {
  display: none;
}

.cooldown-screen:has(#restart-waiting:not([hidden]))::after,
.cooldown-screen:has(#restart-success:not([hidden]))::after {
  display: none;
}

.cooldown-screen:has(#restart-waiting:not([hidden])),
.cooldown-screen:has(#restart-success:not([hidden])) {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0 1.25rem;
}

.cooldown-screen:has(#restart-waiting:not([hidden])) > .restart-logo,
.cooldown-screen:has(#restart-success:not([hidden])) > .restart-logo {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: min(9.5rem, 58vw);
  max-width: min(9.5rem, 58vw);
  margin: max(1.5rem, env(safe-area-inset-top)) auto 0;
}

#restart-waiting:not([hidden]),
#restart-success:not([hidden]) {
  display: flex !important;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin-top: 0;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

.restart-waiting {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 0;
}

.restart-waiting-card,
.restart-success-card {
  margin-inline: auto;
  backdrop-filter: none;
}

.restart-waiting-card .ending-share-action,
.restart-success-card .ending-share-action {
  margin: 0 auto;
}

.restart-success-card .restart-auto-caption {
  margin: 0.75rem 0 0;
  color: color-mix(in srgb, #f8f3e4 70%, transparent);
  font-size: var(--text-xs);
}

/* Align HUD — red / orange / green / AR */
#heading-align-stage::before,
.ar-stage::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

#heading-align-stage .align-camera,
.ar-stage .align-camera,
.ar-stage .ar-camera {
  z-index: 0 !important;
  transform: translateZ(0);
}

#heading-align-stage .align-scrim,
.ar-stage .align-scrim {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: translateZ(0);
  isolation: isolate;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent),
    linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  background-size: 100% 40%, 100% 40%;
  background-position: top, bottom;
  background-repeat: no-repeat;
}

#heading-align-stage::after,
.ar-stage::after,
.minimal-ui .ar-stage::after,
body.play-ar-page .ar-stage::after {
  z-index: 6;
  opacity: 0.6;
  background:
    linear-gradient(#d1d1d1, #d1d1d1) left  top    / 1.5rem 1px no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) left  top    / 1px 1.5rem no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) right top    / 1.5rem 1px no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) right top    / 1px 1.5rem no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) left  bottom / 1.5rem 1px no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) left  bottom / 1px 1.5rem no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) right bottom / 1.5rem 1px no-repeat,
    linear-gradient(#d1d1d1, #d1d1d1) right bottom / 1px 1.5rem no-repeat !important;
}

#heading-align-stage .align-back,
.ar-stage .align-back {
  top: calc(1.7rem - 2px);
  left: 1.3rem;
  z-index: 11;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  background: #d1d1d1;
  background-image: none;
  -webkit-mask: url("./assets/icons/icon-exit.svg") center / contain no-repeat;
          mask: url("./assets/icons/icon-exit.svg") center / contain no-repeat;
}

#heading-align-stage .align-visual,
.ar-stage .align-visual {
  z-index: 8;
}

#heading-align-stage .compass-widget::before,
#heading-align-stage .heading-needle,
.ar-stage .compass-widget::before,
.ar-stage .heading-needle {
  background: var(--color-light-gold);
}

#heading-align-stage .compass-widget,
.ar-stage .compass-widget {
  top: calc(max(0.85rem, env(safe-area-inset-top)) + 2px);
  width: 40px;
  height: 40px;
}

#heading-align-stage .heading-needle,
.ar-stage .heading-needle {
  width: 16px;
  height: 16px;
}
