/* MNight.com — "Ending explained" pages (film.php?section=ending, inc/ending.php) and the hub (endings.php).
   Film colors arrive as --c / --g / --w / --lt from the .fp wrapper. */

/* ---------- teaser (always visible) ---------- */
.end-teaser p { margin: 0 0 16px; max-width: 64ch; font-size: 19px; line-height: 1.7; color: #d3d8de; text-wrap: pretty; }
.end-teaser p:last-child { margin-bottom: 0; }

/* ---------- spoiler veil ---------- */
.veil { position: relative; margin-top: 44px; }
.veil-gate { display: none; }
.veil-in { transition: filter 1s cubic-bezier(.22,1,.36,1), opacity 1s; }
.end-js .veil:not(.open) { max-height: 620px; overflow: hidden; cursor: pointer; }
.end-js .veil:not(.open) .veil-in { filter: blur(11px) saturate(.7); opacity: .55; pointer-events: none; user-select: none; -webkit-mask-image: linear-gradient(180deg, #000 25%, transparent 92%); mask-image: linear-gradient(180deg, #000 25%, transparent 92%); }
.end-js .veil:not(.open) .veil-gate { display: flex; position: absolute; z-index: 5; top: 64px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 48px)); flex-direction: column; align-items: center; gap: 20px; padding: 36px 32px 34px; text-align: center; background: rgba(8,9,11,.74); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); border-radius: 4px; box-shadow: inset 0 2px 0 var(--c), 0 0 70px var(--g); animation: vgIn .8s cubic-bezier(.22,1,.36,1) both; }
.veil-gate .cap { color: #e3e8ee; letter-spacing: .3em; }
.vg-moon { width: 46px; height: 46px; border-radius: 50%; box-shadow: inset 12px -5px 0 0 #e6ecf3, 0 0 26px var(--g); transform: rotate(-20deg); animation: vgMoon 5s ease-in-out infinite; }
.vg-btn:hover, .vg-btn:focus-visible { box-shadow: 0 0 0 1px var(--c), 0 0 30px var(--g); }
.veil.open.quick .veil-in { transition: none; }
@keyframes vgIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes vgMoon { 0%, 100% { box-shadow: inset 12px -5px 0 0 #e6ecf3, 0 0 22px var(--g); } 50% { box-shadow: inset 12px -5px 0 0 #fff, 0 0 38px var(--g); } }

/* ---------- the short version ---------- */
.end-card { position: relative; max-width: 860px; margin: 0 auto; padding: 34px 40px 30px; background: linear-gradient(160deg, #1b1f27, #13161c); border-top: 3px solid var(--c); box-shadow: 0 40px 80px -50px var(--g); }
.end-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 70% at 100% 0%, var(--w), rgba(0,0,0,0) 70%); }
.end-card > * { position: relative; z-index: 1; }
.end-card > .cap { color: var(--lt); }
.end-h2 { margin: 12px 0 20px; font-weight: 300; font-size: clamp(24px, 2.8vw, 34px); letter-spacing: .12em; text-transform: uppercase; line-height: 1.1; color: #f3f6fa; }
.end-card p { margin: 0 0 16px; max-width: 68ch; font-size: 17px; line-height: 1.75; color: #c3c8cf; text-wrap: pretty; }
.end-card p.end-lead { font-size: 20px; line-height: 1.6; color: #eef1f5; }
.end-card strong, .end-body strong { color: #f6f8fb; font-weight: 600; }
.end-card .end-lead strong { background: linear-gradient(90deg, #fff, var(--lt)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-down { display: inline-flex; gap: 10px; margin-top: 4px; color: var(--lt); transition: color .3s, text-shadow .3s, gap .35s cubic-bezier(.34,1.56,.64,1); }
.end-down:hover { color: #fff; text-shadow: 0 0 12px var(--c); gap: 16px; }
.end-splash { margin-top: 70px; }

/* ---------- the full breakdown ---------- */
.end-full { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px; padding-top: 80px; }
.end-side { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.end-side nav { display: flex; flex-direction: column; border-left: 1px solid rgba(255,255,255,.1); }
.end-side nav a { margin-left: -1px; padding: 8px 0 8px 16px; font-size: 14px; line-height: 1.35; color: #9aa0a8; border-left: 2px solid transparent; transition: color .25s, border-color .25s, padding .35s cubic-bezier(.34,1.56,.64,1); }
.end-side nav a:hover, .end-side nav a.on { color: #fff; border-color: var(--c); padding-left: 20px; }
.end-body { min-width: 0; max-width: 74ch; }
.end-kick { color: var(--lt); }
.end-h { display: flex; align-items: center; gap: 14px; margin: 60px 0 20px; font-weight: 300; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .12em; text-transform: uppercase; line-height: 1.15; color: #f3f6fa; scroll-margin-top: 80px; }
.end-h::before { content: ""; flex: 0 0 28px; height: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.end-kick + .end-h { margin-top: 16px; }
.end-card, #short { scroll-margin-top: 70px; }
.end-body p { margin: 0 0 18px; font-size: 17px; line-height: 1.75; color: #c3c8cf; text-wrap: pretty; }
.end-body a, .end-teaser a { color: #cfe0ff; border-bottom: 1px solid rgba(207,224,255,.3); transition: border-color .25s, color .25s; }
.end-body a:hover, .end-teaser a:hover { color: #fff; border-color: var(--c); }
.end-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.end-list li { position: relative; padding: 16px 20px 16px 46px; font-size: 16.5px; line-height: 1.7; color: #c3c8cf; background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); border-left: 2px solid var(--c); transition: background .4s, transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .4s; }
.end-list li::before { content: ""; position: absolute; left: 19px; top: 25px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--c); box-shadow: 0 0 10px var(--g); transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.end-list li:hover { background: var(--w); transform: translateX(3px); box-shadow: 0 0 30px -10px var(--g); }
.end-list li:hover::before { transform: rotate(225deg) scale(1.25); }
.end-srch { margin-top: 70px; }
.end-src { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; color: #8d96a3; }
.end-src li::marker { color: #6f7a88; }
.end-src a { color: #cfe0ff; border: 0; }
.end-src a:hover { color: #fff; text-shadow: 0 0 10px var(--c); }
.end-src span { display: block; color: #8d96a3; }

/* inline spoilers for other films: [spoiler=Film]...[/spoiler] */
.spl { cursor: pointer; padding: 1px 6px; border-radius: 3px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); transition: background .3s, box-shadow .3s; }
.spl:hover, .spl:focus-visible { background: var(--w); box-shadow: inset 0 0 0 1px var(--c); outline: 0; }
.spl-l { margin-right: 8px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--c); filter: brightness(1.25); }
.spl-l i { font-style: normal; }
.spl-t { filter: blur(5px); transition: filter .5s; }
.spl.open { cursor: auto; padding: 0; background: none; box-shadow: none; }
.spl.open .spl-l { display: none; }
.spl.open .spl-t { filter: none; }

/* ---------- hub (endings.php) ---------- */
.endh-card .qzi-n { color: var(--cl); }

@media (max-width: 900px) {
  .end-full { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 60px; }
  .end-side { position: static; }
  .end-side nav { flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; border: 0; }
  .end-side nav::-webkit-scrollbar { display: none; }
  .end-side nav a { flex: 0 0 auto; margin: 0; padding: 7px 13px; font-size: 12px; letter-spacing: .08em; border: 0; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
  .end-side nav a:hover, .end-side nav a.on { padding-left: 13px; box-shadow: inset 0 0 0 1px var(--c); }
}
@media (max-width: 600px) {
  .end-teaser p { font-size: 17px; }
  .end-card { padding: 26px 20px 22px; }
  .end-card p.end-lead { font-size: 18px; }
  .end-list li { padding: 14px 16px 14px 38px; font-size: 16px; }
  .end-list li::before { left: 15px; top: 23px; }
  .end-js .veil:not(.open) .veil-gate { top: 40px; padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .veil-in, .vg-moon, .veil-gate, .end-list li, .end-list li::before { animation: none !important; transition: none !important; }
}

/* Films page link to the hub */
.fl-end { align-self: flex-start; color: #cfe0ff; transition: color .3s, text-shadow .3s, letter-spacing .4s cubic-bezier(.34,1.56,.64,1); }
.fl-end:hover { color: #fff; text-shadow: 0 0 12px rgba(170,205,250,.6); letter-spacing: .4em; }
