/* ═══════════════════════════════════════════════════
   OSIĄGNIĘCIA — siatka odznak + opis po hover/tap
   ═══════════════════════════════════════════════════ */

.lbn-achievements {
  --ach-gold: #d4af37;
  --ach-gold-bright: #ffe566;
  --ach-ink: #e8dcc0;
  --ach-muted: #8a7a5e;
}

.lbn-achievements .cmd-hero {
  margin-bottom: 10px;
}

.lbn-achievements .cmd-lead {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.ach-section-label {
  margin: 4px 0 8px;
  padding: 0 2px;
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ach-gold);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
}

.ach-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin: 0 0 14px;
  padding: 8px 6px;
  border: 1px solid rgba(138, 106, 26, 0.4);
  background: rgba(0, 0, 0, 0.25);
}

.ach-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Cinzel", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft, #cbb892);
}

.ach-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fx, var(--ach-gold));
  box-shadow: 0 0 6px var(--fx-soft, rgba(212, 175, 55, 0.45));
}

.ach-dot--start { --fx: #ffd54a; --fx-soft: rgba(255, 213, 74, 0.45); }
.ach-dot--grind { --fx: #ff6b4a; --fx-soft: rgba(255, 80, 40, 0.4); }
.ach-dot--support { --fx: #f0a070; --fx-soft: rgba(240, 160, 112, 0.4); }
.ach-dot--admin { --fx: #5eb8ff; --fx-soft: rgba(70, 160, 255, 0.4); }
.ach-dot--event { --fx: #4ade80; --fx-soft: rgba(74, 222, 128, 0.4); }
.ach-dot--quest { --fx: #c084fc; --fx-soft: rgba(180, 100, 255, 0.45); }

/* ── Siatka ── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.ach-card {
  --fx: #ffd54a;
  --fx-soft: rgba(255, 213, 74, 0.45);

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 148px;
  padding: 18px 10px 14px;
  width: 100%;
  margin: 0;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: var(--ach-ink);
  border: 2px solid rgba(138, 106, 26, 0.55);
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 220, 80, 0.1) 0%, transparent 55%),
    linear-gradient(180deg, #2c2116 0%, #161210 100%);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1;
}

.ach-card:hover,
.ach-card:focus,
.ach-card.is-open {
  transform: translateY(-2px);
  color: #fff8e0;
  z-index: 8;
  outline: none;
  border-color: var(--fx);
  box-shadow: 0 0 20px var(--fx-soft), inset 0 0 18px rgba(255, 200, 50, 0.08);
}

.ach-card--start { --fx: #ffd54a; --fx-soft: rgba(255, 213, 74, 0.45); }
.ach-card--grind { --fx: #ff6b4a; --fx-soft: rgba(255, 80, 40, 0.4); }
.ach-card--support { --fx: #f0a070; --fx-soft: rgba(240, 160, 112, 0.4); }
.ach-card--admin { --fx: #5eb8ff; --fx-soft: rgba(70, 160, 255, 0.4); }
.ach-card--event { --fx: #4ade80; --fx-soft: rgba(74, 222, 128, 0.4); }
.ach-card--quest { --fx: #c084fc; --fx-soft: rgba(180, 100, 255, 0.45); }

/* FX */
.ach-card__burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ach-card__burst::before,
.ach-card__burst::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 2px solid var(--fx);
  opacity: 0;
  animation: ach-burst 2.8s ease-out infinite;
  animation-delay: var(--ach-delay, 0s);
}

.ach-card__burst::after {
  animation-delay: calc(var(--ach-delay, 0s) + 1.4s);
  border-width: 1px;
}

@keyframes ach-burst {
  0% {
    transform: scale(0.35);
    opacity: 0.85;
    box-shadow: 0 0 8px var(--fx-soft);
  }
  70% { opacity: 0.25; }
  100% {
    transform: scale(2.6);
    opacity: 0;
    box-shadow: 0 0 0 transparent;
  }
}

.ach-card__sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.ach-card__sparks span {
  position: absolute;
  bottom: 22%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fx);
  box-shadow: 0 0 6px var(--fx), 0 0 12px var(--fx-soft);
  opacity: 0;
  animation: ach-spark 2.4s ease-out infinite;
}

.ach-card__sparks span:nth-child(1) { margin-left: -18px; animation-delay: calc(var(--ach-delay, 0s) + 0s); }
.ach-card__sparks span:nth-child(2) { margin-left: 10px; width: 2px; height: 2px; animation-delay: calc(var(--ach-delay, 0s) + 0.4s); }
.ach-card__sparks span:nth-child(3) { margin-left: -4px; animation-delay: calc(var(--ach-delay, 0s) + 0.8s); }
.ach-card__sparks span:nth-child(4) { margin-left: 20px; width: 2px; height: 2px; animation-delay: calc(var(--ach-delay, 0s) + 1.2s); }
.ach-card__sparks span:nth-child(5) { margin-left: -26px; animation-delay: calc(var(--ach-delay, 0s) + 1.6s); }
.ach-card__sparks span:nth-child(6) { margin-left: 2px; width: 4px; height: 4px; animation-delay: calc(var(--ach-delay, 0s) + 2s); }

@keyframes ach-spark {
  0% {
    transform: translateY(8px) scale(0.4);
    opacity: 0;
  }
  15% { opacity: 1; }
  100% {
    transform: translateY(-52px) scale(0.2);
    opacity: 0;
  }
}

.ach-card__shine {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 220, 0.14) 48%,
    transparent 62%
  );
  background-size: 220% 100%;
  animation: ach-shine 3.8s linear infinite;
  animation-delay: var(--ach-delay, 0s);
}

@keyframes ach-shine {
  0% { background-position: 140% 0; }
  100% { background-position: -140% 0; }
}

.ach-card__badge {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 3;
  padding: 1px 5px;
  font-family: "Cinzel", serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, var(--ach-gold-bright), var(--ach-gold));
  border: 1px solid rgba(255, 240, 160, 0.6);
  box-shadow: 0 0 8px var(--fx-soft);
}

.ach-card__hint {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 50%;
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 800;
  color: var(--ach-gold);
  background: rgba(0, 0, 0, 0.35);
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.ach-card:hover .ach-card__hint,
.ach-card:focus .ach-card__hint,
.ach-card.is-open .ach-card__hint {
  opacity: 1;
  transform: scale(1.12);
  border-color: var(--fx);
  color: var(--fx);
  box-shadow: 0 0 8px var(--fx-soft);
}

.ach-card__icon {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px var(--fx-soft));
  animation: ach-icon-pulse 2.2s ease-in-out infinite;
  animation-delay: var(--ach-delay, 0s);
}

.ach-card__icon img {
  max-width: 60px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
}

@keyframes ach-icon-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px var(--fx-soft));
  }
  50% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 14px var(--fx));
  }
}

.ach-card__label {
  position: relative;
  z-index: 2;
  font-family: "Cinzel", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--fx);
  text-shadow: 0 0 10px var(--fx-soft), 0 1px 2px #000;
  line-height: 1.2;
}

.ach-card__how {
  position: relative;
  z-index: 2;
  font-size: 10px;
  color: var(--ach-muted);
  text-align: center;
  max-width: 95%;
  line-height: 1.25;
}

/* ── Tip po najechaniu / tapnięciu ── */
.ach-card__tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: linear-gradient(
    180deg,
    rgba(10, 8, 6, 0.15) 0%,
    rgba(12, 10, 8, 0.72) 45%,
    rgba(14, 10, 8, 0.94) 100%
  );
  transition:
    opacity 0.22s ease,
    visibility 0.22s;
}

.ach-card__tip-inner {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(180deg, rgba(44, 36, 24, 0.95), rgba(21, 17, 12, 0.98));
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ach-ink);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  transform: translateY(8px);
  transition: transform 0.22s ease;
}

.ach-card:hover .ach-card__tip,
.ach-card:focus .ach-card__tip,
.ach-card:focus-within .ach-card__tip,
.ach-card.is-open .ach-card__tip {
  opacity: 1;
  visibility: visible;
}

.ach-card:hover .ach-card__tip-inner,
.ach-card:focus .ach-card__tip-inner,
.ach-card:focus-within .ach-card__tip-inner,
.ach-card.is-open .ach-card__tip-inner {
  transform: translateY(0);
}

.ach-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(138, 106, 26, 0.4);
  background: rgba(28, 22, 16, 0.92);
  text-align: center;
  font-size: 13px;
  color: var(--ach-ink);
}

.ach-note a {
  color: var(--ach-gold-bright);
  text-decoration: underline;
}

.ach-note a:hover {
  color: #fff;
}

@media (max-width: 720px) {
  .ach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .ach-grid {
    grid-template-columns: 1fr;
  }

  .ach-card {
    min-height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ach-card__burst::before,
  .ach-card__burst::after,
  .ach-card__sparks span,
  .ach-card__shine,
  .ach-card__icon {
    animation: none !important;
  }

  .ach-card__tip {
    transition: none;
  }
}
