@import url("../../root/root.css");

:root {
  --teams-banner-shared-backdrop-bg: rgba(0,0,0,0.2);
  --teams-banner-shared-backdrop-blur: 2px;
  --teams-banner-toggle-duration: 280ms;
  --teams-banner-toggle-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* FIXED BANNER (no page layout adjustments) */
#teams-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;    
  z-index: 100;
    z-index: 99998;
}

/* BANANA HEADER (scoreboard strip) */
#teams-banner .scoreboard {
  display: flex;
  flex-wrap: wrap;
  /* gap: 1rem; */
gap: clamp(4rem, 6vw, 5rem);

  justify-content: center;
  width: 100%;
  background: var(--duck-banana);
  background: linear-gradient(to bottom, #ffe26f, #f3d663);
  padding-top: 2rem;
  padding-bottom: 1rem;
  /* box-shadow:
    0 0.4rem 0.4rem 0 rgba(44, 62, 80, 0.12),
    0 0.2rem 0.6rem 0 rgba(44, 62, 80, 0.16); */
    box-shadow: var(--scoreboard-shadow);
  transition:
    gap var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    padding-top var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    padding-bottom var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner.expanded .scoreboard,
#teams-banner.is-expanding .scoreboard,
#teams-banner:not(.hide-avatars):not(.is-collapsing) .scoreboard {
  gap: 0;
  justify-content: space-around;
}

/* TEAM CARDS */
#teams-banner .team {
  text-align: center;
  width: 14rem;
  transition:
    width var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}


#teams-banner .team-img {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.5rem;
  box-shadow:
    0 0.4rem 0.4rem 0 rgba(44, 62, 80, 0.12),
    0 0.2rem 0.6rem 0 rgba(44, 62, 80, 0.16);
    z-index: 99;
        z-index: 99998;

    cursor: pointer;
}

#teams-banner .team-name {
  margin: 1rem 0 0.25rem;
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-charcoal);
  max-height: 4rem;
  overflow: hidden;
  transition:
    opacity var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    max-height var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    margin-top var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    margin-bottom var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner .team-score {
  /* margin: 0.25rem 0 0; */
  margin: 0.25rem auto 0;
  font-family: var(--title-font);
  font-weight: 800;
  font-size: 4rem;
  padding: 0;
  color: var(--duck-white) !important;
  background-color: var(--duck-charcoal);
  border-radius: 1.8rem;
  box-shadow:
    inset 0rem 0.5rem 0.6rem rgba(0, 0, 0, 0.8),
    inset 0 -0.3rem 0.6rem rgba(70, 70, 90, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  transition:
    font-size var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    padding var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    border-radius var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner { z-index: 99; }
#teams-banner { z-index: 99998; }
.modal       { z-index: 200; }


#teams-banner .banana-icon {
  width: 5.5rem;
  height: 5.5rem;
  margin-right: 1rem;
  filter: drop-shadow(0 0.5rem 0.8rem rgba(0, 0, 0, 0.5));
  transform: translateX(-0.5rem);
  transition:
    width var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    height var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    margin-right var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner .team-score .banana-icon {
  transition:
    opacity 250ms ease,
    width var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    height var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    margin-right var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner .team-score .score-value {
  color: var(--duck-white) !important;
  -webkit-text-fill-color: var(--duck-white) !important;
  transition:
    opacity 250ms ease,
    font-size var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

.teams-banner-score-popup {
  position: fixed;
  font-family: var(--font-main);
  font-size: 5rem;
  font-weight: bold;
  padding: 0.6rem 1.2rem;
  background-color: var(--duck-white);
  color: var(--teams-banner-popup-color, var(--duck-charcoal));
  border-radius: 1.8rem;
  opacity: 0;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 0.4rem 0.8rem rgba(0, 0, 0, 0.3);
  box-shadow:
    0 0 0 8px var(--duck-yellow),
    0 0 15px 13px var(--duck-yellow),
    0 1rem 2rem 0 rgba(44, 62, 80, 0.48),
    0 0.5rem 1.5rem rgba(44, 62, 80, 0.22);
  transform: translate(-50%, -50%);
  z-index: 100001;
  animation: teamsBannerScorePopup 2s forwards;
}

.teams-banner-score-popup.is-positive {
  color: var(--teams-banner-popup-color, var(--duck-charcoal));
}

.teams-banner-score-popup.is-negative {
  color: #d62828;
}


/* HIGHLIGHT CURRENT TEAM */
#teams-banner .team.is-current .team-img {
  outline: 0.5rem solid var(--correct-green);
  outline-offset: 0.8rem;
  box-shadow: 0 0 0 0.5rem rgba(34, 197, 94, 0.18);
  animation: currentTeamPulse 1.2s ease-in-out infinite;
  transform-origin: center;
}

/* ANIMATIONS */
@keyframes currentTeamPulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0.5rem rgba(34, 197, 94, 0.18); }
  50%  { transform: scale(1.06); box-shadow: 0 0 0 1rem   rgba(34, 197, 94, 0.32); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0.5rem rgba(34, 197, 94, 0.18); }
}

@keyframes bananaBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes teamsBannerScorePopup {
  0% {
    transform: translate(-50%, calc(-50% - 10px)) scale(0.9) rotate(-5deg);
    opacity: 0;
  }
  4% {
    transform: translate(-50%, -50%) scale(1.05) rotate(-3deg);
    opacity: 1;
  }
  8% {
    transform: translate(-50%, -50%) scale(0.97) rotate(9deg);
    opacity: 1;
  }
  16% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  35% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, calc(-50% + 10px)) scale(0.92) rotate(0deg);
    opacity: 0;
  }
}

@media (min-width: 480px) and (max-width: 1023px) {
  .teams-banner-score-popup {
    font-size: 4.5rem;
  }
}

@media (max-width: 479px) {
  .teams-banner-score-popup {
    font-size: 3rem;
  }
}

#teams-banner .banana-animate {
  animation: bananaBounce 0.4s ease;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  #teams-banner .team.is-current .team-img { animation: none; }
}

/* RESPONSIVE */
@media (max-width: 1000px) {
  #teams-banner .scoreboard { padding-top: 1.2rem; padding-bottom: 0.8rem; }
  #teams-banner .scoreboard { gap: 0.8rem; }
  #teams-banner .team { width: 12rem; }
  #teams-banner .team-img { width: 9rem; height: 9rem; }
  #teams-banner .team-name { font-size: 1.8rem; margin-top: 0.6rem; }
  #teams-banner .team-score { font-size: 3.2rem; padding: 0.4rem 1.4rem; }
  #teams-banner .banana-icon { width: 4.4rem; height: 4.4rem; margin-right: 0.6rem; transform: translateX(-0.2rem); }
}

@media (max-width: 600px) {
  #teams-banner .scoreboard { padding-top: 1rem; padding-bottom: 0.5rem; }
  #teams-banner .scoreboard { flex-wrap: wrap; gap: 0.75rem; }
  #teams-banner .team { width: 45%; max-width: 16rem; }
  #teams-banner .team-img { width: 7rem; height: 7rem; }
  #teams-banner .team-name { font-size: 1.6rem; margin-top: 0.5rem; }
  #teams-banner .team-score { font-size: 2rem; padding: 0.4rem 1rem; }
  #teams-banner .banana-icon { width: 3.6rem; height: 3.6rem; margin-right: 0.4rem; transform: translateX(0); }
}







/* Modal shell */
.modal {
    font-family: var(--font-main);
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teams-banner-shared-backdrop-bg);
  backdrop-filter: blur(var(--teams-banner-shared-backdrop-blur));
  -webkit-backdrop-filter: blur(var(--teams-banner-shared-backdrop-blur));
  opacity: 0; /* for enter animation */
  z-index: 999999;
}

.modal.hidden { display: none; }

/* Modal card */
.modal-content {
  background: var(--duck-white);
  padding: 4rem;
  border-radius: 3.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;

  /* enter animation base */
  transform: translateY(8px) scale(.98);
  opacity: 0;
}

/* Heading */
#number-of-teams-p {
  font-size: var(--size-header);
  color: var(--text-charcoal);
  margin: 1rem;
}

/* Team count row */
.team-count-picker {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Team count buttons */
.team-count-picker button {
  font-family: var(--font-main);
  padding: 2rem 3.6rem;
  font-size: 3rem;
  border: none;
  border-radius: 1.8rem;
  background: var(--duck-charcoal);
  color: var(--duck-white);
  cursor: pointer;
}

.team-count-picker button:hover {
  background: var(--duck-pink);
}

.team-count-picker button.is-selected {
  background: var(--duck-pink);
  color: var(--duck-white);
  box-shadow: 0 0.2rem 1rem rgba(44,62,80,0.25);
  transform: translateY(-0.1rem);
}

/* Enter/exit animations */
/* Apply animations ONLY to the animal selector modal */
#select-animal-modal:not(.hidden) {
  animation: backdropIn 240ms ease both;
}

#select-animal-modal.is-closing {
  animation: backdropOut 180ms ease both;
}

#select-animal-modal:not(.hidden) .modal-content {
  animation: cardIn 320ms cubic-bezier(.2,.9,.2,1) 60ms both;
}

#select-animal-modal.is-closing .modal-content {
  animation: cardOut 180ms ease both;
}

/* Default behavior for all other modals */
.modal:not(.hidden):not(#select-animal-modal) {
  opacity: 1; /* make visible */
}

.modal:not(.hidden):not(#select-animal-modal) .modal-content {
  opacity: 1;
  transform: none;
}



@keyframes backdropIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdropOut  { from { opacity: 1; } to { opacity: 0; } }
@keyframes cardIn {
  0%   { transform: translateY(8px) scale(.98); opacity: 0; }
  60%  { transform: translateY(0) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes cardOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to   { transform: translateY(8px) scale(.98); opacity: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal:not(.hidden), .modal.is-closing,
  .modal:not(.hidden) .modal-content,
  .modal.is-closing .modal-content {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .modal-content {
    padding: 2.4rem;
    border-radius: 2.4rem;
    margin: 0 1.5rem;
  }

  #number-of-teams-p { font-size: 2.5rem; }

  .team-count-picker button {
    padding: 1rem 2rem;
    font-size: 2rem;
  }
}



/* :root { --teams-banner-bottom: 64px; }  */

/* :root { --teams-banner-bottom: 64px; } */

/* Button placement: right side, just under the banner (you already have similar) */
#avatar-toggle-btn{
  position: fixed;
  right: 1.3rem;
  top: calc(var(--teams-banner-bottom, 64px) + 8px);
  z-index: 100000;
  font-family: var(--font-main);
  font-size: 1.4rem;

  /* center the icon */
  display: flex;               /* or: display:grid; place-items:center; */
  align-items: center;
  justify-content: center;

  width: 4rem;
  height: 4rem;
  padding: 0;                  /* ← remove padding */
  box-sizing: border-box;
  line-height: 1;              /* avoid extra inline spacing */

  border: 1px solid var(--duck-charcoal);
  border-radius: 1.2rem;
  background-color: var(--duck-white);
  color: var(--duck-charcoal);
  box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,.15);
  cursor: pointer;
  user-select: none;
}

#avatar-toggle-btn i{
  display: block;              /* prevents inline spacing quirks */
  line-height: 1;
  pointer-events: none;
  width: 1em;                  /* makes left/right bearings symmetrical */
  text-align: center;
}



#avatar-toggle-btn:active { transform: scale(0.98); }

#teams-banner-focus-overlay {
  z-index: 99997;
  display: none;
  cursor: default;
}

#teams-banner-focus-overlay.is-active {
  display: block;
  opacity: 1;
}

body.teams-banner-animal-modal-open #teams-banner-focus-overlay.is-active {
  z-index: 100500;
}

body.teams-banner-focus-active #select-animal-modal {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Collapse scoreboard spacing when avatars are hidden */
#teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
#teams-banner.is-collapsing .scoreboard {
  padding-top: 1rem !important;
  margin-top: 0 !important;   /* in case any future margin is added */
  gap: clamp(4rem, 6vw, 5rem);
  justify-content: center;
}

#teams-banner.hide-avatars:not(.is-expanding) .team,
#teams-banner.is-collapsing .team {
  width: 10rem;
}

#teams-banner.hide-avatars:not(.is-expanding) .team-score,
#teams-banner.is-collapsing .team-score {
  font-size: 2.6rem;
  padding: 0.2rem 0.8rem;
  border-radius: 1.2rem;
}

#teams-banner.hide-avatars:not(.is-expanding) .team-score .score-value,
#teams-banner.is-collapsing .team-score .score-value {
  font-size: 0.9em;
}

#teams-banner.hide-avatars:not(.is-expanding) .banana-icon,
#teams-banner.is-collapsing .banana-icon {
  width: 3rem;
  height: 3rem;
  margin-right: 0.4rem;
}




/* When avatars are hidden, move the "current team" highlight to the score box */
#teams-banner.hide-avatars:not(.is-expanding) .team.is-current .team-img,
#teams-banner.is-collapsing .team.is-current .team-img {
  outline: none;
  animation: none;
}

#teams-banner.hide-avatars:not(.is-expanding) .team.is-current .team-score,
#teams-banner.is-collapsing .team.is-current .team-score {
  position: relative;
  outline: 0.35rem solid var(--correct-green);
  outline-offset: 0.35rem;
  box-shadow: 0 0 0 0.35rem rgba(34, 197, 94, 0.18);
  animation: currentTeamPulseScore 1.2s ease-in-out infinite;
}

/* Slightly tighter ring for the compact hidden state layout */
@keyframes currentTeamPulseScore {
  0%   { box-shadow: 0 0 0 0.35rem rgba(34, 197, 94, 0.18); transform: scale(1); }
  50%  { box-shadow: 0 0 0 0.8rem  rgba(34, 197, 94, 0.32); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 0.35rem rgba(34, 197, 94, 0.18); transform: scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #teams-banner.hide-avatars:not(.is-expanding) .team.is-current .team-score,
  #teams-banner.is-collapsing .team.is-current .team-score {
    animation: none;
  }
}


@media (max-width: 520px) {
  #teams-banner .team-score {
    inline-size: clamp(5.6rem, 26vw, 7.6rem);
    padding: 0.25rem 0.6rem;
    font-size: 1.6rem;
    border-radius: 1.2rem;
    width: 5rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    inline-size: clamp(5.2rem, 24vw, 7.2rem);
    padding: 0.22rem 0.5rem;
    font-size: 1.5rem;
    border-radius: 1rem;
    width: 3rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard > .team,
  #teams-banner.is-collapsing .scoreboard > .team {

width: 4rem;}
}




/* make scorebox a positioning context */
#teams-banner .team-score {
  position: relative;
}

/* left-side circular badge inside the scorebox */
#teams-banner .team-score .score-badge {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--title-font);
  font-weight: 800;
  font-size: 2rem;
  background: var(--duck-yellow);
  color: var(--duck-charcoal);
  box-shadow: inset 0 0.2rem 0.3rem rgba(0,0,0,0.25);
      display: none !important;

}

/* compact tweak when avatars are hidden */
#teams-banner.hide-avatars:not(.is-expanding) .team-score .score-badge,
#teams-banner.is-collapsing .team-score .score-badge {
  transform: translateY(-50%) scale(0.9);
}


@media (max-width: 800px) {
  #teams-banner .team-score .score-badge {
    display: none;
  }
}


/* 1) local context for each card */
#teams-banner .team { position: relative; isolation: isolate; }

/* 2) put avatar above the pill (even while transformed) */
#teams-banner .team-img { position: relative; z-index: 2; }

/* 3) keep the score pill below */
#teams-banner .team-score { position: relative; z-index: 1; }

/* optional: when highlighted, guarantee ring is topmost */
#teams-banner .team.is-current .team-img { z-index: 3; }




@media (max-width: 600px) {
  .team-score {
    font-size: 1.8rem;
  }

  .team-score .banana-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .team {
  text-align: center;
  width: 8rem !important;       
    gap: 2rem;
        
}

.team-img {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
}

/* .team-name {
  display: none;
} */
#teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
#teams-banner.is-collapsing .scoreboard {
  gap: clamp(4rem, 6vw, 5rem);
  justify-content: center;
}
}

@media (max-width: 500px) {
  .team-score {
    font-size: 1.8rem;
  }

  .team-score .banana-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .team {
  text-align: center;
  width: 6rem !important;    
    gap: 2rem;
           
}

.team-img {
display: none;
}

/* .team-name {
  display: none;
} */
#teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
#teams-banner.is-collapsing .scoreboard {
  gap: clamp(4rem, 6vw, 5rem);
  justify-content: center;
}
}

@media (max-width: 500px) {
  .team-score {
    font-size: 1.8rem;
  }

  .team-score .banana-icon {
    width: 2.4rem;
    height: 2.4rem;
  }

  .team {
  text-align: center;
  width: 6rem !important;    
    gap: 1rem;
           
}

.team-img {
display: none;
}

/* .team-name {
  display: none;
} */
#teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
#teams-banner.is-collapsing .scoreboard {
  gap: clamp(4rem, 6vw, 5rem);
  justify-content: center;
}
}

/* ================================ */
/* Select Animal Modal */
/* ================================ */
.select-animal-modal-container {
  background: var(--duck-white);
  border-radius: 1.6rem;
  padding: 1.5rem;
  max-width: 80rem;
  margin: 4rem auto;
  z-index: 999999;
}

.select-animal-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.6rem;
  color: var(--duck-charcoal);
}

.select-animal-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.select-animal-grid button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  width: 100%;
}

/* ============================================================ */
/* ASSET FADE IN */
/* ============================================================ */

.select-animal-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.16) 34%, transparent 36%),
    linear-gradient(145deg, var(--duck-white) 0%, var(--duck-disabled) 100%);
  box-shadow:
    0 0.2rem 0.35rem rgba(44, 62, 80, 0.1),
    0 0.15rem 0.4rem rgba(44, 62, 80, 0.12);
}

.select-animal-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 65% 75%, rgba(255, 255, 255, 0.24), transparent 42%);
  opacity: 1;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.select-animal-thumb.is-ready::after {
  opacity: 0;
}

#teams-banner .team-avatar {
  position: relative;
  width: 12rem;
  height: 12rem;
  max-height: 12rem;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  cursor: pointer;
      background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.16) 34%, transparent 36%),
    linear-gradient(145deg, var(--duck-white) 0%, var(--duck-disabled) 100%);

  box-shadow:
    0 0.4rem 0.4rem 0 rgba(44, 62, 80, 0.12),
    0 0.2rem 0.6rem 0 rgba(44, 62, 80, 0.16);
  transition:
    opacity var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    transform var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    max-height var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease),
    margin-bottom var(--teams-banner-toggle-duration) var(--teams-banner-toggle-ease);
}

#teams-banner .team-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 65% 75%, rgba(255, 255, 255, 0.24), transparent 42%);
  opacity: 1;
  transition: opacity 220ms ease;
  pointer-events: none;
}

#teams-banner .team-avatar.is-ready::after {
  opacity: 0;
}

#teams-banner .team-img {
  width: 100%;
  height: 100%;
  margin: 0;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 220ms ease, transform 220ms ease;
  box-shadow: none;
}

#teams-banner .team-avatar.is-ready .team-img {
  opacity: 1;
  transform: scale(1);
}

#teams-banner .team.is-current .team-img {
  outline: none;
  animation: none;
  box-shadow: none;
}

#teams-banner .team.is-current .team-avatar {
  outline: 0.5rem solid var(--correct-green);
  outline-offset: 0.8rem;
  box-shadow: 0 0 0 0.5rem rgba(34, 197, 94, 0.18);
  animation: currentTeamPulse 1.2s ease-in-out infinite;
  transform-origin: center;
}

#teams-banner.hide-avatars:not(.is-expanding) .team-avatar,
#teams-banner.is-collapsing .team-avatar {
  opacity: 0;
  transform: translateY(-0.8rem) scale(0.72);
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
}

#teams-banner.hide-avatars:not(.is-expanding) p.team-name,
#teams-banner.is-collapsing p.team-name {
  opacity: 0;
  transform: translateY(-0.6rem) scale(0.96);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}

#teams-banner.hide-avatars:not(.is-expanding) .team-avatar,
#teams-banner.hide-avatars:not(.is-expanding) p.team-name {
  visibility: hidden;
}

#teams-banner.hide-avatars:not(.is-expanding) .team.is-current .team-avatar,
#teams-banner.is-collapsing .team.is-current .team-avatar {
  outline: none;
  animation: none;
  box-shadow:
    0 0.4rem 0.4rem 0 rgba(44, 62, 80, 0.12),
    0 0.2rem 0.6rem 0 rgba(44, 62, 80, 0.16);
}

@media (max-width: 750px) {
#teams-banner .team-name {
  display: none;
}
}

@media (prefers-reduced-motion: reduce) {
  #teams-banner .team.is-current .team-avatar {
    animation: none;
  }

  #teams-banner .scoreboard,
  #teams-banner .team,
  #teams-banner .team-avatar,
  #teams-banner .team-name,
  #teams-banner .team-score,
  #teams-banner .banana-icon {
    transition: none !important;
  }
}

@media (max-width: 1000px) {
  #teams-banner .team-avatar {
    width: 9rem;
    height: 9rem;
  }
}

@media (max-width: 600px) {
  #teams-banner .team-avatar {
    width: 7rem;
    height: 7rem;
  }
}

@media (max-width: 500px) {
  #teams-banner .team-img {
    display: block;
  }
}

.select-animal-thumb-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0.75rem;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 220ms ease, transform 220ms ease;
}

.select-animal-thumb.is-ready .select-animal-thumb-img {
  opacity: 1;
  transform: scale(1);
}

.select-animal-grid button.locked-animal {
  cursor: default;
}

.select-animal-grid button.locked-animal .select-animal-thumb {
  opacity: 0.9;
}

.select-animal-close-btn {
  display: block;
  margin: 0 auto;
  padding: 0.7rem 1.8rem;
  border-radius: 1.4rem;
  border: none;
  font-family: var(--font-main);
  font-size: 1rem;
  background: var(--duck-charcoal);
  color: var(--duck-white);
  cursor: pointer;
}
.select-animal-close-btn:hover {
  font-family: var(--font-main);
  background: var(--duck-pink);
}

/* ================================ */
/* UNLOCKED ANIMAL POPUP TOAST */
/* ================================ */
.animal-unlock-toast {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 1rem 2rem;
  border-radius: 1.8rem;
  background: var(--duck-pink);
  color: var(--duck-white);
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.animal-unlock-toast.is-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

@media (max-width: 850px) {
  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
  #teams-banner.is-collapsing .scoreboard {
    gap: clamp(1.2rem, 2.4vw, 2rem);
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team,
  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard > .team,
  #teams-banner.is-collapsing .team,
  #teams-banner.is-collapsing .scoreboard > .team {
    width: auto !important;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    font-size: 2.3rem;
    padding: 0.2rem 3rem;
    white-space: nowrap;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score .score-value,
  #teams-banner.is-collapsing .team-score .score-value {
    white-space: nowrap;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .banana-icon,
  #teams-banner.is-collapsing .banana-icon {
    width: 2.7rem;
    height: 2.7rem;
    margin-right: 0.3rem;
  }
}

@media (max-width: 700px) {
  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
  #teams-banner.is-collapsing .scoreboard {
    gap: 0.9rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    font-size: 2.15rem;
    padding: 0.18rem 3rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .banana-icon,
  #teams-banner.is-collapsing .banana-icon {
    width: 2.3rem;
    height: 2.3rem;
    margin-right: 0.22rem;
  }
}

@media (max-width: 550px) {
  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
  #teams-banner.is-collapsing .scoreboard {
    gap: 0.6rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    font-size: 1.8rem;
    padding: 0.16rem 2rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .banana-icon,
  #teams-banner.is-collapsing .banana-icon {
    width: 2rem;
    height: 2rem;
    margin-right: 0.18rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    font-size: 1.8rem;
    padding: 0.16rem 1.2rem;
  }
}



@media (max-width: 520px) {
  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard,
  #teams-banner.is-collapsing .scoreboard {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .scoreboard > .team,
  #teams-banner.is-collapsing .scoreboard > .team {
    width: 3.8rem !important;
    min-width: 0 !important;
    max-width: 3.8rem !important;
    flex: 0 0 3.8rem !important;
  }

  #teams-banner.hide-avatars:not(.is-expanding) .team-score,
  #teams-banner.is-collapsing .team-score {
    width: 3.8rem !important;
    inline-size: 3.8rem !important;
    min-width: 0 !important;
    max-width: 3.8rem !important;
    padding: 0.16rem 0.3rem;
    box-sizing: border-box;
  }
}