/* Parts of the Episode and Card pages that the design files had no place for.
   Hand written; nse-episode.css and nsk-card.css come from the design files. */

/* Said to the Management Office only (unannounced, preview). Sits above the page. */
.ns-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 22px; background: #2d2110; border-bottom: 1px solid #9b6d24; color: #f3c76a; font: 500 13px "DM Sans", Arial, sans-serif; }
.ns-notice p { margin: 0; }
.ns-notice a { color: #fff; text-decoration: underline; font-weight: 600; }

/* "Defending" beside a side's name. */
.ns-defending { display: inline-block; margin-left: 8px; padding: 3px 8px; vertical-align: middle; border: 1px solid #9b6d24; background: #2d2110; color: #f3c76a; font: 600 10px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 1.6px; }

/* The Title on the line. */
.episode-page .ns-titleline { margin: 14px 0 0; font: 600 13px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 3px; color: #e4b84a; }
.nsk .ns-titleline-card { margin: 0 0 10px; font: 600 13px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 2.4px; color: #e4b84a; }

/* A bout with its own picture (uploaded in the Management Office). */
.episode-page .ns-boutpic { position: relative; z-index: 1; margin: 6px 0 18px; }
.episode-page .ns-boutpic img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: cover; }
.episode-page .matchSides.ns-multi { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px 12px; min-height: 0; padding-bottom: 12px; }
/* At most four wrestlers to a row (two on a phone), each row centred, so eight is four and four. */
.episode-page .matchSides.ns-multi .team { flex: 0 0 calc(25% - 9px); min-width: 0; }
.episode-page .matchSides.ns-multi .versus { display: none; }
.episode-page .matchSides.ns-multi .figures { height: 230px; }
.episode-page .matchSides.ns-multi .figures img { max-width: 86%; }
.episode-page .matchSides.ns-multi .team h3 { min-height: 0; margin: 14px 0 0; font-size: clamp(18px, 1.8vw, 26px); }
@media (max-width: 899px) {
  .episode-page .matchSides.ns-multi .team { flex-basis: calc(50% - 6px); }
  .episode-page .matchSides.ns-multi .figures { height: 190px; }
}

/* Bouts with more than two sides, or a side of three or more, on the Card. */
.nsk .ns-multi-panel { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 10px; padding: 12px 24px 6px; }
.nsk .ns-competitor { display: flex; flex-direction: column; align-items: center; text-align: center; }
.nsk .ns-competitor img { display: block; width: 100%; max-width: 190px; height: 210px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 20px #000b); }
.nsk .ns-competitor span { margin-top: 8px; font: 700 15px/1.2 "Oswald", "Arial Narrow", sans-serif; letter-spacing: 0.6px; }

/* What each side carries into the bout (the Card), and the promos written for it. */
.nsk .ns-going { margin: 14px 0 6px; font: 600 11px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 2.4px; color: #e4b84a; }
.nsk .ns-tape { list-style: none; margin: 0; padding: 0; }
.nsk .ns-tape li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid #3a2a3b; font-size: 14px; }
.nsk .ns-tape li:first-child { border-top: 0; }
.nsk .ns-tape b { font-weight: 600; color: #fff; }
.nsk .ns-tape a { color: var(--pink, #ff2faf); }

.episode-page .ns-promos { margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid #3d2b40; }
.episode-page .ns-promos ul { list-style: none; margin: 10px 0 0; padding: 0; }
.episode-page .ns-promos li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding: 8px 0; font-size: 15px; }
.episode-page .ns-promos li span { font: 500 12px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 1.6px; color: #b0a3b4; }
.episode-page .ns-promos li a { color: var(--pink, #ff2faf); }
.episode-page .portrait a { display: block; height: 100%; }

/* Long words in an Episode's name: the design sizes the title for short ones. */
.episode-page .heroLeft h1 { overflow-wrap: anywhere; }
.episode-page .heroLeft h1.ns-long { font-size: clamp(54px, 11vw, 150px); }
.episode-page .heroLeft h1.ns-xlong { font-size: clamp(42px, 8.2vw, 125px); letter-spacing: -2px; }

/* Written for this match: the bar under the match heading, same shape as the decision bar.
   The label is on its own line and every promo sits on a line of its own under it. */
.episode-page .matchResult.ns-promobar { flex-direction: column; align-items: flex-start; gap: 12px; }
.episode-page .ns-promobar .ns-promolist { display: flex; flex-direction: column; gap: 8px; width: 100%; min-width: 0; }
.episode-page .ns-promobar .ns-promolist a { display: block; font: 500 18px var(--heading); letter-spacing: 0.5px; color: #fff; overflow-wrap: anywhere; }
.episode-page .ns-promobar .ns-promolist a b { font: 500 11px var(--heading); letter-spacing: 1.6px; color: var(--gold); margin-right: 10px; }
.episode-page .ns-promobar .ns-promolist a:hover { color: var(--pink); }
/* The chapter's closing line sits under the decision bar. */
.episode-page .prose.ns-tail { padding-top: 0; padding-bottom: 50px; }
.episode-page .ns-tail .chapterEnd { margin-top: 34px; }

/* Segments: the cast listed in gold under "The Cast", and every picture standing on the bottom of its cell. */
.episode-page .ns-castline { margin: 10px 0 4px; font: 500 17px/1.5 var(--heading); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.episode-page .ns-castline a { color: var(--gold); }
.episode-page .ns-castline a:hover { color: #fff; }
.episode-page .ns-castline .ns-castsep { color: #8c798f; margin: 0 4px; }
.episode-page .portrait a { display: flex; align-items: flex-end; align-self: flex-end; height: 100%; }
.episode-page .portrait img { align-self: flex-end; }

/* A speaker's name and colon are bold; a character's name colour comes from the Management Office. */
.episode-page .prose .dialogue strong { font-weight: 700; }

/* ~~Text~~ in the writing: an indented block on the same dark panel the descriptions use. */
.episode-page .prose p.ns-indent { margin-left: 38px; padding: 18px 22px; background: linear-gradient(125deg, #241329, #100b12); }
@media (max-width: 560px) { .episode-page .prose p.ns-indent { margin-left: 16px; padding: 14px 16px; } }

/* A title match on the Card: the Title's picture centred along the top of the match. */
.nsk .ns-titlebanner, .episode-page .ns-titlebanner { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 24px 0; text-align: center; }
.nsk .ns-titlebanner img, .episode-page .ns-titlebanner img { display: block; max-width: min(520px, 84%); max-height: 150px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 10px 22px #000b); }
.nsk .ns-titlebanner span, .episode-page .ns-titlebanner span { font: 600 12px "Oswald", "Arial Narrow", sans-serif; letter-spacing: 3px; color: var(--gold, #e4b84a); }
.nsk .card-layout.compact .ns-titlebanner img { max-height: 90px; }

/* A segment set in a location: that location's picture behind the whole top row, under a
   shade that keeps the cast and the title readable. */
.episode-page .sceneTop.ns-hasloc {
  background: linear-gradient(90deg, rgba(6, 3, 6, 0.86) 0%, rgba(6, 3, 6, 0.5) 55%, rgba(6, 3, 6, 0.72) 100%), var(--loc-img) center / cover no-repeat;
}

/* A segment's top row: the location's picture fills the whole row (the match stage's picture
   when it has no location), the title runs across it on ONE line. (The cast are in the column
   down the right of the segment body.) */
.episode-page .ns-segbanner {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 14px;
  min-height: 340px; padding: 56px 45px; overflow: hidden;
  border: 1px solid #30263a;
  /* With no location: the same picture and shade a match's stage uses. */
  background: linear-gradient(to top, #0d0611 0%, #0d0611b0 62%, #0d0611ed 100%), url("/assets/brand/set-ring.webp") center / cover no-repeat;
}
.episode-page .ns-segbanner.has-loc {
  background: linear-gradient(180deg, rgba(6, 3, 6, 0.34) 0%, rgba(6, 3, 6, 0.86) 100%), var(--loc-img) center / cover no-repeat;
}
.episode-page .ns-segloc { margin: 0; font: 500 13px var(--heading); letter-spacing: 4px; color: var(--gold); text-transform: uppercase; }
.episode-page .ns-segtitle { margin: 0; width: 100%; white-space: nowrap; overflow: hidden; font: 600 clamp(56px, 6vw, 100px)/1.04 var(--heading); }
.episode-page .ns-segstill { margin: 18px 0 0; }
.episode-page .ns-segstill img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
@media (max-width: 780px) { .episode-page .ns-segbanner { min-height: 260px; padding: 36px 22px; } }

/* A segment's body: the writing on the left, and every character's upper-body picture stacked down
   the far right, against the border and starting at the very top (1st character first). The column's
   width is set by script so the stack is not much taller than the writing; it never goes below 110px. */
.episode-page .ns-segbody { display: block; }
.episode-page .ns-segbody.has-cast { display: grid; grid-template-columns: minmax(0, 1fr) var(--ns-castw, 230px); align-items: start; }
.episode-page .ns-segcast { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; align-self: start; }
.episode-page .ns-segcast a { display: block; }
.episode-page .ns-segcast img { display: block; width: 100%; height: auto; }
/* ON A PHONE the cast is a bar of round faces pinned under the reader bar for as long as that segment is being read; swipe it sideways when there
   are more faces than fit (the edge fades where there is more). Each face links to the bio; the names stay for screen readers. See the end of this
   file for the bar itself. */
@media (max-width: 780px) {
  .episode-page .ns-segbody.has-cast { display: flex; flex-direction: column; min-width: 0; }
  .episode-page .ns-segbody.has-cast > * { min-width: 0; }
}

/* The cast column, styled: each picture has its character's colour as a thin bar down its left edge and a
   soft glow of it behind (pink for a character with no colour), their name on a caption bar across the
   foot, and the whole column stays in view under the reader bar while the segment scrolls past. */
.episode-page .ns-segcast { position: sticky; top: 168px; }
.episode-page .ns-segcast a { position: relative; box-shadow: -10px 0 26px -8px var(--cc, #ff2faf); background: #0d0710; }
.episode-page .ns-segcast a::before { content: ""; position: absolute; z-index: 2; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc, #ff2faf); }
.episode-page .ns-segcast a::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(to top, rgba(6, 3, 8, 0.92), rgba(6, 3, 8, 0)); pointer-events: none; }
.episode-page .ns-capname { position: absolute; z-index: 3; left: 12px; right: 8px; bottom: 9px; font: 600 13px/1.15 var(--heading); letter-spacing: 1.4px; text-transform: uppercase; color: var(--cn, #fff); overflow-wrap: anywhere; text-shadow: 0 1px 6px #000; }
/* More than four characters: the pictures go two across (1st top left, 2nd top right, and so on),
   so a big cast still fits the screen and can stay in view. */
.episode-page .ns-segcast.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.episode-page .ns-segcast.two-col .ns-capname { left: 9px; right: 5px; bottom: 7px; font-size: 11px; letter-spacing: 1px; }
@media (max-width: 780px) {
  .episode-page .ns-segcast, .episode-page .ns-segcast.two-col {
    order: -1; position: sticky; top: var(--ns-sticky, 147px); z-index: 60;
    display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px;
    align-self: flex-start; box-sizing: border-box; width: 100vw; max-width: 100vw; margin: 0 calc(50% - 50vw) 20px; padding: 9px 16px;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none;
    background: #070408f7; border-bottom: 1px solid #4a2b52;
  }
  .episode-page .ns-segcast::-webkit-scrollbar { display: none; }
  .episode-page .ns-segcast.can-scroll { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%); }
  .episode-page .ns-segcast a { flex: 0 0 50px; width: 50px; height: 50px; max-width: none; border-radius: 50%; overflow: hidden; scroll-snap-align: start; box-shadow: 0 0 0 2px var(--cc, #ff2faf); background: #0d0710; }
  .episode-page .ns-segcast a:first-child { margin-left: auto; }
  .episode-page .ns-segcast a:last-child { margin-right: auto; }
  .episode-page .ns-segcast a::before, .episode-page .ns-segcast a::after { display: none; }
  .episode-page .ns-segcast img { display: block; width: 50px; height: 50px; max-width: none; object-fit: cover; object-position: 50% 14%; }
  .episode-page .ns-capname { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

/* The Card draws each match with the Episode page's stage. These fit it into the Card's page. */
.nsk .ns-cardmatch { margin: 0 0 34px; }
.nsk .ns-cardmatch .episode-page { background: transparent; }
.nsk .ns-cardmatch .episode-page .chapter { margin: 0; }
.nsk .ns-cardmatch .ns-cardfoot .match-footer { border-top: 1px solid #3d2842; background: #100a14; }
.nsk .ns-cardmatch .ns-cardfoot .match-details { border-top: 1px solid #3d2842; background: #0d0710; }
.nsk .ns-cardmatch .ns-titlebanner { padding-top: 6px; }
/* The Lineup view: names only, no pictures or big heading. */
.nsk .card-layout.compact .ns-cardmatch .figures,
.nsk .card-layout.compact .ns-cardmatch .matchHeading,
.nsk .card-layout.compact .ns-cardmatch .ns-titlebanner img { display: none; }
.nsk .card-layout.compact .ns-cardmatch .matchStage { padding-bottom: 28px; }

/* The Episode's hero: a minimum height instead of a fixed one, so the button never lands on the bottom row. */
.episode-page .showhero { height: auto; min-height: 700px; }
.episode-page .heroInner { height: auto; min-height: 620px; }

/* THE EVENT VIDEO behind the aired Episode page's header, the same as behind the Card's: it loops silently where the still picture was, darkened so the title and text
   stay readable whatever the footage is like (the left, where the text is, is almost black and eases off to the right). On a wide screen it stops at the width of the
   page's content and fades to black at its sides. A device set to reduce motion keeps the still picture. */
.episode-page .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; background: #060306; filter: saturate(.82) contrast(1.05) brightness(.8); }
.episode-page .showhero.has-video .heroImage { background: linear-gradient(90deg, #060306 3%, rgba(6, 3, 6, .94) 36%, rgba(6, 3, 6, .87) 47%, rgba(6, 3, 6, .6) 55%, rgba(6, 3, 6, .36) 68%, rgba(6, 3, 6, .2) 84%, rgba(6, 3, 6, .38)), linear-gradient(180deg, rgba(6, 3, 6, .4), transparent 20%); filter: none; }
@media (max-width: 820px) { .episode-page .showhero.has-video .heroImage { background: linear-gradient(180deg, rgba(6, 3, 6, .85), rgba(6, 3, 6, .73) 50%, rgba(6, 3, 6, .86) 82%, #060306); } }
@media (min-width: 1361px) {
  .episode-page .hero-video, .episode-page .showhero.has-video .heroImage { inset: 0 auto 0 50%; transform: translateX(-50%); width: 1360px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent 100%); }
}
@media (prefers-reduced-motion: reduce) { .episode-page .hero-video { display: none; } .episode-page .showhero.has-video .heroImage { inset: 0; transform: none; width: auto; -webkit-mask-image: none; mask-image: none; background: linear-gradient(90deg, #060306 1%, #080309de 33%, #12061855 70%, #06030688 100%), var(--hero-img, url("/assets/brand/set-ring.webp")) center 40%/cover; filter: saturate(.9); } }

/* Empty paragraphs in Episode writing (<p><br></p>: Enter pressed on an empty line, or blank lines pasted in).
   Every paragraph already has the paragraph gap below it, so one empty paragraph between two others used to add a whole
   extra line AND a second gap: three gaps where the editor shows one. Now the FIRST empty paragraph in a row adds nothing
   (the gap above it is the blank line the writer sees), and each further one in the row adds one more gap, so extra blank
   lines still make extra space. Same on the usual Episode page and the Transcendence page. */
.episode-page .prose p:has(> br:only-child) { margin: 0; height: 0; line-height: 0; overflow: hidden; }
.episode-page .prose p:has(> br:only-child) + p:has(> br:only-child) { height: 1.4em; }
.pe-t .story-body p:has(> br:only-child) { margin: 0; height: 0; line-height: 0; overflow: hidden; }
.pe-t .story-body p:has(> br:only-child) + p:has(> br:only-child) { height: 22px; }
