/* The stage: a fixed full-bleed layer stack (namek Stage.svelte order):
   background, subject, frame, watermark, text, wall, idle, filters, flash, review (countdown.css has the countdown).
   Motion is CSS only; every feature is correct with all animation removed. */

#stage {
  position: fixed; inset: 0; background: #000; overflow: hidden;
}
#stage .layer { position: absolute; inset: 0; }

@font-face { font-family: "Bebas Neue"; src: url(../fonts/bebas-neue.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Pacifico"; src: url(../fonts/pacifico.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Lobster"; src: url(../fonts/lobster.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Bangers"; src: url(../fonts/bangers.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Nunito"; src: url(../fonts/nunito.woff2) format("woff2"); font-weight: 400 900; font-display: block; }
@font-face { font-family: "Permanent Marker"; src: url(../fonts/permanent-marker.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Playfair Display"; src: url(../fonts/playfair-display.woff2) format("woff2"); font-weight: 400 900; font-display: block; }
@font-face { font-family: "Fredoka"; src: url(../fonts/fredoka.woff2) format("woff2"); font-weight: 300 700; font-display: block; }

#layer-background { background: #000; overflow: hidden; }
.bg-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: transparent;
  transform: translateZ(0);
}
#bg-cam, #bg-img { display: none; }
#layer-background[data-mode="camera"] #bg-cam { display: block; }
#layer-background[data-mode="still"] #bg-img:not([hidden]) { display: block; }
.deck { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.deck.on { opacity: 1; }
#layer-background:not([data-mode="video"]) .deck { display: none; }
#bg-dim { position: absolute; inset: 0; pointer-events: none; }

#subject {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; background: transparent;
}
#subject.mirror { transform: scaleX(-1); }
#stage[data-bg="camera"] #subject { background: #000; }

#layer-frame { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
#layer-watermark, #layer-text { pointer-events: none; transform: translateZ(0); }
#watermark-img { position: absolute; object-fit: contain; object-position: center; pointer-events: none; }
body[data-branding-open="1"] #watermark-img { pointer-events: auto; cursor: move; outline: 2px dashed rgba(255, 225, 77, .9); }
.text-line { position: absolute; margin: 0; line-height: 1; white-space: nowrap; }

#layer-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 6vh; gap: 2vh; pointer-events: none;
}
#idle-logo { max-width: 30vw; max-height: 20vh; object-fit: contain; }
/* Font, size and effect are the client's (Branding, Idle screen; stage-fx.css). */
#idle-prompt {
  margin: 0; font-size: var(--prompt-size, clamp(24px, 4.5vw, 72px)); font-weight: 700; text-align: center;
  font-family: var(--prompt-font, inherit); color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
#idle-prompt:empty { display: none; }

/* Guest filter strip (0.6): thumbnails of the live camera through each
   preset, along the top of the idle screen; a tap picks one for this trip. */
#layer-filters {
  display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: 1.2vw; padding: 3vh 2vw;
  pointer-events: none;
}
#layer-filters button {
  pointer-events: auto; display: flex; flex-direction: column; align-items: center; padding: 0; overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .55); border-radius: 10px; background: rgba(0, 0, 0, .4); cursor: pointer;
}
#layer-filters canvas { display: block; width: clamp(64px, 9vw, 160px); height: auto; }
#layer-filters span { color: #fff; font-size: clamp(12px, 1.3vw, 22px); font-weight: 700; padding: .4vh .6vw; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
#layer-filters button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }

/* Photo wall (0.6 attract mode): today's photos in tiles over the stage
   while idle, one tile fading to a new photo every few seconds. */
#layer-wall { display: grid; gap: 1vw; padding: 1vw; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; pointer-events: none; }
#stage:not([data-state="idle"]) #layer-wall { display: none; }
#layer-wall[data-tiles="1"] { grid-template-columns: 1fr; }
#layer-wall[data-tiles="2"], #layer-wall[data-tiles="3"], #layer-wall[data-tiles="4"] { grid-template-columns: repeat(2, 1fr); }
@media (orientation: portrait) { #layer-wall[data-tiles="5"], #layer-wall[data-tiles="6"] { grid-template-columns: repeat(2, 1fr); } }
#layer-wall .tile { position: relative; overflow: hidden; border-radius: 1vw; background: rgba(0, 0, 0, .35); }
#layer-wall .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
#layer-wall .tile img.on { opacity: 1; }

/* The countdown layer lives in countdown.css and countdown-motion.css. */

#layer-flash { background: #fff; opacity: 0; pointer-events: none; }
#layer-flash.on { opacity: 1; animation: flash-fade .35s ease-out both; }
@keyframes flash-fade { 0% { opacity: 1; } 100% { opacity: 0; } }

#layer-review { display: none; background: #000; }
#stage[data-state="review"] #layer-review { display: block; }
#review-img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* A set's filmstrip sits above the buttons; the picture leaves room for it. */
#review-strip {
  position: absolute; left: 0; right: 0; bottom: 16vh; display: flex; justify-content: center; gap: 1.2vw; padding: 0 2vw;
}
#review-strip[hidden] { display: none; }
#layer-review:has(#review-strip:not([hidden])) #review-img { height: calc(100% - 30vh); }
#review-strip img { height: 12vh; max-width: 22vw; object-fit: contain; border: 2px solid rgba(255, 255, 255, .7); border-radius: 4px; background: #000; display: block; }
#review-strip button { border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 4px; }
#review-strip.retake button img { border-color: rgba(255, 225, 77, .9); }
#review-strip.retake button:focus-visible img, #review-strip.retake button:hover img { border-color: #fff; }
#review-actions {
  position: absolute; left: 0; right: 0; bottom: 6vh; display: flex; justify-content: center; gap: 3vw;
}
#review-actions button {
  border: 0; border-radius: 999px; padding: 1.4vh 4vw; font-size: clamp(18px, 2.4vw, 34px); font-weight: 700;
  background: rgba(255, 255, 255, .92); color: #111; cursor: pointer;
}
#review-actions button[data-action="keep"] { background: #fff; }
#review-actions button[hidden] { display: none; }
#review-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255, 255, 255, .15); }
#review-bar-fill { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; }
#review-bar-fill.run { animation: review-drain var(--review-ms, 6000ms) linear both; }
@keyframes review-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

#banner {
  position: absolute; left: 50%; top: 4vh; transform: translateX(-50%);
  max-width: 80vw; padding: 10px 18px; border-radius: 8px;
  background: rgba(20, 22, 43, .85); color: #fff; font-size: 16px; text-align: center;
}
#banner.error { background: rgba(228, 72, 91, .92); }

/* Readability (0.8, Look panel, stage/access.js). data-contrast: a dark
   plate behind every word on the stage and black-on-white buttons with a
   thick outline; data-big: larger review buttons, prompt and filter strip.
   Black and white only: the stage stays unbranded. The photo is not touched. */
#stage[data-contrast] #idle-prompt {
  background: rgba(0, 0, 0, .85); padding: .25em .7em; border-radius: .25em; text-shadow: none; animation: none; opacity: 1; translate: 0 0;
}
#stage[data-contrast] #review-actions button, #stage[data-contrast] #review-actions button[data-action="keep"] {
  background: #fff; color: #000; border: .16em solid #000; box-shadow: 0 0 0 .16em #fff;
}
#stage[data-contrast] #review-actions button:focus-visible { outline: .2em solid #000; outline-offset: .2em; }
#stage[data-contrast] #review-bar { height: 14px; background: rgba(0, 0, 0, .8); }
#stage[data-contrast] #layer-filters button { border-color: #fff; background: #000; }
#stage[data-contrast] #layer-filters span { text-shadow: none; }
#stage[data-contrast] #layer-filters button[aria-pressed="true"] { box-shadow: 0 0 0 4px #000, 0 0 0 7px #fff; }
#stage[data-contrast] #banner { background: #000; }

#stage[data-big] #idle-prompt { font-size: clamp(32px, 6.5vw, 104px); }
#stage[data-big] #review-actions { gap: 4vw; bottom: 7vh; }
#stage[data-big] #review-actions button { font-size: clamp(28px, 3.8vw, 56px); padding: 2.4vh 6vw; min-width: 22vw; }
#stage[data-big] #review-strip { bottom: 22vh; }
#stage[data-big] #layer-review:has(#review-strip:not([hidden])) #review-img { height: calc(100% - 38vh); }
#stage[data-big] #layer-filters canvas { width: clamp(96px, 13vw, 240px); }
#stage[data-big] #layer-filters span { font-size: clamp(16px, 1.9vw, 30px); }
