/* ============================================
   XPLOSION — Админка «Ачивки»
   ============================================ */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.ach-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ach-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
}

.ach-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ach-color, #FFD700);
}

.ach-card.off {
  opacity: 0.55;
}

.ach-card.off::before {
  background: var(--muted);
}

.ach-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  background: var(--input-bg);
  border: 2px solid var(--ach-color, #FFD700);
  overflow: hidden;
}

.ach-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.ach-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}

.ach-card-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.ach-card-condition {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 215, 0, .1);
  color: var(--gold-text);
  border: 1px solid rgba(255, 215, 0, .3);
}

.ach-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-direction: column;
}

.ach-card-actions .mini-btn {
  padding: 4px 8px;
  font-size: 11px;
}

.ach-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
}

/* Модалка */
.ach-form-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.ach-form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.ach-icon-picker {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.ach-icon-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: var(--input-bg);
  border: 3px solid var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}

.ach-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ach-icon-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ach-icon-controls button {
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  transition: all .15s;
}

.ach-icon-controls button:hover {
  border-color: var(--gold);
  color: var(--gold-text);
}

.ach-condition-help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
}

.ach-value-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ach-value-row input {
  flex: 1;
}

.ach-value-row .unit {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Стена наград у спортсмена */
.ach-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ach-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px;
  border-radius: 12px;
  transition: transform .15s;
  cursor: default;
}

.ach-slot:hover {
  transform: translateY(-3px);
}

.ach-slot-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.ach-slot-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ach-slot-name {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.ach-slot-date {
  font-size: 9px;
  opacity: .7;
  margin-top: 3px;
}

.ach-slot.locked {
  opacity: 0.35;
  filter: grayscale(1);
}

.ach-slot.locked .ach-slot-icon {
  background: var(--panel-3);
  border: 2px dashed var(--border-light);
}

.ach-slot.unlocked {
  background: rgba(255, 215, 0, .04);
  border: 1px solid rgba(255, 215, 0, .15);
}

.ach-slot.unlocked .ach-slot-icon {
  background: var(--input-bg);
  border: 2px solid var(--gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, .5);
}

.ach-slot.unlocked .ach-slot-name {
  color: var(--gold-text);
}

.ach-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ach-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--panel-3);
  border-radius: 3px;
  overflow: hidden;
}

.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  border-radius: 3px;
  transition: width .4s;
}

.ach-progress-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-text);
  white-space: nowrap;
}

@media (max-width: 780px) {
  .ach-grid {
    grid-template-columns: 1fr;
  }
  .ach-wall {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}