/* The Kids finish screen and the header sound switch. Drawn by games/reward.js. */

.sound {
  background: transparent; border: 0; border-radius: 999px; padding: 6px 10px;
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px;
}
.sound svg { width: 22px; height: 22px; display: block; }
.sound[aria-pressed="false"] { color: var(--muted); }
@media (max-width: 640px) {
  .sound { order: 2; padding: 6px 8px; }
}

.cheer {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(255, 244, 232, .97); overflow: auto;
  animation: cheer-in .25s ease-out both;
}
.cheer-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cheer-sky .fireworks { position: absolute; inset: 0; height: auto; max-width: none; margin: 0; }
.cheer-card {
  position: relative; width: min(460px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.cheer-card h2 { margin: 0; font-size: clamp(24px, 6vw, 32px); font-weight: 800; color: #e25b16; line-height: 1.2; }
.cheer-finale { margin: 0; font-size: clamp(20px, 4.5vw, 26px); font-weight: 800; color: #1c1915; line-height: 1.25; }

.cheer-hero { height: 140px; display: flex; align-items: flex-end; }
.cheer-pal { width: 120px; height: 132px; overflow: visible; transform-origin: 50% 100%; animation: cheer-hop .7s ease-in-out 4; }
.cheer-pal .arm-l { transform-origin: 22px 76px; animation: cheer-wave-l .3s ease-in-out infinite alternate; }
.cheer-pal .arm-r { transform-origin: 98px 76px; animation: cheer-wave-r .3s ease-in-out .15s infinite alternate; }

.cheer-dance { display: flex; align-items: flex-end; justify-content: center; gap: 10px; min-height: 64px; flex-wrap: wrap; }
.cheer-dance .dancer { width: 52px; height: auto; animation: cheer-bob .55s ease-in-out infinite alternate; animation-delay: calc(var(--n) * .12s); }
.cheer-dance.dance-socks .dancer { width: 54px; animation-name: cheer-sway; }
.cheer-dance.dance-birds .dancer { width: 46px; animation: cheer-fly 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--n) * .15s); }
.cheer-dance.dance-bonds .dancer { width: 230px; margin: 0; padding: 8px; gap: 6px; animation: none; }
.cheer-dance.dance-bonds .cell.fill::after { background: #d9a441; animation: cheer-pop .3s ease-out both; animation-delay: calc(.2s + var(--i) * .09s); }

.cheer-stars { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 40px; max-width: 340px; }
.cheer-stars svg { width: 34px; height: 34px; }
.cheer-stars svg.new { animation: cheer-land .55s cubic-bezier(.2, 1.4, .4, 1) .9s both; }
.cheer-stars .more { font-weight: 800; font-size: 20px; margin-left: 4px; }

.cheer-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.cheer-go {
  min-height: 72px; min-width: 72px; width: 72px; padding: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: white; border: 3px solid #1c1915;
}
.cheer-go svg { width: 32px; height: 32px; }
.cheer-go.primary { background: #e25b16; border-color: #e25b16; color: white; }
.cheer-go:focus-visible { outline: 4px solid #2c5f8a; outline-offset: 3px; }

.cheer-go.next { flex-basis: auto; max-width: none; }

/* The Kids path: numbered stages in the game header and on the finish screen. */
.stage-path { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.stage-path .stage {
  width: 44px; height: 48px; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
}
.stage-path .stage > span {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 16px; background: white; border: 3px solid var(--stage, #f2c14e); color: #1c1915;
}
.stage-path .stage.on > span { background: var(--stage, #f2c14e); color: #1c1915; transform: scale(1.12); }
.stage-path .stage.locked { cursor: default; }
.stage-path .stage.locked > span { border-color: #d8cfc4; color: #b3a89b; background: #f4ede4; }
.stage-path .stage:focus-visible { outline: none; }
.stage-path .stage:focus-visible > span { outline: 3px solid #2c5f8a; outline-offset: 2px; }

.cheer-path { justify-content: center; gap: 6px; }
.cheer-path .stage { width: 40px; height: 40px; }
.cheer-path .stage.done > span { background: var(--stage, #f2c14e); }
.cheer-path .stage.next > span { animation: cheer-glow 1s ease-in-out 1.3s infinite alternate; }

.tile-stages { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 4px; }
.tile-stages i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .45); border: 2px solid rgba(28, 25, 21, .35); }
.tile-stages i.open { background: white; border-color: #1c1915; }

/* Tens, last stage: only the filled places are drawn, so the gap has to be known, not counted. */
.ten.blind .cell:not(.fill) { border-color: transparent; }

@keyframes cheer-glow {
  from { transform: scale(1); box-shadow: 0 0 0 0 rgba(226, 91, 22, .5); }
  to { transform: scale(1.25); box-shadow: 0 0 0 8px rgba(226, 91, 22, 0); }
}
@keyframes cheer-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cheer-hop {
  0% { transform: translateY(0) scale(1.06, .94); }
  40% { transform: translateY(-34px) scale(.96, 1.04); }
  72% { transform: translateY(0) scale(1.08, .92); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes cheer-wave-l { from { transform: rotate(-28deg); } to { transform: rotate(12deg); } }
@keyframes cheer-wave-r { from { transform: rotate(28deg); } to { transform: rotate(-12deg); } }
@keyframes cheer-bob { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-14px) rotate(6deg); } }
@keyframes cheer-sway { from { transform: rotate(-14deg); } to { transform: translateY(-10px) rotate(14deg); } }
@keyframes cheer-fly { from { transform: translate(-8px, 6px) scaleY(1); } to { transform: translate(8px, -18px) scaleY(.7); } }
@keyframes cheer-pop { from { transform: scale(0); } 70% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes cheer-land {
  0% { transform: translateY(-160px) scale(3) rotate(-30deg); opacity: 0; }
  60% { transform: translateY(0) scale(1.3) rotate(8deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cheer, .cheer-pal, .cheer-pal .arm-l, .cheer-pal .arm-r, .cheer-dance .dancer,
  .cheer-dance.dance-bonds .cell.fill::after, .cheer-stars svg.new, .cheer-path .stage.next > span { animation: none; }
}
