:root {
  color-scheme: dark;
  --gold: #f2c14e;
  --ink: #f7f8fa;
  --muted: #b9c4cf;
  --panel: rgba(5, 12, 25, .96);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071019;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body { user-select: none; }
button { font: inherit; }

.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #071019;
}

.slide-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #071019;
  container-type: size;
}

.slide-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  transform: scale(1.001);
  transition: opacity .28s ease, transform .42s ease;
}

.slide-frame[data-background-layout="portrait"] .slide-background {
  object-fit: contain;
  object-position: right center;
}

.background-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 10, .97) 0%, rgba(2, 6, 10, .9) 30%, rgba(2, 6, 10, .58) 46%, rgba(2, 6, 10, .08) 66%, rgba(2, 6, 10, .04) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .12));
}

.slide-copy {
  --accent: #f2c14e;
  position: absolute;
  z-index: 3;
  top: 7.8%;
  bottom: 7.8%;
  left: 5.2%;
  width: 39.5%;
  padding-left: 2.2%;
  color: #fff;
}

.slide-copy::before {
  content: "";
  position: absolute;
  top: 2%;
  bottom: 1%;
  left: 0;
  width: .48cqw;
  min-width: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.slide-section {
  color: var(--accent);
  font-size: 1.22cqw;
  font-weight: 800;
  letter-spacing: .06em;
}

.slide-title {
  max-width: 100%;
  margin: 5.2% 0 0;
  font-size: 3.35cqw;
  font-weight: 760;
  letter-spacing: -.025em;
  line-height: 1.04;
  text-wrap: balance;
}

.slide-subtitle {
  display: none;
  margin: 7% 0 0;
  color: #d9e4eb;
  font-size: 2.05cqw;
  line-height: 1.24;
}

.slide-bullets {
  display: grid;
  gap: 1.65cqh;
  margin: 8.5% 0 0;
  padding: 0;
  list-style: none;
  color: #f5f8fa;
  font-size: 1.88cqw;
  line-height: 1.22;
}

.slide-bullets li {
  position: relative;
  padding-left: 1.45em;
}

.slide-bullets li::before {
  content: "";
  position: absolute;
  top: .52em;
  left: .15em;
  width: .36em;
  height: .36em;
  border-radius: 50%;
  background: var(--accent);
}

.slide-footer-copy {
  display: none;
  position: absolute;
  bottom: 2%;
  margin: 0;
  color: #a7bbc8;
  font-size: 1.25cqw;
}

.class-races { display: none; }

.slide-frame[data-class-slide="true"] .slide-copy {
  width: 42.5%;
}

.slide-frame[data-class-slide="true"] .slide-title {
  margin-top: 3.8%;
  font-size: 3.05cqw;
}

.slide-frame[data-class-slide="true"] .slide-subtitle {
  display: block;
  margin: 3.2% 0 0;
  color: var(--accent);
  font-size: 1.2cqw;
  font-weight: 750;
  line-height: 1.25;
}

.slide-frame[data-class-slide="true"] .slide-bullets {
  gap: 1.05cqh;
  margin-top: 5.5%;
  font-size: 1.58cqw;
  line-height: 1.18;
}

.slide-frame[data-class-slide="true"] .class-races {
  display: block;
  margin-top: 5.2%;
  padding-top: 3.5%;
  border-top: 1px solid rgba(255,255,255,.2);
}

.class-races-heading {
  margin-bottom: 1.5%;
  color: #fff;
  font-size: 1.18cqw;
  font-weight: 800;
}

.class-race-row {
  margin: .45em 0 0;
  color: #dce7ee;
  font-size: 1.08cqw;
  line-height: 1.25;
}

.class-race-row.alliance strong { color: #76baff; }
.class-race-row.horde strong { color: #ff7b64; }

.slide-number {
  position: absolute;
  bottom: 0;
  color: #a7bbc8;
  font-size: 1.05cqw;
  font-weight: 800;
}

.slide-frame[data-cover="true"] .slide-copy {
  top: 19%;
  bottom: 12%;
  width: 44%;
}

.slide-frame[data-cover="true"] .slide-title {
  margin-top: 9%;
  font-size: 4.85cqw;
  line-height: .96;
}

.slide-frame[data-cover="true"] .slide-subtitle,
.slide-frame[data-cover="true"] .slide-footer-copy { display: block; }

.slide-frame[data-cover="true"] .slide-bullets,
.slide-frame[data-cover="true"] .slide-number { display: none; }

.slide-frame.is-changing .slide-background {
  opacity: .22;
  transform: scale(1.012);
}

.reveal-stage {
  position: absolute;
  z-index: 5;
  top: 1.8%;
  right: 1.5%;
  bottom: 3.8%;
  left: 51%;
  pointer-events: none;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,.42));
}

.reveal-card {
  --x: 50%;
  --y: 50%;
  --w: 80%;
  --h: 95%;
  --r: 0deg;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: clamp(7px, .8vw, 14px);
  background: rgba(4,9,17,.92);
  box-shadow: 0 24px 55px rgba(0,0,0,.58), 0 5px 15px rgba(0,0,0,.45);
  opacity: 0;
  transform: translate(-50%, -46%) rotate(var(--r)) scale(.92);
  transition: opacity .38s ease, transform .58s cubic-bezier(.18,.8,.2,1), filter .35s ease;
  will-change: opacity, transform;
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--r)) scale(1);
  pointer-events: auto;
  cursor: zoom-in;
}

.reveal-card.is-visible:hover,
.reveal-card.is-visible:focus-visible {
  border-color: rgba(242,193,78,.78);
  filter: brightness(1.08);
  outline: none;
}

.reveal-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: radial-gradient(circle at 50% 40%, #172338, #050a12 72%);
}

.reveal-caption {
  display: none;
}

.reveal-stage[data-count="2"] .reveal-card { --w: 66%; --h: 95%; }
.reveal-stage[data-count="3"] .reveal-card { --w: 60%; --h: 95%; }
.reveal-stage[data-count="4"] .reveal-card { --w: 58%; --h: 95%; }
.reveal-stage[data-count="5"] .reveal-card { --w: 52%; --h: 95%; }

.tools {
  position: fixed;
  z-index: 30;
  top: clamp(16px, 2.4vw, 30px);
  right: clamp(18px, 2.5vw, 36px);
  display: flex;
  gap: 9px;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: rgba(255,255,255,.86);
  background: rgba(5,12,25,.6);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.icon-button:hover, .icon-button:focus-visible, .icon-button[aria-expanded="true"] {
  color: var(--gold);
  border-color: rgba(242,193,78,.55);
  outline: none;
}

.text-icon { font-weight: 800; }

.presentation-footer {
  position: fixed;
  z-index: 20;
  left: clamp(24px, 3.6vw, 52px);
  right: clamp(24px, 3.6vw, 52px);
  bottom: clamp(17px, 2.4vw, 34px);
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  color: rgba(255,255,255,.64);
  font-size: clamp(11px, .75vw, 14px);
  letter-spacing: .03em;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width .35s ease;
}

.status { min-width: 120px; text-align: center; }
.hint { text-align: right; }
.hint kbd { color: var(--gold); font: inherit; font-weight: 800; }

.notes-panel {
  position: fixed;
  z-index: 28;
  right: clamp(24px, 3.4vw, 52px);
  bottom: clamp(68px, 8vw, 104px);
  width: min(580px, calc(100vw - 48px));
  max-height: min(58vh, 500px);
  overflow: auto;
  padding: 24px 27px;
  border: 1px solid rgba(242,193,78,.36);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 30px 84px rgba(0,0,0,.68);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}

.chapters-panel {
  position: fixed;
  z-index: 29;
  top: clamp(74px, 7vw, 104px);
  left: clamp(20px, 3.4vw, 52px);
  bottom: clamp(68px, 8vw, 104px);
  width: min(440px, calc(100vw - 40px));
  overflow: auto;
  padding: 24px 24px 20px;
  border: 1px solid rgba(242,193,78,.36);
  border-radius: 15px;
  background: #050c19;
  box-shadow: 0 30px 84px rgba(0,0,0,.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.deck.chapters-open .chapters-panel {
  opacity: 1;
  pointer-events: auto;
}

.chapters-panel h2 {
  margin: 0 0 15px;
  font-size: clamp(20px, 1.55vw, 28px);
}

.chapter-list {
  display: grid;
  gap: 7px;
}

.chapter-button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  color: #edf1f7;
  background: rgba(255,255,255,.035);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.chapter-button:hover,
.chapter-button:focus-visible {
  border-color: rgba(242,193,78,.5);
  background: rgba(242,193,78,.08);
  outline: none;
  transform: translateX(2px);
}

.chapter-button.is-current {
  border-color: rgba(242,193,78,.7);
  background: rgba(242,193,78,.14);
}

.chapter-index {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.chapter-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chapter-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-range {
  color: #9fb0bc;
  font-size: 11px;
  font-weight: 700;
}

.chapters-tip {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.deck.notes-open .notes-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.panel-kicker {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.notes-panel h2, dialog h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 1.55vw, 28px);
}

.notes-panel p {
  margin: 0;
  color: #edf1f7;
  font-size: clamp(15px, 1.1vw, 19px);
  line-height: 1.52;
}

.notes-panel .notes-tip {
  margin-top: 15px;
  color: var(--muted);
  font-size: 13px;
}

dialog {
  width: min(690px, calc(100vw - 36px));
  max-height: min(78vh, 760px);
  overflow: auto;
  border: 1px solid rgba(242,193,78,.36);
  border-radius: 15px;
  padding: 28px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 34px 100px rgba(0,0,0,.74);
}

dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.source-list { display: grid; gap: 9px; margin: 18px 0 24px; }
.source-list a { color: #cfe6ff; line-height: 1.35; text-decoration-color: rgba(207,230,255,.42); }
.source-list a:hover { color: var(--gold); }
.source-list p { color: var(--muted); }
.close-button { padding: 9px 17px; cursor: pointer; }

.image-dialog {
  width: min(96vw, 1800px);
  height: min(94vh, 1100px);
  max-width: none;
  max-height: none;
  overflow: hidden;
  padding: 18px;
  border-color: rgba(242,193,78,.58);
  background: rgba(3, 8, 16, .97);
}

.image-dialog figure {
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.image-dialog img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.image-dialog figcaption {
  padding: 2px 54px 2px 12px;
  color: #edf1f7;
  font-size: clamp(14px, 1.1vw, 19px);
  line-height: 1.35;
  text-align: center;
}

.image-dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: white;
  background: rgba(5,12,25,.78);
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
}

.image-dialog-close:hover,
.image-dialog-close:focus-visible {
  color: var(--gold);
  border-color: rgba(242,193,78,.7);
  outline: none;
}

.screen-reader-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 850px) {
  .reveal-stage { left: 49%; right: 1%; }
  .presentation-footer { grid-template-columns: 1fr auto; }
  .hint { display: none; }
  .notes-panel { right: 18px; bottom: 64px; width: calc(100vw - 36px); }
  .chapters-panel { top: 68px; left: 18px; bottom: 64px; width: calc(100vw - 36px); }
}

@media (max-height: 760px) {
  .chapters-panel {
    top: 64px;
    bottom: 48px;
    padding: 18px 20px 16px;
  }

  .chapters-panel h2 { margin-bottom: 10px; }
  .chapter-list { gap: 5px; }
  .chapter-button { padding: 8px 10px; }
  .chapter-copy small { display: none; }
  .chapters-tip { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
