/* Dynasty site polish, 24 Oct 2026 (loads after premium-polish.css).
   One content axis, one button language, artwork always whole inside its frame. Presentation only. */

/* 1. Every full-width band shares the header's content axis (was 56px from the edge on wide screens). */
html body .trace { padding-inline:max(var(--gut),calc((100% - var(--wrap))/2)); }

/* 2. One button language: a <button class="btn"> beside a link button gets the same quiet hairline and
      8px radius. (pay.css gave every <button class="btn"> a heavy opaque border, so "Share file" never
      matched the "Download" link next to it.) Game and payment controls keep their own designs. */
html body :is(.free-media-actions,#keep,.discovery-share) button.btn:not(.ghost):not(.crown),
html body button.btn:is(.discovery-share__button,.discovery-share):not(.crown) { border-color:var(--control-line); border-radius:8px; }
html body :is(.free-media-actions,#keep,.discovery-share) button.btn:not(.ghost):not(.crown):hover,
html body button.btn:is(.discovery-share__button,.discovery-share):not(.crown):hover { border-color:color-mix(in srgb,currentColor 48%,transparent); }
html body .bar .reader-back,
html body[data-discovery-kind="home"] .bar>.iconbtn,
html body .discovery-carousel-tabs .t-tab,
html body .discovery-carousel-playback button,
html body .sense-nav :is(button,.back),
html body .story-access-actions :is(a,button) { border-radius:8px; }

/* 3. Chapter rails: cards top-aligned (their progress rules line up) and a whole number of cards
      fills the content width exactly, so no sliver of a cut-off cover sits against the edge. */
html body .rail { --rail-n:2; grid-auto-columns:calc((100% - (var(--rail-n) - 1) * 18px) / var(--rail-n)); padding-inline:0; scroll-padding-inline:0; }
html body .rail>.ep,html body .rail>.world-chapter-card>.ep { align-content:start; }
@media (min-width:565px) { html body .rail { --rail-n:3; } }
@media (min-width:759px) { html body .rail { --rail-n:4; } }
@media (min-width:952px) { html body .rail { --rail-n:5; } }
@media (min-width:1146px) { html body .rail { --rail-n:6; } }
@media (min-width:1339px) { html body .rail { --rail-n:7; } }
html body .world-chapter-card { display:flex; flex-direction:column; gap:12px; min-width:0; }
html body .world-chapter-card>.discovery-share,html body .world-chapter-card>.discovery-share .discovery-share__button,
html body .world-chapter-card>button.btn { width:100%; }
html body .world-chapter-card>:last-child:not(.ep) { margin-top:auto; } /* Share buttons share one baseline across the rail */

/* 4. Home: seven books in a three-column grid leave one alone; centre it under the middle column. */
@media (min-width:1001px) {
  html body .experience-books>.experience-book:last-child:nth-child(3n+1) { grid-column:2; }
}
@media (min-width:541px) and (max-width:1000px) {
  html body .experience-books>.experience-book:last-child:nth-child(2n+1) { grid-column:1 / -1; justify-self:center; width:calc((100% - 24px) / 2); }
}

/* 5. Book covers: the whole cover, never trimmed at the sides. */
html body .experience-book img { object-fit:contain; object-position:center; background:transparent; box-shadow:none; filter:drop-shadow(3px 5px 10px #0004); }

/* 6. Moving artwork sits inside the same print mat as its still, so no dark bars appear at the frame edge. */
html body .r-fig .character-frame>video.character-video { box-sizing:border-box; padding:inherit; background-clip:content-box; }

/* 7. Phone action rows: equal-width buttons instead of ragged ones. */
@media (max-width:540px) {
  html body .free-catalog-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  html body .free-catalog-nav a { min-width:0; }
}

/* 8. Films tab. The download/share row that the page adds after each film used to take its own grid cell:
      the film text dropped below the frame and every clip took two columns. Pair each frame with its row. */
@media (min-width:861px) {
  html body .wrap.film { grid-template-rows:auto auto; align-items:start; row-gap:0; }
  html body .wrap.film>.frame { grid-column:1; grid-row:1 / span 2; }
  html body .wrap.film>:not(.frame):not(.free-media-actions) { grid-column:2; grid-row:1; align-self:end; }
  html body .wrap.film>.free-media-actions { grid-column:2; grid-row:2; align-self:start; margin:24px 0 0; }
}
html body .rail.clips { --rail-n:2; grid-template-rows:auto auto; row-gap:0; }
html body .rail.clips>.frame { grid-row:1; overflow:hidden; }
html body .rail.clips>.free-media-actions { grid-row:2; margin:10px 0 0; align-items:stretch; }
html body .rail.clips>.free-media-actions .btn { flex:1 1 130px; }
html body .rail.clips>.free-media-actions .free-media-status:empty { display:none; }
html body .rail.clips .frame .play { left:10px; bottom:10px; gap:8px; padding:8px 12px 8px 10px; font-size:14px; max-width:calc(100% - 20px); }
html body .rail.clips .frame .play svg { width:24px; height:24px; flex:none; }
@media (min-width:759px) { html body .rail.clips { --rail-n:3; } }
@media (min-width:1146px) { html body .rail.clips { --rail-n:4; } }
/* Posters keep their own shape at one shared height and wrap instead of running off the edge. */
html body .rail.posters { display:flex; flex-wrap:wrap; align-items:flex-start; gap:18px; overflow:visible; padding:6px 0 20px; }
html body .rail.posters>.poster { flex:none; max-width:100%; }
html body .rail.posters>.poster img { display:block; height:min(380px,calc((100vw - 2 * var(--gut)) * 9 / 16)); width:auto; max-width:100%; object-fit:contain; }

/* 9. Header on phones and tablets: the Sound control matches Comfort and Menu (icon over a small label)
      instead of a label spilling out of a 44px box with the icon outside it. */
@media (max-width:1100px) {
  html body .bar>[data-sound] { flex-direction:column; justify-content:center; gap:2px; padding:6px 1px; overflow:hidden; }
  html body .bar>[data-sound] svg { width:19px; height:19px; }
  html body .bar>[data-sound] .lbl { position:static; width:auto; height:auto; overflow:visible; clip:auto; margin:0; font:600 9px/1.1 var(--f-ui,system-ui); letter-spacing:0; white-space:nowrap; }
}

/* 10. Disclosure rows speak one language: every "Download & share", "Story effects" and "Artwork options"
       row is the same quiet bordered control, and the artwork row lines up with the artwork's own edges. */
html body .reader.chapter .story-access,html body .story-access { border:0; border-radius:0; padding:0; }
html body .story-access>summary,
html body .artwork-options>summary { box-sizing:border-box; min-height:44px; padding:10px 14px; border:1px solid var(--control-line); border-radius:8px; background:var(--control-fill); }
html body .reader.chapter .artwork-options { padding-inline:0; }

/* 11. Gallery pictures stay whole: no hover zoom that trims their edges. */
html body .gal-pic img,html body .gal-pic:hover img { transform:none; }
html body .gal-pic:hover { border-color:var(--accent-text,currentColor); }

/* 12. GODBODY sealed cards: titles share a top line and Reveal buttons share a bottom line across each row. */
html body :is(.gb-vitals,.gal-grid)>.gb-spoiler { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; }
html body .gb-vitals>.gb-spoiler { padding:26px; } /* .pair>div dropped the first card's left padding */
html body .pair.gb-vitals { border-top:0; } /* the cards carry their own borders; the extra rule sat on top of them */
html body :is(.gb-vitals,.gal-grid)>.gb-spoiler>button { margin-top:auto; }
@media (max-width:540px) {
  html body .gb-vitals>.gb-spoiler { padding:18px 12px; }
  html body :is(.gb-vitals,.gal-grid)>.gb-spoiler>button { width:100%; border-radius:12px; padding:10px 8px; }
}

/* 13. Home feature reel: the story tabs sit exactly under the text column and the pause controls end
       exactly under the picture frame, instead of a tab block that stopped part-way across the page. */
@media (min-width:1001px) {
  html body .discovery-carousel.tellings .discovery-carousel-controls { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); column-gap:40px; }
  html body .discovery-carousel.tellings .discovery-carousel-tabs { max-width:none; }
  html body .discovery-carousel.tellings .discovery-carousel-playback { justify-self:end; }
}
html body .discovery-carousel-tabs .t-tab { text-align:center; line-height:1.25; }

/* 14. Rotating reels: every wide reel picture and film is 16:9 and every tall one is 9:16, so the frame takes
       exactly that shape. The whole picture fills its frame with no black bands above, below or beside it. */
html body .discovery-carousel.tellings>.stage { padding-top:0; } /* left over from the old full-bleed header */
@media (min-width:541px) {
  html body :is(.discovery-carousel.tellings,.w-hero)>.stage,
  html body .premium-hero-media>.stage { aspect-ratio:16/9; max-height:none; }
}
@media (max-width:540px) {
  html body :is(.discovery-carousel.tellings,.w-hero)>.stage,
  html body .premium-hero-media>.stage { aspect-ratio:9/16; height:min(480px,64vh); width:auto; max-width:100%; max-height:none; align-self:center; margin-inline:auto; }
  html body .premium-hero-media { width:fit-content; max-width:100%; margin-inline:auto; align-self:center; }
}

/* 15. GODBODY sealed Films panel: same content axis as the page and clear of the tab bar above it. */
html body .w-panel:has(>.gb-spoiler-section) { display:flow-root; }
html body .w-panel>.gb-spoiler-section { max-width:none; margin:48px max(var(--gut),calc((100% - var(--wrap))/2)); }
