/* Marin's victory confetti (public/cheer.js): one canvas of paper confetti over everything (taps go through), and a felt
   letterboard banner hung on two strings from the top of the screen, bunting in the winner's color along its foot. */
.chr-confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 6004; pointer-events: none; }

.chr-banner { position: fixed; z-index: 6003; left: 50%; top: calc(19vh + env(safe-area-inset-top)); width: min(calc(100% - 28px), 420px);
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform-origin: 50% calc(-19vh - env(safe-area-inset-top)); /* swings from where the strings are tied, off the top */
  transform: translate(-50%, calc(-100% - 22vh - env(safe-area-inset-top))); visibility: hidden; }
.chr-banner.in { visibility: visible; animation: chr-drop 1.5s cubic-bezier(.3, .8, .3, 1) both; transform: translate(-50%, 0); }
.chr-banner.out { visibility: visible; transform: translate(-50%, calc(-100% - 22vh - env(safe-area-inset-top))); transition: transform .5s cubic-bezier(.6, 0, .8, .4); }
@keyframes chr-drop {
  0% { transform: translate(-50%, calc(-100% - 22vh - env(safe-area-inset-top))) rotate(0); }
  28% { transform: translate(-50%, 0) rotate(6deg); }
  48% { transform: translate(-50%, 0) rotate(-4deg); }
  66% { transform: translate(-50%, 0) rotate(2.2deg); }
  82% { transform: translate(-50%, 0) rotate(-1deg); }
  100% { transform: translate(-50%, 0) rotate(0); }
}
/* the strings, tied off the top of the screen */
.chr-banner::before, .chr-banner::after { content: ''; position: absolute; bottom: calc(100% - 6px); height: 100vh; width: 2px;
  background: var(--letter, #f5f5f2); box-shadow: 0 0 0 1px #0003; }
.chr-banner::before { left: 13%; }
.chr-banner::after { right: 13%; }

.chr-board { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 18px 16px;
  border-radius: 12px 12px 0 0; box-shadow: 0 0 0 1px #f5f5f21f, 0 4px 0 #0000004d; text-align: center; }
.chr-board .row1 { font-size: clamp(30px, 10.5vw, 46px); letter-spacing: .12em; white-space: nowrap; max-width: 100%; overflow: hidden; }
.chr-board .row1 b { display: inline-block; font-weight: inherit; }
.chr-banner.in:not(.still) .chr-board .row1 b { animation: chr-tile .32s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(.45s + var(--i) * 55ms); }
@keyframes chr-tile { from { transform: translateY(-14px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.chr-board .row2 { font-family: var(--font); font-weight: 400; text-transform: none; letter-spacing: .01em; font-size: 17px;
  opacity: .92; white-space: normal; text-shadow: none; }

/* bunting: a row of pennants under the board */
.chr-flags { display: flex; height: 26px; filter: drop-shadow(0 2px 0 #0000004d); }
.chr-flags i { flex: 1; clip-path: polygon(0 0, 100% 0, 50% 100%); }

.chr-banner:focus-visible { outline: none; }
.chr-banner:focus-visible .chr-board { outline: 3px solid var(--signal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .chr-banner.in, .chr-banner.out { animation: none; transition: opacity .4s; transform: translate(-50%, 0); }
  .chr-banner.out { opacity: 0; }
}
