:root {
  color-scheme: dark;
  --lapis: #1b2a6b;
  --gold: #e0b653;
  --gold-pale: #f6e6b4;
  --ember: #f0521c;
  --ember-pale: #ff8a5c;
  --oxblood: #5a0f0b;
  --char: #0e0a0b;
  --bone: #efe7d8;
  --ash: #a39889;
  --tablet: rgba(16, 13, 19, 0.84);
  --rule: rgba(239, 231, 216, 0.12);
  --logo-cream: #fdf0c6;
  --logo-orange: #fe581a;

  --font-display: "Grenze Gotisch", "Times New Roman", serif;
  --font-text: "Newsreader", Georgia, serif;
  --font-ui: "Instrument Sans", system-ui, sans-serif;
  --font-numeral: "Grenze", "Times New Roman", serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #120e1c;
  color: var(--bone);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

/* The game is a phone app: the page itself never scrolls or changes size.
   Every screen fits the phone exactly, and only the inside of the game
   window scrolls. (The privacy and results pages scroll normally.) */
/* Like an app, not a web page: long-pressing a fact or button doesn't pop up
   text selection handles. The note form's fields still select normally. */
body.app {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

body.app input, body.app textarea, body.app select { -webkit-user-select: text; user-select: text; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold-pale);
  outline-offset: 3px;
}

/* No grey flash over buttons and links when tapped on phones: each has its own
   pressed look instead, and keyboard users still get the focus ring above. */
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
html, body { overscroll-behavior-y: none; }
.link-btn { transition: opacity 0.15s, color 0.2s; }
.link-btn:active { opacity: 0.6; }

[hidden] { display: none !important; }

/* ---------- The scene: heaven above, hell below ----------
   body[data-lean] tilts the light toward whichever verdict the player holds. */

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  /* The page's base colour sits here, on a fixed layer, so it covers the
     screen the same way on every phone however long the page is. */
  background: linear-gradient(180deg, #131a3d 0%, #120e1c 48%, #1a0907 100%);
}

.scene > div {
  position: absolute;
  inset: 0;
  transition: opacity 1.1s var(--ease);
}

.scene__sky {
  background:
    radial-gradient(ellipse 110% 55% at 50% -12%, rgba(246, 230, 180, 0.55), rgba(76, 111, 217, 0.28) 45%, transparent 72%);
  opacity: 0.45;
}

.scene__rays {
  background: repeating-conic-gradient(from 180deg at 50% -20%, rgba(246, 230, 180, 0.07) 0deg 3deg, transparent 3deg 11deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  opacity: 0;
}

.scene__pit {
  background:
    radial-gradient(ellipse 120% 50% at 50% 112%, rgba(240, 82, 28, 0.6), rgba(90, 15, 11, 0.55) 45%, transparent 75%);
  opacity: 0.45;
}

/* The embers float above the cards and the verdict bar (z-index over the
   stage), so Hell's sparks rise over the screen instead of vanishing behind
   it. pointer-events: none lets taps through. */
.embers {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 1.1s var(--ease);
}

.ember {
  position: absolute;
  bottom: -10px;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: #ffb36b;
  box-shadow: 0 0 6px 2px rgba(240, 82, 28, 0.7);
  animation: rise var(--dur, 8s) linear var(--delay, 0s) infinite;
}

@keyframes rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--sway, 20px), -70vh); opacity: 0; }
}

body[data-lean="heaven"] .scene__sky { opacity: 1; }
body[data-lean="heaven"] .scene__rays { opacity: 1; }
body[data-lean="heaven"] .scene__pit { opacity: 0.08; }
body[data-lean="heaven"] .embers { opacity: 0; }

body[data-lean="hell"] .scene__sky { opacity: 0.06; }
body[data-lean="hell"] .scene__pit { opacity: 1; }
body[data-lean="hell"] .embers { opacity: 1; }

/* ---------- Layout ---------- */

/* Phone-shaped: the full screen on a phone; on a tablet or computer, a
   phone-sized column in the middle, so the game looks the same everywhere. */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  height: 100vh;
  height: 100dvh;
  max-height: 60rem;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Lets text inside size itself from the game's width (cqi) rather than the
     screen's, which differ on tablets and computers. */
  container-type: inline-size;
}

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.credit {
  margin: 10px 0 0;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--ash);
}

/* Links inside a line of text get a 48 px tall tap area without spreading the
   lines apart: padding grows the box, an equal negative margin cancels it. */
.credit a,
.account__note a,
.page p a,
.page li a {
  display: inline-block;
  min-width: 48px;
  padding: 16px 6px;
  margin: -16px -6px;
  text-align: center;
}

/* ---------- Intro ---------- */

.intro { text-align: center; }

/* The rules scroll if a small phone can't fit them; the start button stays
   at the bottom, under the thumb. Auto margins centre the rules when they fit. */
.intro__scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 4px 0 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
}
.intro__scroll::-webkit-scrollbar { display: none; }
.intro__scroll > :first-child { margin-top: auto; }
.intro__scroll > :last-child { margin-bottom: auto; }

.intro__foot {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
}
.intro__foot .cta { width: 100%; max-width: 22rem; }

.title {
  position: relative;
  isolation: isolate;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.82;
}

/* The logo's two layers sit on top of each other: "Heaven or" and "Be the
   judge" with a cream glow, "Hell" with a red one. */
.logo {
  display: grid;
  width: min(72%, 19rem);
  margin: 0 auto 6px;
  line-height: 0;
}

.logo img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
}

.logo__light {
  filter:
    drop-shadow(0 0 3px rgba(255, 238, 200, 0.45))
    drop-shadow(0 0 10px rgba(255, 150, 90, 0.25));
}

.logo__hell {
  filter:
    drop-shadow(0 0 3px rgba(255, 96, 60, 0.4))
    drop-shadow(0 0 11px rgba(214, 28, 12, 0.5));
}

.title__heaven,
.title__hell {
  font-size: clamp(5rem, 28vw, 11rem);
  letter-spacing: -0.01em;
}

/* The logo: cream Heaven, orange Hell, everything glowing (from horhlogo.png). */
.title__heaven {
  color: var(--logo-cream);
  text-shadow:
    0 0 6px rgba(255, 244, 210, 0.9),
    0 0 22px rgba(255, 236, 190, 0.65),
    0 0 60px rgba(255, 226, 170, 0.5),
    0 0 120px rgba(255, 214, 150, 0.35);
}

.title__hell {
  color: var(--logo-orange);
  text-shadow:
    0 0 6px rgba(255, 120, 60, 0.9),
    0 0 24px rgba(254, 88, 26, 0.7),
    0 0 64px rgba(254, 88, 26, 0.55),
    0 0 130px rgba(240, 70, 20, 0.4);
}

.title__or {
  margin: 0.2em 0 0.05em;
  font-family: var(--font-text);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.8rem, 9vw, 2.8rem);
  line-height: 1;
  color: var(--logo-cream);
  text-shadow: 0 0 8px rgba(255, 240, 200, 0.85), 0 0 26px rgba(255, 230, 180, 0.55);
}

.subtitle {
  margin: 22px 0 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(0.95rem, 4.4vw, 1.45rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--logo-cream);
  text-shadow: 0 0 8px rgba(255, 240, 200, 0.75), 0 0 26px rgba(255, 230, 180, 0.45);
}

.lede {
  max-width: 29rem;
  margin: 18px 0 22px;
  font-size: 1.125rem;
  color: rgba(239, 231, 216, 0.82);
}

/* The points table on the intro */
.tariff {
  width: 100%;
  max-width: 20rem;
  margin: 0 0 30px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}

.tariff div {
  display: flex;
  justify-content: space-between;
  padding: 7px 2px;
  border-top: 1px solid var(--rule);
}

.tariff div:first-child { border-top: 0; }

.tariff dt { color: rgba(239, 231, 216, 0.8); }

.tariff dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
}

.tariff .tariff__note { justify-content: center; }
.tariff__note dt { color: var(--ash); font-size: 0.8rem; }

.points--match, .points--split { color: var(--gold-pale); }
.points--against { color: var(--ember-pale); }

.fineprint {
  margin: 12px 0 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ash);
}

/* ---------- Buttons ---------- */

.cta {
  display: inline-block;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--bone);
  color: var(--char);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.cta:hover { background: #fff; }
.cta:active { transform: scale(0.98); }

.cta--ghost {
  background: transparent;
  color: var(--bone);
  box-shadow: inset 0 0 0 1.5px rgba(239, 231, 216, 0.35);
}

.cta--ghost:hover { background: rgba(239, 231, 216, 0.08); }

/* Every link button is at least 48 px tall, Android's minimum tap target
   (Play's pre-launch accessibility report checks it). In the top bar the bar
   keeps its height and the button's taller tap area overhangs it evenly. */
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  cursor: pointer;
}

.link-btn:hover { color: var(--bone); }

/* ---------- The case ---------- */

.case__bar {
  flex: none;
  /* As tall as the "End round" button (one line plus its padding), so every
     screen's bar is the same height and the game window never shifts. */
  height: calc(1.5em + 12px);
  align-items: center;
  white-space: nowrap;
  gap: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--font-ui);
  font-size: min(0.78rem, 3.5cqi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

.case__count b,
.case__score b { color: var(--bone); font-weight: 600; }

/* "End round" follows the bar's own size, so the three items shrink together on
   narrow phones and with big text, and a long count gives way before the edge. */
.case__bar .link-btn { font-size: inherit; letter-spacing: inherit; flex: none; }
.case__bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.tablet {
  padding: 22px 22px 10px;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: var(--tablet);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transition: transform 0.9s var(--ease), box-shadow 0.9s var(--ease), border-color 0.9s var(--ease);
}

body[data-lean="heaven"] .tablet {
  border-color: rgba(224, 182, 83, 0.45);
  box-shadow: 0 -12px 60px rgba(224, 182, 83, 0.2), 0 30px 80px rgba(0, 0, 0, 0.45);
}

body[data-lean="hell"] .tablet {
  border-color: rgba(240, 82, 28, 0.45);
  box-shadow: 0 22px 70px rgba(240, 82, 28, 0.24), 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* ---------- The game window ----------
   One window for the whole game: it fills the space under the top bar and
   never changes size or moves. The middle scrolls (and fades at its edges);
   the footer holds the buttons, always in reach at the bottom of the phone.
   The verdict you lean towards shows only in its edge colour and glow. */
.frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.frame__scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 231, 216, 0.18) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 22px), transparent);
}

/* While judging, the five facts spread out to fill the window evenly. */
.frame__scroll > .facts { flex: 1 0 auto; display: flex; flex-direction: column; }
.frame__scroll > .facts > .fact { flex: 1 0 auto; align-content: center; }

.frame__foot {
  flex: none;
  position: relative;
  isolation: isolate;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--rule);
}

/* Hell's fire glows up into the footer; Heaven's light comes from above. */
.frame__foot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 0 0 21px 21px;
  background: radial-gradient(ellipse 120% 100% at 50% 125%, rgba(240, 82, 28, 0.42), rgba(120, 20, 10, 0.14) 55%, transparent 80%);
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  pointer-events: none;
}
body[data-lean="hell"] .frame__foot::after { opacity: 1; }

.frame__foot .cta { width: 100%; }

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ash);
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fact {
  display: grid;
  /* minmax(0, …): a long word may not stretch the text column past the window. */
  grid-template-columns: 2.4rem minmax(0, 1fr);
  column-gap: 10px;
  padding: 15px 0;
  border-top: 1px solid var(--rule);
}

.fact:first-child { border-top: 0; }

.fact__num {
  font-family: var(--font-numeral);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--gold);
}

.fact__text {
  margin: 0;
  /* Very big phone text on the narrowest phones is capped (150% shows as about
     123% on a 320 px phone), so long words like "narcoterrorism" still fit a
     line whole. Normal phones and normal text sizes are unchanged. */
  font-size: min(1.13rem, 7.4cqi);
  line-height: 1.5;
  outline: none;
  /* Only a word too long for a whole line (very big phone text on the
     narrowest phones) may wrap; otherwise it would be cut off at the edge. */
  overflow-wrap: break-word;
}

.fact.is-new .fact__text { animation: inscribe 0.9s var(--ease) both; }
.fact.is-new .fact__num { animation: num-light 0.6s var(--ease) both; }

@keyframes num-light {
  from { color: rgba(224, 182, 83, 0.55); }
}

.facts.is-entering .fact { animation: inscribe 0.7s var(--ease) both; }
.facts.is-entering .fact:nth-child(2) { animation-delay: 0.12s; }
.facts.is-entering .fact:nth-child(3) { animation-delay: 0.24s; }
.facts.is-entering .fact:nth-child(4) { animation-delay: 0.36s; }
.facts.is-entering .fact:nth-child(5) { animation-delay: 0.48s; }

/* Text rises into place as it fades in. (It used to sharpen from a blur too,
   but animating a blur over text stalled slow Android phones for a quarter of
   a second each time a seal broke; fading and rising costs almost nothing.) */
@keyframes inscribe {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Sealed testimony */

/* Dim, but still 3:1 against the window (the minimum for large text). */
.fact--sealed .fact__num { color: rgba(224, 182, 83, 0.55); }

.sealed {
  display: flex;
  align-items: center;
  gap: 14px;
}

.redact { flex: 1; }

.redact span {
  display: block;
  height: 0.62em;
  margin: 0.5em 0;
  border-radius: 4px;
  background: rgba(239, 231, 216, 0.08);
}

.redact span:nth-child(1) { width: 94%; }
.redact span:nth-child(2) { width: 80%; }
.redact span:nth-child(3) { width: 52%; }

.sealed__hint {
  grid-column: 2;
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ash);
}

/* A wax seal: an uneven blob of red wax with a stamped ring and an embossed
   numeral. Breaking it splits the wax along a jagged crack (the left and
   right halves only show while it breaks, so there's no seam at rest). Only
   transform and opacity move, so the break stays smooth on phones. */
.seal {
  --wax-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M96.9 50.0L96.9 53.1L96.7 56.1L96.0 59.2L94.6 61.9L92.5 64.4L90.1 66.6L88.2 68.8L87.1 71.4L86.6 74.5L86.2 77.8L85.3 80.9L83.4 83.4L80.9 85.2L78.0 86.5L75.3 87.8L72.7 89.3L70.2 90.9L67.5 92.4L64.8 93.5L61.9 94.4L59.0 95.2L56.1 96.1L53.1 96.7L50.0 96.8L47.0 95.8L44.2 94.1L41.6 92.3L39.0 91.0L36.2 90.7L33.0 91.0L29.6 91.3L26.4 90.9L23.6 89.6L21.2 87.5L19.2 85.1L17.3 82.7L15.4 80.3L13.6 77.9L12.2 75.3L11.0 72.5L9.7 69.9L8.2 67.3L6.5 64.8L5.0 62.1L4.2 59.1L4.5 56.0L5.6 52.9L6.8 50.0L7.3 47.2L6.9 44.3L5.9 41.2L5.2 38.0L5.1 34.8L6.0 31.8L7.4 29.0L9.2 26.5L11.1 24.0L13.2 21.8L15.7 19.9L18.3 18.3L20.9 16.9L23.3 15.2L25.3 13.0L27.2 10.5L29.4 8.3L32.1 6.8L35.2 6.4L38.4 6.7L41.5 7.1L44.3 6.8L47.1 5.8L50.0 4.5L53.0 3.5L56.2 3.1L59.3 3.5L62.3 4.2L65.2 5.3L68.0 6.6L70.5 8.4L72.6 10.8L74.5 13.4L76.3 15.8L78.4 17.6L81.1 18.9L84.2 20.0L87.0 21.6L89.1 23.9L90.2 26.8L90.7 29.9L91.2 32.9L92.1 35.7L93.5 38.3L95.0 41.1L96.1 43.9L96.7 46.9Z'/%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), filter 0.3s;
  -webkit-tap-highlight-color: transparent;
}

/* Its shadow on the page. */
.seal::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7) 55%, rgba(0, 0, 0, 0));
  transform: translateY(4px) scale(1.06);
  transition: opacity 0.2s;
}

.seal__wax {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 36% 28%, #f06d4c 0%, #c4361f 30%, #8c1b10 64%, #5a0d08 100%);
  -webkit-mask: var(--wax-shape) center / 100% 100% no-repeat;
  mask: var(--wax-shape) center / 100% 100% no-repeat;
}

/* The ring the stamp pressed into the wax. */
.seal__wax::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(72, 7, 3, 0.5);
  border-radius: 50%;
  box-shadow: 0 1px 0 rgba(255, 170, 140, 0.28), inset 0 1px 0 rgba(255, 170, 140, 0.22);
}

/* Light catching the wax. */
.seal__wax::after {
  content: "";
  position: absolute;
  top: 9%;
  left: 15%;
  width: 40%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 228, 214, 0.45), rgba(255, 228, 214, 0));
  transform: rotate(-28deg);
}

.seal__mark {
  position: relative;
  z-index: 1;
  font-family: var(--font-numeral);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  color: #ffe0cf;
  text-shadow: 0 1px 0 #5a0b06, 0 -1px 0 rgba(255, 196, 172, 0.3);
}

.seal__wax--left,
.seal__wax--right {
  visibility: hidden;
  will-change: transform, opacity;
}
.seal__wax--left { clip-path: polygon(0 0, 53% 0, 47% 21%, 57% 39%, 45% 57%, 55% 76%, 48% 100%, 0 100%); transform-origin: 35% 80%; }
.seal__wax--right { clip-path: polygon(53% 0, 100% 0, 100% 100%, 48% 100%, 55% 76%, 45% 57%, 57% 39%, 47% 21%); transform-origin: 65% 80%; }

.seal:hover:not(:disabled) { transform: scale(1.06); }

/* Not yet: the wax has cooled dark and dull. */
.seal:disabled {
  cursor: not-allowed;
  filter: saturate(0.55) brightness(0.48);
}

/* Breaking: the seal swells slightly (as on hover, so nothing jumps), cracks
   open, and the halves drop away under their own weight. */
.seal.is-breaking,
.seal.is-breaking:disabled {
  cursor: default;
  filter: none;
  transform: scale(1.06);
}
.seal.is-breaking::after { opacity: 0; }
.seal.is-breaking .seal__wax--whole { visibility: hidden; }
.seal.is-breaking .seal__wax--left { visibility: visible; animation: split-left 0.5s linear forwards, wax-fade 0.5s linear forwards; }
.seal.is-breaking .seal__wax--right { visibility: visible; animation: split-right 0.5s linear forwards, wax-fade 0.5s linear forwards; }

@keyframes split-left {
  0%   { transform: none; animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  30%  { transform: translate(-4px, -2px) rotate(-7deg); animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.5); }
  100% { transform: translate(-16px, 40px) rotate(-28deg); }
}

@keyframes split-right {
  0%   { transform: none; animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  30%  { transform: translate(4px, -2px) rotate(7deg); animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.5); }
  100% { transform: translate(15px, 44px) rotate(24deg); }
}

@keyframes wax-fade {
  0%, 35%   { opacity: 1; }
  85%, 100% { opacity: 0; }
}

/* The blank lines and hint fade while the seal breaks, before the fact takes their place. */
.fact--sealed .redact,
.fact--sealed .sealed__hint { transition: opacity 0.25s; }
.fact--sealed.is-opening .redact,
.fact--sealed.is-opening .sealed__hint { opacity: 0; }

/* The verdict */

.judge { text-align: center; }

/* The scoring line and the send button take turns in one slot under the
   verdicts, cross-fading, so the bar keeps its height when a verdict is picked. */
.judge__slot {
  display: grid;
  margin-top: 10px;
}

.judge__slot > * {
  grid-area: 1 / 1;
  transition: opacity 0.22s var(--ease) 0.1s, transform 0.3s var(--ease) 0.1s, visibility 0s;
}
.judge__slot > .is-off {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.1s, transform 0.1s, visibility 0s 0.1s;
}

.judge__prompt {
  align-self: center;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: rgba(239, 231, 216, 0.85);
}

.judge__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.verdict {
  font-size: min(2.35rem, 12cqi);
  /* Uneven on purpose: Grenze Gotisch sits low in its line box, so this puts
     the letters in the true middle of the button. */
  padding: 0.26em 0 0.38em;
  border: 1.5px solid;
  border-radius: 16px;
  font-family: var(--font-display);
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.35s, box-shadow 0.35s, border-color 0.35s, opacity 0.35s, transform 0.15s;
}

.verdict:active { transform: scale(0.97); }

/* Heaven is lit from above, Hell from below, like the scene behind them. */
.verdict--heaven {
  border-color: rgba(253, 240, 198, 0.38);
  background: linear-gradient(180deg, rgba(253, 240, 198, 0.09), rgba(253, 240, 198, 0.015));
}

.verdict--heaven:hover { border-color: rgba(253, 240, 198, 0.6); background-color: rgba(253, 240, 198, 0.05); }

.verdict--heaven[aria-pressed="true"] {
  border-color: var(--logo-cream);
  background: radial-gradient(130% 100% at 50% 0%, rgba(255, 236, 190, 0.34), rgba(224, 182, 83, 0.05) 75%);
  box-shadow: 0 0 30px rgba(255, 226, 170, 0.35), inset 0 1px 0 rgba(255, 250, 232, 0.4);
}

.verdict--hell {
  border-color: rgba(254, 88, 26, 0.5);
  background: linear-gradient(0deg, rgba(254, 88, 26, 0.12), rgba(254, 88, 26, 0.02));
}

.verdict--hell:hover { border-color: rgba(254, 88, 26, 0.75); background-color: rgba(254, 88, 26, 0.06); }

.verdict--hell[aria-pressed="true"] {
  border-color: var(--logo-orange);
  background: radial-gradient(130% 100% at 50% 100%, rgba(254, 88, 26, 0.45), rgba(120, 20, 10, 0.1) 75%);
  box-shadow: 0 0 30px rgba(254, 88, 26, 0.42), inset 0 -1px 0 rgba(255, 150, 100, 0.35);
}

/* Once one is picked, the other steps back. */
.judge__buttons:has([aria-pressed="true"]) .verdict[aria-pressed="false"] { opacity: 0.5; }

/* Lettering from the logo: heavy blackletter, a light-to-deep fill, a thin
   darker edge underneath like the logo's bevel, and a soft glow. Used on the
   verdict buttons and on the verdicts in the reveal. */
.verdict__word {
  display: inline-block;
  padding: 0 0.08em;
}

.verdict__word,
.ruling dd.word--heaven,
.ruling dd.word--hell {
  font-weight: 900;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.verdict--heaven .verdict__word,
.ruling dd.word--heaven {
  background-image: linear-gradient(180deg, #fff8e2 0%, #fdecbd 45%, #f0cb82 100%);
  filter: drop-shadow(0.5px 1px 0 #c3934a) drop-shadow(0.5px 1px 0 #8a5f26) drop-shadow(0 0 6px rgba(255, 232, 180, 0.3));
}

.verdict--hell .verdict__word,
.ruling dd.word--hell {
  background-image: linear-gradient(180deg, #ff8d42 0%, #fe5c1e 50%, #eb4110 100%);
  filter: drop-shadow(0.5px 1px 0 #a82a0a) drop-shadow(0.5px 1px 0 #6a1705) drop-shadow(0 0 7px rgba(254, 88, 26, 0.4));
}

.judge .cta {
  width: 100%;
  margin-top: 0;
  /* One line, whatever the verdict and text size, so the bar never changes height. */
  white-space: nowrap;
  font-size: min(1rem, 4.8cqi);
}

/* Screens (start, judging, end of round) fade in rather than popping, without
   sliding, so the game window never moves. */
.screen:not([hidden]) { animation: screen-in 0.45s var(--ease) both; }

@keyframes screen-in {
  from { opacity: 0; }
}

/* ---------- The reveal ---------- */

.reveal {
  padding-top: 4px;
  text-align: center;
}

.portrait {
  display: grid;
  place-items: center;
  width: 150px;
  height: 188px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 2px solid var(--portrait-edge, var(--bone));
  border-radius: 75px 75px 14px 14px;
  background: #221c26;
  box-shadow: 0 0 40px var(--portrait-glow, transparent);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  animation: inscribe 0.8s var(--ease) both;
}

.portrait__initial {
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: var(--ash);
}

.reveal--heaven { --portrait-edge: var(--gold); --portrait-glow: rgba(224, 182, 83, 0.35); }
.reveal--hell { --portrait-edge: var(--ember); --portrait-glow: rgba(240, 82, 28, 0.4); }

.reveal__name {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  /* From the game's width, with no floor, so the longest word of the longest
     name ("Schwarzenegger") always fits on one line, even with big phone text. */
  font-size: min(3.6rem, 12cqi);
  line-height: 1;
  outline: none;
  animation: inscribe 0.9s var(--ease) both;
}

.reveal__role {
  margin: 0 0 22px;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--ash);
}

.rulings {
  display: grid;
  /* minmax(0, …) lets a long label wrap instead of widening its column. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  margin: 0 0 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.ruling { padding: 14px 8px; }
/* Both columns share the parent rows, so "Heaven" and "Widely admired" sit
   level even though the label is set smaller, and a two-line label keeps the
   other word centred beside it (older browsers just stack). */
.ruling {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  align-content: start;
}
.ruling dd:not(.ruling__basis) { align-self: center; }
.ruling + .ruling { border-left: 1px solid var(--rule); }

.ruling dd { overflow-wrap: anywhere; }

.ruling dt {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
}

.ruling dd {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  /* Capped by screen width so whole words fit a half-width column on the
     narrowest phones and with big text; breaking inside a word is the last resort. */
  font-size: min(1.7rem, 9.3cqi);
  line-height: 1.05;
}

.ruling dd.is-label { font-size: min(1.35rem, 6.3cqi); }

.ruling dd.ruling__basis {
  margin-top: 4px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ash);
}

.word--heaven { color: var(--gold-pale); }
.word--hell { color: var(--ember-pale); }
.word--divided {
  background: linear-gradient(90deg, var(--gold-pale), var(--ember-pale));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Only as wide as the number: the stamp-in animation starts at 160%, and a
   full-width box at that size made phones zoom out for the rest of the page. */
.points {
  width: fit-content;
  margin: 4px auto 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.4rem;
  line-height: 1;
  animation: stamp 0.6s var(--ease) 0.3s both;
}

@keyframes stamp {
  from { opacity: 0; transform: scale(1.6); }
  to   { opacity: 1; transform: none; }
}

.reveal__outcome {
  margin: 6px 0 22px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.95rem;
}

.unseen {
  margin: 0 0 18px;
  padding: 14px 16px 0;
  border-radius: 14px;
  background: rgba(239, 231, 216, 0.05);
  text-align: left;
}

.reveal__summary {
  margin: 0 0 18px;
  text-align: left;
  font-size: 1.08rem;
  color: rgba(239, 231, 216, 0.9);
}

.reveal__source {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 22px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--gold-pale);
  text-underline-offset: 3px;
}


/* How players voted, on the reveal */

.crowd {
  min-height: 118px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(239, 231, 216, 0.05);
  text-align: left;
}

.crowd__verdict {
  margin: 4px 0 10px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ash);
}

.crowd__verdict span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}

.crowd__labels {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
}

.crowd__bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #a3200f, var(--ember));
}

/* Grows by scaling rather than by width, so the phone doesn't redo the
   layout on every frame of the animation. */
.crowd__bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-pale));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease) 0.2s;
}

.crowd__note {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ash);
}

/* Players' notes on a fact, on the reveal */

.note {
  margin: -8px 0 18px;
  text-align: left;
}
/* Closed, the note button sits centred like the rest of the reveal. */
.note:not(:has(form)) { text-align: center; }

.note__open {
  padding: 8px 14px;
  border: 1px solid rgba(224, 182, 83, 0.4);
  border-radius: 999px;
  color: var(--gold-pale);
  letter-spacing: 0.1em;
}

.note__open:hover { border-color: var(--gold); color: var(--gold-pale); background: rgba(224, 182, 83, 0.1); }

.note__form,
.note__thanks {
  margin: 0;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: rgba(239, 231, 216, 0.05);
}

.note__intro,
.note__thanks {
  font-family: var(--font-text);
  font-size: 0.98rem;
  color: rgba(239, 231, 216, 0.85);
}

.note__intro { margin: 2px 0 12px; }
.note__thanks:focus { outline: none; }

.note__label {
  display: block;
  margin: 12px 0 6px;
  padding: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--bone);
}

.note__optional { font-weight: 400; color: var(--ash); }

.note__select,
.note__text {
  min-height: 48px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(239, 231, 216, 0.22);
  border-radius: 10px;
  background: rgba(14, 10, 11, 0.6);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.note__text {
  resize: vertical;
  min-height: 74px;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.4;
}

.note__select:focus,
.note__text:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.note__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.note__reasons legend { width: 100%; }

.note__reason { cursor: pointer; }

.note__reason input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.note__reason span {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid rgba(239, 231, 216, 0.25);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ash);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.note__reason input:checked + span {
  border-color: var(--gold);
  background: rgba(224, 182, 83, 0.14);
  color: var(--gold-pale);
}

.note__reason input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.note__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.reveal .note__send {
  min-height: 48px;
  width: auto;
  padding: 11px 22px;
  font-size: 0.92rem;
}

.note__send:disabled { opacity: 0.6; cursor: default; }

.note__status {
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ember-pale);
}

.note__status:empty { display: none; }

.preview-banner {
  position: fixed;
  z-index: 10;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(224, 182, 83, 0.92);
  color: var(--char);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ---------- Account (only when accounts are turned on) ---------- */

.account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 auto 6px;
  text-align: center;
}

body:not([data-screen="intro"]) .account { display: none; }

.google-btn {
  min-height: 48px;
  padding: 9px 18px;
  border: 1px solid rgba(239, 231, 216, 0.35);
  border-radius: 999px;
  background: rgba(239, 231, 216, 0.06);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.google-btn:hover { background: rgba(239, 231, 216, 0.14); }

/* Google's own "Sign in with Google" button draws itself in here. */
.gsi-btn { display: flex; align-items: center; justify-content: center; min-height: 48px; }

.account__line,
.account__note {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ash);
}

.account__line { font-size: 0.82rem; }
.account__line b { color: var(--bone); font-weight: 600; }
.account__note { max-width: 23rem; font-size: 0.75rem; }
.account__note a { color: inherit; text-underline-offset: 3px; }
.account__actions { display: flex; gap: 18px; }
.account__delete { padding: 2px 0; font-size: 0.68rem; }

/* ---------- End of round ---------- */

.end__eyebrow { text-align: center; }

.end__score {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  /* No floor, so even a perfect +3000 fits the narrowest window with big text. */
  font-size: min(6.5rem, 24cqi);
  line-height: 1;
  text-align: center;
  color: var(--gold-pale);
  text-shadow: 0 0 40px rgba(224, 182, 83, 0.4);
}

.end__rank {
  margin: 6px 0 12px;
  font-family: var(--font-text);
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  text-align: center;
}

.end__stats {
  margin: 0 auto 24px;
  max-width: 30rem;
  text-align: center;
  font-size: 1.1rem;
  color: rgba(239, 231, 216, 0.88);
}

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.ledger li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.ledger li:first-child { border-top: 0; }
.ledger li:last-child { padding-bottom: 0; }

.ledger__name { font-size: 1.08rem; }

.ledger__points {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.ledger__detail {
  grid-column: 1 / -1;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ash);
}

.end__actions {
  display: grid;
  gap: 10px;
}

/* ---------- Text pages (privacy) ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px 56px;
}

.page h1 {
  margin: 18px 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
}

.page h2 {
  margin: 30px 0 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-pale);
}

.page p, .page li { color: rgba(239, 231, 216, 0.88); }
.page li { margin-bottom: 8px; }
.page a { color: var(--gold-pale); text-underline-offset: 3px; }

.page__back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.page__date {
  margin: 0 0 22px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ash);
}

.credit a { color: inherit; text-underline-offset: 3px; }

/* ---------- Small screens and motion ---------- */

/* A tighter reveal on phones, so more of it shows at once. */
@media (max-width: 640px) {
  .portrait { width: 124px; height: 156px; border-radius: 62px 62px 12px 12px; margin-bottom: 14px; }
  .reveal__role { margin-bottom: 16px; }
  .ruling { padding: 11px 6px; }
  .points { font-size: 2.9rem; }
  .reveal__outcome { margin-bottom: 16px; }
  .reveal__source { margin-bottom: 16px; }
}

/* The narrowest phones (Galaxy Fold folded, 280px): keep the top bar on one line. */
@media (max-width: 340px) {
  .stage { padding-left: 10px; padding-right: 10px; }
  .frame__foot { padding-left: 12px; padding-right: 12px; }
  .unseen { padding-left: 8px; padding-right: 8px; }
  .case__bar { font-size: min(0.66rem, 3.8cqi); letter-spacing: 0.06em; }
  /* One line whatever the verdict, so switching Heaven/Hell can't resize the bar. */
  .judge .cta { padding-left: 12px; padding-right: 12px; }
}

/* Short windows (a phone held sideways, split screen, a pop-up window): the
   buttons go compact so the facts keep room. The scoring line steps aside
   (the send button and seal hints say the points). */
@media (max-height: 500px) {
  .logo { width: min(48%, 12.5rem); }
  .frame__foot { padding: 10px 14px 12px; }
  .frame__scroll { padding-top: 14px; padding-bottom: 16px; }
  .judge__slot { margin-top: 8px; }
  .judge__prompt { display: none; }
  .judge .cta { white-space: nowrap; font-size: min(0.92rem, 4.4cqi); padding: 11px 14px; }
  .verdict { font-size: min(1.7rem, 9cqi); padding: 0.18em 0 0.3em; }
  .frame__foot .cta { padding-top: 11px; padding-bottom: 11px; }
  /* The round score's two buttons sit side by side. */
  .end__actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .end__actions .cta { padding-left: 8px; padding-right: 8px; font-size: min(0.92rem, 4.2cqi); }
}

/* Very short windows (a small phone in split screen): tighter spacing all
   round, so the facts still get a readable area. */
@media (max-height: 380px) {
  .stage { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .case__bar { margin-bottom: 6px; }
  .frame__scroll { padding-top: 10px; padding-bottom: 12px; }
  .frame__foot { padding: 8px 12px 10px; }
  .judge__slot { margin-top: 6px; }
  .verdict { font-size: min(1.5rem, 8cqi); padding: 0.14em 0 0.26em; }
}

/* Short and wide (a phone held sideways): the send button sits next to the
   verdicts instead of under them. */
@media (max-height: 500px) and (min-width: 600px) {
  .judge {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    align-items: center;
  }
  .judge__slot { margin-top: 0; }
}
}

@media (max-width: 420px) {
  .frame__scroll { padding: 18px 16px 22px; }
  .unseen { padding-left: 12px; padding-right: 12px; }
  /* The numeral column is capped by the width, so very big phone text leaves room for long words. */
  .fact { grid-template-columns: min(2rem, 10cqi) minmax(0, 1fr); }
  .verdict { font-size: min(2.05rem, 12cqi); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .embers { display: none; }
  .crowd__bar span { transition: none; }
}
