/* award_notice.css - the announcement of a new badge or a new level
   (AWARDS_NOTICE 0001; D931, D965, D2106). Concept Art/awards.html frames
   7 and 8 (.scrim, .dialog, .anntop, .hero, .burst, .medal, .dtitle,
   .dbody, .dbtn.blue, .confetti, .ls-ann) and wide_awards_and_get_cards
   .html A5, written under award_notice.js's prefix, an-. The box is the
   overlay family's (§1c: 330 px, a 20 px corner, #22304A on #37476B) and
   flat (D1699); the medal is the_icon_set.html's drawing at the size the
   render's 60 px emoji takes (1.15em, as awards.css draws a medal); the
   confetti is the look sprints.css draws, which is frame 7's exactly, its
   pieces falling once, to the screen's foot. Little Sai Thura's look is
   figure.css's; here only his place. ⛔ No grain, no gradient, no shadow. */

/* The layer: over every page, the scrim the overlay family's. */
.an-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
}
.an-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 16, .62);
}

/* The frame: the screen at nav's scale (award_notice.js sets its size and
   transform), the box centered on it, as the render centers its dialog. */
.an-frame {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.an-box {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 330px;
  padding: 24px 20px 20px;
  transform: translate(-50%, -50%);
  background: #22304A;
  border: 1px solid #37476B;
  border-radius: 20px;
  text-align: center;
}

/* The headline: gold, 21 px, the overlay family's one exception to 18 px
   titles (D965), in the headlines' font. */
.an-head {
  font-family: var(--font-headline);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  color: #F2C14E;
}

/* THE HERO: the medal grows in and overshoots (0.3, 1.15, 1) while a gold
   ring bursts out behind it, then everything holds still: ONE play. */
.an-hero {
  position: relative;
  height: 104px;
  margin: 8px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  line-height: 1;
}
.an-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  box-sizing: border-box;
  border: 2px solid rgba(242, 193, 78, .75);
  border-radius: 50%;
  opacity: 0;
  animation: an-burst 2.8s ease-out both;
}
.an-medal {
  position: relative;
  display: block;
  width: 1.15em;
  height: 1.15em;
  animation: an-pop 2.8s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes an-pop {
  0% { transform: scale(.3); opacity: 0; }
  18% { transform: scale(1.15); opacity: 1; }
  28% { transform: scale(1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes an-burst {
  0% { transform: scale(.4); opacity: 0; }
  15% { opacity: 1; }
  45% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

/* The name, in the headlines' font on the render's 21 px line, and the line
   the Awards page draws under it. */
.an-name {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 600;
  line-height: 21px;
  color: #FFFFFF;
}
.an-line {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.5;
  color: #AEBBD0;
}

/* Continue: the kit's blue button, the overlay family's 54 px. */
.an-go {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  margin-top: 20px;
  padding: 0;
  border: 1px solid #6FAEFF;
  border-radius: 12px;
  background: rgba(111, 174, 255, .07);
  color: #6FAEFF;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Little Sai Thura on the box (D2106): centered, his feet 15 px over its top
   edge; his size is award_notice.js's (the phone's own room), set on this
   holder. He catches no tap and moves nothing. */
.an-fig {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 15px);
  transform: translateX(-50%);
  pointer-events: none;
}

/* CONFETTI (D931): over the whole screen, scrim and box included, never
   catching a tap; it rains for the first few seconds only, each piece once. */
.an-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.an-confetti i {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation-name: an-fall-a;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}
.an-confetti i:nth-child(even) {
  animation-name: an-fall-b;
}
.an-confetti i:nth-child(1) { left: 37%; animation-delay: .29s; animation-duration: 3.3s; background: #4E9BF0; width: 8px; height: 12px; }
.an-confetti i:nth-child(2) { left: 74%; animation-delay: .58s; animation-duration: 3s; background: #35E07E; width: 10px; height: 14px; }
.an-confetti i:nth-child(3) { left: 11%; animation-delay: .87s; animation-duration: 2.7s; background: #ED6A76; width: 6px; height: 16px; }
.an-confetti i:nth-child(4) { left: 48%; animation-delay: 1.16s; animation-duration: 3.4s; background: #EE9440; width: 8px; height: 10px; }
.an-confetti i:nth-child(5) { left: 85%; animation-delay: 1.45s; animation-duration: 3.1s; background: #EAF0FA; width: 10px; height: 12px; }
.an-confetti i:nth-child(6) { left: 22%; animation-delay: 1.74s; animation-duration: 2.8s; background: #F2C14E; width: 6px; height: 14px; }
.an-confetti i:nth-child(7) { left: 59%; animation-delay: 2.03s; animation-duration: 3.5s; background: #4E9BF0; width: 8px; height: 16px; }
.an-confetti i:nth-child(8) { left: 96%; animation-delay: 2.32s; animation-duration: 3.2s; background: #35E07E; width: 10px; height: 10px; }
.an-confetti i:nth-child(9) { left: 33%; animation-delay: .01s; animation-duration: 2.9s; background: #ED6A76; width: 6px; height: 12px; }
.an-confetti i:nth-child(10) { left: 70%; animation-delay: .3s; animation-duration: 2.6s; background: #EE9440; width: 8px; height: 14px; }
.an-confetti i:nth-child(11) { left: 7%; animation-delay: .59s; animation-duration: 3.3s; background: #EAF0FA; width: 10px; height: 16px; }
.an-confetti i:nth-child(12) { left: 44%; animation-delay: .88s; animation-duration: 3s; background: #F2C14E; width: 6px; height: 10px; }
.an-confetti i:nth-child(13) { left: 81%; animation-delay: 1.17s; animation-duration: 2.7s; background: #4E9BF0; width: 8px; height: 12px; }
.an-confetti i:nth-child(14) { left: 18%; animation-delay: 1.46s; animation-duration: 3.4s; background: #35E07E; width: 10px; height: 14px; }
.an-confetti i:nth-child(15) { left: 55%; animation-delay: 1.75s; animation-duration: 3.1s; background: #ED6A76; width: 6px; height: 16px; }
.an-confetti i:nth-child(16) { left: 92%; animation-delay: 2.04s; animation-duration: 2.8s; background: #EE9440; width: 8px; height: 10px; }
.an-confetti i:nth-child(17) { left: 29%; animation-delay: 2.33s; animation-duration: 3.5s; background: #EAF0FA; width: 10px; height: 12px; }
.an-confetti i:nth-child(18) { left: 66%; animation-delay: .02s; animation-duration: 3.2s; background: #F2C14E; width: 6px; height: 14px; }
.an-confetti i:nth-child(19) { left: 3%; animation-delay: .31s; animation-duration: 2.9s; background: #4E9BF0; width: 8px; height: 16px; }
.an-confetti i:nth-child(20) { left: 40%; animation-delay: .6s; animation-duration: 2.6s; background: #35E07E; width: 10px; height: 10px; }
.an-confetti i:nth-child(21) { left: 77%; animation-delay: .89s; animation-duration: 3.3s; background: #ED6A76; width: 6px; height: 12px; }
.an-confetti i:nth-child(22) { left: 14%; animation-delay: 1.18s; animation-duration: 3s; background: #EE9440; width: 8px; height: 14px; }
.an-confetti i:nth-child(23) { left: 51%; animation-delay: 1.47s; animation-duration: 2.7s; background: #EAF0FA; width: 10px; height: 16px; }
.an-confetti i:nth-child(24) { left: 88%; animation-delay: 1.76s; animation-duration: 3.4s; background: #F2C14E; width: 6px; height: 10px; }
.an-confetti i:nth-child(25) { left: 25%; animation-delay: 2.05s; animation-duration: 3.1s; background: #4E9BF0; width: 8px; height: 12px; }
.an-confetti i:nth-child(26) { left: 62%; animation-delay: 2.34s; animation-duration: 2.8s; background: #35E07E; width: 10px; height: 14px; }
.an-confetti i:nth-child(27) { left: 99%; animation-delay: .03s; animation-duration: 3.5s; background: #ED6A76; width: 6px; height: 16px; }
.an-confetti i:nth-child(28) { left: 36%; animation-delay: .32s; animation-duration: 3.2s; background: #EE9440; width: 8px; height: 10px; }

/* Each piece falls to the screen's foot, however tall the screen. */
@keyframes an-fall-a {
  0% { transform: translate(0, -20px) rotate(0deg); }
  100% { transform: translate(34px, calc(100vh + 36px)) rotate(560deg); }
}
@keyframes an-fall-b {
  0% { transform: translate(0, -20px) rotate(0deg); }
  100% { transform: translate(-40px, calc(100vh + 36px)) rotate(-480deg); }
}

/* With less motion asked, nothing grows, bursts or falls: the medal stands
   at its size and Little Sai Thura stands still in his pose (figure.css). */
@media (prefers-reduced-motion: reduce) {
  .an-medal,
  .an-burst,
  .an-confetti i,
  .an-confetti i:nth-child(even) {
    animation: none;
  }
}
