/* Photobooth UI. Graphik and Skillbox/holiday tokens are inherited; no shadows,
   no text shadows, no drop-shadow filters anywhere in this component. */
.modal.is-photobooth { width: min(1180px,100%); max-height: 94vh; }
.modal.is-photobooth .modal-scroll { max-height: 94vh; }
.photobooth { display:grid; gap:var(--space-lg); min-width:0; color:var(--text); }
.photobooth [hidden] { display:none !important; }
.photobooth p { margin:0; line-height:1.5; }

/* Door intro and gallery live in the day modal; capture happens in its own dialog. */
.pb-header { display:grid; gap:var(--space-md); padding-right:var(--space-xl); }
.pb-kicker,.pb-demo,.pb-closed,.pb-local-note,.pb-position-note,.pb-card-team,.pb-save-note,.pb-private-note,.pb-source-status,.pb-perm-status { font-size:var(--small-size); }
.pb-title { margin:0; font-size:clamp(28px,3vw,40px); line-height:1.12; font-weight:600; letter-spacing:-.045em; }
.pb-intro { display:grid; gap:var(--space-sm); max-width:850px; }
.pb-intro p { font-size:var(--body-size); }
.pb-demo,.pb-closed { padding:var(--space-md); background:var(--holiday-cream); border-radius:var(--radius-md); }
.pb-entry-actions { display:flex; flex-wrap:wrap; gap:var(--space-sm); }

/* Gallery */
.pb-feed { display:grid; gap:var(--space-md); min-width:0; }
.pb-feed-heading { display:flex; justify-content:space-between; gap:var(--space-md); align-items:baseline; }
.pb-feed h4 { margin:0; font-size:var(--body-size); font-weight:600; }
.pb-total { font-size:var(--small-size); }
.pb-filters { display:flex; flex-wrap:wrap; gap:var(--space-md); align-items:center; padding:var(--space-md); background:var(--surface); border-radius:var(--radius-md); }
.pb-filters > label:not(.pb-mine-label) { display:flex; align-items:center; gap:var(--space-sm); font-size:var(--small-size); }
.pb-mine-label { display:flex; gap:var(--space-sm); align-items:flex-start; cursor:pointer; font-size:var(--small-size); line-height:1.5; }
.pb-mine-label input { flex:none; margin:3px 0 0; width:18px; height:18px; accent-color:var(--primary); }
.pb-filter-template { background:var(--bg); color:var(--text); border:1px solid var(--text); border-radius:var(--radius-sm); padding:var(--space-xs); font:inherit; max-width:100%; }
.pb-feed-refresh { margin-left:auto; font-size:var(--small-size); padding:var(--space-sm); }
.pb-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-md); }
.pb-card { display:grid; gap:var(--space-xs); align-content:start; min-width:0; padding:var(--space-sm); background:var(--holiday-cream); border-radius:var(--radius-md); }
.pb-card-open { width:100%; display:block; border:0; padding:0; background:transparent; border-radius:var(--radius-sm); cursor:pointer; overflow:hidden; }
.pb-card-open img { display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:cover; }
.pb-card-author { font-size:var(--small-size); font-weight:500; overflow-wrap:anywhere; }
.pb-card-team { overflow-wrap:anywhere; }

/* Photobooth dialog: desktop fills a laptop screen without vertical scrolling. */
.pb-overlay { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; padding:var(--space-lg); background:rgba(0,0,0,.58); }
.pb-dialog { position:relative; display:flex; flex-direction:column; width:min(1200px,100%); height:min(860px,100%); max-height:100%; background:var(--bg); border-radius:var(--radius-lg); overflow:hidden; }
.pb-dialog::before { content:''; position:absolute; top:0; left:0; right:0; height:10px; background:repeating-linear-gradient(120deg, var(--holiday-red) 0 16px, var(--holiday-cream) 16px 32px, var(--holiday-sky) 32px 48px, var(--holiday-cream) 48px 64px); }
.pb-close { position:absolute; top:var(--space-md); right:var(--space-md); z-index:3; width:36px; height:36px; display:flex; align-items:center; justify-content:center; border:none; border-radius:var(--radius-pill); background:var(--holiday-cream); color:var(--text); font:inherit; font-size:var(--small-size); cursor:pointer; }
.pb-close:hover { background:var(--primary); color:var(--text-on-dark); }
.pb-reward-dialog { box-sizing:border-box; width:min(420px,calc(100% - 32px)); margin:auto; padding:var(--space-xl); border:0; border-radius:var(--radius-lg); background:var(--bg); color:var(--text); text-align:center; }
.pb-reward-dialog::backdrop { background:rgba(0,0,0,.5); }
.pb-reward-dialog h3 { margin:0 0 var(--space-md); font-size:var(--h3-size); line-height:1.2; }
.photobooth .pb-reward-points { margin:0 0 var(--space-lg); color:var(--primary); font-size:var(--h2-size); font-weight:600; line-height:1.2; }
.pb-dialog-title { margin:0; padding:calc(10px + var(--space-md)) var(--space-xl) var(--space-sm); font-size:var(--body-size); font-weight:600; letter-spacing:-.02em; }
.pb-dialog-body { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) clamp(320px,36%,440px); gap:var(--space-lg); padding:0 var(--space-xl) var(--space-xl); }

/* Live 4:5 stage: the original template PNG over the clipped camera face. */
.pb-stage-col { min-width:0; min-height:0; display:flex; padding:var(--space-sm); background:var(--holiday-cream); border-radius:var(--radius-md); }
.pb-stage-wrap { position:relative; display:flex; margin:auto; aspect-ratio:4/5; height:100%; max-width:100%; }
.pb-stage { display:block; margin:auto; width:auto; height:auto; max-width:100%; max-height:100%; touch-action:none; cursor:move; }
.pb-stage:focus-visible { outline:3px solid var(--primary); outline-offset:4px; }
.pb-video { display:none; }
.pb-countdown { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; font-size:clamp(72px,16vw,120px); font-weight:600; color:var(--text); background:rgba(255,255,255,.82); border-radius:var(--radius-sm); }

/* Controls column */
.pb-side { min-width:0; min-height:0; display:flex; flex-direction:column; gap:var(--space-sm); overflow-y:auto; padding:2px 4px 2px 0; }
.pb-template-field { min-width:0; margin:0; padding:0; border:0; }
.pb-template-field legend { margin-bottom:var(--space-xs); font-size:var(--small-size); font-weight:600; padding:0; }
.pb-templates { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-xs); }
.pb-template-choice { position:relative; min-width:0; display:grid; grid-template-rows:auto 1fr; gap:2px; padding:var(--space-xs); background:var(--bg); border-radius:var(--radius-sm); cursor:pointer; font-size:11px; text-align:center; line-height:1.25; }
.pb-template-choice img { display:block; width:100%; height:64px; object-fit:contain; }
.pb-template-choice input { position:absolute; top:6px; left:6px; width:14px; height:14px; margin:0; accent-color:var(--primary); }
.pb-template-choice:has(input:checked) { outline:3px solid var(--primary); outline-offset:0; }
.pb-template-choice:has(input:focus-visible) { outline:3px solid var(--text); outline-offset:2px; }

/* Pre-permission card with the approved copy; camera never starts on its own. */
.pb-perm { display:grid; gap:var(--space-sm); padding:var(--space-md); background:var(--holiday-ice); border-radius:var(--radius-md); }
.pb-perm-title { margin:0; font-size:15px; font-weight:600; line-height:1.3; letter-spacing:-.01em; }
.pb-perm-copy { font-size:var(--small-size); }
.pb-perm-actions { display:grid; gap:var(--space-xs); }
.pb-perm-status:empty { display:none; }

.pb-edit,.pb-review { display:grid; gap:var(--space-sm); }
.pb-edit-actions { display:grid; gap:var(--space-xs); }
.pb-mirror-label { display:flex; gap:var(--space-sm); align-items:flex-start; cursor:pointer; font-size:var(--small-size); line-height:1.5; }
.pb-mirror-label input { flex:none; margin:3px 0 0; width:18px; height:18px; accent-color:var(--primary); }
.pb-zoom-label { display:grid; gap:var(--space-xs); font-size:var(--small-size); }
.pb-zoom { width:100%; accent-color:var(--primary); }
.pb-side .btn { width:100%; }
.pb-status { padding:var(--space-sm); background:var(--holiday-cream); border-radius:var(--radius-sm); font-size:var(--small-size); }
.pb-status:empty { display:none; }
.pb-save-note:empty { display:none; }
.pb-open-image { color:var(--text); text-underline-offset:3px; font-size:var(--small-size); }
.pb-open-image:hover { color:var(--primary); }
.pb-error { margin-top:auto; }

/* Gallery detail lightbox */
.pb-detail { position:fixed; inset:0; z-index:70; overflow-y:auto; background:var(--bg); display:flex; align-items:center; flex-direction:column; gap:var(--space-md); padding:var(--space-lg); }
.pb-detail-image { display:block; width:min(500px,100%); height:auto; aspect-ratio:4/5; object-fit:contain; background:var(--surface); }
.pb-detail-author { max-width:650px; overflow-wrap:anywhere; text-align:center; }

.photobooth button:focus-visible,.photobooth select:focus-visible,.photobooth input:focus-visible,.photobooth a:focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
.photobooth-entry { background:var(--holiday-ice); }

@media (prefers-reduced-motion:reduce) { .pb-overlay,.pb-dialog,.pb-countdown { transition:none; animation:none; } }

@media (max-width:960px) {
  .pb-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
  /* Mobile: fullscreen dialog honoring notches and home indicator. */
  .pb-overlay { padding:0; }
  .pb-dialog { width:100%; height:100%; max-height:none; border-radius:0; }
  .pb-dialog-title { padding:calc(10px + env(safe-area-inset-top,0px) + var(--space-sm)) var(--space-lg) var(--space-xs); padding-right:calc(env(safe-area-inset-right,0px) + 56px); }
  .pb-close { top:calc(env(safe-area-inset-top,0px) + var(--space-sm)); right:calc(env(safe-area-inset-right,0px) + var(--space-sm)); width:44px; height:44px; }
  .pb-dialog-body { grid-template-columns:1fr; gap:var(--space-md); overflow-y:auto; padding:0 calc(env(safe-area-inset-right,0px) + var(--space-md)) calc(env(safe-area-inset-bottom,0px) + var(--space-md)) calc(env(safe-area-inset-left,0px) + var(--space-md)); }
  .pb-stage-col { padding:0; background:transparent; }
  .pb-stage-wrap { width:min(420px,100%); height:auto; margin-inline:auto; }
  .pb-side { overflow:visible; }
}
@media (max-width:720px) {
  .pb-header { padding-right:var(--space-md); }
  .pb-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-sm); }
  .pb-feed-heading { align-items:flex-start; flex-direction:column; gap:var(--space-xs); }
  .pb-filters { align-items:flex-start; flex-direction:column; }
  .pb-feed-refresh { margin-left:0; }
  .pb-filters > label:not(.pb-mine-label) { width:100%; flex-wrap:wrap; }
  .pb-filter-template { min-width:0; width:100%; }
  .pb-template-choice img { height:84px; }
}
