.gamification-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(114, 230, 164, 0.18);
  background:
    radial-gradient(circle at top left, rgba(114, 230, 164, 0.18), transparent 42%),
    rgba(12, 18, 28, 0.78);
  color: #eef3fa;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gamification-mini__level {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #72e6a4 0%, #57c8ff 100%);
  color: #07111c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.gamification-mini__body {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.main-header .gamification-mini__body {
  display: none;
}

.gamification-mini__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb1c6;
}

.gamification-mini__bar,
.gamification-card__bar,
.quest-card__bar,
.achievement-card__bar {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(132, 147, 165, 0.14);
}

.gamification-mini__bar > span,
.gamification-card__bar > span,
.quest-card__bar > span,
.achievement-card__bar > span {
  display: block;
  width: calc(var(--progress, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #72e6a4 0%, #57c8ff 100%);
  box-shadow: 0 0 18px rgba(114, 230, 164, 0.26);
  transition: width 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gamification-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

.gamification-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.gamification-card__eyebrow,
.quest-card__label,
.achievement-card__label {
  display: block;
  margin-bottom: 8px;
  color: #7e93ac;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gamification-card__head h2 {
  margin: 0;
  color: #f4f7fb;
  font-size: 28px;
  line-height: 1.05;
}

.gamification-card__streak {
  min-width: 86px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(246, 184, 95, 0.12);
  color: #f6c76d;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.gamification-card__xp {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(8, 13, 22, 0.48);
  border: 1px solid rgba(132, 147, 165, 0.12);
}

.gamification-card__level {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #72e6a4 0%, #57c8ff 100%);
  color: #07111c;
  font-size: 18px;
  font-weight: 900;
}

.gamification-card__xp-text {
  color: #d7e1ed;
  font-size: 13px;
  font-weight: 800;
}

.gamification-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gamification-card__stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(18, 26, 38, 0.72);
  border: 1px solid rgba(132, 147, 165, 0.1);
}

.gamification-card__stat span {
  display: block;
  color: #7e93ac;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gamification-card__stat strong {
  display: block;
  margin-top: 6px;
  color: #f4f7fb;
  font-size: 18px;
}

.gamification-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quest-card,
.achievement-card {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(132, 147, 165, 0.12);
  background:
    radial-gradient(circle at top right, rgba(87, 200, 255, 0.1), transparent 42%),
    rgba(12, 18, 28, 0.72);
}

.quest-card.is-complete,
.achievement-card.is-unlocked {
  border-color: rgba(114, 230, 164, 0.26);
  box-shadow: 0 0 32px rgba(114, 230, 164, 0.1);
}

.quest-card strong,
.achievement-card strong {
  display: block;
  color: #f4f7fb;
  font-size: 14px;
  line-height: 1.25;
}

.quest-card p,
.achievement-card p {
  margin: 7px 0 10px;
  color: #93a5ba;
  font-size: 12px;
  line-height: 1.45;
}

.achievement-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.achievement-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(114, 230, 164, 0.12);
  color: #72e6a4;
  font-size: 11px;
  font-weight: 900;
}

.gamification-float {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(330px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(114, 230, 164, 0.2);
  background:
    radial-gradient(circle at top left, rgba(114, 230, 164, 0.22), transparent 44%),
    rgba(8, 13, 22, 0.86);
  color: #eef3fa;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.gamification-float span {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: inherit;
  background: linear-gradient(135deg, #72e6a4 0%, #57c8ff 100%);
  color: #07111c;
  font-size: 12px;
  font-weight: 900;
}

.gamification-float strong {
  overflow: hidden;
  color: #d7e1ed;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamification-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 12px;
}

.leaderboard-list,
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.leaderboard-list > p,
.activity-list > p {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(18, 26, 38, 0.62);
  color: #8fa2b8;
  font-size: 13px;
}

.leaderboard-row,
.activity-row {
  display: grid;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(132, 147, 165, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(12, 18, 28, 0.72);
}

.leaderboard-row {
  grid-template-columns: 46px 38px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 18px;
}

.leaderboard-row__rank {
  color: #72e6a4;
  font-size: 13px;
  font-weight: 900;
}

.leaderboard-row__avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(132, 147, 165, 0.14);
}

.leaderboard-row__name,
.activity-row__type {
  overflow: hidden;
  color: #f4f7fb;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row__meta,
.activity-row__xp {
  color: #94a8bf;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.activity-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
}

.activity-row__xp {
  color: #72e6a4;
}

.gamification-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.gamification-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 12px 15px 16px;
  border-radius: 12px;
  border: 1px solid #373a30;
  border-left: 3px solid var(--gb-accent, #b6f400);
  background: #20211d;
  color: #f0f2e9;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .24);
  pointer-events: auto;
  animation: gamificationToastIn 180ms ease-out both;
}
.gamification-toast__copy { flex: 1; min-width: 0; }
.gamification-toast strong { display: block; font-size: 13px; margin-bottom: 5px; }
.gamification-toast span { display: block; color: #b4b8aa; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.gamification-toast .gamification-toast__close { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: #30332a; color: #c9cdbf; font-size: 20px; cursor: pointer; }
.gamification-toast .gamification-toast__close:hover { background: #3c4033; color: #fff; }
.gamification-toast .gamification-toast__close:focus-visible { outline: 2px solid var(--gb-accent, #b6f400); outline-offset: 3px; }

@keyframes gamificationToastIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1280px) {
  .main-header .account-pill {
    flex-wrap: nowrap;
    border-radius: 16px;
  }

  .gamification-mini {
    order: 0;
    width: auto;
  }
}

@media (max-width: 760px) {
  .gamification-grid,
  .gamification-card__stats,
  .gamification-columns {
    grid-template-columns: 1fr;
  }

  .gamification-card__xp {
    grid-template-columns: auto 1fr;
  }

  .gamification-float {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .leaderboard-row {
    grid-template-columns: 40px 34px minmax(0, 1fr);
  }

  .leaderboard-row__meta {
    grid-column: 3;
  }
}

/* Account progress uses the same graphite surfaces and brand accent as the site. */
.gamification-mini { border-radius: 9px; border-color: #363a2d; background: #25291f; box-shadow: none; }
.gamification-mini__level { border-radius: 6px; background: transparent; color: var(--gb-accent, #b6f400); font-weight: 700; letter-spacing: 0; }
.gamification-mini__label { color: #a7ad9b; }
.gamification-mini__bar > span { background: var(--gb-accent, #b6f400); box-shadow: none; }
.gamification-float { border-radius: 10px; border-color: #363a2d; background: #20231c; box-shadow: 0 6px 20px #0003; }
.gamification-float span { background: #2b3220; color: var(--gb-accent, #b6f400); min-height: 30px; }
.gamification-float strong { color: #bdc4ae; font-weight: 600; }
.gamification-mini:focus-visible, .gamification-float:focus-visible { outline: 2px solid var(--gb-accent, #b6f400); outline-offset: 3px; }
@media (max-width: 760px) {
  .gamification-float { left: auto; right: 12px; top: 12px; width: auto; }
  .gamification-toast-stack { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .gamification-toast { animation: none; }
  .gamification-mini__bar > span { transition: none; }
}
