/* Streaks, daily challenges, lucky drops, trophies, records, friend challenges and Granny's story. */

/* Header pills */
.streak-pill,
.daily-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 60, .4);
  background: rgba(40, 18, 4, .7);
  color: #ffe2b8;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.streak-pill .streak-flame {
  filter: grayscale(1) brightness(.7);
  transition: filter .3s ease;
}

.streak-pill.is-waiting .streak-flame {
  filter: grayscale(.4);
  animation: streak-wait 1.6s ease-in-out infinite;
}

.streak-pill.is-lit {
  border-color: rgba(255, 150, 40, .85);
  box-shadow: 0 0 12px rgba(255, 130, 30, .45);
}

.streak-pill.is-lit .streak-flame {
  filter: none;
}

@keyframes streak-wait {
  50% { transform: scale(1.18) rotate(-6deg); }
}

.daily-pill {
  border-color: rgba(120, 200, 255, .4);
  background: rgba(6, 22, 40, .7);
  color: #d4ecff;
}

.daily-pill.is-complete {
  border-color: #ffd65a;
  color: #ffe9a8;
  box-shadow: 0 0 12px rgba(255, 200, 60, .4);
}

/* Sheets */
.gb-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 4, 10, .8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.gb-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 22px 22px 20px;
  border: 1px solid rgba(255, 210, 90, .35);
  border-radius: 18px;
  background: linear-gradient(165deg, #1e1830, #110d1c);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  color: #f2ecff;
  animation: sheet-in .28s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.gb-sheet-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.gb-sheet-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: .05em;
  text-align: center;
  color: var(--gold);
}

.gb-sheet-sub {
  margin: 0 0 12px;
  text-align: center;
  color: rgba(242, 236, 255, .82);
}

.gb-sheet-small {
  margin: 4px 0 0;
  text-align: center;
  font-size: .8rem;
  font-weight: 800;
  color: #ffe4a2;
}

.gb-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.gb-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e0960f, #ffd65a);
}

.gb-btn,
.gb-btn-ghost {
  display: block;
  margin: 12px auto 0;
  padding: 10px 22px;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  letter-spacing: .05em;
  cursor: pointer;
}

.gb-btn {
  border: 2px solid #ffe18a;
  background: linear-gradient(180deg, #ffeb8a, #ffb235 53%, #e97a20);
  color: #2a1102;
}

.gb-btn-ghost {
  border: 1px solid rgba(255, 255, 255, .25);
  background: transparent;
  color: #f2ecff;
}

/* Streak */
.streak-sheet-flame {
  display: block;
  width: 84px;
  height: auto;
  margin: 0 auto;
  filter: grayscale(.8) brightness(.7);
}

.streak-sheet-flame.is-lit {
  filter: drop-shadow(0 0 18px rgba(255, 140, 30, .9));
  animation: streak-wait 1.4s ease-in-out infinite;
}

.streak-facts {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.streak-facts span {
  color: rgba(242, 236, 255, .65);
  font-size: .85em;
}

/* Daily challenges */
.daily-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.daily-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}

.daily-item.is-done {
  background: rgba(80, 255, 140, .1);
}

.daily-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  color: #0d2;
  font-weight: 900;
}

.daily-item.is-done .daily-check {
  border-color: #6dff9a;
  background: #6dff9a;
  color: #032;
}

.daily-copy strong {
  display: block;
  margin-bottom: 6px;
}

.daily-reward {
  display: grid;
  justify-items: end;
  font-weight: 900;
  color: #ffe4a2;
}

.daily-reward em {
  font-style: normal;
  font-size: .75rem;
  color: rgba(242, 236, 255, .6);
}

.daily-chest {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 210, 90, .45);
}

.daily-chest > span {
  font-size: 2.2rem;
}

.daily-chest div {
  display: grid;
}

.daily-chest strong {
  color: var(--gold);
}

.daily-chest.is-open {
  border-style: solid;
  box-shadow: 0 0 20px rgba(255, 200, 60, .35);
}

/* Pops */
.gb-pop {
  position: fixed;
  left: 50%;
  top: calc(96px + var(--stack, 0) * 74px);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 12px;
  border-radius: 16px;
  border: 2px solid #ffd65a;
  background: linear-gradient(180deg, #2b1f08, #170f03);
  box-shadow: 0 0 26px rgba(255, 200, 60, .55);
  color: #fff3c4;
  pointer-events: none;
  transform: translateX(-50%);
  animation: pop-in .45s cubic-bezier(.34, 1.56, .64, 1) both;
}

.gb-pop-icon {
  font-size: 2rem;
}

.gb-pop div {
  display: grid;
}

.gb-pop strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: .05em;
  color: #ffd65a;
}

.gb-pop.is-leaving {
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .45s ease, transform .45s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translate(-50%, -16px) scale(.7); }
  to { opacity: 1; transform: translateX(-50%); }
}

/* Story */
.story-sheet {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: end;
  gap: 12px;
  width: min(100%, 620px);
}

.story-granny {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6));
}

.story-bubble {
  position: relative;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff8e6;
  color: #2a1a06;
}

.story-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  bottom: 24px;
  border: 12px solid transparent;
  border-right-color: #fff8e6;
  border-left: 0;
}

.story-title {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: #c0560a;
  text-shadow: 1px 1px 0 #ffd88a;
}

.story-line {
  min-height: 3.4em;
  margin: 0 0 10px;
  font-family: var(--font-math);
  font-size: 1.15rem;
  line-height: 1.4;
  color: #3a2208;
}

.story-next {
  float: right;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffa53a, #e0650f);
  box-shadow: 0 4px 0 #9c4206, 0 6px 12px rgba(0, 0, 0, .25);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: .06em;
  text-shadow: 2px 2px 0 #8a3a05;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.story-next:hover {
  transform: translateY(-1px) scale(1.04);
}

.story-next:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #9c4206;
}

/* My Defender */
.profile-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}

.profile-tabs button {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: transparent;
  color: rgba(242, 236, 255, .8);
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}

.profile-tabs button.is-active {
  border-color: #ffd65a;
  background: rgba(255, 214, 90, .15);
  color: #ffe4a2;
}

.profile-sheet .rank-ladder-list {
  margin: 0;
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.trophy {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: rgba(242, 236, 255, .55);
  font: inherit;
  font-size: .78rem;
  text-align: center;
  cursor: default;
}

.trophy-icon {
  font-size: 1.9rem;
  filter: grayscale(1) brightness(.5);
}

.trophy.is-earned {
  border-color: rgba(255, 210, 90, .45);
  background: rgba(255, 200, 60, .08);
  color: #f2ecff;
  cursor: pointer;
}

.trophy.is-earned .trophy-icon {
  filter: drop-shadow(0 0 8px rgba(255, 200, 60, .7));
}

.trophy strong {
  font-size: .85rem;
}

.trophy em {
  font-style: normal;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: #ffd65a;
}

.trophy.is-worn {
  border-color: #ffd65a;
  box-shadow: 0 0 14px rgba(255, 200, 60, .45);
}

.records-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.records-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  column-gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}

.records-list strong {
  font-size: 1.15rem;
  color: #ffe4a2;
  font-variant-numeric: tabular-nums;
}

.records-list em {
  grid-column: 2 / 4;
  font-style: normal;
  font-size: .7rem;
  color: rgba(242, 236, 255, .5);
}

.challenge-block {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}

.challenge-block h3 {
  margin: 0 0 6px;
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--gold);
}

.challenge-block p {
  margin: 0 0 8px;
}

.challenge-block label {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  font-size: .8rem;
  font-weight: 800;
}

.challenge-block input {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.challenge-code {
  display: block;
  padding: 10px;
  border-radius: 12px;
  border: 2px dashed #ffd65a;
  background: rgba(0, 0, 0, .35);
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: .14em;
  text-align: center;
  color: #ffe4a2;
  user-select: all;
}

.challenge-code--sm {
  display: inline-block;
  padding: 4px 12px;
  font-size: 1.2rem;
}

.challenge-msg {
  color: #ff9f8a;
  font-weight: 800;
}

.challenge-active {
  color: #9dff7a;
}

/* Results extras */
.results-extras {
  display: grid;
  gap: 10px;
  margin: 10px auto 0;
  width: min(100%, 440px);
}

.record-banner {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffeb8a, #ffb235 60%, #e97a20);
  color: #2a1102;
  overflow: hidden;
  animation: pop-in-static .6s cubic-bezier(.34, 1.56, .64, 1) both;
}

.record-banner strong {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: .06em;
}

@keyframes pop-in-static {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}

.record-confetti i {
  position: absolute;
  top: -10px;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: #fff;
  animation: confetti 1.8s ease-in infinite;
}

.record-confetti i:nth-child(3n) { background: #6dff9a; }
.record-confetti i:nth-child(3n + 1) { background: #ff5fa2; }
.record-confetti i:nth-child(3n + 2) { background: #5fc8ff; }
.record-confetti i:nth-child(1) { left: 4%; animation-delay: 0s; }
.record-confetti i:nth-child(2) { left: 10%; animation-delay: .4s; }
.record-confetti i:nth-child(3) { left: 16%; animation-delay: .9s; }
.record-confetti i:nth-child(4) { left: 22%; animation-delay: .2s; }
.record-confetti i:nth-child(5) { left: 28%; animation-delay: 1.2s; }
.record-confetti i:nth-child(6) { left: 34%; animation-delay: .6s; }
.record-confetti i:nth-child(7) { left: 40%; animation-delay: 1s; }
.record-confetti i:nth-child(8) { left: 46%; animation-delay: .3s; }
.record-confetti i:nth-child(9) { left: 52%; animation-delay: 1.4s; }
.record-confetti i:nth-child(10) { left: 58%; animation-delay: .7s; }
.record-confetti i:nth-child(11) { left: 64%; animation-delay: .1s; }
.record-confetti i:nth-child(12) { left: 70%; animation-delay: 1.1s; }
.record-confetti i:nth-child(13) { left: 76%; animation-delay: .5s; }
.record-confetti i:nth-child(14) { left: 82%; animation-delay: 1.3s; }
.record-confetti i:nth-child(15) { left: 88%; animation-delay: .8s; }
.record-confetti i:nth-child(16) { left: 94%; animation-delay: .25s; }
.record-confetti i:nth-child(17) { left: 7%; animation-delay: 1.6s; }
.record-confetti i:nth-child(18) { left: 60%; animation-delay: 1.7s; }

@keyframes confetti {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(120px) rotate(540deg); opacity: 0; }
}

.challenge-result {
  display: grid;
  justify-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 160, 120, .5);
  background: rgba(60, 20, 10, .5);
}

.challenge-result strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #ffb08a;
}

.challenge-result.is-won {
  border-color: #6dff9a;
  background: rgba(10, 60, 30, .55);
}

.challenge-result.is-won strong {
  color: #9dff7a;
}

.results-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: rgba(242, 236, 255, .8);
}

/* Header title under the rank, and the vault's next-tier silhouette */
.rank-badge-title {
  display: block;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  color: #ffd65a;
  white-space: nowrap;
}

.crystal-vault-next-art {
  width: 22px;
  height: 28px;
  margin-right: 6px;
  object-fit: contain;
  vertical-align: middle;
  filter: brightness(0) drop-shadow(0 0 4px rgba(255, 210, 90, .9));
}

@media (prefers-reduced-motion: reduce) {
  .streak-pill.is-waiting .streak-flame,
  .streak-sheet-flame.is-lit,
  .record-confetti i,
  .gb-sheet,
  .gb-pop {
    animation: none;
  }
}

/* Hot streak: shown on question screens from five right in a row. */
.onfire-badge {
  position: fixed;
  left: 50%;
  top: 118px;
  z-index: 9000;
  padding: 6px 16px;
  border-radius: 999px;
  border: 2px solid #ffd65a;
  background: linear-gradient(180deg, #ff9a2e, #e0400f);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .06em;
  text-shadow: 0 2px 0 rgba(90, 20, 0, .6);
  box-shadow: 0 0 22px rgba(255, 110, 20, .6);
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 1;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.onfire-badge[hidden] {
  display: none;
}

.onfire-badge.is-bump {
  animation: onfire-bump .45s cubic-bezier(.34, 1.56, .64, 1);
}

.onfire-badge.is-fade {
  opacity: 0;
  transform: translateX(-50%) scale(0.92);
}

@keyframes onfire-bump {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.25); }
  100% { transform: translateX(-50%) scale(1); }
}

/* Sound button with music off: effects still on, so it stays bright with a small crossed note. */
.topbar-action-btn.music-off {
  position: relative;
}

.topbar-action-btn.music-off::after {
  content: '♪';
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a1102;
  color: #ffb08a;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: line-through;
  box-shadow: 0 0 0 2px #ffd65a;
}

@media (prefers-reduced-motion: reduce) {
  .onfire-badge.is-bump { animation: none; }
  .onfire-badge.is-fade { transition: opacity 0.2s ease; transform: translateX(-50%); }
}

/* The daily challenge dart, in the header pill, the panel and the "challenge done" pop. */
.daily-dart {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

.daily-sheet-dart {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(255, 60, 40, .45));
}

.gb-pop-icon .daily-dart,
.gb-pop .daily-dart {
  width: 40px;
  height: 40px;
}

/* Level 3 and 4 stretch: an exciting, optional "keep going" after the ten. */
.prep-stretch {
  display: grid;
  gap: 3px;
  width: min(100%, 460px);
  margin: 12px auto 4px;
  padding: 12px 18px;
  border: 2px solid #ffd65a;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff9a2e, #e0400f);
  color: #fff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 110, 20, .55);
  animation: stretch-pulse 1.4s ease-in-out infinite;
}

.prep-stretch strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: .05em;
  text-shadow: 0 2px 0 rgba(90, 20, 0, .6);
}

.prep-stretch span {
  font-size: .85rem;
  font-weight: 800;
}

.prep-stretch:hover {
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.02);
}

@keyframes stretch-pulse {
  50% { box-shadow: 0 0 34px rgba(255, 140, 30, .9); transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .prep-stretch { animation: none; }
}
