/* styles-additions.css (workstream M): Live Photo and stack presentation.
   New file on purpose: existing styles.css keeps its ?v= string untouched.
   Wire with: <link rel="stylesheet" href="./styles-additions.css?v=17">
   right after the styles.css link in index.html (see EDIT-PAIRS.md). */

/* LIVE badge on grid cells: small red pill, top-left, iOS-style. */
.photo-cell { position: relative; }
.live-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
}

/* Stack count badge: bottom-right pill with the member count. */
.stack-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
}

/* Members of an inline-expanded stack get a subtle outline. */
.photo-cell.stack-member {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: -2px;
}

/* Wave E2: gold "Best" badge for the keeper pick in a stack. Top-right:
   the score badge shares the spot but only renders on search grids,
   where _best is never set. */
.best-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6cd55, #dfa92c);
  color: #3a2a00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}
/* In the stack sheet, the best member's label turns gold, and a best
   member that is not the cover gets a soft gold border. */
.stack-member-bar .best-tag {
  color: #dfa92c;
  font-weight: 700;
}
.stack-member.is-best:not(.is-cover) {
  border-color: rgba(223, 169, 44, 0.65);
}

/* Tier 2: RAW badge on grid cells, bottom-left (LIVE owns top-left,
   stack/video own the right side). Dark pill with gold text, matching
   the app's gold accent. */
.raw-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #e8b93c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}
/* A RAW file LibRaw could not develop: same spot, warning colors. */
.unsupported-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(120, 30, 20, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* Lightbox: the motion part plays in a video layer over the still. */
.lb-slide { position: relative; }
.lb-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 3;
}
.lb-live-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* Stack manager bottom sheet. */
.stack-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.stack-sheet-panel {
  width: 100%;
  max-width: 720px;
  background: var(--card, #141414);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.stack-sheet-head,
.stack-sheet-foot {
  padding: 14px 16px;
}
.stack-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stack-sheet-head h3 {
  margin: 0;
  font-size: 17px;
}
.stack-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 4px 16px 10px;
  max-height: 56vh;
  overflow-y: auto;
}
.stack-member {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
}
.stack-member.is-cover {
  border-color: #ffd60a;
}
.stack-member-cell {
  width: 100%;
  aspect-ratio: 1;
}
.stack-member-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 2px 2px;
}
.stack-sheet-foot {
  padding-bottom: 14px;
}

/* Build 41: GIF maker sheet + lightbox Live Photo effects. */
.gif-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.gif-panel {
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  width: min(480px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gif-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
}
.gif-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gif-label {
  min-width: 92px;
  font-weight: 600;
}
.gif-select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
}
.gif-range { flex: 1; }
.gif-val {
  min-width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.gif-check { width: 20px; height: 20px; }
.gif-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.lb-livefx-video {
  width: 100%;
  max-height: 260px;
  background: #000;
  border-radius: 10px;
  margin: 8px 0;
}
.lb-livefx-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.lb-livefx-long { margin-top: 8px; }
