/**
 * @file        achievements.css
 * @module      UI / Achievements
 * @description 成就系统样式：解锁弹窗 Toast + 成就列表面板
 */

/* ==============================================================
   成就解锁弹窗 Toast
   ============================================================== */
.achievement-toast {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  min-width: 240px;
  max-width: 320px;
  background: linear-gradient(135deg, var(--color-grid-bg, #1a1a3e) 0%, var(--color-secondary, #2d1b69) 50%, var(--color-grid-bg, #1a1a3e) 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(255, 215, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  backdrop-filter: blur(12px);
}

.achievement-toast .ach-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.achievement-toast .ach-body {
  flex: 1;
  min-width: 0;
}

.achievement-toast .ach-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffd700;
  margin-bottom: 2px;
}

.achievement-toast .ach-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.achievement-toast .ach-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
  line-height: 1.4;
}

/* ==============================================================
   成就面板（设置页可查看）
   ============================================================== */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-cell-bg);
  border-radius: 8px;
  border: 1px solid var(--color-secondary);
  transition: background 0.2s;
}

.achievement-item.achieved {
  background: rgba(255, 215, 0, 0.06);
  border-color: rgba(255, 215, 0, 0.15);
}

.achievement-item.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.achievement-item .ach-item-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.achievement-item .ach-item-info {
  flex: 1;
  min-width: 0;
}

.achievement-item .ach-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-dark, #e0e0e0);
}

.achievement-item .ach-item-desc {
  font-size: 12px;
  color: var(--color-text-dark, #e0e0e0);
  opacity: 0.65;
  margin-top: 1px;
}

.achievement-item .ach-item-status {
  font-size: 11px;
  font-weight: 700;
  color: #ffd700;
  flex-shrink: 0;
}

.achievement-item.locked .ach-item-status {
  color: rgba(255, 255, 255, 0.25);
}

/* ==============================================================
   响应式适配
   ============================================================== */
@media (max-width: 520px) {
  .achievement-toast {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 8px;
    left: 8px;
    max-width: none;
    min-width: 0;
    padding: 12px 14px;
  }

  .achievement-toast .ach-icon {
    font-size: 26px;
  }

  .achievement-toast .ach-title {
    font-size: 15px;
  }
}
