/* The home account ribbon is independent of the room and its controls. */
body[data-site-home] .topbar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible;
  padding-right: max(24px, env(safe-area-inset-right), calc((100vw - 1100px) / 2)) !important;
}

/* The old mascot header painted a full-width rectangular panel here. */
body[data-site-home] .topbar::before {
  content: none !important;
  display: none !important;
}

body[data-site-home] .topbar > .top-actions {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px !important;
  width: max-content;
  max-width: calc(100% - 245px);
  min-width: 0;
  min-height: 76px;
  padding: 7px 13px 7px 10px;
  margin-left: auto;
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 32% 0, #d7efff24, transparent 70%) padding-box,
    linear-gradient(135deg, #234c92, #243b79 60%, #402d72) padding-box,
    linear-gradient(110deg, #ff8893, #69d3ff 28%, #ffe783 50%, #8be7ac 73%, #bd91ff) border-box;
  box-shadow:
    inset 0 2px 0 #e3f6ff33,
    inset 0 -5px 12px #070f3526,
    0 5px 0 #0c1d4d66,
    0 13px 26px #050e393d;
  backdrop-filter: blur(12px);
}

body[data-site-home] .topbar .classic-xp-bank {
  display: flex !important;
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0 4px 0 0;
}

body[data-site-home] .topbar .classic-bank-art {
  width: 72px !important;
  height: 60px !important;
  flex: 0 0 72px;
  filter: drop-shadow(0 3px 3px #07163d4d);
}

body[data-site-home] .topbar .classic-bank-count {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 68px;
  padding: 6px 12px;
  align-items: center;
  gap: 1px;
  border: 1px solid #76dfff88;
  border-radius: 999px;
  background: radial-gradient(ellipse at 25% 0, #256b9655, transparent 75%), linear-gradient(155deg, #173b68, #081b36 70%, #132b53);
  box-shadow: inset 0 1px 0 #a2efff44, inset 0 -4px 9px #02091855, 0 3px 0 #06132e88, 0 0 12px #59cfff25;
  color: #fff9dd !important;
  text-shadow: none !important;
}

body[data-site-home] .topbar .classic-bank-count::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: -8px auto -8px -65%;
  width: 65%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 24%, #6fdcff13 43%, #b2f5ff33 50%, #6fdcff13 57%, transparent 76%);
  transform: translateX(0);
  animation: home-xp-energy-scan 5.6s ease-in-out infinite;
}


body[data-site-home] .topbar .classic-bank-count b {
  position: relative;
  z-index: 1;
  font: 950 20px/1.1 Nunito, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #fff9dd !important;
  letter-spacing: -.5px;
  text-shadow: 0 1px 2px #020a20, 0 0 7px #7fe9ff22 !important;
}

body[data-site-home] .topbar .classic-bank-count small {
  position: relative;
  z-index: 1;
  font: 900 10px/1.1 Nunito, Arial, sans-serif;
  color: #ffe58d !important;
  letter-spacing: .8px;
}

@keyframes home-xp-energy-scan {
  0%, 12% { transform: translateX(0); opacity: 0; }
  22% { opacity: 1; }
  70% { transform: translateX(265%); opacity: 1; }
  82%, 100% { transform: translateX(300%); opacity: 0; }
}

body[data-site-home] .topbar > .top-actions > :is(.language-button, .account-access, .profile-chip) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  height: 44px !important;
  min-width: 44px;
  padding: 0 15px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  font: 850 12px/1.15 Nunito, Arial, sans-serif;
  text-shadow: none;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

body[data-site-home] .topbar .language-button {
  background: #ffffff12 !important;
  border-color: #a1caff44 !important;
  color: #f7fbff !important;
  box-shadow: none !important;
}

body[data-site-home] .topbar .language-button span {
  color: #aba6b4;
  padding-left: 6px;
}

body[data-site-home] .topbar .account-access {
  background: #123a77 !important;
  border-color: #7acbff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body[data-site-home] .topbar .account-access:disabled {
  opacity: 1;
  background: #123a77 !important;
  border-color: #7acbff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body[data-site-home] .topbar .profile-chip {
  gap: 8px;
  padding-left: 6px !important;
  background: #ffffff12 !important;
  border-color: #a1caff44 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body[data-site-home] .topbar .profile-chip-name {
  display: block !important;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff !important;
}

body[data-site-home] .topbar .profile-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: transparent !important;
  box-shadow: none;
}

body[data-site-home] .topbar .profile-chip .chevron {
  color: #aaa5b2 !important;
}

body[data-site-home] .topbar > .top-actions > button:not(:disabled):hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}

body[data-site-home] .topbar > .top-actions > button:not(:disabled):active {
  filter: brightness(.98);
  transform: translateY(2px);
}

body[data-site-home] .topbar > .top-actions > button:focus-visible {
  outline: 3px solid #fff8c4;
  outline-offset: 4px;
}

@media (min-width: 761px) and (max-width: 980px) {
  body[data-site-home] .topbar {
    height: auto !important;
    min-height: 96px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  body[data-site-home] .topbar > .top-actions {
    max-width: calc(100% - 235px);
    border-radius: 32px;
    justify-content: center;
  }

  body[data-site-home] .topbar .profile-chip-name {
    max-width: 95px;
  }
}

@media (max-width: 760px) {
  body[data-site-home] .topbar {
    height: auto !important;
    min-height: 126px;
    align-items: center !important;
    gap: 10px !important;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)) !important;
  }

  /* Keep the approved lion and logo, with room for the two-row capsule. */
  body[data-site-home] .topbar .classic-mascot-brand {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 102px !important;
    height: 100px !important;
    flex: 0 0 102px !important;
  }

  body[data-site-home] .topbar .classic-mascot-brand .approved-logo {
    top: 36px;
    width: 78px !important;
  }

  body[data-site-home] .topbar .classic-lion-mascot {
    left: 28px;
    top: 0;
    width: 82px;
    height: 82px;
  }

  body[data-site-home] .topbar > .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    justify-content: normal;
    gap: 6px !important;
    width: min(350px, calc(100% - 112px));
    max-width: none;
    min-height: 108px;
    padding: 8px;
    border-radius: 29px;
  }

  body[data-site-home] .topbar .classic-xp-bank {
    grid-column: 1;
    grid-row: 1;
    gap: 3px;
    margin: 0;
    justify-content: center;
  }

  body[data-site-home] .topbar .classic-bank-art {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px;
  }

  body[data-site-home] .topbar .classic-bank-count {
    min-width: 0;
    padding: 5px 8px;
  }

  body[data-site-home] .topbar .classic-bank-count b {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  body[data-site-home] .topbar .classic-bank-count small {
    font-size: 8px;
  }

  body[data-site-home] .topbar > .top-actions > :is(.language-button, .account-access, .profile-chip) {
    min-width: 0;
    width: 100%;
    padding: 0 7px !important;
    font-size: 11px;
  }

  body[data-site-home] .topbar .language-button {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-site-home] .topbar .language-button span {
    padding-left: 3px;
  }

  body[data-site-home] .topbar .account-access {
    grid-column: 1;
    grid-row: 2;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
  }

  body[data-site-home] .topbar .profile-chip {
    grid-column: 2;
    grid-row: 2;
  }

  /* Preserve the real profile name for assistive technology. */
  body[data-site-home] .topbar .profile-chip-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body[data-site-home] .topbar .profile-chip .chevron {
    display: none !important;
  }

  body[data-site-home] .topbar .season-pill {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-site-home] .topbar .classic-bank-count::before {
    animation: none;
    opacity: 0;
  }

  body[data-site-home] .topbar > .top-actions > button {
    transition: none;
    transform: none !important;
  }
}
