/* AFTERMATH DIRECTOR
   Isolated cinematic layer for the shared post-match story transmission. */

.aftermath-director {
  --aftermath-accent: #a65be0;
  --aftermath-accent-rgb: 166, 91, 224;
  --aftermath-hot: #e5c4ff;
  --aftermath-ink: #030205;
}

.aftermath-director.aftermath-won {
  --aftermath-accent: #d8a83d;
  --aftermath-accent-rgb: 216, 168, 61;
  --aftermath-hot: #fff0b0;
}

.aftermath-director.aftermath-lost {
  --aftermath-accent: #c22f43;
  --aftermath-accent-rgb: 194, 47, 67;
  --aftermath-hot: #ffb1b9;
}

.aftermath-director .aftermath-dim {
  background:
    radial-gradient(ellipse at 50% 43%, rgba(var(--aftermath-accent-rgb), .18), transparent 42%),
    linear-gradient(115deg, rgba(var(--aftermath-accent-rgb), .07), transparent 35% 65%, rgba(var(--aftermath-accent-rgb), .05)),
    #020204;
  backdrop-filter: grayscale(.4) brightness(.38) blur(2px);
}

.aftermath-director .aftermath-dim::before,
.aftermath-director .aftermath-dim::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.aftermath-director .aftermath-dim::before {
  opacity: .34;
  background: repeating-linear-gradient(90deg, transparent 0 9.8vw, rgba(var(--aftermath-accent-rgb), .12) 9.9vw 10vw);
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
}

.aftermath-director .aftermath-dim::after {
  background: radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, .82) 100%);
}

.aftermath-board-ghost {
  position: absolute;
  inset: 10% 6%;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.2vw, 22px);
  opacity: .065;
  filter: blur(.25px);
  transform: perspective(900px) rotateX(62deg) translateY(19%);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.aftermath-board-ghost i {
  display: grid;
  place-items: center;
  border: 1px solid var(--aftermath-accent);
  color: var(--aftermath-hot);
  font: 900 clamp(60px, 10vw, 190px)/1 var(--font-display, sans-serif);
  font-style: normal;
  text-shadow: 0 0 30px var(--aftermath-accent);
}

.aftermath-director .aftermath-stage {
  width: min(76vw, 1280px);
  max-height: min(88vh, 940px);
  gap: clamp(13px, 1.5vw, 22px);
}

.aftermath-director .aftermath-identity {
  justify-content: flex-start;
  padding-inline: clamp(8px, 2vw, 30px);
}

.aftermath-director .aftermath-avatar {
  width: clamp(58px, 5.8vw, 94px);
  filter: grayscale(.18) drop-shadow(0 0 9px rgba(var(--aftermath-accent-rgb), .7));
}

.aftermath-director .aftermath-kicker,
.aftermath-scene-count,
.aftermath-scene-eyebrow,
.aftermath-scene-detail {
  font-family: var(--font-system, monospace);
  text-transform: uppercase;
  letter-spacing: .22em;
}

.aftermath-director .aftermath-title {
  color: var(--aftermath-hot);
  text-shadow: 0 0 18px rgba(var(--aftermath-accent-rgb), .66);
}

.aftermath-director .aftermath-panel {
  position: relative;
  display: grid;
  align-content: center;
  min-height: clamp(300px, 43vh, 500px);
  padding: clamp(46px, 5vw, 78px);
  overflow: hidden;
  border-color: rgba(var(--aftermath-accent-rgb), .55);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  background:
    linear-gradient(90deg, rgba(var(--aftermath-accent-rgb), .08), transparent 18% 82%, rgba(var(--aftermath-accent-rgb), .08)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.012) 5px 6px),
    rgba(3, 3, 6, .96);
  box-shadow: 0 30px 90px #000, inset 0 0 70px rgba(var(--aftermath-accent-rgb), .05), 0 0 40px rgba(var(--aftermath-accent-rgb), .15);
}

.aftermath-director .aftermath-panel::before,
.aftermath-director .aftermath-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--aftermath-accent) 12% 88%, transparent);
  box-shadow: 0 0 14px rgba(var(--aftermath-accent-rgb), .7);
}

.aftermath-director .aftermath-panel::before { top: 0; }
.aftermath-director .aftermath-panel::after { bottom: 0; }

.aftermath-scene-count {
  position: absolute;
  top: clamp(16px, 2vw, 26px);
  right: clamp(18px, 2.6vw, 38px);
  color: rgba(255,255,255,.35);
  font-size: clamp(8px, .65vw, 11px);
}

.aftermath-scene-eyebrow {
  margin: 0 auto clamp(18px, 2vw, 30px);
  color: var(--aftermath-accent);
  font-size: clamp(10px, .9vw, 14px);
  font-weight: 900;
  text-shadow: 0 0 12px rgba(var(--aftermath-accent-rgb), .45);
}

.aftermath-director .aftermath-story,
.aftermath-director .aftermath-final-line {
  max-width: 980px;
  text-align: center;
  color: #eeeaf1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 1.65vw, 31px);
  line-height: 1.58;
}

.aftermath-director .aftermath-final-line {
  margin-top: 0;
  color: var(--aftermath-hot);
  font-family: var(--font-display, sans-serif);
  font-size: clamp(30px, 3.4vw, 62px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(var(--aftermath-accent-rgb), .75), 0 0 34px rgba(var(--aftermath-accent-rgb), .38);
}

.aftermath-scene-detail {
  min-height: 1.2em;
  margin-top: clamp(18px, 2.2vw, 34px);
  text-align: center;
  color: rgba(255,255,255,.47);
  font-size: clamp(9px, .78vw, 12px);
}

.aftermath-director[data-scene="evidence"] .aftermath-story {
  color: var(--aftermath-hot);
  font-family: var(--font-display, sans-serif);
  font-size: clamp(34px, 5vw, 84px);
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1;
}

.aftermath-director[data-scene="opening"] .aftermath-panel,
.aftermath-director[data-scene="final"] .aftermath-panel {
  background:
    radial-gradient(circle at center, rgba(var(--aftermath-accent-rgb), .16), transparent 52%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.012) 5px 6px),
    rgba(3, 3, 6, .97);
}

.aftermath-director.scene-enter .aftermath-scene-eyebrow,
.aftermath-director.scene-enter .aftermath-story,
.aftermath-director.scene-enter .aftermath-final-line,
.aftermath-director.scene-enter .aftermath-scene-detail {
  animation: aftermath-scene-arrive .52s cubic-bezier(.2,.75,.2,1) both;
}

.aftermath-director.scene-enter .aftermath-story,
.aftermath-director.scene-enter .aftermath-final-line { animation-delay: .09s; }
.aftermath-director.scene-enter .aftermath-scene-detail { animation-delay: .18s; }

.aftermath-director .aftermath-btn {
  border-color: rgba(var(--aftermath-accent-rgb), .58);
  color: var(--aftermath-hot);
}

.aftermath-director .aftermath-btn:hover:not(:disabled) {
  border-color: var(--aftermath-accent);
  background: rgba(var(--aftermath-accent-rgb), .13);
  box-shadow: 0 0 22px rgba(var(--aftermath-accent-rgb), .27);
}

@keyframes aftermath-scene-arrive {
  from { opacity: 0; filter: blur(5px); transform: translateY(11px) scale(.992); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  :where(html:not(.asoc-mobile)) .aftermath-director .aftermath-stage { width: min(94vw, 780px); }
  :where(html:not(.asoc-mobile)) .aftermath-director .aftermath-panel { min-height: 300px; padding: 52px 24px 34px; }
  :where(html:not(.asoc-mobile)) .aftermath-board-ghost { inset-inline: 2%; }
}

@media (prefers-reduced-motion: reduce) {
  .aftermath-director.scene-enter .aftermath-scene-eyebrow,
  .aftermath-director.scene-enter .aftermath-story,
  .aftermath-director.scene-enter .aftermath-final-line,
  .aftermath-director.scene-enter .aftermath-scene-detail { animation: none !important; }
}
/* Broker reading room: restrained metal, warm ink and one final violet reveal. */
.aftermath-overlay.aftermath-director{--aftermath-accent:#a983ce;--aftermath-accent-rgb:169,131,206;--aftermath-hot:#e0cbef;padding:24px;animation:none}
.aftermath-director .aftermath-dim{background:radial-gradient(ellipse at 50% 40%,#21132b77,transparent 65%),#050508ed;backdrop-filter:blur(8px) brightness(.4)}
.aftermath-director .aftermath-dim::before{opacity:.12}
.aftermath-director .aftermath-grain{animation:none;opacity:.045}
.aftermath-director .aftermath-stage{box-sizing:border-box;width:min(960px,100%);max-height:calc(100dvh - 48px);min-height:0;gap:22px;transform:none}
.aftermath-director .aftermath-identity{flex:none;gap:18px;padding:0 6px;opacity:1;transform:none;animation:none;min-width:0}
.aftermath-portrait{flex:none;width:64px;height:64px;border:1px solid #ad8ac16e;padding:4px;border-radius:50%;background:linear-gradient(145deg,#59515d,#19161e 45%,#08080c);box-shadow:0 0 0 4px #17101f,0 0 28px #8c4db72b}
.aftermath-director .aftermath-avatar{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;filter:none}
.aftermath-director .aftermath-kicker{font:700 10px/1.5 var(--font-system,monospace);letter-spacing:.19em;color:#a497af;margin-bottom:7px}
.aftermath-director .aftermath-title{font-size:clamp(25px,3vw,38px);line-height:1.1;letter-spacing:.2em;text-shadow:none;color:#e9ddf2}
.aftermath-signal{margin-left:auto;flex:none;font:700 9px/1.4 var(--font-system,monospace);letter-spacing:.15em;color:#c1a3d5;border:1px solid #9073a53b;padding:7px 10px;border-radius:4px;background:#1f152a66}
.aftermath-director .aftermath-panel.aftermath-typewriter-panel{display:flex;flex-direction:column;gap:24px;min-height:240px;max-height:100%;padding:32px 40px;clip-path:none;border:1px solid #8973955c;border-radius:14px;background:linear-gradient(135deg,#24202999,#121116 34%,#0c0c10);box-shadow:0 30px 90px #0009,inset 0 1px 0 #ffffff0d;opacity:1;transform:none;animation:none;overflow:hidden}
.aftermath-director .aftermath-panel::before{height:1px;background:linear-gradient(90deg,transparent,#d8bde79c,transparent);box-shadow:none}
.aftermath-director .aftermath-panel::after{display:none}
.aftermath-reading-label{display:flex;justify-content:space-between;gap:12px;flex:none;color:#9c8aa8;font:700 9px/1.5 var(--font-system,monospace);letter-spacing:.17em;padding-bottom:16px;border-bottom:1px solid #bba6ce21}
.aftermath-progress{color:#887e91;white-space:nowrap;letter-spacing:.09em}
.aftermath-director .aftermath-story{box-sizing:border-box;width:100%;max-width:68ch;max-height:55dvh;min-height:50px;margin:0 auto;overflow-y:auto;overscroll-behavior:contain;padding:0 12px 4px 0;scrollbar-width:thin;scrollbar-color:#695379 #18131c;text-align:left;font:400 clamp(18px,1.55vw,22px)/1.7 Georgia,"Times New Roman",serif;letter-spacing:.004em;text-transform:none;white-space:normal;color:#e7e1d8;text-shadow:none;outline-offset:-2px}
.aftermath-director .aftermath-sentence{position:relative;margin:0 0 1em;opacity:1;text-wrap:pretty;animation:aftermath-paragraph-in .23s ease both}
.aftermath-director .aftermath-sentence:last-child{margin-bottom:0}
.aftermath-director .aftermath-sentence.is-typing::after{content:"▏";color:#bca1ce;margin-left:1px;animation:aftermath-caret .8s steps(1,end) infinite}
.aftermath-director .aftermath-closing{padding:4px 0 4px 20px;border-left:2px solid #a580c3;font-size:1.13em;line-height:1.55;color:#e5d1f1;overflow:hidden}
.aftermath-director .aftermath-closing.is-complete::before{content:"";pointer-events:none;position:absolute;inset:0;background:linear-gradient(100deg,transparent 25%,#c994f115 50%,transparent 75%);transform:translateX(-100%);animation:aftermath-final-sweep .9s ease-out forwards}
.aftermath-director .aftermath-final-solution{align-self:flex-end;flex:none;display:grid;gap:5px;min-width:150px;margin:0;padding:12px 20px;border:1px solid #a48ab943;border-radius:6px;background:linear-gradient(120deg,#33263888,#19151e);box-shadow:inset 0 1px 0 #ffffff0a;opacity:0;text-align:left;letter-spacing:.1em;transform:translateY(5px);transition:opacity .3s ease,transform .3s ease}
.aftermath-director .aftermath-final-solution small{font:700 9px/1.4 var(--font-system,monospace);letter-spacing:.2em;color:#aa93bd}
.aftermath-director .aftermath-final-solution strong{font:700 clamp(18px,2vw,25px)/1.2 var(--font-display,serif);color:#ebdbf6;overflow-wrap:anywhere;max-width:100%}
.aftermath-director .aftermath-final-solution.is-visible{opacity:1;transform:none}
.aftermath-director [hidden]{display:none!important}
.aftermath-reader-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.aftermath-director .aftermath-controls{flex:none;justify-content:flex-end;align-items:center;gap:12px;min-height:44px}
.aftermath-speed{display:flex;align-items:center;gap:10px;margin-right:auto;font:700 9px/1.4 var(--font-system,monospace);letter-spacing:.12em;color:#a397ac}
.aftermath-speed select{min-height:40px;padding:8px 26px 8px 12px;border:1px solid #79608666;border-radius:6px;background:#161119;color:#e3d5ec;font:500 12px/1.2 Arial,sans-serif;color-scheme:dark}
.aftermath-director .aftermath-btn{min-height:44px;min-width:0;padding:12px 18px;border-radius:6px;font:700 10px/1.4 var(--font-system,monospace);letter-spacing:.12em;border-color:#9c7eb255;background:#141017;color:#c5b1d2;box-shadow:none}
.aftermath-director .aftermath-continue{background:linear-gradient(135deg,#604273,#382440);border-color:#b28cc5a6;color:#f7ecfc}
.aftermath-director .aftermath-continue span{margin-left:14px}
.aftermath-director :is(button,select,.aftermath-story):focus-visible{outline:2px solid #ddbae9;outline-offset:3px}
.aftermath-wait{flex:none;text-align:center;color:#877b90;font:700 9px/1.5 var(--font-system,monospace);letter-spacing:.14em}
@keyframes aftermath-paragraph-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes aftermath-final-sweep{to{transform:translateX(100%)}}
@keyframes aftermath-caret{0%,49%{opacity:1}50%,100%{opacity:0}}
@media(max-width:600px){
 .aftermath-overlay.aftermath-director{padding:14px}
 .aftermath-director .aftermath-stage{max-height:calc(100dvh - 28px);gap:16px}
 .aftermath-director .aftermath-identity{gap:12px;padding:0}
 .aftermath-portrait{width:46px;height:46px;padding:3px}
 .aftermath-director .aftermath-title{font-size:23px;letter-spacing:.13em}
 .aftermath-director .aftermath-kicker{font-size:8px;letter-spacing:.1em}
 .aftermath-signal{display:none}
 .aftermath-director .aftermath-panel.aftermath-typewriter-panel{padding:22px 20px;gap:18px;min-height:160px;border-radius:10px}
 .aftermath-director .aftermath-story{font-size:18px;max-height:52dvh;line-height:1.6}
 .aftermath-reading-label{font-size:8px;letter-spacing:.08em}
 .aftermath-director .aftermath-controls{flex-wrap:wrap;justify-content:stretch;gap:10px}
 .aftermath-speed{flex:1 1 100%;justify-content:space-between}
 .aftermath-director .aftermath-btn{flex:1;padding:12px}
 .aftermath-director .aftermath-closing{padding-left:14px}
}
@media(max-height:500px){.aftermath-director .aftermath-stage{gap:10px}.aftermath-director .aftermath-panel.aftermath-typewriter-panel{padding:16px 24px;gap:12px;min-height:0}.aftermath-director .aftermath-story{max-height:38dvh}.aftermath-portrait{width:38px;height:38px}.aftermath-director .aftermath-title{font-size:23px}}
@media(prefers-reduced-motion:reduce){.aftermath-overlay.aftermath-director,.aftermath-director *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
