/* The celebration shown at the end of something (js/ui/celebration.js): a medal under sun rays and confetti, a
   score pill, a ribbon with the verdict in English over Spanish, the prizes in a gold pill and a note. The
   window around it is a sky with clouds and meadow hills: the Practice Club exercises (.mv-dialog) and the
   adventure sheets (.ce-screen) share it, and so does the colour of each ribbon (data-tier on .ce). */
:root {
  --ce-sky:
    radial-gradient(70% 12% at 10% 102%, rgb(168 220 138) 99%, transparent 100%),
    radial-gradient(70% 10% at 92% 103%, rgb(147 207 116) 99%, transparent 100%),
    radial-gradient(60% 9% at 52% 107%, rgb(185 227 157) 99%, transparent 100%),
    radial-gradient(ellipse 70px 24px at 86% 7%, rgb(255 255 255 / 0.85) 98%, transparent 100%),
    radial-gradient(ellipse 44px 30px at 89% 5%, rgb(255 255 255 / 0.85) 98%, transparent 100%),
    radial-gradient(ellipse 60px 20px at 12% 16%, rgb(255 255 255 / 0.6) 98%, transparent 100%),
    linear-gradient(rgb(191 227 255), rgb(234 246 255) 62%, rgb(244 251 242));
}
html[data-appearance="dark"] {
  --ce-sky:
    radial-gradient(70% 12% at 10% 102%, rgb(52 96 70) 99%, transparent 100%),
    radial-gradient(70% 10% at 92% 103%, rgb(44 84 62) 99%, transparent 100%),
    radial-gradient(60% 9% at 52% 107%, rgb(60 108 78) 99%, transparent 100%),
    linear-gradient(rgb(30 52 82), rgb(36 62 94) 62%, rgb(32 56 70));
}
.mv-dialog,
.journey-sheet.ce-screen {
  background: var(--ce-sky);
}

.ce {
  --ribbon-top: rgb(86 198 124);
  --ribbon-bottom: rgb(38 146 84);
  --ribbon-edge: rgb(24 104 58);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  flex: 1;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 12px 0 18px;
  text-align: center;
}
.ce[data-tier="good"] {
  --ribbon-top: rgb(96 160 232);
  --ribbon-bottom: rgb(48 112 196);
  --ribbon-edge: rgb(32 78 144);
}
.ce[data-tier="try"] {
  --ribbon-top: rgb(166 126 224);
  --ribbon-bottom: rgb(120 82 188);
  --ribbon-edge: rgb(82 52 138);
}
.ce p {
  margin: 0;
}
.ce-hero {
  position: relative;
  display: grid;
  place-items: center;
}
.ce-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 150vmax;
  height: 150vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(
    from -4deg,
    rgb(255 255 255 / 0.42) 0 7deg,
    transparent 7deg 18deg
  );
  -webkit-mask-image: radial-gradient(circle, black 0, transparent 34%);
  mask-image: radial-gradient(circle, black 0, transparent 34%);
  pointer-events: none;
}
.ce-burst {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.ce[data-tier="try"] .ce-burst {
  display: none;
}
.ce-burst i {
  position: absolute;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  animation: ce-confetti 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.ce-burst i:nth-child(1) {
  top: 10%;
  left: 12%;
  background: rgb(150 100 230);
  transform: rotate(35deg);
}
.ce-burst i:nth-child(2) {
  top: 30%;
  left: 8%;
  background: rgb(250 200 40);
  transform: rotate(-30deg);
}
.ce-burst i:nth-child(3) {
  top: 22%;
  left: 30%;
  background: rgb(60 190 160);
  transform: rotate(60deg);
  animation-delay: 0.08s;
}
.ce-burst i:nth-child(4) {
  top: 6%;
  left: 40%;
  background: rgb(250 200 40);
  transform: rotate(20deg);
  animation-delay: 0.14s;
}
.ce-burst i:nth-child(5) {
  top: 8%;
  left: 62%;
  background: rgb(250 200 40);
  transform: rotate(-50deg);
  animation-delay: 0.1s;
}
.ce-burst i:nth-child(6) {
  top: 26%;
  left: 70%;
  background: rgb(70 140 230);
  transform: rotate(40deg);
  animation-delay: 0.05s;
}
.ce-burst i:nth-child(7) {
  top: 32%;
  left: 88%;
  background: rgb(240 90 100);
  transform: rotate(-20deg);
  animation-delay: 0.12s;
}
.ce-burst i:nth-child(8) {
  top: 12%;
  left: 90%;
  background: rgb(150 100 230);
  transform: rotate(70deg);
}
.ce-burst i:nth-child(9) {
  top: 42%;
  left: 20%;
  background: rgb(70 140 230);
  transform: rotate(-65deg);
  animation-delay: 0.16s;
}
.ce-burst i:nth-child(10) {
  top: 44%;
  left: 80%;
  background: rgb(60 190 160);
  transform: rotate(25deg);
  animation-delay: 0.18s;
}
@keyframes ce-confetti {
  from {
    opacity: 0;
    translate: 0 -40px;
  }
}
.ce-medal {
  font-size: 104px;
  line-height: 1;
  filter: drop-shadow(0 6px 0 rgb(0 0 0 / 0.12));
  animation: ce-medal-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.ce-medal img {
  width: 1em;
  height: 1em;
}
@keyframes ce-medal-pop {
  from {
    transform: scale(0.3) rotate(-14deg);
    opacity: 0;
  }
}
.ce-score {
  padding: 2px 40px 4px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ad-surface) 88%, transparent);
  box-shadow: 0 3px 0 var(--ad-edge);
  color: var(--ad-ink-deep);
  font-size: calc(52px * var(--text-scale, 1));
  font-weight: 900;
  line-height: 1.15;
}
.ce-note {
  display: grid;
  justify-items: center;
  width: 100%;
  gap: 8px;
}
.ce-ribbon {
  position: relative;
  isolation: isolate;
  display: inline-block;
  max-width: calc(100% - 76px);
  padding: 6px 40px 8px;
  border-radius: 14px;
  background: linear-gradient(var(--ribbon-top), var(--ribbon-bottom));
  box-shadow: 0 4px 0 var(--ribbon-edge);
  color: white;
  font-size: calc(38px * var(--text-scale, 1));
  font-weight: 900;
  text-shadow: 0 2px 0 var(--ribbon-edge);
}
.ce-ribbon::before,
.ce-ribbon::after {
  content: "";
  position: absolute;
  top: 14px;
  z-index: -1;
  width: 56px;
  height: 100%;
  background: var(--ribbon-edge);
}
.ce-ribbon::before {
  left: -34px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 26% 50%);
}
.ce-ribbon::after {
  right: -34px;
  clip-path: polygon(0 0, 100% 0, 74% 50%, 100% 100%, 0 100%);
}
.ce-verdict::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.3em;
  border-radius: 50%;
  background: white;
  color: var(--ribbon-bottom);
  font-size: 0.8em;
  text-shadow: none;
  vertical-align: 0.06em;
}
.ce-es {
  padding: 2px 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ad-surface) 78%, transparent);
  color: var(--ad-blue-ink);
  font-size: calc(20px * var(--text-scale, 1));
  font-weight: 700;
}
.ce-prizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  padding: 8px 28px;
  border: 3px solid var(--ad-gold-edge);
  border-radius: 999px;
  background: var(--ad-tint-gold);
  box-shadow: 0 3px 0 var(--ad-line-gold);
  color: var(--ad-gold-ink);
  font-size: calc(26px * var(--text-scale, 1));
  font-weight: 900;
}
.ce-prizes[hidden] {
  display: none;
}
.ce-prize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ce-prize + .ce-prize::before {
  content: "·";
  margin-right: 8px;
}
.ce-prize b {
  font-size: 1.2em;
}
.ce-prize-icon {
  width: 1.3em;
  height: 1.3em;
  line-height: 1.3;
  text-align: center;
}
.ce-prize-icon img {
  width: 100%;
  height: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .ce-medal,
  .ce-burst i {
    animation: none;
  }
}
@media (max-width: 520px) {
  .ce-medal {
    font-size: 88px;
  }
  .ce-score {
    font-size: calc(44px * var(--text-scale, 1));
  }
  .ce-ribbon {
    padding: 4px 30px 6px;
    font-size: calc(32px * var(--text-scale, 1));
  }
  .ce-prizes {
    padding: 6px 18px;
    font-size: calc(22px * var(--text-scale, 1));
  }
}
@media (orientation: landscape) and (min-width: 768px) and (min-height: 640px) {
  .ce {
    gap: 14px;
  }
  .ce-medal {
    font-size: 150px;
  }
  .ce-score {
    font-size: calc(68px * var(--text-scale, 1));
  }
  .ce-ribbon {
    font-size: calc(54px * var(--text-scale, 1));
  }
  .ce-es {
    font-size: calc(24px * var(--text-scale, 1));
  }
  .ce-prizes {
    font-size: calc(34px * var(--text-scale, 1));
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .ce {
    gap: 4px;
    padding: 4px 0;
  }
  .ce-medal {
    font-size: 56px;
  }
  .ce-score {
    padding: 0 24px;
    font-size: calc(30px * var(--text-scale, 1));
  }
  .ce-ribbon {
    font-size: calc(26px * var(--text-scale, 1));
  }
  .ce-es {
    padding: 0 14px;
    font-size: calc(15px * var(--text-scale, 1));
  }
  .ce-prizes {
    padding: 4px 18px;
    font-size: calc(18px * var(--text-scale, 1));
  }
}

/* A note under the prizes: English first, Spanish smaller beneath it. */
.ce-hint {
  display: grid;
  gap: 2px;
  max-width: min(520px, 100%);
  margin: 0;
  padding: 8px 20px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 20px;
  background: color-mix(in srgb, var(--ad-surface) 82%, transparent);
  color: var(--ad-ink-deep);
  font-size: calc(18px * var(--text-scale, 1));
  font-weight: 800;
  line-height: 1.25;
}
.ce-hint small {
  color: var(--ad-blue-ink);
  font-size: 0.82em;
  font-weight: 600;
}

/* The adventure sheets that celebrate ("Well done!" between steps, "Adventure complete!") are the whole
   window, like the Practice Club exercises: the celebration in the middle, the choices below it. */
.journey-sheet.ce-screen[open] {
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(14px, env(safe-area-inset-top, 0px)) 18px max(16px, env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
  color: var(--ad-ink-deep);
  text-align: center;
}
.ce-screen > * {
  box-sizing: border-box;
  width: min(720px, 100%);
  margin-right: auto;
  margin-left: auto;
}
.ce-screen > .ce {
  flex: 1;
}
.ce-choices {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}
.ce-screen .journey-button {
  min-height: 60px;
  padding: 10px 22px;
  border: 3px solid var(--ad-line-blue);
  border-bottom-width: 6px;
  background: var(--ad-surface);
  color: var(--ad-blue-ink);
  font-size: calc(18px * var(--text-scale, 1));
}
.ce-screen .journey-button.is-primary {
  min-height: 84px;
  border: 3px solid var(--ad-surface);
  background: var(--color-action-confirm);
  color: var(--ad-on-accent);
  box-shadow:
    0 0 0 2px var(--ad-mint-edge),
    0 4px 0 rgb(32 85 63);
}
.ce-screen .journey-button.is-primary strong {
  font-size: calc(24px * var(--text-scale, 1));
}
.ce-screen .journey-button.is-exit {
  min-height: 44px;
  padding: 6px 14px;
  font-size: calc(15px * var(--text-scale, 1));
}
.topic-finish .ce-choices .journey-button {
  height: 72px;
  min-height: 72px;
  box-sizing: border-box;
}
