/* ========== Steam 风成就弹窗 ========== */
.ach-toast-host {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  width: min(360px, calc(100vw - 24px));
}

body:has(#screen-table.active) .ach-toast-host {
  right: max(88px, calc(env(safe-area-inset-right) + 72px));
  bottom: max(150px, calc(env(safe-area-inset-bottom) + 136px));
}

.ach-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(22, 28, 36, 0.96), rgba(12, 16, 22, 0.98));
  border: 1px solid rgba(120, 160, 200, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateX(28px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.2, 1.1, 0.3, 1);
  overflow: hidden;
}
.ach-toast.is-in {
  opacity: 1;
  transform: none;
}
.ach-toast.is-out {
  opacity: 0;
  transform: translateX(20px);
  transition-duration: 0.35s;
}

.ach-toast-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 20% 40%, rgba(100, 180, 255, 0.22), transparent 55%);
  pointer-events: none;
  animation: achGlow 2.4s ease infinite alternate;
}
@keyframes achGlow {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.ach-toast-icon {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 30px;
  border-radius: 6px;
  background: linear-gradient(160deg, #2a3544, #151b24);
  border: 1px solid rgba(180, 210, 255, 0.25);
  box-shadow: inset 0 0 20px rgba(80, 140, 255, 0.15);
}
.ach-toast-body {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}
.ach-toast-who {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8bb4d9;
  margin-bottom: 2px;
}
.ach-toast-name {
  font-size: 17px;
  font-weight: 900;
  color: #f2f6ff;
  line-height: 1.25;
  text-shadow: 0 0 12px rgba(120, 180, 255, 0.35);
}
.ach-toast-desc {
  font-size: 12px;
  color: rgba(220, 230, 245, 0.72);
  margin-top: 3px;
  line-height: 1.35;
}
.ach-toast-rare {
  margin-top: 6px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #9ec0e0;
}

/* 稀有度描边 */
.ach-rare-common { border-color: rgba(140, 160, 180, 0.4); }
.ach-rare-rare {
  border-color: rgba(90, 160, 255, 0.65);
  box-shadow: 0 0 24px rgba(60, 140, 255, 0.25), 0 12px 40px rgba(0, 0, 0, 0.55);
}
.ach-rare-rare .ach-toast-rare { color: #6eb6ff; background: rgba(60, 130, 255, 0.15); }
.ach-rare-epic {
  border-color: rgba(180, 100, 255, 0.7);
  box-shadow: 0 0 28px rgba(160, 80, 255, 0.3), 0 12px 40px rgba(0, 0, 0, 0.55);
}
.ach-rare-epic .ach-toast-rare { color: #d4a0ff; background: rgba(150, 80, 255, 0.18); }
.ach-rare-epic .ach-toast-glow {
  background: radial-gradient(circle at 25% 40%, rgba(180, 100, 255, 0.35), transparent 55%);
}
.ach-rare-legendary {
  border-color: rgba(255, 200, 80, 0.85);
  box-shadow: 0 0 32px rgba(255, 180, 40, 0.4), 0 12px 40px rgba(0, 0, 0, 0.55);
}
.ach-rare-legendary .ach-toast-name {
  color: #ffe6a0;
  text-shadow: 0 0 16px rgba(255, 200, 80, 0.55);
}
.ach-rare-legendary .ach-toast-rare {
  color: #1a1200;
  background: linear-gradient(135deg, #ffe08a, #f0c56d);
}
.ach-rare-legendary .ach-toast-glow {
  background: radial-gradient(circle at 25% 40%, rgba(255, 200, 80, 0.4), transparent 55%);
}

/* ========== 图鉴面板 ========== */
.ach-progress-bar {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold, #f0c56d);
  margin: 0 0 12px;
  letter-spacing: 0.06em;
}
.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(58vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.ach-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ach-item.is-locked {
  opacity: 0.48;
  filter: grayscale(0.35);
}
.ach-item.is-on {
  border-color: rgba(120, 180, 255, 0.28);
  background: linear-gradient(135deg, rgba(30, 50, 80, 0.45), rgba(0, 0, 0, 0.35));
}
.ach-item-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ach-item-name {
  font-size: 14px;
  font-weight: 900;
  color: #f0f4ff;
}
.ach-item-desc {
  font-size: 12px;
  color: var(--muted, rgba(255, 255, 255, 0.6));
  margin-top: 2px;
  line-height: 1.35;
}
.ach-item-foot {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(180, 200, 230, 0.7);
}
.ach-item.ach-rare-epic.is-on { border-color: rgba(180, 100, 255, 0.4); }
.ach-item.ach-rare-legendary.is-on { border-color: rgba(255, 200, 80, 0.5); }

@media (max-width: 720px) {
  .ach-toast-host {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
  }
  body:has(#screen-table.active) .ach-toast-host {
    right: 10px;
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
  }
  .ach-toast {
    padding: 12px 12px;
  }
  .ach-toast-icon {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }
  .ach-toast-name { font-size: 15px; }
}
