/* Approved celebration art above complete native paper/gold controls.
   Scenery has no painted actions; all copy, rewards and buttons remain live. */
dialog.result-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100svh;
  max-height: 100svh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #c7a064;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}
dialog.result-dialog::-webkit-scrollbar {
  display: none;
}
dialog.result-dialog::backdrop {
  background: #183633cc;
  backdrop-filter: none;
}
.result-dialog #dialog-content {
  position: relative;
  isolation: isolate;
  min-height: 100%;
}
.result-dialog .result-world {
  --result-world-image: url("../assets/expedition/reveal-sanctuary-background-v1.webp");
  --result-world-blur: clamp(1.4px, .14vw, 2.8px);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  background: #c7a064;
}
/* Lens softness belongs to the scenery, never to Olga, the paper or controls.
   Overscan keeps filtered edges outside the continuous painting's viewport. */
.result-dialog .result-world::before {
  content: "";
  position: absolute;
  inset: calc(var(--result-world-blur) * -4);
  background: #c7a064 var(--result-world-image) center top / cover no-repeat;
  filter: blur(var(--result-world-blur)) saturate(.82) contrast(.9);
}
/* Static atmospheric perspective: cooler/milkier in the distant sanctuary,
   lighter near the foreground steps. No animated blur or backdrop filtering. */
.result-dialog .result-world::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 110% 70% at 60% 18%,
      #dceee665 0%, #e9efdf38 48%, #f5ecd612 78%, transparent 100%),
    linear-gradient(180deg, #e7f0e51c, #f3ecd31a 60%, #f3ecd30a);
}
@media (min-aspect-ratio: 1 / 1) {
  .result-dialog .result-world {
    --result-world-image: url("../assets/expedition/reveal-sanctuary-background-desktop-v1.webp");
  }
}
.result-wrap.result-study-sheet {
  --study-result-scale: calc(100vw / 853);
  --result-card-offset: -13.48vw;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100svh;
  padding: 0 0 max(16px, env(safe-area-inset-bottom)) !important;
  color: #073d48;
  background: none;
}
.result-study-sheet .result-hero {
  --result-guide-width: 100%;
  /* Register each portrait by crown, chin and face center. The shared head
     size uses the stage above the paper, including on compact screens. */
  --result-crown-space: max(8px, 2.6cqh);
  --result-head-height: min(35cqw, calc((100cqh + var(--result-card-offset) - var(--result-crown-space)) * .43));
  --reveal-guide-height: calc(var(--result-head-height) / var(--result-head-ratio));
  container-type: size;
  width: 100%;
  height: auto;
  aspect-ratio: 853 / 754;
  flex: 0 0 auto;
  overflow: hidden;
  margin: 0;
  border-radius: 0;
  background: none;
}
.result-study-sheet .result-hero .result-guide-motion {
  --result-art-width: calc(var(--reveal-guide-height) * var(--result-art-aspect));
  display: block;
  position: absolute;
  top: calc(var(--result-crown-space) - var(--reveal-guide-height) * var(--result-crown-y));
  left: calc(50% - var(--result-art-width) * var(--result-face-x));
  width: var(--result-art-width);
  height: var(--reveal-guide-height);
  transform-origin: calc(var(--result-face-x) * 100%) 35%;
}
.result-study-sheet .result-hero .result-guide-motion img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center top;
  mask-image: none;
  filter: none;
}
.result-study-sheet .result-card {
  --result-reading-width: 480px;
  --result-quote-edge: clamp(44px, 6.2vw, 64px);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: calc(100% - 10px);
  min-width: 0;
  max-width: none;
  min-height: 0;
  box-sizing: border-box;
  margin: var(--result-card-offset) 0 0;
  padding: 14px 22px 14px;
  border: 5px solid transparent;
  border-radius: 24px;
  background:
    var(--relic-parchment) padding-box,
    var(--relic-gilding) border-box;
  box-shadow:
    inset 0 0 0 1px #fff7d8,
    inset 0 0 0 6px #d6aa6240,
    0 0 0 1px #a16a25,
    0 5px 12px #5e401c55;
}
.result-study-sheet .result-quote-row {
  display: grid;
  grid-template-columns: var(--result-quote-edge) minmax(0, 1fr) var(--result-quote-edge);
  align-items: center;
  column-gap: clamp(3px, 1.1vw, 14px);
  width: min(100%, calc(var(--result-reading-width) + var(--result-quote-edge) * 2 + 28px));
  margin-block: 0 14px;
}
.result-category-mark {
  display: grid;
  place-items: center;
  min-block-size: 44px;
  color: #996f2b;
}
.result-category-mark > .icon {
  width: clamp(27px, 4vw, 42px);
  height: clamp(27px, 4vw, 42px);
}
.result-study-sheet .result-scroll {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  width: 100%;
  gap: 5px;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-image: none !important;
  background: none !important;
  box-shadow: none;
}
.result-study-sheet .result-scroll > figcaption,
.result-study-sheet .result-kind {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.result-study-sheet .result-card .result-phrase {
  align-self: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font: 600 clamp(28px, 7.8vw, 36px)/1.24 var(--heading);
  color: #073c48;
  text-align: center;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.result-study-sheet .result-art-credit {
  font-size: .8125rem;
  line-height: 1.4;
}
.result-author-block {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 11px;
  width: min(100%, var(--result-reading-width));
  margin-block: 1px 2px;
}
.result-author-credit { min-inline-size: 0; }
.result-author-block:has(.result-author-signature) {
  display: grid;
  grid-template-columns: 40px minmax(0, auto) clamp(88px, 26vw, 130px);
}
.result-author-portrait,
.result-author-monogram {
  inline-size: 40px;
  block-size: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--result-author-mark-rim, #a28044);
  border-radius: 50%;
  background: var(--result-author-mark-paper, #eadbb1);
  color: var(--result-author-mark-ink, #694e26);
}
.result-author-portrait { object-fit: cover; }
.result-author-monogram {
  display: grid;
  place-items: center;
  font: 700 .875rem/1 Georgia, serif;
  letter-spacing: .035em;
}
.result-author-signature {
  display: block;
  max-block-size: 26px;
  block-size: auto;
  inline-size: 100%;
  object-fit: contain;
  opacity: .92;
  filter: drop-shadow(0 .2px .2px #3b291b85);
}
@media (max-width: 350px) {
  .result-author-block:has(.result-author-signature) { grid-template-columns: 40px minmax(0, auto); }
  .result-author-signature { grid-column: 1 / -1; justify-self: center; inline-size: 115px; }
}
.result-study-sheet .result-scroll .result-author {
  margin: 0;
  padding: 0;
  font: 700 clamp(16px, 4.2vw, 19px)/1.35 var(--body);
  color: #073e4b;
  text-align: center;
}
.result-study-sheet .result-scroll .result-work {
  display: block;
  margin: 0;
  font: 600 clamp(.8125rem, 3vw, 1rem)/1.35 var(--body);
  color: var(--result-work-ink, #665d4b);
  text-align: center;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) and (701px <= height <= 820px) {
  .result-wrap.result-study-sheet {
    --result-card-offset: max(-13.48vw, -42px);
  }
}
.result-hero .result-lantern-light {
  /* The painted flame sits near (900, 660) on the 1097 × 1434 art. */
  position: absolute;
  z-index: 0;
  left: calc(50% + var(--reveal-guide-height) * var(--result-art-aspect) * (.82 - var(--result-face-x)));
  top: calc(var(--result-crown-space) + var(--reveal-guide-height) * (.46 - var(--result-crown-y)));
  width: calc(var(--reveal-guide-height) * .76);
  height: calc(var(--reveal-guide-height) * .61);
  margin-left: calc(var(--reveal-guide-height) * -.38);
  margin-top: calc(var(--reveal-guide-height) * -.305);
  pointer-events: none;
  opacity: .72;
  background:
    radial-gradient(ellipse 50% 48% at 50% 50%, #fff0b98b, #ffc27044 28%, #ca784a25 52%, transparent 88%),
    radial-gradient(ellipse 49% 35% at 28% 38%, #e2a26728, transparent 79%);
}
.result-hero[data-celebration="loading"] .result-lantern-light {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .result-hero[data-celebration="loading"] .result-lantern-light {
    opacity: .72;
  }
}
@media (forced-colors: active) {
  .result-hero .result-lantern-light {
    display: none;
  }
}
.result-study-sheet .result-source {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 44px;
  margin: 2px 0 0;
  color: #076279;
  font: 800 clamp(12px, 3.5vw, 16px)/1.25 var(--body);
  text-align: center;
  text-underline-offset: 3px;
}
:is(.result-card, .poem-reading-extras) .result-narration {
  max-inline-size: 100%;
  margin: 4px 0;
  text-align: center;
  color: var(--result-narration-ink, #076279);
}
:is(.result-card, .poem-reading-extras) .result-narration-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: 6px 13px;
  border: 1px solid var(--result-narration-border, #93784b);
  border-radius: 999px;
  background: var(--result-narration-background, #fff8df);
  box-shadow: none;
  color: inherit;
  font: 750 0.875rem/1.25 var(--body);
}
:is(.result-card, .poem-reading-extras) .result-narration-button .icon {
  flex: none;
  inline-size: 19px;
  block-size: 19px;
}
.result-narration-button[aria-pressed="true"] {
  border-color: var(--result-narration-focus, #087c7e);
  box-shadow: 0 0 0 2px var(--result-narration-glow, #178d8940);
}
.result-wrap[data-result-tier="6"] .result-narration-button {
  --result-narration-glow: #88eaff54;
}
@media (prefers-reduced-motion: no-preference) {
  .result-narration-button[aria-pressed="true"] .sound-wave {
    animation: narration-wave 880ms ease-in-out infinite alternate;
  }
  .result-narration-button[aria-pressed="true"] .sound-wave-outer { animation-delay: -270ms; }
  .result-narration-button[aria-pressed="true"] {
    animation: narration-outline 1.7s ease-in-out infinite alternate;
  }
}
@keyframes narration-wave {
  from { opacity: .34; transform: translateX(-.4px); }
  to { opacity: 1; transform: translateX(.35px); }
}
@keyframes narration-outline {
  from { box-shadow: 0 0 0 1px var(--result-narration-glow, #178d8940); }
  to { box-shadow: 0 0 0 2px var(--result-narration-glow, #178d8940), 0 0 11px var(--result-narration-glow, #178d8940); }
}
:is(.result-card, .poem-reading-extras) .result-narration-button:focus-visible {
  outline: 2px solid var(--result-narration-focus, #076279);
  outline-offset: 3px;
}
:is(.result-card, .poem-reading-extras) .result-narration-button:disabled {
  cursor: default;
  opacity: 1;
}
:is(.result-card, .poem-reading-extras) .result-narration-status {
  display: block;
  font: 600 0.75rem/1.4 var(--body);
  overflow-wrap: anywhere;
}
:is(.result-card, .poem-reading-extras) .result-narration-status:not(:empty) {
  margin-block-start: 4px;
}
.result-card .result-narration--compact {
  position: relative;
  margin: 0;
}
.result-card .result-narration--compact .result-narration-button {
  display: grid;
  place-items: center;
  inline-size: var(--result-quote-edge);
  block-size: var(--result-quote-edge);
  padding: 0;
}
.result-card .result-narration--compact .result-narration-button .icon {
  inline-size: clamp(26px, 3.6vw, 38px);
  block-size: clamp(26px, 3.6vw, 38px);
}
.result-card .result-narration--compact .result-narration-button:disabled {
  opacity: .65;
}
.result-card .result-narration--compact .result-narration-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.result-card .result-narration--compact .result-narration-button:not(:disabled) + .result-narration-status:not(:empty) {
  z-index: 2;
  inset-inline-end: 0;
  width: min(200px, 62vw);
  height: auto;
  padding: 6px 9px;
  border: 1px solid var(--result-narration-border, #93784b);
  border-radius: 8px;
  background: var(--result-narration-background, #fff8df);
  color: inherit;
  clip-path: none;
}
.result-study-sheet .result-card .result-favorite {
  position: absolute;
  inset: 10px 10px auto auto;
  margin: 0;
  display: block;
}
.result-study-sheet .result-card .favorite-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  width: 54px;
  min-height: 50px;
  padding: 4px;
  border: 0;
  background: none;
  color: #064656;
  box-shadow: none;
  font: 800 10px/1.2 var(--body);
}
.result-study-sheet .result-card .favorite-button .icon {
  width: 28px;
  height: 28px;
}
.result-study-sheet .result-topline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 12px 0 0;
  padding: 0;
  color: #074b5a;
}
.result-study-sheet .result-topline .result-coins {
  order: 0;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: #075166;
  font-size: 14px;
}
.result-study-sheet .result-coins strong {
  font-size: 15px;
}
.result-study-sheet .result-coins > .icon {
  width: 16px;
  height: 16px;
}
.result-study-sheet .result-reward-precision {
  order: 1;
  font: 800 .75rem/1.2 var(--body);
  color: #1b5260;
}
.result-study-sheet .result-topline .stars {
  order: 2;
  gap: 0;
  margin-left: auto;
  font-size: 19px;
  color: #f4b62b;
  white-space: nowrap;
}
.result-study-sheet .result-topline .stars span {
  text-shadow:
    0 1px #ab6e20,
    1px 0 #b88028,
    -1px 0 #b88028;
}
.result-study-sheet .result-topline .stars .reward-empty {
  color: #bea474;
}
.result-study-sheet > .journey-result-progress {
  flex: 0 0 auto;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  margin: 14px 0 0;
  text-align: center;
}
/* Rewards, the progress plaque and every action share one scroll flow.
   A bottom-pinned action used to slide over the paper and the plaque. */
.result-study-sheet > .dialog-actions {
  position: static;
  inset: auto;
  transform: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0;
  width: calc(100% - 34px);
  margin: 16px 0 0;
  padding: 0 0 max(8px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background: linear-gradient(transparent, #bc8c4455 45%, #bc8c4433);
  box-shadow: none;
}
.result-study-sheet > .dialog-actions .primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 66px;
  margin: 0;
  padding: 12px 22px;
  font: 650 clamp(18px, 5.3vw, 24px)/1.1 var(--heading);
  text-shadow: 0 2px 1px #005569;
}
.result-study-sheet > .dialog-actions .continue-arrow {
  margin-left: 7px;
}
.result-study-sheet > .dialog-actions .secondary {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 7px;
  border: 0;
  background: none;
  color: #fff6da;
  box-shadow: none;
  font: 800 13px/1.25 var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 2px #765022;
}
.result-study-sheet > .result-more {
  z-index: 3;
  width: calc(100% - 40px);
  margin: 0 0 50px;
  padding: 0;
  border: 0;
  color: #0c4650;
}
.result-study-sheet > .result-more > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 3px;
  color: #fff9e2;
  font: 800 15px/1.2 var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 2px #765022;
  cursor: pointer;
}
.result-study-sheet > .result-more[open] {
  padding: 8px 15px 16px;
  border: 2px solid #b88943;
  border-radius: 18px;
  background: #fff0c9;
  box-shadow:
    inset 0 0 0 2px #ffe4a0,
    0 3px #99672d55;
}
.result-study-sheet > .result-more[open] > summary {
  color: #075166;
  text-shadow: none;
}
.result-study-sheet :is(button, a, summary):focus-visible {
  outline: 3px solid #ffe682;
  outline-offset: 3px;
}
.result-study-sheet .result-art-fallback .result-guide-motion img {
  object-fit: contain;
}
@media (min-width: 761px) {
  .result-wrap.result-study-sheet { --result-card-offset: -6.67vw; }
  .result-study-sheet .result-hero {
    aspect-ratio: 1544 / 425;
  }
  .result-study-sheet .result-card {
    width: min(66.2vw, 1021px);
    min-height: 280px;
    padding: 18px 58px 18px;
  }
  .result-study-sheet .result-card .result-phrase {
    font-size: clamp(34px, 3.4vw, 52px);
  }
  .result-study-sheet .result-scroll .result-author {
    font-size: 20px;
  }
  .result-study-sheet .result-scroll .result-work {
    font-size: 16px;
  }
  .result-study-sheet .result-card .result-favorite {
    right: 14px;
    top: 12px;
  }
  .result-study-sheet .result-card .favorite-button {
    width: 64px;
    min-height: 56px;
    font-size: 11px;
  }
  .result-study-sheet .result-card .favorite-button .icon {
    width: 30px;
    height: 30px;
  }
  .result-study-sheet .result-topline .result-coins strong {
    font-size: 20px;
  }
  .result-study-sheet .result-reward-precision {
    font-size: 14px;
    max-width: none;
  }
  .result-study-sheet .result-topline .stars {
    font-size: 26px;
  }
  .result-study-sheet > .dialog-actions {
    width: min(46vw, 590px);
  }
  .result-study-sheet > .dialog-actions .primary {
    min-height: 73px;
    font-size: 26px;
  }
  .result-study-sheet > .result-more {
    width: min(66.2vw, 950px);
    margin-bottom: 30px;
  }
  .result-study-sheet > .result-more > summary {
    color: #075166;
    text-shadow: none;
  }
}
@media (max-height: 700px) and (max-width: 760px) {
  .result-wrap.result-study-sheet { --result-card-offset: 0px; }
  .result-study-sheet .result-hero {
    height: 140px;
    aspect-ratio: auto;
  }
  .result-study-sheet .result-hero .result-guide-motion img {
    object-position: center top;
  }
  .result-study-sheet .result-card {
    padding: 14px 18px 12px;
  }
  .result-study-sheet .result-card .result-phrase {
    font-size: 28px;
  }
  .result-study-sheet .result-scroll .result-author {
    font-size: 16px;
  }
  .result-study-sheet .result-scroll .result-work {
    font-size: 12px;
  }
  .result-study-sheet > .dialog-actions .primary {
    min-height: 58px;
    font-size: 18px;
  }
}
@media (max-width: 374px) {
  .result-study-sheet .result-card { padding-inline: clamp(12px, 4.5vw, 17px); }
  .result-study-sheet .result-card .result-phrase { font-size: clamp(21px, 7vw, 26px); }
}
@media (375px <= width <= 460px) {
  .result-study-sheet .result-card { padding-inline: 16px; }
  .result-study-sheet .result-card .result-phrase { font-size: clamp(26px, 6.8vw, 30px); }
}
@media (max-height: 480px) and (min-width: 761px) {
  .result-wrap.result-study-sheet { --result-card-offset: -14px; }
  .result-study-sheet .result-hero {
    height: 110px;
    aspect-ratio: auto;
  }
  .result-study-sheet .result-card {
    width: min(70vw, 760px);
    min-height: 0;
    padding: 12px 35px 12px;
  }
  .result-study-sheet .result-card .result-phrase {
    font-size: 32px;
  }
  .result-study-sheet .result-scroll .result-author {
    font-size: 18px;
  }
  .result-study-sheet .result-scroll .result-work {
    font-size: 12px;
  }
  .result-study-sheet > .dialog-actions .primary {
    min-height: 58px;
    font-size: 20px;
  }
}

/* Short phones: the first view of a result must show the reward.
   The whole action bar used to be sticky with a near-transparent backdrop,
   so on 701–820px-tall phones (iPhone Safari with its bars, common Androids)
   it covered the stars and drew its text links over the step pill. Every
   action and secondary link now follows the same scroll flow. This
   also replaces the position:fixed bar used while "Ver descoberta" is open,
   which swallowed swipes that started on it.
   The bar is flattened with display:contents, so its buttons become items of
   the sheet's column. Older bar-relative rules (width:100%, flex:1) would
   then stretch them to the sheet, so they get their own size here, with the
   specificity to win, and the bar's former width per breakpoint. */
.result-study-sheet > .dialog-actions { display: contents; }
.result-wrap.result-study-sheet > .dialog-actions > :is(.primary, .secondary) {
  flex: 0 0 auto;
  align-self: center;
  width: calc(100% - 34px);
  max-width: none;
  box-sizing: border-box;
}
.result-wrap.result-study-sheet > .dialog-actions > .primary {
  position: static;
  inset: auto;
  z-index: 5;
  margin-top: 16px;
}
@media (min-width: 761px) {
  .result-wrap.result-study-sheet > .dialog-actions > :is(.primary, .secondary) {
    width: min(46vw, 590px);
  }
}
.result-study-sheet > .result-more[open] { margin-bottom: 50px; }
/* Between the existing ≤700px compaction and tall phones, the celebration
   scene shrinks only as much as the height requires. Olga's figure scales
   with the hero (cqh/cqw), so she stays whole, just smaller. */
@media (max-width: 760px) and (min-height: 701px) and (max-height: 820px) {
  .result-study-sheet .result-hero {
    height: min(calc(100vw * 754 / 853), max(200px, calc(100dvh - 505px)));
    aspect-ratio: auto;
  }
}

/* Laptop and desktop windows: the result was sized by width only, so on a
   657–800px-tall window 'Continuar jogando' fell below the fold with nothing
   saying there was more. Like the phone rule above, the celebration scene
   shrinks only as much as the height requires; Olga scales with the hero
   (cqh), and the card keeps the same relative overlap. Tall windows are
   unchanged. The CTA stays in the flow (it is deliberately not pinned). */
@media (min-width: 761px) and (min-height: 481px) {
  .result-wrap.result-study-sheet {
    --result-desktop-hero: min(calc(100vw * 425 / 1544), max(150px, calc((100dvh - 508px) * 1.32)));
    --result-card-offset: calc(var(--result-desktop-hero) * -0.2423);
  }
  .result-study-sheet .result-hero { height: var(--result-desktop-hero); aspect-ratio: auto; }
}
@media (min-width: 761px) and (min-height: 481px) and (max-height: 760px) {
  .result-study-sheet .result-card { padding: 14px 48px; }
  .result-study-sheet .result-card .result-phrase { font-size: clamp(32px, 3vw, 40px); }
}

/* A short, separate layer around Olga keeps the result's controls clear. */
.result-hero .result-celebration-field {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: min(100%, max(430px, 62%));
  margin-inline: auto;
  pointer-events: none;
  contain: layout paint;
}
.result-celebration-particle {
  position: absolute;
  width: var(--result-particle-size);
  height: calc(var(--result-particle-size) * .55);
  border-radius: 2px;
  background: linear-gradient(135deg, #fff2bc, #e7ac54);
  box-shadow: 0 0 2px #8b4e2844;
  opacity: 0;
}
.result-celebration-field[data-motif="petals-and-leaves"] .result-celebration-particle {
  height: calc(var(--result-particle-size) * .7);
  border-radius: 85% 55% 78% 8%;
  background: linear-gradient(140deg, #ffe7ed 2%, #ed9fbf 52%, #ba5388 100%);
}
.result-celebration-field[data-motif="petals-and-leaves"] .result-celebration-particle[data-leaf] {
  height: calc(var(--result-particle-size) * .48);
  border-radius: 85% 0 85% 0;
  background: linear-gradient(150deg, #b2dc80, #77b75c 46%, #306c4a 100%);
}
.result-gold-flare {
  position: absolute;
  inset: 2% 0 -19%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 72%;
  background:
    radial-gradient(ellipse min(32vw, 415px) 47% at 50% 61%, #fff4c193, #ffc4664d 44%, transparent 82%),
    radial-gradient(ellipse min(23vw, 290px) 35% at 29% 81%, #f8bf6573, transparent 85%),
    radial-gradient(ellipse min(24vw, 310px) 40% at 72% 64%, #ffe3a27a, transparent 83%);
}
.result-gold-field,
.result-clip-gold {
  /* The clasp sits at x=622, y=652 on the 1024 × 1536 portrait. */
  --gold-origin-x: 60.7%;
  --gold-origin-y: 42.4%;
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}
.result-gold-spark {
  position: absolute;
  left: var(--gold-origin-x);
  top: var(--gold-origin-y);
  width: var(--result-gold-size);
  aspect-ratio: 1;
  opacity: 0;
  filter: drop-shadow(0 0 5px #ffd47dc9);
}
.result-gold-spark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #fffbea, #ffdc7d 56%, #e8a444);
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}
.result-clip-gold::before,
.result-clip-gold > span {
  position: absolute;
  left: var(--gold-origin-x);
  top: var(--gold-origin-y);
  opacity: 0;
}
.result-clip-gold::before {
  content: "";
  width: 36%;
  height: 19%;
  transform: translate(-50%, -55%);
  background: radial-gradient(ellipse closest-side, #fff7ce90, #ffe49544 56%, transparent);
}
.result-clip-gold > span {
  width: clamp(4px, calc(var(--reveal-guide-height) * .019), 8px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff9e2 16%, #ffdc7e9c 47%, transparent 72%);
}
.result-clip-gold[data-running]::before {
  animation: result-clip-glow 3.7s ease-in-out infinite alternate;
}
.result-clip-gold[data-running] > span {
  animation: result-clip-mote 4.2s var(--clip-delay) linear infinite;
}
@keyframes result-clip-glow {
  from { opacity: .18; transform: translate(-50%, -55%) scale(.8); }
  to { opacity: .57; transform: translate(-50%, -55%) scale(1.12); }
}
@keyframes result-clip-mote {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.45); }
  24% { opacity: .8; }
  65% { opacity: .55; }
  100% {
    opacity: 0;
    transform: translate3d(
      calc(var(--reveal-guide-height) * var(--clip-x) - 50%),
      calc(var(--reveal-guide-height) * var(--clip-y) - 50%), 0
    ) scale(.66);
  }
}

/* The gold stays in the world, behind the paper. A slow breath follows the
   short fan of sparks without turning five stars into the blue spell. */
.result-world-gold {
  position: absolute;
  z-index: 1;
  inset: 0;
  contain: paint;
  pointer-events: none;
}
.result-world-gold::before {
  content: "";
  position: absolute;
  inset: -9%;
  opacity: 0;
  background:
    radial-gradient(ellipse 44% 32% at 42% 18%, #ffc85d86, transparent 83%),
    radial-gradient(ellipse 42% 35% at 77% 37%, #ffe4a04a, transparent 85%),
    radial-gradient(ellipse 47% 37% at 14% 71%, #f2a65047, transparent 85%);
}
.result-world-gold[data-running]::before {
  animation: result-world-gold 6.8s ease-in-out infinite alternate;
}
@keyframes result-world-gold {
  from { opacity: .22; transform: translate3d(-4%, 2%, 0); }
  to { opacity: .67; transform: translate3d(4%, -3%, 0); }
}

/* A warm pool of light distinguishes the most modest discovery. */
dialog.result-dialog:has(.result-wrap[data-result-tier="1"]),
.result-dialog:has(.result-wrap[data-result-tier="1"]) .result-world {
  background: #191822;
}
.result-dialog:has(.result-wrap[data-result-tier="1"]) .result-world::before {
  filter: blur(var(--result-world-blur)) brightness(.24) saturate(.54);
}
.result-dialog:has(.result-wrap[data-result-tier="1"]) .result-world::after {
  background:
    radial-gradient(ellipse min(62vw, 495px) min(57vh, 435px) at 51% 21%, #21182407, #1715257d 82%, #12131ed6),
    linear-gradient(160deg, #23233340, #28263539 49%, #15142081);
}
.result-dialog:has(.result-wrap[data-result-tier="2"]) .result-world::before {
  filter: blur(var(--result-world-blur)) brightness(.73) saturate(.75);
}
.result-dialog:has(.result-wrap[data-result-tier="2"]) .result-world::after {
  background:
    radial-gradient(ellipse 63% 48% at 50% 16%, #ffd89766, transparent 80%),
    linear-gradient(160deg, #684d3530, #654b3725 49%, #51433a50);
}
.result-dialog:has(.result-wrap[data-result-tier="3"]) .result-world::after {
  background:
    radial-gradient(ellipse 72% 45% at 50% 13%, #fff2bb6b, transparent 80%),
    linear-gradient(160deg, #cfefda20, #f8e8c72a 60%, #9e95622b);
}
.result-dialog:has(.result-wrap[data-result-tier="4"]) .result-world::after {
  background:
    radial-gradient(ellipse 64% 48% at 59% 8%, #fff4bc9b, #ffd68236 49%, transparent 83%),
    linear-gradient(165deg, #d6f1de26, #ffe7ac35 61%, #c8924431);
}

/* Inverted paper: the colors and edge stay legible after the light fades. */
dialog.result-dialog:has(.result-wrap[data-result-tier="6"]),
.result-dialog:has(.result-wrap[data-result-tier="6"]) .result-world {
  background: #071426;
}
.result-dialog:has(.result-wrap[data-result-tier="6"]) .result-world::before {
  filter: blur(var(--result-world-blur)) brightness(.36) saturate(.68);
}
.result-dialog:has(.result-wrap[data-result-tier="6"]) .result-world::after {
  /* Barely visible rays in the existing atmosphere layer. Nothing moves
     over the blue paper, and there is no new full-screen compositing layer. */
  background:
    conic-gradient(from 146deg at 62% -12%,
      transparent 0deg 4deg, #a9ebff0b 8deg, #c6f0ff13 11deg, transparent 15deg 22deg,
      #bfeaff0e 26deg, transparent 31deg 38deg, #a6dbff10 42deg, transparent 48deg 360deg),
    radial-gradient(ellipse 76% 54% at 52% 14%, #58bdff73, transparent 80%),
    radial-gradient(ellipse 68% 55% at 12% 84%, #245aa174, transparent 80%),
    linear-gradient(155deg, #06172e80, #10254b96 50%, #041323e3);
}

/* The open 6A diary emits its own light. Anchor to the spine in the
   original sprite; the emitter inherits the guide's scale and position. */
.result-book-magic {
  --result-book-x: 58.6%;
  --result-book-y: 50.7%;
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.result-book-magic[data-running] {
  visibility: visible;
}
.result-book-magic::before,
.result-book-magic::after {
  content: "";
  position: absolute;
  left: var(--result-book-x);
  top: var(--result-book-y);
  pointer-events: none;
}
.result-book-magic::before {
  width: 57%;
  height: 15%;
  background: radial-gradient(ellipse closest-side, #e0fdff9e, #78eaff5e 40%, #2b9dff27 70%, transparent);
  transform: translate(-50%, -56%);
  transform-origin: center;
  opacity: .5;
}
.result-book-magic::after {
  width: 27%;
  height: 19%;
  background: radial-gradient(ellipse closest-side at 52% 55%, #b7f8ff55, #57c5ff25 62%, transparent);
  transform: translate(-50%, -94%) rotate(-10deg);
  transform-origin: 50% 92%;
  opacity: .65;
}
.result-book-ribbons {
  position: absolute;
  top: var(--result-book-y);
  left: var(--result-book-x);
  width: 66%;
  height: auto;
  overflow: visible;
  stroke: #9cf1ff;
  stroke-width: 2.1;
  stroke-linecap: round;
  mask-image: linear-gradient(transparent 12%, #000 76%);
  transform-origin: 50% 98%;
  transform: translate(-50%, -98%);
  opacity: .54;
}
.result-book-ribbons path:nth-child(2) { stroke: #d0f7ff; }
.result-book-ribbons path:nth-child(3) { stroke: #72baff; stroke-width: 1.25; }
.result-book-mote {
  position: absolute;
  top: var(--result-book-y);
  left: var(--result-book-x);
  width: clamp(2px, calc(var(--reveal-guide-height) * .022 * var(--mote-scale)), 10px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #f2ffff 17%, #9ef5ff 35%, #41c5ff91 51%, transparent 73%);
  box-shadow: 0 0 5px #6fdcff83;
  opacity: 0;
}
.result-book-mote[data-flare] {
  width: clamp(5px, calc(var(--reveal-guide-height) * .034), 14px);
  border-radius: 0;
  background: linear-gradient(#fff, #a9edff 48%, #42aaff);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}
.result-book-magic[data-running]::before {
  animation: result-book-glow 3.8s ease-in-out infinite alternate;
}
.result-book-magic[data-running]::after {
  animation: result-book-current 4.7s ease-in-out infinite alternate;
}
.result-book-magic[data-running] .result-book-ribbons {
  animation: result-book-ribbons 4.9s -1.7s ease-in-out infinite alternate;
}
.result-book-magic[data-running] .result-book-mote {
  animation: result-book-mote var(--flight) var(--phase) linear infinite;
}
@keyframes result-book-glow {
  from { opacity: .44; transform: translate(-50%, -56%) scale(.9, .84); }
  to { opacity: .82; transform: translate(-50%, -56%) scale(1.12, 1.08); }
}
@keyframes result-book-current {
  from { opacity: .36; transform: translate(-50%, -94%) rotate(-15deg) scale(.84, .81); }
  to { opacity: .76; transform: translate(-50%, -94%) rotate(9deg) scale(1.15, 1.08); }
}
@keyframes result-book-ribbons {
  from { opacity: .48; transform: translate(-50%, -98%) rotate(-7deg) scale(.85, .83); }
  to { opacity: .88; transform: translate(-50%, -98%) rotate(7deg) scale(1.05, 1.02); }
}
@keyframes result-book-mote {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(.42);
  }
  27% {
    opacity: .86;
    transform: translate3d(
      calc(var(--reveal-guide-height) * var(--drift) * .25 - 50%),
      calc(var(--reveal-guide-height) * var(--rise) * .36 - 50%), 0
    ) scale(1);
  }
  68% { opacity: .62; }
  100% {
    opacity: 0;
    transform: translate3d(
      calc(var(--reveal-guide-height) * var(--drift) - 50%),
      calc(var(--reveal-guide-height) * var(--rise) - 50%), 0
    ) scale(.66);
  }
}

/* Light travels in the world, behind Olga and behind all readable content.
   Only opacity and transform animate; the background painting stays still. */
.result-world-magic {
  position: absolute;
  z-index: 1;
  inset: 0;
  contain: paint;
  pointer-events: none;
}
.result-world-magic::before,
.result-world-magic::after {
  content: "";
  position: absolute;
  inset: -9%;
  opacity: 0;
}
.result-world-magic::before {
  background:
    radial-gradient(ellipse 49% 36% at 17% 20%, #34b6ff70, transparent 78%),
    radial-gradient(ellipse 46% 41% at 69% 65%, #3584f44a, transparent 85%);
}
.result-world-magic::after {
  background:
    radial-gradient(circle at 20% 14%, #b7f2ffcf 0 1px, #6acaff4c 2px, transparent 5px),
    radial-gradient(circle at 28% 24%, #b7f2ff90 0 1px, transparent 3px),
    radial-gradient(circle at 73% 13%, #b7f2ffbf 0 1px, #6acaff40 2px, transparent 4px),
    radial-gradient(circle at 83% 23%, #b7f2ffbf 0 1px, #6acaff4c 2px, transparent 5px),
    radial-gradient(ellipse 47% 35% at 80% 20%, #86deff66, transparent 84%),
    radial-gradient(ellipse 50% 37% at 13% 75%, #467eff48, transparent 86%);
}
.result-world-magic[data-running]::before {
  animation: result-world-left 8.6s -2.8s ease-in-out infinite alternate;
}
.result-world-magic[data-running]::after {
  animation: result-world-right 10.2s -6.2s ease-in-out infinite alternate;
}
@keyframes result-world-left {
  from { opacity: .36; transform: translate3d(-5%, 2%, 0); }
  to { opacity: .78; transform: translate3d(6%, -3%, 0); }
}
@keyframes result-world-right {
  from { opacity: .72; transform: translate3d(3%, -2%, 0); }
  to { opacity: .30; transform: translate3d(-5%, 4%, 0); }
}

.result-wrap[data-result-tier="6"] .result-card {
  --result-narration-ink: #d9f7ff;
  --result-narration-background: #17426a;
  --result-narration-border: #70b8df;
  --result-narration-focus: #adf0ff;
  background:
    radial-gradient(ellipse at 48% 0%, #1b4169 0%, #0c2548 51%, #081b35 100%) padding-box,
    linear-gradient(130deg, #a7efff, #438fd5 25%, #233f83 55%, #63c6ff 86%, #ceeaff) border-box;
  box-shadow:
    inset 0 0 0 1px #8eeaff9c,
    inset 0 0 0 6px #80cfff17,
    0 0 0 1px #b2edff85,
    0 4px 20px #3383ce54,
    0 8px 24px #020b1dc9;
}
.result-wrap[data-result-tier="6"] .result-card .result-phrase {
  color: #f0fbff;
  text-shadow: 0 0 9px #7be6ff52, 0 0 21px #47a7ef21;
}
.result-wrap[data-result-tier="6"] .result-card {
  --result-work-ink: #9fbbd5;
  --result-author-mark-ink: #c9e9f5;
  --result-author-mark-paper: #1d4267;
  --result-author-mark-rim: #7599b8;
}
.result-wrap[data-result-tier="6"] .result-author-signature { filter: invert(1) drop-shadow(0 .2px .2px #e2faff91); }
.result-wrap[data-result-tier="6"] .result-card .result-reward-precision {
  color: #bcd5ed;
}
.result-wrap[data-result-tier="6"] .result-category-mark { color: #a5d3ea; }
.result-wrap[data-result-tier="6"] .result-card :is(.result-author, .result-source, .favorite-button, .result-star-count > span) {
  color: #c6eeff;
}
.result-wrap[data-result-tier="6"] .result-card :is(.result-coins, .result-star-count strong, .result-star-bonus-count),
.result-wrap[data-result-tier="6"] .result-card .favorite-button[aria-pressed="true"] {
  color: #ffe3a5;
}
.result-wrap[data-result-tier="6"] .result-card :is(button, a, summary):focus-visible {
  outline-color: #adf0ff;
}
.result-wrap[data-result-tier="6"] > .result-more:not([open]) > summary,
.result-wrap[data-result-tier="6"] > .dialog-actions > .secondary {
  color: #d7eeff;
  text-shadow: 0 1px 3px #06132d;
}
.result-magic-halo {
  position: absolute;
  z-index: 0;
  inset: -5% 0 0;
  width: min(100%, max(210px, 176cqh), 570px);
  margin-inline: auto;
  pointer-events: none;
  transform-origin: 50% 68%;
  background:
    radial-gradient(ellipse 44% 64% at 50% 56%, #bcf7ffb8, #69ceff70 39%, #6684ff28 68%, transparent 100%),
    radial-gradient(ellipse 52% 34% at 50% 73%, #b8e8ff64, #4c81ff33 60%, transparent 100%);
  opacity: .46;
}
.result-hero .result-magic-field {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: min(100%, max(200px, 154cqh), 490px);
  margin-inline: auto;
  contain: layout paint;
  pointer-events: none;
}
.result-magic-dust {
  position: absolute;
  width: var(--result-dust-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #f0fdff 14%, #abf0ff 36%, #69c6ff75 48%, transparent 71%);
  box-shadow: 0 0 5px #62cfff76;
  opacity: 0;
}
.result-magic-outline {
  position: absolute;
  z-index: -1;
  inset: -3px;
  border: 2px solid #93e7ffb0;
  border-radius: inherit;
  box-shadow: 0 0 9px #9ae5ffc9, 0 0 23px #54b7ff8a, 0 0 38px #5978ff58;
  opacity: 0;
  pointer-events: none;
}
.result-magic-outline::before,
.result-magic-outline::after {
  content: "";
  position: absolute;
  inset: -12px 6% auto;
  height: 14px;
  background:
    radial-gradient(ellipse 7px 14px at 12% 100%, #c9f6ff, #5bc9ff66 46%, transparent 88%),
    radial-gradient(ellipse 11px 9px at 30% 100%, #a4ecff, #5bb4ff55 47%, transparent 90%),
    radial-gradient(ellipse 7px 12px at 52% 100%, #ddf7ff, #70afff66 46%, transparent 90%),
    radial-gradient(ellipse 12px 8px at 73% 100%, #a3d9ff, #6bc7ff55 47%, transparent 90%),
    radial-gradient(ellipse 6px 13px at 90% 100%, #d1f7ff, #5bc7ff66 47%, transparent 90%);
}
.result-magic-outline::after {
  inset: auto 6% -12px;
  transform: rotate(180deg);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .result-wrap[data-result-tier="6"] .result-card .result-phrase.result-magic-words {
    background-image: linear-gradient(103deg, #f0fbff 27%, #bdedff 42%, #fff 50%, #b9eeff 58%, #f0fbff 73%);
    background-size: 250% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
  }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .result-celebration-field,
  .result-gold-flare,
  .result-gold-field,
  .result-clip-gold,
  .result-world-gold,
  .result-book-magic,
  .result-world-magic,
  .result-magic-field,
  .result-magic-outline {
    display: none;
  }
  .result-wrap[data-result-tier="6"] .result-card .result-phrase.result-magic-words {
    background-image: none;
    color: #f0fbff;
  }
}
@media (forced-colors: active) {
  .result-magic-halo { display: none; }
}
