/* The owner's finished-film screen (status/film-screen.js, status/app-status-films.js): "Your film is ready!" with the
   film's name and length, the film itself as a large cinematic card with one Play button, then the one action area (Save
   film in gold, Share film outlined in gold, Download HD outlined), then "Make changes" (the photos, the music, what is in
   the film), Create another film and the keepsakes. The download engine's own look (app-layout.css: the working fill, the
   cells, the ring, Cancel) is left alone: these rules restyle only an idle button and move the rows. Each display rule has
   its [hidden] twin. */

/* A finished film has no progress to show: no percent, no bar, no step line, and the album's own picture and name are
   the heading's line. */
#progress.done .wait-overall, #progress.done > .eyebrow, #progress.done > #album-summary { display: none; }
#progress.done #status-title, #progress.done .film-meta { text-align: center; }
.film-meta { margin: 0 0 4px; color: var(--ink-dim); font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.film-meta[hidden] { display: none; }
#progress:not(.done) .film-meta, #progress.rendering .film-meta, #progress.erased .film-meta { display: none; }


/* Compact top: the panel's padding and the heading's reserved two lines (made for the waiting screens) are given back, so
   the film starts high on the first screen. The title is one balanced line; the name and length line sits close under it. */
#progress.done:not([hidden]) { margin-top: 16px; padding-top: 22px; display: flex; flex-direction: column; }
#progress.done #status-title { min-height: 0; margin: 0 0 2px; font-size: clamp(1.5rem, 7.2vw, 2.05rem); line-height: 1.15; text-wrap: balance; }
#progress.done .film-meta { margin: 0; font-size: .95rem; line-height: 1.3; }
/* Under the film's actions come "Your photos and privacy" (a labelled quiet row), then the changes, the next film and the
   keepsakes; every other child keeps its place at order 0. The column's own children are full width up to the hero's. */
#progress.done > #status-privacy { order: 1; max-width: 480px; margin: 14px auto 0; }
#progress.done > .film-changes, #progress.done > .film-another, #progress.done > .bonus { order: 2; }
#progress.done #downloads, #progress.done > #status-privacy, #progress.done .film-changes, #progress.done .film-another, #progress.done .bonus { width: 100%; box-sizing: border-box; }

/* One centred column on a wide screen: the film is the hero, so it is never wider than a phone. */
#progress.done #downloads, #progress.done .film-changes, #progress.done .film-another, #progress.done .bonus { max-width: 480px; margin-inline: auto; }

/* The hero: the film's cover in a card of the film's own shape, full width of the column. A portrait film is tall (about
   two thirds of the screen's height, never more than 520 px) so it fills the first screen on a phone; a landscape one is
   wide. A soft gold edge and a deep shadow, no glow. Nothing is fetched of the film until Play. */
#downloads .film-hero { position: relative; display: grid; box-sizing: border-box; width: 100%; margin: 10px 0 0; border-radius: 18px; overflow: hidden; background: #000;
  border: 1px solid rgba(240, 177, 85, .5); box-shadow: 0 18px 44px rgba(0, 0, 0, .38); }
#downloads .film-hero-portrait { height: min(64vh, 520px); }
#downloads .film-hero-landscape { aspect-ratio: 16 / 9; }
#downloads .film-hero-cut.film-hero-portrait { height: min(44vh, 340px); }
#downloads .film-hero video { grid-area: 1 / 1; display: block; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border-radius: 0; background: #000; object-fit: cover; }
#downloads .film-hero video.watching { object-fit: contain; }
/* A soft gold sheen at the top and a shade at the foot, where the length sits. */
#downloads .film-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 214, 140, .14), transparent 28%, transparent 62%, rgba(0, 0, 0, .55)); }
#downloads .film-hero.watching::after, #downloads .film-hero.watching .film-badge { display: none; }
#downloads .film-play { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
#downloads .film-play[hidden] { display: none; }
#downloads .film-play-disc { display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%; color: var(--accent); background: rgba(12, 10, 8, .58); border: 2px solid var(--accent); box-shadow: 0 8px 26px rgba(0, 0, 0, .5); transition: transform .18s ease; }
#downloads .film-play-disc svg { width: 38px; height: 38px; fill: currentColor; margin-left: 4px; }
#downloads .film-play:hover .film-play-disc { transform: scale(1.06); }
#downloads .film-play:focus-visible { outline: 3px solid var(--accent); outline-offset: -6px; border-radius: 18px; }
#downloads .film-badge { position: absolute; z-index: 1; inset-inline-end: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .68); color: #fff; font-size: .9rem; font-weight: 600; line-height: 1.4; pointer-events: none; }

/* The action area: one column, each button the full width, in the order Save > Share > Download HD. */
#downloads .film-owner { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin-top: 16px; }
#downloads .film-owner > * { flex: 0 0 auto; min-width: 0; }
#downloads .film-owner > a.film-save { order: 0; }
#downloads .film-owner > .film-cancel-btn { order: 1; margin-block: 0; }
#downloads .film-owner > .gallery-btn, #downloads .film-owner > .gallery-note { order: 2; }
#downloads .film-owner > .keep-open-note { order: 6; margin: 0; }
#downloads .film-owner[data-active="save"] > .keep-open-note { order: 2; }
#downloads .film-owner > .share-open { order: 3; }
#downloads .film-owner > .share-sheet { order: 4; }
#downloads .film-owner > .film-more { order: 5; }

/* Save film: gold, with its picture, the film's size and what it is for on the line under it. */
#downloads .film-owner a.download-btn.film-save { display: block; box-sizing: border-box; width: 100%; min-height: 60px; margin: 0; padding: 10px 16px; border-radius: min(var(--r-pill), 30px); font-size: 1.1rem; text-align: center; overflow-wrap: anywhere; }
#downloads .film-owner a.download-btn.film-save:not(.preparing):not(.pressed):not(.done):not(.stopped):not(.not-ready)::before { content: ""; display: inline-block; width: 1.15em; height: 1.15em; margin-inline-end: .45em; vertical-align: -.2em; background: currentColor; -webkit-mask: var(--film-save-icon) center / contain no-repeat; mask: var(--film-save-icon) center / contain no-repeat; }
#downloads .film-owner a.download-btn.film-save .share-detail { font-size: .82rem; font-weight: 500; margin-top: 2px; }
#downloads .film-owner a.download-btn.film-save.held, #downloads .film-owner a.download-btn.film-hd.held { opacity: .55; pointer-events: none; }
#downloads .film-owner a.download-btn.film-save:focus-visible, #downloads .film-owner a.download-btn.film-hd:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Share film: outlined gold, as wide as Save, with the share picture and an arrow that turns while its sheet is open. The
   engine's own chevron (app-share-sheet.js) is hidden: the arrow is drawn here from aria-expanded, so its swap leaves the
   look alone. */
#downloads .film-owner .share-open.film-share { width: 100%; box-sizing: border-box; min-height: 56px; margin: 0; padding: 10px 16px; justify-content: center; gap: .5em; font-size: 1.1rem; font-weight: 700; color: var(--accent); background: transparent; border: 2px solid var(--accent); border-radius: min(var(--r-pill), 30px); }
#downloads .film-owner .share-open.film-share .share-choice-ico { display: none; }
#downloads .film-owner .share-open.film-share::before, #downloads .film-owner .share-open.film-share::after { content: ""; flex: none; width: 1.15em; height: 1.15em; background: currentColor; }
#downloads .film-owner .share-open.film-share::before { -webkit-mask: var(--film-share-icon) center / contain no-repeat; mask: var(--film-share-icon) center / contain no-repeat; }
#downloads .film-owner .share-open.film-share::after { width: .9em; height: .9em; -webkit-mask: var(--film-chevron-icon) center / contain no-repeat; mask: var(--film-chevron-icon) center / contain no-repeat; transition: transform .18s ease; }
#downloads .film-owner .share-open.film-share[aria-expanded="true"]::after { transform: rotate(180deg); }
#downloads .film-owner .share-open.film-share:hover { background: rgba(240, 177, 85, .12); }
#downloads .film-owner .share-open.film-share:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The film is saved: Share leads and Save rests as an outlined "Saved". Only a film this page fetched whole says so. */
#downloads .film-owner[data-leader="share"] .share-open.film-share { color: var(--on-accent); background: var(--accent); }
#downloads .film-owner[data-leader="share"] .share-open.film-share:hover { background: var(--accent); filter: brightness(1.08); }
#downloads .film-owner a.download-btn.film-save.done:not(.preparing) { color: var(--ink); background: transparent; border: 2px solid var(--accent); }

/* Download HD: the outlined secondary, a quieter line than Share's gold. A download that is working, saved, stopped,
   refused or failed is not at rest: the engine's own look applies to it. */
#downloads .film-more { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
#downloads .film-more > a.film-hd { order: 0; }
#downloads .film-more > .film-slow-offer { order: 1; }
#downloads .film-more > .film-cancel-btn { order: 2; }
#downloads .film-owner a.download-btn.film-hd { display: block; box-sizing: border-box; width: 100%; min-height: 52px; margin: 0; padding: 8px 16px; border-radius: min(var(--r-pill), 30px); text-align: center; }
#downloads .film-owner a.download-btn.film-hd:not(.preparing):not(.pressed):not(.done):not(.stopped):not(.not-ready):not(.film-loud) { color: var(--ink); background: transparent; border: 1px solid var(--line-strong); font-size: 1rem; font-weight: 600; }
#downloads .film-owner a.download-btn.film-hd:not(.preparing):not(.pressed):not(.done):not(.stopped):not(.not-ready):not(.film-loud)::before { content: none; }
#downloads .film-owner a.download-btn.film-hd:not(.preparing):not(.pressed):not(.done):not(.stopped):not(.not-ready):not(.film-loud):hover { background: rgba(240, 177, 85, .12); filter: none; }
#downloads .film-owner a.download-btn.film-hd .share-detail { font-size: .8125rem; font-weight: 400; opacity: .8; }

/* Make changes: Change my photos, the look, the music and what is in the film, one coherent group under the film. The
   heading goes when nothing under it is shown (a film being made, a snaps album, a film whose files are gone). */
.film-changes { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 0; min-width: 0; }
.film-changes:not(:has(#choice-summary:not([hidden]), #rereview:not([hidden]), #remix-music:not([hidden]))) { display: none; }
.film-changes-title { margin: 0 0 2px; font-size: 1.05rem; color: var(--ink-dim); font-weight: 600; }
#progress.done .film-changes #choice-summary:not([hidden]) { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; background: none; }
#progress.done .film-changes #choice-summary > * { min-width: 0; }
#progress.done .film-changes #choice-change { order: 1; }
#progress.done .film-changes #choice-look { order: 2; }
#progress.done .film-changes .choice-details { order: 3; }
#progress.done .film-changes #choice-restart, #progress.done .film-changes #choice-status { order: 4; }
#progress.done #choice-change { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 12px 18px; min-height: 52px; font-size: 1.05rem; font-weight: 700; color: var(--accent); background: rgba(240, 177, 85, .1); border: 1px solid rgba(240, 177, 85, .55); border-radius: min(var(--r-pill), 30px); box-shadow: none; }
#progress.done #choice-change:hover { background: rgba(240, 177, 85, .2); }
#progress.done #choice-look:not([hidden]) { display: block; width: 100%; box-sizing: border-box; margin: 0; min-height: 48px; padding: 10px 18px; font-size: 1rem; font-weight: 600; border-radius: min(var(--r-pill), 30px); }
#progress.done .film-changes #remix-music { margin: 0; padding: 0; border: 0; background: none; }
/* Even rows: the older Change card's own margins and empty status line are given up, and an empty message takes no row. */
#progress.done .film-changes #rereview { margin: 0; }
#progress.done .film-changes #rereview > :last-child { margin-bottom: 0; }
#progress.done .film-changes p.error:empty, #progress.done .film-changes #choice-summary p.error:empty { display: none; }
#progress.done .film-changes #remix-music .remix-fold { margin: 0; }

/* "In your film" and "Change the music": two rows of the same make, closed until asked. */
#progress.done .choice-details, .remix-fold { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); padding: 0 14px; min-width: 0; }
.choice-details > summary, .remix-fold > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; min-height: 48px; padding-inline-end: 28px; position: relative; cursor: pointer; list-style: none; font-weight: 600; }
.choice-details > summary::-webkit-details-marker, .remix-fold > summary::-webkit-details-marker { display: none; }
.choice-details > summary::after, .remix-fold > summary::after { content: ""; position: absolute; inset-inline-end: 4px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border: solid var(--ink-dim); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .18s ease; }
.choice-details[open] > summary::after, .remix-fold[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.choice-details > summary:focus-visible, .remix-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.choice-details > summary .choice-title { margin: 0; font-size: 1rem; }
.choice-details > summary .choice-figures { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 400; }
.choice-details[open] > summary, .remix-fold[open] > summary { margin-bottom: 8px; }
.remix-fold[open] { padding-bottom: 14px; }
.remix-fold .remix-title { margin-top: 0; }

/* Create another film: the next thing after a film, an outlined gold button of its own right under the changes. */
.film-another { margin: 18px 0 0; }
.film-another[hidden] { display: none; }
#progress.rendering .film-another, #progress.erased .film-another { display: none; }
.film-another-btn { display: flex; align-items: center; justify-content: center; gap: .5em; width: 100%; box-sizing: border-box; min-height: 56px; padding: 10px 20px; font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--accent); background: transparent; border: 2px solid var(--accent); border-radius: var(--r-pill); cursor: pointer; }
.film-another-btn::before { content: ""; flex: none; width: 1.1em; height: 1.1em; background: currentColor; -webkit-mask: var(--film-plus-icon) center / contain no-repeat; mask: var(--film-plus-icon) center / contain no-repeat; }
.film-another-btn:hover { background: rgba(240, 177, 85, .12); }
.film-another-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The keepsakes' consent is read, not skimmed: it sits under "Read more" with the button that agrees to it. */
.bonus-more { min-width: 0; }
.bonus-more > summary { display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bonus-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.bonus-more[open] > summary { margin-bottom: 8px; }
.bonus-more .bonus-ask { width: 100%; margin-top: 12px; }

:root {
  --film-save-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11m0 0-4-4m4 4 4-4M5 19.5h14'/%3E%3C/svg%3E");
  --film-share-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='2.6'/%3E%3Ccircle cx='6' cy='12' r='2.6'/%3E%3Ccircle cx='18' cy='19' r='2.6'/%3E%3Cpath d='m8.3 10.8 7.4-4.4M8.3 13.2l7.4 4.4'/%3E%3C/svg%3E");
  --film-chevron-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --film-plus-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
