/*
 * Foul Play — reveal.js theme
 *
 * Design tokens and geometry are lifted from the source PowerPoint. The deck
 * canvas is 1280x720, which maps 1:1 onto the original 12192000x6858000 EMU
 * slide (1px = 9525 EMU, 1pt = 4/3 px), so the px values below are the
 * original shape offsets converted straight across.
 */

:root {
  --ink-top: #1b1b2a; /* background gradient stop 0 */
  --ink-bottom: #11111a; /* background gradient stop 100% */
  --accent: #ff5c49; /* badge fill, title, highlights */
  --cream: #f7f4ec; /* body text */
  --muted: #9a9ab4; /* credit line */
  --ghost: #23233a; /* oversized background numeral */
}

/* ---------------------------------------------------------------- shell */

html {
  background: var(--ink-bottom);
}

.reveal-viewport {
  background: linear-gradient(180deg, var(--ink-top) 0%, var(--ink-bottom) 100%);
  background-attachment: fixed;
}

.reveal {
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

.reveal ::selection {
  background: var(--accent);
  color: #fff;
}

.reveal .slides section {
  width: 1280px;
  height: 720px;
  padding: 0;
  text-align: left;
}

/*
 * reveal sets `display: block` on the present section, so all layout lives on
 * this inner element instead of the section itself.
 */
.frame {
  position: relative;
  width: 1280px;
  height: 720px;
}

.reveal strong {
  font-weight: 700;
  color: var(--accent);
}

.reveal em {
  font-style: italic;
}

.reveal p,
.reveal h1,
.reveal h2 {
  margin: 0;
}

/* ----------------------------------------------------------- title slide */

.slide-title h1 {
  position: absolute;
  left: 160px; /* 1524000 EMU */
  top: 117.83px; /* 1122363 EMU */
  width: 960px;
  height: 250.64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 146.67px; /* 110pt */
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-align: center;
}

/*
 * The original run is coloured tx1 (black) over the dark background, so it is
 * invisible in PowerPoint. Rendered in cream to match the rest of the deck.
 */
.slide-title .tagline {
  position: absolute;
  left: 160px;
  top: 378.17px; /* 3602038 EMU */
  width: 960px;
  font-size: 32px; /* 24pt */
  font-weight: 400;
  line-height: 1.3;
  color: var(--cream);
  text-align: center;
}

.slide-title .credit {
  position: absolute;
  left: 160px;
  top: 594.67px; /* 5664200 EMU */
  width: 960px;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 21.33px; /* 16pt */
  color: var(--muted);
  text-align: center;
}

.slide-title .credit a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(154, 154, 180, 0.4);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.slide-title .credit a:hover,
.slide-title .credit a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ----------------------------------------------------------- rules slide */

.slide-rules h2 {
  position: absolute;
  left: 88px; /* 838200 EMU */
  top: 38.33px; /* 365125 EMU */
  width: 1104px;
  height: 139.17px;
  display: flex;
  align-items: center;
  font-size: 53.33px; /* 40pt */
  font-weight: 700;
  color: var(--cream);
}

.slide-rules .body {
  position: absolute;
  left: 88px;
  top: 191.67px; /* 1825625 EMU */
  width: 1104px;
  height: 456.83px;
}

.slide-rules .intro {
  font-size: 26.67px; /* 20pt */
  line-height: 1.5; /* 110% line spacing plus PowerPoint's own leading */
  color: var(--cream);
}

.slide-rules .rules-label {
  margin-top: 26px;
  font-size: 26.67px;
  font-weight: 700;
  color: var(--cream);
}

.slide-rules ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.slide-rules li {
  position: relative;
  margin-top: 10px;
  padding-left: 44px;
  font-size: 26.67px;
  line-height: 1.4;
  color: var(--cream);
  counter-increment: rule;
}

.slide-rules li:first-child {
  margin-top: 0;
}

.slide-rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--accent);
  text-align: right;
}

/* ---------------------------------------------------- interstitial slide */

.slide-interstitial h2 {
  position: absolute;
  left: 87.33px; /* 831850 EMU */
  top: 179.5px; /* 1709738 EMU */
  width: 1104px;
  height: 299.5px;
  display: flex;
  align-items: flex-end; /* the section-header layout bottom-anchors this */
  font-size: 72px; /* 54pt */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.slide-interstitial .subtitle {
  position: absolute;
  left: 87.33px;
  top: 481.83px; /* 4589463 EMU */
  width: 1104px;
  font-size: 32px; /* 24pt */
  line-height: 1.4;
  color: var(--cream);
}

/* Bolded in the original, but not accent-coloured. */
.slide-interstitial .subtitle strong {
  color: var(--cream);
}

/* -------------------------------------------------------- question slide */

.slide-question .ghost {
  position: absolute;
  left: 53.33px; /* 508000 EMU */
  top: 98.13px; /* 889000 EMU + the 45720 EMU top inset */
  font-size: 266.67px; /* 200pt */
  font-weight: 700;
  /* Montserrat's own ascent+descent. line-height: 1 would lift the numeral
   * ~34px above where PowerPoint sets it, losing the overlap with the
   * question text below. */
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--ghost);
  user-select: none;
}

.slide-question .badge {
  position: absolute;
  left: 640px; /* 480px pill at x=400px, i.e. centred on the canvas */
  top: 104px; /* 990600 EMU */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 480px; /* 4572000 EMU */
  height: 72px; /* 685800 EMU */
  padding: 0 36px;
  box-sizing: border-box;
  border-radius: 12px; /* roundRect default adjust: 0.16667 * 72px */
  background: var(--accent);
  color: #fff;
  font-size: 24px; /* 18pt */
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.slide-question .question {
  position: absolute;
  left: 173.33px; /* 1651000 EMU */
  top: 273.33px; /* 2603500 EMU */
  width: 933.33px; /* 8890000 EMU */
  height: 320px; /* 3048000 EMU, vertically centred */
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 48px; /* 36pt */
  font-weight: 700;
  line-height: 1.2;
  color: var(--cream);
  text-wrap: pretty;
}

/* Long questions step down so they stay inside the canvas. */
.slide-question .question.long {
  font-size: 40px;
}

.slide-question .question.longest {
  font-size: 34px;
}

/* --------------------------------------------------------- reveal chrome */

.reveal .progress {
  height: 4px;
  color: var(--accent);
  background: rgba(247, 244, 236, 0.08);
}

.reveal .controls {
  color: var(--muted);
  opacity: 0.5;
}

.reveal .controls button:hover {
  opacity: 1;
}

.reveal .slide-number {
  right: 14px;
  bottom: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(35, 35, 58, 0.7);
  color: var(--muted);
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 13px;
}

.reveal .slide-number a {
  color: inherit;
}

.reveal.overview .slides section {
  outline: 1px solid rgba(154, 154, 180, 0.18);
  border-radius: 6px;
}

/* --------------------------------------------------------------- portrait */

/*
 * On a portrait screen deck.js grows the reveal canvas to the window's own
 * aspect ratio (1280 wide, up to 2600 tall) so the slide fills the phone
 * rather than sitting letterboxed in a thin band. The fixed 16:9 offsets above
 * are meaningless at that size, so portrait re-lays everything out as a
 * centred column that works at any canvas height.
 */

.portrait .reveal .slides section {
  height: 100%;
}

.portrait .frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 72px;
  box-sizing: border-box;
}

.portrait .frame > * {
  position: static;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
  transform: none;
}

/* Title */

.portrait .slide-title h1 {
  display: block;
  font-size: 190px;
  line-height: 1;
}

.portrait .slide-title .tagline {
  margin-top: 40px;
  font-size: 52px;
  line-height: 1.3;
}

.portrait .slide-title .credit {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 6%;
  width: auto;
  font-size: 32px;
  line-height: 1.5;
}

/* Rules */

.portrait .slide-rules h2 {
  display: block;
  margin-bottom: 48px;
  font-size: 86px;
}

.portrait .slide-rules .intro,
.portrait .slide-rules .rules-label,
.portrait .slide-rules li {
  font-size: 42px;
}

.portrait .slide-rules .rules-label {
  margin-top: 40px;
}

.portrait .slide-rules ol {
  margin-top: 20px;
}

.portrait .slide-rules li {
  margin-top: 18px;
  padding-left: 64px;
}

.portrait .slide-rules li::before {
  width: 42px;
  font-size: 34px;
  line-height: 1.7;
}

/* Interstitial */

.portrait .slide-interstitial h2 {
  display: block;
  font-size: 120px;
}

.portrait .slide-interstitial .subtitle {
  margin-top: 32px;
  font-size: 52px;
}

/* Question */

.portrait .slide-question .frame {
  align-items: center;
  justify-content: center;
}

/* Deliberately overlaps the question text, as on the 16:9 canvas. */
.portrait .slide-question .ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 620px;
  line-height: 1;
  z-index: 0;
}

.portrait .slide-question .badge {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  height: 96px;
  margin-bottom: 64px;
  padding: 0 44px;
  border-radius: 16px;
  font-size: 34px;
}

/* Block is centred on the slide, but the text itself stays left-aligned —
 * centred ragged text is hard to read at this length. */
.portrait .slide-question .question,
.portrait .slide-question .question.long,
.portrait .slide-question .question.longest {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  font-size: 76px;
  line-height: 1.22;
  text-align: left;
}

.portrait .slide-question .question.long {
  font-size: 64px;
}

.portrait .slide-question .question.longest {
  font-size: 54px;
}

/* ------------------------------------------------------------ print / PDF */

@media print {
  .reveal-viewport {
    background: var(--ink-bottom);
  }
}
