/* Fotobox – setzt tokens.css voraus. Alle Klassen mit Präfix .pb */

.pb-lock,
.pb-lock body {
  overflow: hidden;
}

.pb {
  --pb-bg: #191412;
  --pb-fg: var(--ivory, #fbf7f1);
  --pb-dim: rgba(251, 247, 241, .66);
  --pb-line: rgba(216, 191, 143, .32);
  --pb-gold: var(--gold-light, #d8bf8f);
  --pb-ease: var(--ease, cubic-bezier(.22, .8, .24, 1));
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(169, 132, 78, .16) 0%, rgba(169, 132, 78, 0) 60%),
    radial-gradient(140% 90% at 50% 100%, #231c18 0%, var(--pb-bg) 70%);
  background-color: var(--pb-bg);
  color: var(--pb-fg);
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  animation: pb-in .32s var(--pb-ease) both;
}

.pb [hidden] {
  display: none !important;
}

.pb *,
.pb *::before,
.pb *::after {
  box-sizing: border-box;
}

.pb button {
  font: inherit;
  color: inherit;
}

.pb :focus-visible,
.pb .pb-file:focus-within {
  outline: 2px solid var(--pb-gold);
  outline-offset: 3px;
}

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

/* ---------- Kopfzeile ---------- */

.pb-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 0;
  min-height: 56px;
}

.pb-title {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 300;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .01em;
  color: var(--pb-fg);
}

.pb-icon,
.pb-icon-spacer {
  flex: none;
  width: 44px;
  height: 44px;
}

.pb-icon {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(251, 247, 241, .08);
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--pb-ease);
}

.pb-icon svg {
  width: 22px;
  height: 22px;
}

.pb-icon:hover {
  background: rgba(251, 247, 241, .16);
}

.pb-icon:active {
  transform: scale(.94);
}

.pb-icon:disabled {
  opacity: .4;
  cursor: default;
}

/* ---------- Bühne ---------- */

.pb-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pb-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
}

.pb-sheet {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #2a2320;
  transition: transform .55s var(--pb-ease);
  will-change: transform;
}

.pb-video {
  position: absolute;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  background: #2a2320;
  transition: top .55s var(--pb-ease);
}

.pb-video.is-mirrored {
  transform: scaleX(-1);
}

.pb-shots,
.pb-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pb-result {
  display: block;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 22px 60px -20px rgba(0, 0, 0, .75);
  animation: pb-pop .45s var(--pb-ease) both;
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}

.pb[data-phase="processing"] .pb-result {
  opacity: .55;
  transition: opacity .2s;
}

/* Countdown */
.pb-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(120px, 42vmin, 280px);
  line-height: 1;
  color: #fffdf9;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .45), 0 0 2px rgba(0, 0, 0, .3);
}

.pb-count.is-tick {
  animation: pb-tick .85s var(--pb-ease) both;
}

/* Blitz */
.pb-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.pb-flash.is-on {
  animation: pb-flash .5s ease-out both;
}

/* Fortschritt beim Streifen */
.pb-progress {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(20, 16, 14, .72);
  border: 1px solid var(--pb-line);
  font-size: 14px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.pb-dots {
  display: inline-flex;
  gap: 6px;
}

.pb-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--pb-gold);
  transition: background-color .3s, transform .3s var(--pb-ease);
}

.pb-dots i.is-done {
  background: var(--pb-gold);
}

.pb-dots i.is-now {
  background: var(--pb-fg);
  border-color: var(--pb-fg);
  transform: scale(1.25);
}

/* Status / kurze Hinweise */
.pb-status {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 8px);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 16, 14, .82);
  border: 1px solid var(--pb-line);
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--pb-ease);
}

.pb-status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Danke */
.pb-thanks {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 16, 14, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: pb-fade .3s ease both;
}

.pb-thanks-card {
  width: min(340px, 100%);
  padding: 26px 22px 20px;
  border-radius: var(--radius, 18px);
  background: var(--paper, #fffdf9);
  color: var(--ink, #2f2925);
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6);
  animation: pb-pop .45s var(--pb-ease) both;
}

.pb-thanks-title {
  margin: 0 0 6px;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}

.pb-thanks-sub {
  margin: 0 0 18px;
  color: var(--ink-soft, #5e544c);
  font-size: 15px;
  line-height: 1.4;
}

.pb-thanks-actions {
  display: grid;
  gap: 8px;
}

.pb-thanks .pb-btn--ghost {
  color: var(--ink, #2f2925);
  border-color: var(--line, rgba(169, 132, 78, .28));
  background: transparent;
}

/* ---------- Bedienleiste ---------- */

.pb-bottom {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 0 12px;
}

.pb-modes {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(251, 247, 241, .08);
  border: 1px solid rgba(251, 247, 241, .08);
}

.pb-mode {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  letter-spacing: .03em;
  color: var(--pb-dim);
  cursor: pointer;
  transition: background-color .25s, color .25s;
}

.pb-mode[aria-pressed="true"] {
  background: var(--pb-fg);
  color: var(--ink, #2f2925);
}

.pb-mode:disabled {
  cursor: default;
}

.pb-chips {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 2px 16px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pb-chips::-webkit-scrollbar {
  display: none;
}

@media (min-width: 560px) {
  .pb-chips {
    justify-content: center;
  }
}

.pb-chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 74px;
  min-height: 44px;
  padding: 6px 4px 5px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(251, 247, 241, .05);
  cursor: pointer;
  scroll-snap-align: start;
  transition: background-color .2s, border-color .2s, transform .2s var(--pb-ease);
}

.pb-chip:hover {
  background: rgba(251, 247, 241, .1);
}

.pb-chip:active {
  transform: scale(.96);
}

.pb-chip[aria-pressed="true"] {
  border-color: var(--pb-gold);
  background: rgba(216, 191, 143, .14);
}

.pb-chip:disabled {
  opacity: .45;
  cursor: default;
}

.pb-chip-thumb {
  display: block;
  width: 52px;
  height: 64px;
}

.pb-chip-label {
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: .02em;
  color: var(--pb-dim);
  text-align: center;
  white-space: nowrap;
}

.pb-chip[aria-pressed="true"] .pb-chip-label {
  color: var(--pb-fg);
}

/* Auslöser-Zeile */
.pb-actions--live {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0 20px;
}

.pb-side {
  display: flex;
  justify-content: center;
}

.pb-shutter {
  position: relative;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 4px var(--pb-fg), 0 0 0 1px rgba(216, 191, 143, .5);
}

.pb-shutter-core {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf9 0%, #f3e9da 70%, #e6d5bc 100%);
  transition: transform .18s var(--pb-ease), background-color .2s;
}

.pb.is-strip .pb-shutter-core::after {
  content: "3";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--gold-deep, #8a6a3a);
}

.pb-shutter:active .pb-shutter-core {
  transform: scale(.88);
}

.pb-shutter:disabled {
  cursor: default;
}

.pb-shutter:disabled .pb-shutter-core {
  transform: scale(.82);
  opacity: .55;
}

/* Buttons */
.pb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid rgba(251, 247, 241, .22);
  border-radius: 999px;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s var(--pb-ease), opacity .2s;
}

.pb-btn svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.pb-btn:active {
  transform: scale(.97);
}

.pb-btn:disabled {
  opacity: .5;
  cursor: default;
}

.pb-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #e3cc98 0%, #c9a66b 55%, #a9844e 100%);
  color: #241c14;
  box-shadow: 0 10px 26px -12px rgba(216, 191, 143, .65);
}

.pb-btn--primary:hover {
  filter: brightness(1.04);
}

.pb-btn--ghost:hover {
  background: rgba(251, 247, 241, .08);
}

.pb-actions--review,
.pb-fallback {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
}

.pb-actions--review .pb-share {
  min-height: 56px;
  font-size: 18px;
}

.pb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pb-row > .pb-btn {
  padding: 0 12px;
}

/* Ausweg ohne Live-Kamera */
.pb-fallback-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--pb-dim);
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
}

.pb-fallback-text strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--pb-fg);
}

.pb-fallback-hint {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(251, 247, 241, .5);
  text-align: center;
}

.pb-file {
  position: relative;
}

.pb-file span {
  min-width: 0;
}

/* ---------- Größen ---------- */

@media (max-height: 700px) {
  .pb-top {
    min-height: 50px;
    padding-top: 2px;
  }

  .pb-bottom {
    gap: 8px;
    padding-bottom: 8px;
  }

  .pb-chip {
    width: 66px;
    padding-top: 5px;
  }

  .pb-chip-thumb {
    width: 44px;
    height: 54px;
  }

  .pb-shutter {
    width: 70px;
    height: 70px;
  }

  .pb-shutter-core {
    inset: 8px;
  }

  .pb-btn {
    min-height: 48px;
  }

  .pb-actions--review .pb-share {
    min-height: 52px;
  }

  .pb-fallback-text {
    font-size: 14px;
  }

  .pb-fallback-text strong {
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .pb-row > .pb-btn {
    font-size: 14px;
    gap: 6px;
  }
}

/* ---------- Animationen ---------- */

@keyframes pb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pb-pop {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pb-tick {
  0% { opacity: 0; transform: scale(1.5); }
  18% { opacity: 1; transform: scale(1); }
  78% { opacity: 1; transform: scale(.94); }
  100% { opacity: 0; transform: scale(.82); }
}

@keyframes pb-tick-soft {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pb-flash {
  0% { opacity: .95; }
  100% { opacity: 0; }
}

@keyframes pb-flash-soft {
  0% { opacity: .35; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pb,
  .pb-result,
  .pb-thanks,
  .pb-thanks-card {
    animation: none;
  }

  .pb-count.is-tick {
    animation: pb-tick-soft .85s linear both;
  }

  .pb-flash.is-on {
    animation: pb-flash-soft .3s linear both;
  }

  .pb-sheet,
  .pb-video,
  .pb-status,
  .pb-dots i {
    transition: none;
  }
}
