/* Sales roguelike power-up selector: mobile-first, aligned with the mini program. */
.buff-mask {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(22, 24, 42, .58);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
}

.buff-panel {
  width: min(100%, 400px);
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #fff 0%, #fbfbff 100%);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(21, 22, 48, .28);
  scrollbar-width: none;
  animation: buff-panel-in .32s cubic-bezier(.2, .78, .2, 1) both;
}

.buff-panel::-webkit-scrollbar { display: none; }

.buff-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  background: #d9dbe6;
  border-radius: 999px;
}

.buff-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 25px;
  color: #706bda;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

.buff-stage > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.buff-stage > span > i {
  width: 6px;
  height: 6px;
  background: #62d1b0;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(98, 209, 176, .13);
}

.buff-stage > em {
  flex: none;
  color: #9b9dab;
  font-style: normal;
  font-weight: 500;
}

.buff-panel > h2 {
  margin: 8px 0 0;
  color: #222432;
  font-size: 21px;
  line-height: 1.3;
  text-align: left;
  letter-spacing: -.3px;
}

.buff-panel > p {
  margin: 6px 0 15px;
  color: #888b99;
  font-size: 11px;
  line-height: 1.55;
  text-align: left;
}

.buff-list {
  display: grid;
  gap: 10px;
}

.buff {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 11px 11px 11px 12px;
  overflow: hidden;
  color: #242632;
  background: #f7f7fb;
  border: 1px solid #e8e9f1;
  border-radius: 17px;
  box-shadow: 0 2px 3px rgba(42, 43, 70, .02);
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.buff::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  background: #7771e9;
  border-radius: 0 999px 999px 0;
  content: '';
}

.buff:active {
  background: #f0efff;
  border-color: #c9c6fa;
  transform: scale(.985);
}

.buff .buff-icon {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #837df2, #625cd8);
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(98, 92, 216, .22);
  place-items: center;
}

.buff-icon > span {
  color: inherit;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.buff .buff-copy {
  display: block;
  min-width: 0;
  color: inherit;
}

.buff-copy > b,
.buff-copy > small {
  display: block;
}

.buff-copy > b {
  overflow: hidden;
  color: #292b38;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buff-copy > small {
  margin-top: 5px;
  color: #858895;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}

.buff .buff-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 7px 0 9px;
  color: #6863d6;
  background: #ecebff;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.buff-action > i {
  margin-left: 3px;
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

.buff--heal::before { background: #48bd98; }
.buff--heal .buff-icon { background: linear-gradient(145deg, #68d8b7, #3db58f); box-shadow: 0 8px 18px rgba(61, 181, 143, .22); }
.buff--heal .buff-action { color: #258e70; background: #e4f7f0; }
.buff--score::before { background: #f39a5b; }
.buff--score .buff-icon { background: linear-gradient(145deg, #ffb36f, #ed7d4e); box-shadow: 0 8px 18px rgba(237, 125, 78, .22); }
.buff--score .buff-action { color: #c86b35; background: #fff0e4; }
.buff--hint::before { background: #4d9ee9; }
.buff--hint .buff-icon { background: linear-gradient(145deg, #69b9fa, #448add); box-shadow: 0 8px 18px rgba(68, 138, 221, .22); }
.buff--hint .buff-action { color: #397dc2; background: #e8f3ff; }
.buff--coin::before { background: #e9ad35; }
.buff--coin .buff-icon { background: linear-gradient(145deg, #ffd46b, #e9a329); box-shadow: 0 8px 18px rgba(233, 163, 41, .22); }
.buff--coin .buff-action { color: #ad7414; background: #fff5da; }

.buff-equipped {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  color: #999ba7;
  font-size: 9px;
  scrollbar-width: none;
}

.buff-equipped::-webkit-scrollbar { display: none; }
.buff-equipped > span { flex: none; }
.buff-equipped > i {
  flex: none;
  padding: 5px 8px;
  color: #6964cd;
  background: #efeeff;
  border-radius: 999px;
  font-style: normal;
}

.buff-safe {
  margin-top: 12px;
  color: #a0a2ad;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.buff-safe > span {
  display: inline-grid;
  width: 19px;
  height: 19px;
  margin-right: 4px;
  color: #fff;
  background: linear-gradient(145deg, #7973eb, #58cba9);
  border-radius: 6px;
  place-items: center;
  font-size: 8px;
  font-weight: 800;
  vertical-align: middle;
}

@keyframes buff-panel-in {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 360px) {
  .buff-mask { padding: 8px; }
  .buff-panel { max-height: calc(100dvh - 16px); padding-right: 12px; padding-left: 12px; border-radius: 23px; }
  .buff-panel > h2 { font-size: 19px; }
  .buff { min-height: 72px; padding: 9px; grid-template-columns: 43px minmax(0, 1fr) auto; gap: 8px; border-radius: 15px; }
  .buff-icon { width: 43px; height: 43px; border-radius: 13px; }
  .buff-icon > span { font-size: 20px; }
  .buff-copy > b { font-size: 13px; }
  .buff-action { min-width: 41px; padding-right: 6px; padding-left: 7px; }
}

@media (max-height: 680px) {
  .buff-panel { padding-top: 8px; }
  .buff-handle { margin-bottom: 7px; }
  .buff-panel > h2 { margin-top: 5px; }
  .buff-panel > p { margin-bottom: 10px; }
  .buff-list { gap: 7px; }
  .buff { min-height: 66px; padding-top: 8px; padding-bottom: 8px; }
  .buff-safe { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .buff-panel { animation: none; }
  .buff { transition: none; }
}
