/* V38: isolated Canopy Inbox and weekly champion notification surfaces. */
.canopy-inbox-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  color: #173228;
  background: #e3eee5;
  font: inherit;
  font-size: .65rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.canopy-inbox-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.canopy-inbox-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  color: #173228;
  background: #f2cb59;
  font-size: .55rem;
  line-height: 1;
}

.canopy-inbox-button b[hidden] {
  display: none;
}

.canopy-inbox-screen,
.champion-reward-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 32, 25, .72);
}

.canopy-inbox-screen[hidden],
.champion-reward-screen[hidden] {
  display: none;
}

.canopy-inbox-shell,
.champion-reward-shell {
  width: min(100%, 520px);
  max-height: min(760px, calc(100dvh - 40px));
  overflow: auto;
  border-radius: 8px;
  color: #173228;
  background: #f7f8f3;
  box-shadow: 0 24px 70px rgba(4, 18, 13, .3);
}

.canopy-inbox-shell {
  padding: 22px;
}

.canopy-inbox-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.canopy-inbox-heading span,
.champion-reward-shell > span {
  color: #2d6b50;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.canopy-inbox-heading h2,
.champion-reward-shell h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.15;
}

.canopy-inbox-heading button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #173228;
  background: #e3eee5;
  font-size: 1.25rem;
  cursor: pointer;
}

.canopy-inbox-rule {
  margin: 14px 0;
  padding: 11px 12px;
  border-radius: 6px;
  color: #173228;
  background: #f4e7aa;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.55;
}

.canopy-inbox-list {
  display: grid;
  gap: 8px;
}

.canopy-note {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  padding: 13px;
  border-radius: 6px;
  background: #e7efe9;
}

.canopy-note.is-unread {
  background: #d9eadf;
}

.canopy-note-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #173228;
  background: #f2cb59;
  font-size: 1rem;
  font-weight: 950;
}

.canopy-note strong,
.canopy-note p,
.canopy-note time {
  display: block;
  margin: 0;
}

.canopy-note strong {
  font-size: .83rem;
  line-height: 1.35;
}

.canopy-note p {
  margin-top: 3px;
  color: #52675e;
  font-size: .68rem;
  line-height: 1.5;
}

.canopy-note time {
  margin-top: 6px;
  color: #708078;
  font-size: .55rem;
}

.canopy-inbox-empty {
  margin: 14px 0 2px;
  color: #607168;
  font-size: .75rem;
  line-height: 1.55;
}

.champion-reward-shell {
  padding: 30px 26px 26px;
  text-align: center;
}

.champion-crown {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 78px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 0 0 7px 7px;
  background: #f2cb59;
  box-shadow: inset 0 -8px 0 rgba(176, 121, 32, .2);
}

.champion-crown i {
  width: 19px;
  height: 43px;
  background: #f2cb59;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.champion-crown i:nth-child(2) {
  height: 54px;
}

.champion-reward-shell > strong {
  display: block;
  margin: 18px auto 9px;
  color: #2d6b50;
  font-size: 1.45rem;
}

.champion-reward-shell p {
  margin: 0 auto 22px;
  max-width: 36ch;
  color: #52675e;
  font-size: .8rem;
  line-height: 1.55;
}

.champion-reward-shell button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #1d5a43;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
}

body.inbox-open,
body.champion-reward-open {
  overflow: hidden;
}

@media (max-width: 640px) and (orientation: portrait) {
  body:not(.needs-entry) .canopy-inbox-button {
    width: 52px;
    min-width: 52px;
    height: 48px;
    min-height: 48px;
    flex-direction: column;
    gap: 0;
    padding: 3px;
  }

  body:not(.needs-entry) .canopy-inbox-button svg {
    width: 22px;
    height: 22px;
  }

  body:not(.needs-entry) .canopy-inbox-button span {
    max-width: 48px;
    overflow: hidden;
    font-size: .47rem;
    line-height: 1.05;
    text-overflow: ellipsis;
  }

  .canopy-inbox-screen,
  .champion-reward-screen {
    align-items: end;
    padding: 10px;
  }

  .canopy-inbox-shell,
  .champion-reward-shell {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 8px;
  }

  .canopy-inbox-shell {
    padding: 18px 16px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .champion-reward-shell {
    animation: championArrives .45s cubic-bezier(.2, .85, .32, 1.15) both;
  }

  .canopy-inbox-button b:not([hidden]) {
    animation: inboxPulse 1.9s ease-in-out infinite;
  }
}

@keyframes championArrives {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes inboxPulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12); }
}
