:root{
  /* visual palette */
  --bg-surface: #F2EFE8;
  --panel: #FFFFFF;
  --text: #111111;
  --muted: #5A5A5A;
  --accent-blue: #0069B4;
  --accent-olive: #9AA63B;
  --success: #2CA34A;
  --danger: #B03A2E;
  --dir-token-stroke-width: 5.2;
  --dir-token-size: 1.25cap;
  
  /* spacing / layout */
  --safe-pad: 16px;
  --max-width: 720px;
  --btn-radius: 12px;
  --progress-height: 10px;
  
  /* layout heights used across file (centralised here) */
  --bottom-actions-height: 72px;  /* match .bottom-actions bottom offset/size */
  --bottom-footer-gap: 12px;  /* match .bottom-footer bottom offset */
  --safe-gap: 12px;  /* breathing room so content doesn't touch controls */
  --photo-button-height: 77px;
  --controls-clearance: calc(var(--bottom-actions-height) + var(--bottom-footer-gap) + var(--safe-gap) + 8px);

  /* available vertical space used for images etc. (derived) */
  --available-vertical-space: calc(100vh - var(--bottom-actions-height) - var(--bottom-footer-gap) - var(--safe-gap));

  /* breakpoint reference values (for humans / maintenance)
     NOTE: CSS custom properties are NOT fully usable inside @media(...) conditions
     across old browsers — these are for documentation and reuse in properties only. */
  --bp-xs: 380px; /* very small phones */
  --bp-sm: 520px; /* typical phone */
  --bp-md: 720px; /* tablet / small laptop */
  --bp-lg: 900px; /* large laptop / desktop */  
}

/* Base */
*{box-sizing:border-box}
html,body{height:100%; margin:0; background:var(--bg-surface); color:var(--text); font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial;}
html.is-duckduckgo-android,
html.is-duckduckgo-android body {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
html.is-ios-webkit,
html.is-ios-webkit body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
.site{
  max-width:var(--max-width);
  margin:0 auto;
  padding:var(--safe-pad);
  min-height: calc((var(--vh, 1vh) * 100) - var(--keyboard-height, 0px));
  display:flex;
  flex-direction:column;
  /* NOTE: removed fixed 90px bottom padding because bottom reserved space
     is handled precisely by the content-specific padding rules below.
     Keeping both caused double-reservation and created a huge gap. */
  padding-bottom: 0;
}

/* Title */
.title-block{padding-top:8px; text-align:center; margin-bottom:8px;}
.part-marker{color:var(--muted); font-family: "Cinzel", Georgia,serif; font-size:14px; margin-bottom:6px;}
.page-title {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.01em;
  line-height: 1.03;
  /* use the single source-of-truth text colour from :root */
  color: var(--text);

  /* layered shadows: faint top highlight, crisp carved edges, deeper blurred depth,
     plus a very subtle blue rim using the accent colour for a hint of character */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.35),               /* faint top highlight */
    0 1px 0 rgba(0,0,0,0.18),                     /* crisp thin edge (gives definition) */
    0 3px 4px rgba(0,0,0,0.22),                   /* main softened depth */
    0 6px 10px rgba(0,0,0,0.12),                  /* deeper blurred shadow */
    0 0 6px rgba(0,105,180,0.06);                 /* subtle blue rim from --accent-blue (#0069B4) */


  /* small additional polish for readability on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.subtitle{color:var(--muted); font-size:14px; margin-top:6px;}

/* center area */
.center-area{display:flex; flex-direction:column; gap:12px; align-items:stretch; justify-content:center; flex:1;}
body.input_focus .center-area{
  justify-content: flex-start;
}
body.input_focus .title-block,
body.input_focus .page-text {
  display: none !important;
}

/* image + footprint / anim layers
   (REPLACEMENT BLOCK - preserves animation display, aligns overlays, prevents overflow) */
.image-wrap{
  /* shrink-wrap to the image width so overlays will line up precisely */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;   /* containing block for absolute overlays */
}

/* main page image -- responsive width, and limit the height so it doesn't drop under controls */
#page-image{
  display: block;
  width: 72%; /* your chosen visual width */
  max-width: 72%;
  height: auto;
  box-sizing: border-box;
  /* keep image height within viewport minus expected control space */
  max-height: calc(100vh - 120px); /* 120px reserves header + footer; adjust later if needed */
  object-fit: contain;
  margin: 0 auto;
}

body.page-image-loading .image-wrap {
  min-height: min(40vh, 260px);
}

.page-image-loader {
  position: absolute;
  inset: 0;
  z-index: 48;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent-blue);
  pointer-events: none;
}

.page-image-loader[hidden] {
  display: none !important;
}

.page-image-loader__spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(0, 105, 180, 0.18);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: page-image-loader-spin 780ms linear infinite;
}

.page-image-loader__text {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

@keyframes page-image-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   IMAGE-ONLY PAGE LAYOUT (for page.type === "image")
   - Makes the image occupy the central area proportionally (no cropping)
   - Never overlaps bottom-actions / bottom-footer (we reserve space via variables)
   - Allows image to use the title area (title collapsed) but does not hide the fullscreen
     toggle button (that button is fixed and has higher z-index)
   ========================= */
.image-page .image-wrap {
  /* occupy the available vertical space (this is calculated from :root var earlier) */
  height: calc(var(--available-vertical-space));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  gap: 0;
  position: relative; /* keep overlays positioned correctly */
}

/* Hide the textual content (page-text + answers) while keeping animation overlays */
.image-page .content {
  display: none !important;
}

/* Collapse title visually so the image can use that vertical space; keeps the element in DOM */
.title-block--collapsed {
  margin: 0;
  padding: 0;
  height: 0;
  overflow: hidden;
  line-height: 0;
  min-height: 0;
}

/* Make the image scale to fill the image-wrap vertically without cropping.
   Width is auto so aspect ratio is preserved; max-width prevents overflow on narrow viewports. */
.image-page #page-image {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Ensure overlays (footprints, anim-host, feedback-ui) continue to fill the image area */
.image-page .footprints,
.image-page .anim-host,
.image-page .feedback-ui {
  inset: 0;
  position: absolute;
  width: 100%;
  height: 100%;
}

/* Small portrait tweak: allow a little more top breathing room for notches/buttons */
@media (orientation: portrait) {
  .image-page .image-wrap {
    padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
  }
}

/* footprints overlay specifics: overlay exactly covers the image-wrap content box */
.footprints{
  position: absolute;
  inset: 0;                  /* top:0; right:0; bottom:0; left:0; -> fills the image-wrap */
  pointer-events: none;
  display: none;             /* shown only during animation */
  box-sizing: border-box;
  z-index: 30;
}

/* anim-host overlay (rewards/confetti) — same containment as footprints */
.anim-host{
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  box-sizing: border-box;
  z-index: 40;
}

/* When overlays are shown, show them (your JS can toggle either display or the .show class) */
.image-wrap .footprints.show,
.image-wrap .anim-host.show {
  display: block;
}

/* Safety: prevent any pseudo-element inside image-wrap from accidentally injecting icons */
.image-wrap::before,
.image-wrap::after,
.image-wrap *::before,
.image-wrap *::after {
  content: none !important;
  display: none !important;
}

/* Portrait safety: slightly increase width but reserve extra vertical space */
@media (orientation: portrait) {
  #page-image {
    width: 84%;
    max-width: 84%;
    max-height: calc(100vh - 140px); /* reserve extra space for header/footer on short phones */
  }
  .footprints, .anim-host {
    inset: 0;
    width: 100%;
  }
}

body[data-page-type="title"] #page-image {
  max-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - 118px) !important;
}

@media (orientation: portrait) {
  body[data-page-type="title"] #page-image {
    max-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - 132px) !important;
  }
}

/* content */
.content{width:100%; max-width:820px; margin: 0 auto; padding:6px 12px calc(var(--controls-clearance) + env(safe-area-inset-bottom, 0px));}
.page-text{font-size:18px; line-height:1.45; color:var(--text); white-space:pre-wrap; text-align:left; margin-bottom:12px;}
.page-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  white-space: normal;
}
.page-link {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: none;
}
.page-link:visited {
  color: var(--accent-blue);
}
.page-link:focus-visible {
  outline: 3px solid rgba(0, 105, 180, 0.24);
  outline-offset: 3px;
}

.dir-token{
  display:inline-block;
  width:calc(var(--dir-token-size) * var(--dir-token-ratio, 1));
  height:calc(var(--dir-token-size) * var(--dir-token-height-mult, 1));
  margin-right:0.24em;
  vertical-align:baseline;
  --dir-token-ratio: 1;
  --dir-token-height-mult: 1;
  --dir-token-baseline-mult: 0;
  line-height:0;
  overflow:visible;
  transform: translateY(calc(var(--dir-token-size) * var(--dir-token-baseline-mult)));
}

.dir-token__img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  object-position:center bottom;
}

.dir-token[data-token="straight"]{
  --dir-token-ratio: 0.510978;
}

.dir-token[data-token="left"],
.dir-token[data-token="right"]{
  --dir-token-ratio: 0.8782;
}

.dir-token[data-token="stairs"],
.dir-token[data-token="stairs_up"]{
  --dir-token-ratio: 0.964286;
}

.dir-token[data-token="stairs_down"]{
  --dir-token-ratio: 0.981781;
}

.dir-token[data-token="stop"]{
  --dir-token-ratio: 0.617822;
}

.dir-token[data-token="warning"]{
  --dir-token-ratio: 1;
}

.dir-token[data-token="arch"]{
  --dir-token-ratio: 0.816;
}

/* answers */
.answers{display:flex; flex-direction:column; gap:10px;}
body[data-page-id="part17_page02_thanks"] .content {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
}
body[data-page-id="part17_page02_thanks"] .center-area {
  justify-content: center;
  min-height: 0;
  padding-bottom: var(--controls-clearance);
}
body[data-page-id="part17_page02_thanks"] .title-block {
  display: none;
}
body[data-page-id="part17_page02_thanks"] .image-wrap {
  flex: 0 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
body[data-page-id="part17_page02_thanks"] #page-image,
body[data-page-id="part17_page02_thanks"] #footprints,
body[data-page-id="part17_page02_thanks"] .feedback-ui {
  display: none !important;
}
body[data-page-id="part17_page02_thanks"] #answers {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 0;
  padding-bottom: 0;
  gap: 20px;
}
body[data-page-id="part17_page02_thanks"] #answers:empty {
  display: none;
}
.photo-inline-slot {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--photo-button-height);
}
.photo-inline-button {
  flex: 0 0 auto;
  margin: 0;
}
.brand-logo-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.brand-logo {
  display: block;
  width: min(54vw, 220px);
  max-height: 24vh;
  object-fit: contain;
}
.brand-logo-slot--access {
  margin-top: 10px;
}
.brand-logo-slot--access .brand-logo {
  width: min(50vw, 190px);
  max-height: 18vh;
}
.brand-logo-slot--final-photo {
  position: static;
  flex: 0 1 var(--final-logo-max-height, 100px);
  width: 100%;
  height: var(--final-logo-max-height, 100px);
  max-height: var(--final-logo-max-height, 100px);
  min-height: 0;
  margin: 0;
  align-items: center;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}
.brand-logo-slot--final-photo .brand-logo {
  width: 100%;
  height: 100% !important;
  max-width: 100%;
  max-height: var(--final-logo-max-height, 100px) !important;
  object-fit: contain;
  object-position: center;
}
.write-field,
.input-complete {
  position: relative;
  overflow: visible;
}

.access-code-message {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
}

.keyboard-close-host {
  padding-top: 48px;
}
.option{
  border:1px solid rgba(0,0,0,0.08);
  border-radius:12px;
  padding:12px;
  background:transparent;
  color: var(--text);
  cursor:pointer;
  text-align:left;
  font-size:16px;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.option.selected{
  border-color:#000;
  background: rgba(0,105,180,0.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}
.option.multiline{white-space:normal;}
.play-mode {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.play-mode__label {
  width: 100%;
  text-align: left;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 400;
  color: var(--text);
}
.play-mode__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 520px);
}
.play-mode-option {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
}
.photo-booth {
  width: 100%;
  display: flex;
  justify-content: center;
}
.photo-booth-source-step {
  display: flex;
  justify-content: center;
  width: min(100%, 124px);
  margin: 6px auto 0;
}
.photo-booth-source {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.photo-booth-source__label {
  color: var(--text);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}
.photo-booth-source__button {
  width: 100%;
  height: 91px;
  border: none;
  border-radius: var(--btn-radius, 12px);
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}
.photo-booth-source__button::after {
  content: "";
  position: absolute;
  inset: -90%;
  background: linear-gradient(90deg, transparent 0%, transparent 43%, rgba(255, 184, 28, 0.3) 47%, rgba(255, 246, 176, 1) 50%, rgba(255, 184, 28, 0.35) 53%, transparent 58%, transparent 100%);
  filter: drop-shadow(0 0 8px rgba(255, 220, 80, 0.9));
  transform: translate(-48%, -48%) rotate(60deg);
  animation: photo-booth-shine 2s linear infinite;
  pointer-events: none;
  z-index: 1;
}
.photo-booth-source__button:focus-visible {
  outline: 3px solid rgba(0,105,180,0.24);
  outline-offset: 2px;
}
.photo-booth-source__icon {
  width: 91px;
  height: 68px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 2;
}
@keyframes photo-booth-shine {
  0% {
    transform: translate(-48%, -48%) rotate(60deg);
  }
  100% {
    transform: translate(48%, 48%) rotate(60deg);
  }
}
@keyframes photo-button-shine {
  0% {
    left: -310%;
    top: -225%;
  }
  100% {
    left: 120%;
    top: 300%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .photo-booth-source__button::after {
    animation: none;
    opacity: 0;
  }
}
.photo-booth-file-input {
  display: none;
}
.photo-booth-warning {
  width: 100%;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
body[data-page-id="part17_page03_photo"] .photo-booth-warning {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  width: auto;
  z-index: 58;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(242,239,232,0.88);
}
.photo-booth-warning[hidden] {
  display: none;
}
.photo-booth-warning::before {
  content: "";
  width: 1em;
  height: 1em;
  display: inline-block;
  background: url("assets/svg/text_symbols/warning.svg") center / contain no-repeat;
  flex: 0 0 auto;
}
.photo-booth-placeholder {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
  text-align: center;
}
.photo-booth-placeholder[hidden] {
  display: none !important;
}
.photo-share {
  position: fixed;
  inset: 0 0 var(--controls-clearance) 0;
  width: 100vw;
  min-height: 0;
  padding: 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(242,239,232,0.92);
  z-index: 55;
}
.photo-share[hidden] {
  display: none !important;
}
.photo-share__preview {
  display: block;
  width: auto;
  height: min(100%, calc((var(--vh, 1vh) * 100) - 112px));
  max-width: min(92vw, 420px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.2);
  background: #f3efe6;
}
.photo-share__meta {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 0;
  margin-top: 0;
}
.photo-share__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(100%, 520px);
}

html.is-ios-webkit .photo-share {
  justify-content: flex-start;
  overflow: auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

html.is-ios-webkit .photo-share__preview {
  width: auto;
  height: auto;
  max-width: min(86vw, 360px);
  max-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - env(safe-area-inset-top, 0px) - 132px);
  flex: 0 1 auto;
}

@media (max-width:700px){
  .play-mode__label{font-size:16px;}
}
.photo-share__button,
.photo-consent__submit {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent-blue);
  color: #fff;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.photo-share__button--primary {
  background: var(--accent-olive);
}
.photo-share__button:disabled,
.photo-consent__submit:disabled {
  cursor: default;
  opacity: 0.55;
}
.photo-consent {
  position: fixed;
  inset: 0 0 var(--controls-clearance) 0;
  width: 100vw;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(242,239,232,0.96);
  z-index: 56;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.photo-consent[hidden] {
  display: none !important;
}
.photo-consent__panel {
  width: min(100%, 640px);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: calc(var(--keyboard-height, 0px) + 72px);
  padding: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

body.input_focus .photo-consent,
body.ios_input_focus .photo-consent {
  inset: 0 0 calc(var(--keyboard-height, 0px) + 8px) 0;
  align-items: flex-start;
  justify-content: flex-start;
}

body.input_focus .photo-consent__panel,
body.ios_input_focus .photo-consent__panel {
  max-height: 100%;
}

.photo-consent--social-focus .photo-consent__panel {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
}

.photo-consent__keyboard-spacer {
  display: block;
  flex: 0 0 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.photo-consent--social-focus .photo-consent__keyboard-spacer {
  flex-basis: max(var(--keyboard-height, 0px), 45vh, 260px);
  height: max(var(--keyboard-height, 0px), 45vh, 260px);
}
.photo-consent__title {
  margin: 0 0 10px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  font-size: 19px;
  line-height: 1.15;
}
.photo-consent__choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 10px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.photo-consent__choice input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent-blue);
}
.photo-consent__note,
.photo-consent__contact,
.photo-consent__social {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.photo-consent__contact {
  color: var(--text);
  font-weight: 700;
}
.photo-consent__field {
  margin-top: 12px;
}
.photo-consent__field[hidden] {
  display: none !important;
}
.photo-consent__field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.photo-consent__social-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.photo-consent__social-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.photo-consent__input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}
.photo-consent__error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.photo-consent__submit {
  width: 100%;
  margin-top: 12px;
}
.photo-consent-complete {
  position: fixed;
  inset: 0 0 var(--controls-clearance) 0;
  width: 100vw;
  background: rgba(242,239,232,0.96);
  z-index: 56;
}
body[data-page-id="part17_page03_photo"][data-photo-booth-step="consent"] #bottom-actions {
  display: none !important;
}
body[data-page-id="part17_page03_photo"][data-photo-booth-step="consent"] .photo-consent {
  inset: 0 0 calc(var(--bottom-footer-gap, 12px) + var(--safe-gap, 12px)) 0;
}
body[data-page-id="part17_page03_photo"][data-photo-booth-step="complete"] .photo-consent-complete {
  inset: 0 0 var(--controls-clearance) 0;
}
.photo-adjust {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - 120px);
}
.photo-adjust-preview {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.photo-frame-preview {
  position: relative;
  width: min(96vw, 430px);
  aspect-ratio: 9 / 16;
  max-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - 18px);
  overflow: hidden;
  background: #f3efe6;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.photo-frame-preview__background,
.photo-frame-preview__foreground {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.photo-frame-preview__background {
  z-index: 0;
}
.photo-frame-preview__foreground {
  z-index: 5;
}
.photo-frame-preview__text {
  position: absolute;
  box-sizing: border-box;
  color: #000;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow:
    0 0 calc(var(--photo-frame-scale, 1px) * 8) rgba(184,145,70,0.95),
    calc(var(--photo-frame-scale, 1px) * 1.4) calc(var(--photo-frame-scale, 1px) * 1.4) 0 rgba(184,145,70,0.68);
}
.photo-frame-preview__team,
.photo-frame-preview__percent,
.photo-frame-preview__date {
  white-space: nowrap;
  text-overflow: ellipsis;
}
.photo-frame-preview__date {
  gap: 0;
}
.photo-adjust-frame {
  position: absolute;
  width: min(100%, 430px);
  max-height: calc((var(--vh, 1vh) * 100) - var(--controls-clearance) - 112px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 2px solid #d9bd72;
  border-radius: 8px;
  background: rgba(0,0,0,0.06);
  touch-action: none;
  z-index: 1;
}
.photo-adjust-image {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.photo-adjust-hint {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(73, 78, 86, 0.32);
  -webkit-backdrop-filter: blur(2px) saturate(0.9);
  backdrop-filter: blur(2px) saturate(0.9);
  z-index: 9400;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-adjust-hint[hidden] {
  display: none !important;
}
body.photo-adjust-hint-open #bottom-actions {
  pointer-events: none !important;
  filter: blur(2px) saturate(0.9);
  opacity: 0.52;
  transition: filter 140ms ease, opacity 140ms ease;
}
.option,
.write-field,
.input-complete,
.warning {
  scroll-margin-bottom: calc(var(--controls-clearance) + 8px);
}

/* inputs */
.input-text, .input-complete{
	width: 100%;
	padding: var(--safe-pad);
	border-radius: 10px;
	border: 1px solid rgba(0,0,0,0.08);
	font-size: 16px;
	font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
	line-height: 1.2;}
input[data-chrome-game-input="true"] {
  -webkit-appearance: none;
  appearance: none;
}
input[data-chrome-game-input="true"]::-webkit-search-decoration,
input[data-chrome-game-input="true"]::-webkit-search-cancel-button,
input[data-chrome-game-input="true"]::-webkit-search-results-button,
input[data-chrome-game-input="true"]::-webkit-search-results-decoration {
  display: none;
}

html.is-ios-webkit .content {
  padding-bottom: calc(var(--controls-clearance) + env(safe-area-inset-bottom, 0px) + 40px);
}

html.is-ios-webkit .option {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

html.is-ios-webkit .input-text,
html.is-ios-webkit .input-complete,
html.is-ios-webkit .photo-consent__input,
html.is-ios-webkit .complete-slot {
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
}

html.is-ios-webkit .input-text::placeholder,
html.is-ios-webkit .photo-consent__input::placeholder {
  font-size: inherit !important;
}

html.is-ios-webkit .complete-fixed {
  font-size: 16px !important;
}

html.is-ios-webkit .input-complete.input-complete--pattern {
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

html.is-ios-webkit .complete-slot {
  width: 29px;
  min-width: 26px;
  height: 37px;
  min-height: 34px;
  margin-left: 1px;
  margin-right: 1px;
}

html.is-ios-webkit body.ios_input_focus #bottom-actions,
html.is-ios-webkit body.ios_input_focus #bottom-footer {
  display: none !important;
}

html.is-ios-webkit body.ios_input_focus .content {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
}

html.is-chrome-android #content,
html.is-chrome-android .answers {
  font-size: 20px;
  line-height: 1.48;
}

html.is-chrome-android .page-text,
html.is-chrome-android .play-mode__label,
html.is-chrome-android .write-field__label {
  font-size: 20px;
  line-height: 1.48;
}

html.is-chrome-android .answers .option {
  font-size: 20px;
  line-height: 1.42;
}

html.is-chrome-android .input-text,
html.is-chrome-android .input-complete,
html.is-chrome-android .photo-consent__input {
  font-size: 18px;
  line-height: 1.25;
}

html.is-chrome-android .input-text::placeholder,
html.is-chrome-android .photo-consent__input::placeholder {
  font-size: inherit;
  line-height: inherit;
}

html.is-chrome-android .complete-slot,
html.is-chrome-android .complete-fixed {
  font-size: 18px;
}

html.is-duckduckgo-android #content,
html.is-duckduckgo-android .answers {
  font-size: 15px !important;
  line-height: 1.38 !important;
}

html.is-duckduckgo-android .page-text,
html.is-duckduckgo-android .play-mode__label,
html.is-duckduckgo-android .write-field__label {
  font-size: 15px !important;
  line-height: 1.38 !important;
}

html.is-duckduckgo-android .answers .option,
html.is-duckduckgo-android .input-text,
html.is-duckduckgo-android .input-complete,
html.is-duckduckgo-android .photo-consent__input,
html.is-duckduckgo-android .complete-slot,
html.is-duckduckgo-android .complete-fixed,
html.is-duckduckgo-android .btn,
html.is-duckduckgo-android .photo-share__button,
html.is-duckduckgo-android .photo-consent__submit {
  font-size: 15px !important;
  line-height: 1.25 !important;
}

html.is-duckduckgo-android .input-text::placeholder,
html.is-duckduckgo-android .photo-consent__input::placeholder {
  font-size: inherit !important;
}

html.is-duckduckgo-android .page-title {
  font-size: 27px !important;
}

html.is-duckduckgo-android .part-marker,
html.is-duckduckgo-android .subtitle,
html.is-duckduckgo-android .part-indicator {
  font-size: 13px !important;
}

html.text-size-large #content,
html.text-size-large .answers {
  font-size: 22px !important;
  line-height: 1.5 !important;
}

html.text-size-large .page-text,
html.text-size-large .play-mode__label,
html.text-size-large .write-field__label {
  font-size: 22px !important;
  line-height: 1.5 !important;
}

html.text-size-large .answers .option {
  font-size: 22px !important;
  line-height: 1.42 !important;
}

html.text-size-large .input-text,
html.text-size-large .input-complete,
html.text-size-large .photo-consent__input,
html.text-size-large .complete-slot,
html.text-size-large .complete-fixed {
  font-size: 20px !important;
}

html.text-size-large .input-text::placeholder,
html.text-size-large .photo-consent__input::placeholder {
  font-size: inherit !important;
}

.text-size-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.text-size-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
  color: var(--text);
  padding: 14px;
  text-align: left;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  cursor: pointer;
}

.text-size-choice.selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0,105,180,0.14);
}

.text-size-choice__title {
  font-weight: 800;
}

.text-size-choice__hint {
  color: var(--muted);
}

.text-size-choice--standard .text-size-choice__title,
.text-size-choice--standard .text-size-choice__body {
  font-size: 16px !important;
  line-height: 1.38 !important;
}

.text-size-choice--standard .text-size-choice__hint {
  font-size: 13px !important;
  line-height: 1.3 !important;
}

.text-size-choice--large .text-size-choice__title,
.text-size-choice--large .text-size-choice__body {
  font-size: 21px !important;
  line-height: 1.38 !important;
}

.text-size-choice--large .text-size-choice__hint {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

/* Complete-mode (pattern) styles */
.input-complete.input-complete--pattern {
  display: block;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  color: var(--text);
  text-align: center;
  white-space: normal; /* stops breaking words weirdly*/
  word-break: keep-all; /* stops breaking words weirdly*/
  
}

.input-complete.input-complete--pattern.keyboard-close-host {
  padding-top: 48px;
}
/* individual letter boxes (user-entered characters) */
.complete-slot {
  /* mobile-first baseline: typical smartphone */
  width: 33px;
  min-width: 28px;
  height: 40px;
  min-height: 34px;
  padding: 0;
  font-size: 16px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  font-weight: 600;
  text-align: center;
  text-indent: 0;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  outline: none;
  margin-right: 2px;
  margin-left: 2px;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
}

.complete-slot:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 6px 18px rgba(0,105,180,0.12);
}

/* fixed (non-editable) characters that appear between/around boxes */
.complete-fixed {
  display: inline;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  color: var(--text);
  margin-right: 0px;
  margin-left: 0px;
  white-space: normal;
  vertical-align: middle;
}

/* hidden input used for validation (keeps same class .input-text so old code works) */
.input-complete-hidden { display: none !important; }

/* responsive adjustments */
/* very small phones */
@media (max-width:380px) {
  .complete-slot { width: 28px; height: 34px; font-size: 14px; }
  .complete-fixed { font-size: 14px; }
}

/* typical smartphones */
@media (min-width:381px) and (max-width:520px) {
  .complete-slot { width: 33px; height: 40px; font-size: 16px; }
  .complete-fixed { font-size: 16px; }
}

/* tablets / laptop: slightly larger slots */
@media (min-width:721px) {
  .complete-slot { width: 42px; height: 48px; font-size: 20px; }
  .complete-fixed { font-size: 18px; }
}

body[data-page-id="part16_page05_questions"].input_focus #page-image {
  width: auto;
  max-width: 56%;
  max-height: min(24vh, 180px);
}

body[data-page-id="part16_page05_questions"].input_focus .image-wrap {
  flex: 0 0 auto;
  gap: 4px;
}

/* small bottom padding so focused inputs can sit above keyboards / toolbars */
.answers {
  padding-bottom: 14px;
}

/* warning */
/* warning — hidden by default; only shown when .visible is added */
.warning{
  min-height:22px;
  color:var(--danger);
  font-size:14px;
  margin-top:4px;
  font-weight:700;
  display:none;              /* hide by default so icon won't flash */
  align-items:center;
  gap:8px;
  box-sizing: border-box;
  position: relative;
  z-index: 70;
}

/* show state */
.warning.visible{
  display:flex;
  animation: warning-pop 220ms ease-out;
}

.warning.warning-pop{
  animation: warning-pop 220ms ease-out;
}

/* glyph only present when visible */
.warning.visible::before{
  content: "";
  width: 1em;
  height: 1em;
  display: inline-block;
  background: url("assets/svg/text_symbols/warning.svg") center / contain no-repeat;
  margin-right:8px;
  flex: 0 0 auto;
}

@keyframes warning-pop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* bottom actions fixed above footer */
.bottom-actions{
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 16px var(--safe-pad);
}

.bottom-actions .inner{
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Footer layout fix: keep part indicator and progress on one line */

#bottom-footer .inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

#part-indicator {
  white-space: nowrap;
  flex: 0 0 auto;
}

#progress {
  flex: 1 1 auto;
  min-width: 0;
}

#progress-bar {
  width: 100%;
}

#keyboard-close{
  position: absolute;
  left: 50%;
  right: auto;
  top: 8px;
  bottom: auto;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: var(--accent-blue) !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  z-index: 9999;
}

.keyboard-close__icon{
  display: block;
  width: 11px;
  height: 11px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg) translate(1px, 1px);
}

#keyboard-close[hidden]{
  display: none !important;
}

/* Buttons */
.btn{
  min-width: 90px;
  padding: 10px 14px;
  border-radius: var(--btn-radius, 10px);
  border: none;
  font-weight: 700;
  color: #fff;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.btn.center{ background: var(--accent-olive); } /* SUBMIT */
.btn.ghost{ 
  background: transparent; 
  border: 1px solid rgba(0,0,0,0.08); 
  color: var(--text); 
  }
.btn.photo {
  --photo-shine-angle: 70deg;
  --photo-shine-duration: 2s;
  --photo-shine-thickness: 72%;
  width: 105px;
  height: var(--photo-button-height);
  min-width: 105px;
  padding: 0;
  border-radius: var(--btn-radius, 12px);
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.btn-photo-shine {
  display: block;
  position: absolute;
  top: -225%;
  left: -310%;
  width: 340%;
  height: var(--photo-shine-thickness);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 205, 47, 0) 18%,
    rgba(255, 205, 47, 0.2) 31%,
    rgba(255, 244, 144, 0.62) 45%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 229, 75, 0.55) 56%,
    rgba(255, 184, 28, 0.18) 69%,
    rgba(255, 205, 47, 0) 82%,
    transparent 100%
  );
  filter: blur(1.8px) drop-shadow(0 0 10px rgba(255, 233, 120, 0.85));
  opacity: 0.86;
  mix-blend-mode: screen;
  transform: rotate(var(--photo-shine-angle));
  transform-origin: center;
  animation: photo-button-shine var(--photo-shine-duration) linear infinite;
  pointer-events: none;
  z-index: 1;
}
.btn-photo-shine::before,
.btn-photo-shine::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.btn-photo-shine::before {
  inset: 36% -8%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 246, 167, 0.14) 24%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 207, 45, 0.18) 76%,
    transparent 100%
  );
  filter: blur(0.55px);
  opacity: 0.78;
}
.btn-photo-shine::after {
  inset: -95% 12%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 250, 198, 0.62) 0%,
    rgba(255, 215, 60, 0.32) 28%,
    rgba(255, 184, 28, 0.06) 55%,
    transparent 72%
  );
  filter: blur(7px);
  opacity: 0.9;
}
.btn-photo-icon {
  width: 77px;
  height: 58px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 2;
}
.btn[disabled]{ 
  opacity: 0.45; 
  cursor: not-allowed; 
  }
/* visually emulate native disabled look but allow clicks so JS can handle them */
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  /* NOTE: do not set pointer-events: none; we want clicks to reach JS handlers */
}

.bottom-actions.is-busy .btn {
  opacity: 0.4 !important;
  pointer-events: none;
}

/* footer: progress + part indicator below buttons */
.bottom-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0; /* keep the footer/page indicator fixed; let the keyboard cover it */
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}
.bottom-footer .inner{
  width: 100%;
  max-width: var(--max-width, 1100px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--safe-pad, 12px);
  gap: 12px;
  pointer-events: auto; /* allow clicks on progress inner controls if any */
}
.progress-bar{
  height: var(--progress-height, 12px);
  width: 60%;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}
.progress-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%);
  transition: width 420ms ease;
}
.part-indicator{
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  color: var(--muted, #777);
}

html.is-fullscreen body.input_focus main,
html.is-fullscreen body.input_focus .content,
html.is-fullscreen body.input_focus #content {
  box-sizing: border-box;
  padding-bottom: calc(var(--bottom-actions-height) + var(--bottom-footer-gap) + var(--safe-gap) + var(--keyboard-height, 0px));
}

/* Keep bottom-actions above the footer and clickable */
.bottom-actions {
  bottom: calc(var(--bottom-footer-gap) + var(--safe-gap));
  z-index: 60;
  pointer-events: auto;
}

html.is-fullscreen body.input_focus .bottom-actions {
  bottom: calc(var(--bottom-footer-gap) + var(--safe-gap) + var(--keyboard-height, 0px)) !important;
}

/* Limit large images to the available vertical space so content fits without scrolling */
main img, .inner img, .content img, #content img {
  max-height: calc(var(--available-vertical-space));
  object-fit: contain;
  height: auto;
}

/* modal (help confirmation) */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,0.6); display:flex; align-items:center; justify-content:center; z-index:200;
}

.transfer-modal-backdrop,
.transfer-blocked-backdrop {
  z-index: 100500;
}

body.transfer-modal-open #fullscreen-guard {
  display: none !important;
}
.modal{
  background:var(--panel); padding:18px; border-radius:12px; max-width:92%; width:360px; box-shadow:0 20px 60px rgba(0,0,0,0.25); color:var(--text);
  /* use the site's base/system font stack so modal text matches the Base rules */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.modal h3{
  margin:0 0 8px 0;
  font-size:18px;
  font-weight:700;
  /* make the heading use the same base/system font and color as the rest of the modal */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}
.modal .modal-body{font-size:15px; color:var(--muted); margin-bottom:12px;}
.modal .modal-actions{display:flex; gap:10px; justify-content:flex-end;}
.modal .modal-actions .btn{min-width:80px;}

.runtime-modal-backdrop {
  z-index: 2147483646;
}

.runtime-modal {
  width: min(92vw, 390px);
  padding: 22px 20px;
  text-align: center;
}

.runtime-modal h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  margin-bottom: 14px;
}

.runtime-modal__body {
  line-height: 1.45;
  text-align: left;
}

.runtime-modal__body p {
  margin: 0;
}

.runtime-modal__body p + p {
  margin-top: 12px;
}

.runtime-modal .runtime-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.runtime-modal .runtime-modal__button {
  min-height: 50px;
  width: 100%;
}

.javascript-required {
  background: var(--panel);
  border: 1px solid var(--muted);
  margin: 24px auto;
  max-width: 560px;
  padding: 24px;
  text-align: center;
}

/* responsiveness */
@media (max-width:700px){
  .page-title{font-size:28px;}
  #page-image{max-width:86%;}
  .page-text{font-size:16px;}
  .progress-bar{width:58%;}
}
@media (max-width:700px){
  html.is-chrome-android .page-title{font-size:31px;}
  html.is-chrome-android .part-marker,
  html.is-chrome-android .subtitle{font-size:15px;}
  html.is-chrome-android .btn{font-size:16px;}
  html.is-chrome-android .part-indicator{font-size:14px;}
}
@media (orientation:landscape) and (max-width:900px){
  .center-area{justify-content:center;}
  #page-image{max-width:46%;}
}

/* helpers */
.hidden{display:none !important;}

/* ===== Surgical fix: anchor the bottom-actions bar above the fixed footer =====
   REPLACEMENT BLOCK. Purpose:
   - Make #bottom-actions a fixed bar anchored above #bottom-footer so it never scrolls away.
   - Keep it horizontally stretched (left:0/right:0) while inner content centers via .inner max-width.
   - Ensure it is clickable (pointer-events), stacked above footer (z-index), and resistant to other stray rules.
   ONLY TOUCHES #bottom-actions / .bottom-actions rules. */
#bottom-actions, .bottom-actions {
  position: fixed !important; /* <-- CRITICAL: take element out of flow and anchor it to viewport */
  top: auto !important; /* ensure any stray top is removed */
  bottom: calc(var(--bottom-footer-gap, 12px) + var(--safe-gap, 12px)) !important; /* sits just above footer */
  left: 0 !important;
  right: 0 !important;

  /* Layout + sizing (kept compact) */
  display: flex !important;
  align-items: center !important;
  height: auto !important;
  padding: 0 var(--safe-pad, 12px) !important;
  box-sizing: border-box !important;

  /* Make sure it is interactive and appears above the footer */
  pointer-events: auto !important;
  z-index: 60 !important;
}

/* ensure inner bar content is centered, spaced and vertically aligned */
#bottom-actions .inner, .bottom-actions .inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

html.is-ios-webkit #bottom-actions,
html.is-ios-webkit .bottom-actions {
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--bottom-footer-gap, 12px) + var(--safe-gap, 12px)) !important;
}

html.is-ios-webkit #bottom-footer,
html.is-ios-webkit .bottom-footer {
  bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* --------------------------
   iOS fullscreen warning toast (temporary message if fullscreen is not allowed)
   -------------------------- */
.ios-fullscreen-warning {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-actions-height, 72px) + 16px); /* appears just above the button row */
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 220;
  max-width: 92%;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  pointer-events: none; /* toast is informational only */
}

#fullscreen-guard {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(73, 78, 86, 0.32);
  -webkit-backdrop-filter: blur(2px) saturate(0.9);
  backdrop-filter: blur(2px) saturate(0.9);
  z-index: 9500;
  cursor: pointer;
  touch-action: manipulation;
}

#fullscreen-guard[hidden] {
  display: none !important;
}

.fullscreen-guard__panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 360px);
  padding: 22px 20px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(242,239,232,0.96);
  color: var(--text);
  text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
}

.fullscreen-guard__title {
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
}

.fullscreen-guard__body {
  font-size: 1rem;
  line-height: 1.35;
}

body.game-paused #app > :not(#fullscreen-toggle-fixed):not(#fullscreen-guard):not(.transfer-modal-backdrop):not(.transfer-blocked-backdrop),
body.game-landscape-blocked #app > :not(#fullscreen-toggle-fixed):not(#fullscreen-guard):not(.transfer-modal-backdrop):not(.transfer-blocked-backdrop) {
  pointer-events: none;
  opacity: 0.34;
  filter: grayscale(0.2);
  transition: opacity 180ms ease, filter 180ms ease;
}

body.game-paused #app > .transfer-modal-backdrop,
body.game-paused #app > .transfer-blocked-backdrop,
body.game-landscape-blocked #app > .transfer-modal-backdrop,
body.game-landscape-blocked #app > .transfer-blocked-backdrop {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

body.game-paused #app *,
body.game-landscape-blocked #app * {
  animation-play-state: paused !important;
}

body.game-landscape-blocked #app > :not(#fullscreen-toggle-fixed):not(#fullscreen-guard) {
  opacity: 0.18;
  filter: grayscale(0.45);
}

body.game-landscape-blocked #fullscreen-guard {
  cursor: default;
}

/* ===== Force light theme / ensure controls visible when #app is fullscreen =====
   Replace any previous snippet you added that used these selectors. */
:root, html, body, #app {
  /* tell the UA we want a light color scheme and prevent forced adjustments */
  color-scheme: light !important;
  forced-color-adjust: none !important;

  /* make sure color / background fallbacks exist if your variables are missing */
  background-color: var(--bg-surface, #F2EFE8) !important;
  color: var(--text, #111111) !important;

  /* avoid webkit text-fill color being overridden by UA changes */
  -webkit-text-fill-color: unset !important;
}

/* Fullscreen selectors (multiple vendor forms for broad support) */
#app:-webkit-full-screen,
#app:-moz-full-screen,
#app:-ms-fullscreen,
#app:fullscreen,
html:-webkit-full-screen,
html:-moz-full-screen,
html:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen,
body:fullscreen {
  color-scheme: light !important;
  forced-color-adjust: none !important;
  background-color: var(--bg-surface, #F2EFE8) !important;
  color: var(--text, #111111) !important;
}

/* Force children to inherit readable colors while in fullscreen */
#app:-webkit-full-screen *,
#app:-moz-full-screen *,
#app:-ms-fullscreen *,
#app:fullscreen *,
html:-webkit-full-screen *,
html:-moz-full-screen *,
html:fullscreen *,
body:-webkit-full-screen *,
body:-moz-full-screen *,
body:fullscreen * {
  color: inherit !important;
  background-color: transparent !important;
  -webkit-text-fill-color: inherit !important;
  /* prevents some UAs from applying high-contrast replacements */
  forced-color-adjust: none !important;
}

/* Buttons and controls: make sure they contrast in fullscreen */
#app:-webkit-full-screen .btn,
#app:fullscreen .btn,
#app:-webkit-full-screen .bottom-actions,
#app:fullscreen .bottom-actions,
#app:-webkit-full-screen .bottom-footer,
#app:fullscreen .bottom-footer {
  color: var(--button-text, #ffffff) !important;
  background-color: var(--button-bg, #007bff) !important;
  border-color: rgba(0,0,0,0.08) !important;
  z-index: 180 !important;
}

/* Ghost / text buttons */
#app:-webkit-full-screen .btn.ghost,
#app:fullscreen .btn.ghost {
  color: var(--text, #111111) !important;
  background: transparent !important;
  border-color: rgba(0,0,0,0.08) !important;
  -webkit-text-fill-color: inherit !important;
}

#app:-webkit-full-screen .btn.photo,
#app:fullscreen .btn.photo {
  color: #fff !important;
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%) !important;
  -webkit-text-fill-color: #fff !important;
}


/* ==============================
   Fullscreen button — consolidated responsive rules
   - Single authoritative block (no duplicates, no overrides at file end)
   - Uses env(safe-area-inset-*) for notches + clamp()/vh for responsive spacing
   - Keeps icon sized as % of button so it always looks centred and proportional
   ============================== */

/* Chrome Android paints fullscreen descendants more aggressively than Firefox.
   Keep the toolbar/footer transparent while preserving real button styling. */
html.is-chrome-android #app:-webkit-full-screen .bottom-actions,
html.is-chrome-android #app:fullscreen .bottom-actions,
html.is-chrome-android #app:-webkit-full-screen .bottom-footer,
html.is-chrome-android #app:fullscreen .bottom-footer {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--text, #111111) !important;
  -webkit-text-fill-color: var(--text, #111111) !important;
}

html.is-chrome-android #app:-webkit-full-screen .btn,
html.is-chrome-android #app:fullscreen .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 90px !important;
  color: #fff !important;
  background: var(--accent-blue) !important;
  background-color: var(--accent-blue) !important;
  -webkit-text-fill-color: #fff !important;
}

html.is-chrome-android #app:-webkit-full-screen .btn.center,
html.is-chrome-android #app:fullscreen .btn.center {
  background: var(--accent-olive) !important;
  background-color: var(--accent-olive) !important;
}

html.is-chrome-android #app:-webkit-full-screen .btn.ghost,
html.is-chrome-android #app:fullscreen .btn.ghost {
  color: var(--text, #111111) !important;
  background: transparent !important;
  background-color: transparent !important;
  -webkit-text-fill-color: var(--text, #111111) !important;
}

html.is-chrome-android #app:-webkit-full-screen .btn.photo,
html.is-chrome-android #app:fullscreen .btn.photo {
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%) !important;
  -webkit-text-fill-color: #fff !important;
}

html.is-chrome-android #app:-webkit-full-screen .part-indicator,
html.is-chrome-android #app:fullscreen .part-indicator {
  color: var(--muted, #5A5A5A) !important;
  background: transparent !important;
  background-color: transparent !important;
  -webkit-text-fill-color: var(--muted, #5A5A5A) !important;
}

html.is-chrome-android #app:-webkit-full-screen .progress-bar,
html.is-chrome-android #app:fullscreen .progress-bar {
  background: rgba(0,0,0,0.06) !important;
  border-color: rgba(0,0,0,0.04) !important;
}

html.is-chrome-android #app:-webkit-full-screen .progress-fill,
html.is-chrome-android #app:fullscreen .progress-fill {
  background: linear-gradient(90deg, var(--accent-olive) 0%, var(--accent-blue) 100%) !important;
}

#fullscreen-toggle-fixed {
  position: fixed;

  /* place below any notch / status-bar, and use a responsive gap:
     - env(safe-area-inset-top, 0px) handles notch devices*/
  top: calc(env(safe-area-inset-top, 0px) + var(--mirror-gap, 0px));

  /* left offset also respects left safe inset (landscape with side inset) */
  left: calc(env(safe-area-inset-left, 0px) + 12px);

  right: auto !important;
  bottom: auto !important;
  transform: none !important;

  /* mobile-first baseline: typical smartphone */
  width: 18px;
  height: 18px;
  padding: 0;
  opacity: 0.55;

  background: transparent;
  border: none;
  cursor: pointer;

  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.is-ios-webkit #fullscreen-toggle-fixed {
  display: none !important;
}

/* Icon sizing as proportion of the button so it always appears balanced */
#fullscreen-toggle-fixed img,
#fullscreen-toggle-fixed svg {
  width: 98%;
  height: 98%;
  display: block;
  object-fit: contain;
  pointer-events: none; /* clicks hit the button, not the image */
}

/* Extra precaution: if a very narrow/short viewport exists, slightly increase top gap */
@media (max-height:420px) and (orientation:portrait) {
  #fullscreen-toggle-fixed {
    top: calc(env(safe-area-inset-top, 0px) + var(--mirror-gap, 0px) + 6px);
  }
}
/* very small phones */
@media (max-width:380px) {
  #fullscreen-toggle-fixed {
    width: 16px;
    height: 16px;
  }
}

/* tablets and larger devices */
@media (min-width:721px) {
  #fullscreen-toggle-fixed {
    width: 20px;
    height: 20px;
  }
}

/* temporary padding added while keyboard is open in fullscreen/landscape */
.fs-keyboard-padding {
  padding-bottom: 45vh !important; /* big enough to cover most landscape keyboards */
}

/* Animation host baseline: ensures hosts occupy layout space and act as overlays */
#footprints, #anim-host {
  display: block;
  width: 100%;
  position: absolute;   /* IMPORTANT: overlay the image-wrap */
  inset: 0;             /* top:0; right:0; bottom:0; left:0; */
  box-sizing: border-box;
  min-height: 56px;
  pointer-events: none;
}

/* wrapper classes used by JS (centering helpers) */
.footprints-wrapper, .feedback-wrapper {
  box-sizing: border-box;
  overflow: visible;
  pointer-events: none;
}
/* ensure images used by animations are not disturbed by global img rules */
#footprints img, #anim-host img {
  display: block;
  height: auto;
  max-width: none;
}

/* Debug helpers — remove when done */

/* ===== Feedback animation UI: separate animation sandbox + UI text =====
   - .feedback-ui : responsive horizontal layout that visually centers text
   - #anim-host : remains the JS animation container (sandbox)
   - #feedback-text: external UI text (responsive font sizing, no transform scaling)
*/

/* feedback UI: overlay inside image-wrap so text visually aligns with animation */
.feedback-ui {
  position: absolute;      /* overlay the image-wrap */
  inset: 0;                /* cover the same area as anim-host/footprints */
  display: flex;
  align-items: center;     /* vertical alignment: visually center text vs animation */
  justify-content: center; /* horizontal alignment */
  gap: 1rem;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
  padding: 0.25rem 0;
  pointer-events: none;    /* allow clicks to go through unless a child needs them */
  z-index: 45;             /* sits above footprints (30) and near anim-host (40) */
}

/* animation host must remain a clean sandbox (no text children inside) */
#anim-host {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 64px;
  box-sizing: border-box;
  /* animations will inject absolutely-positioned children into this element */
}

/* external feedback text (UI) — responsive font sizing and strong weight */
#feedback-text {
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  /* Responsive font size: small on tiny screens, capped on large screens */
    /* mobile-first baseline */
  font-size: 1rem; /* adjust if you want different sizing */
  color: inherit;
  /* IMPORTANT: do not use transform to scale/move this element.
     We ensure it never participates in transform-based scaling. */
  transform: none !important;
  will-change: auto;
  /* optional small visual nudge if you prefer the text slightly higher/lower than the center:
     use margin-top instead of transform (keeps no transform rule)
  */
  margin-top: 0; /* tweak to taste, e.g. -0.06rem to visually center if needed */
}

/* small modifier class we toggle from JS during the animation (visible state) */
#feedback-text.feedback-text--active {
  /* we keep this class small: it only indicates 'active' — visual changes via CSS if wanted */
  opacity: 1;
  transition: opacity 160ms ease;
}

/* hidden state (if you want the text hidden before/after animation) */
#feedback-text.feedback-text--hidden {
  opacity: 0;
  pointer-events: none;
}

/* make feedback text slightly smaller on very small phones */
@media (max-width:380px) {
  #feedback-text {
    font-size: 0.90rem;
  }
}

/* medium phones / small tablets: slightly larger for readability */
@media (min-width:521px) and (max-width:900px) {
  #feedback-text {
    font-size: 1.10rem;
  }
}

/* large screens: restore the previous maximum */
@media (min-width:901px) {
  #feedback-text {
    font-size: 1.50rem;
  }
}

/* === responsive animation host and svg centering (paste at EOF) === */

#anim-host {
  display: block;              /* stable block-level container */
  width: 100%;                 /* span the available width */
  max-width: 720px;            /* optional cap; change as you like */
  box-sizing: border-box;
  position: relative;          /* containing block for abs children */
  overflow: hidden;            /* prevent artwork from spilling out */
  margin: 0 auto;              /* center block if narrower than page */
  padding: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-page {
  justify-content: stretch;
}

.score-page .image-wrap {
  width: 100%;
  flex: 1 1 auto;
  justify-content: center;
  gap: 0;
}

.score-page .content {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
  min-height: 0;
  overflow: hidden;
}

.score-page #page-text {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  min-height: 0;
  overflow: hidden;
}

html.is-ios-webkit .score-page .content,
html.is-ios-webkit .score-page #page-text,
html.is-ios-webkit .final-score-stage {
  overflow: visible !important;
}

html.is-ios-webkit .final-score-wrapper {
  overflow: hidden !important;
}

html.is-ios-webkit .score-page .content {
  justify-content: flex-start;
  padding-bottom: calc(var(--controls-clearance) + env(safe-area-inset-bottom, 0px) + 24px) !important;
}

html.is-ios-webkit .score-page #page-text {
  min-height: min(62vh, 520px);
}

.photo-adjust-page {
  flex: 1 1 auto;
  justify-content: stretch;
  min-height: 0;
}

.photo-adjust-page #page-text {
  display: none !important;
}

body[data-page-id="part17_page03_photo"] .image-wrap {
  display: flex !important;
  width: 100%;
  flex: 1 1 auto;
}

body[data-page-id="part17_page03_photo"] #page-image,
body[data-page-id="part17_page03_photo"] #footprints,
body[data-page-id="part17_page03_photo"] #anim-host,
body[data-page-id="part17_page03_photo"] .feedback-ui {
  display: none !important;
}

body[data-page-id="part17_page03_photo"] .title-block {
  display: none !important;
}

.photo-adjust-page .content {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  padding: 0 8px calc(var(--controls-clearance) + env(safe-area-inset-bottom, 0px));
}

.photo-adjust-page #answers {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

body[data-page-id="part17_page03_photo"] .content {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: 100vw;
  height: calc((var(--vh, 1vh) * 100) - var(--photo-adjust-bottom-gap, 72px));
  max-width: none;
  padding: 0;
  margin: 0;
}

body[data-page-id="part17_page03_photo"] #answers,
body[data-page-id="part17_page03_photo"] .photo-booth--adjust,
body[data-page-id="part17_page03_photo"] .photo-adjust,
body[data-page-id="part17_page03_photo"] .photo-adjust-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

body[data-page-id="part17_page03_photo"] .photo-booth--adjust {
  position: relative;
}

body[data-page-id="part17_page03_photo"] .photo-adjust-frame {
  position: absolute;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  border: 2px solid #d9bd72;
}

body[data-page-id="part17_page03_photo"] #bottom-actions .inner {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 12px !important;
}

body[data-page-id="part17_page03_photo"] #bottom-actions .footer-action-area {
  width: auto !important;
  min-width: 0 !important;
  flex: initial !important;
}

body[data-page-id="part17_page03_photo"] #bottom-actions .footer-action-area--left {
  justify-self: start;
  justify-content: flex-start !important;
}

body[data-page-id="part17_page03_photo"] #bottom-actions .footer-action-area--center {
  justify-self: stretch;
  justify-content: center !important;
}

body[data-page-id="part17_page03_photo"] #bottom-actions .footer-action-area--right {
  justify-self: end;
  justify-content: flex-end !important;
}

body[data-page-id="part17_page03_photo"] #btn-RETAKE {
  padding-left: 12.6px;
  padding-right: 12.6px;
}

/* If animations inject absolute layers, make this helper container center them */
.anim-abs-center {
  position: absolute;
  inset: 0;                    /* top:0; right:0; bottom:0; left:0 */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
  overflow: visible;
}

/* Force inline SVGs to scale responsively and align their internal graphics to center */
#anim-host svg,
.footprints-wrapper svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  box-sizing: border-box;
  /* let the SVG decide how to keep aspect ratio; see preserveAspectRatio below */
}

/* fallback: ensure wrapper spans full width and centers its content */
.footprints-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
  overflow: visible;
}

/* ===== Image element fullscreen & fallback lightbox styles ===== */

/* When the IMG element itself is placed into fullscreen mode via the Fullscreen API,
   ensure it scales to viewport while preserving aspect ratio. */
#page-image:fullscreen,
#page-image:-webkit-full-screen,
#page-image:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  margin: 0 !important;
  display: block !important;
  background: #fff;
  touch-action: none;
}

/* Optional small visual tweak when the image has our JS helper class */
#page-image.image--is-fullscreen {
  outline: none;
}

/* ===== Lightbox fallback styles (used when Fullscreen API isn't available) ===== */
#image-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 99999;
  padding: env(safe-area-inset, 12px);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* visible state */
#image-lightbox.open {
  display: flex;
}

/* inner wrapper centers content and allows clicks on backdrop to close */
#image-lightbox .image-lightbox-inner {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0;
}

/* image inside the lightbox */
#image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  touch-action: none;
}

/* make the lightbox clickable area obvious on small screens */
@media (max-width:600px){
  #image-lightbox { padding: env(safe-area-inset, 6px); }
  #image-lightbox img { border-radius: 0; }
}

/* temporary padding while keyboard is open in fullscreen/landscape (if needed) */
.fs-keyboard-padding {
  padding-bottom: 45vh !important;
}
