/* Coleção nas cartas da grade (ui/card-browser.js): o selo do nível, e a carta bloqueada apagada, com o
   cadeado e os fragmentos juntados. */
.card-level {
  position: absolute;
  left: 50%;
  top: 2px;
  z-index: 2;
  min-width: 34px;
  padding: 1px 6px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: linear-gradient(#5a4f8a, #3a3260);
  color: #f2eaff;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.card--tile.can-upgrade .card-level {
  background: linear-gradient(#5ee28a, #22a45a);
  color: #08240f;
  animation: level-glow 1.6s ease-in-out infinite;
}

.card--tile.is-locked .card-art,
.card--tile.is-locked .card-icons {
  filter: grayscale(1) brightness(0.55);
}

.card--tile.is-locked .card-name,
.card--tile.is-locked .card-cost {
  opacity: 0.7;
}

/* Cadeado desenhado em SVG no meio do retrato. */
.card--tile.is-locked::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 2;
  width: 30px;
  height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34'%3E%3Cpath d='M8 15V10a7 7 0 0 1 14 0v5' fill='none' stroke='%231c1530' stroke-width='7' stroke-linecap='round'/%3E%3Cpath d='M8 15V10a7 7 0 0 1 14 0v5' fill='none' stroke='%23d8d2f0' stroke-width='3.4' stroke-linecap='round'/%3E%3Crect x='3' y='14' width='24' height='18' rx='4' fill='%23d8d2f0' stroke='%231c1530' stroke-width='3'/%3E%3Ccircle cx='15' cy='22' r='2.6' fill='%231c1530'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* O mesmo nas miniaturas dos decks (ui/deck-minis.js): o deck incompleto aparece na lista. */
.deck-card.is-locked canvas {
  filter: grayscale(1) brightness(0.55);
}

.deck-card.is-locked .mini-cost {
  opacity: 0.7;
}

.deck-card.is-locked::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 60%;
  max-width: 22px;
  aspect-ratio: 30 / 34;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34'%3E%3Cpath d='M8 15V10a7 7 0 0 1 14 0v5' fill='none' stroke='%231c1530' stroke-width='7' stroke-linecap='round'/%3E%3Cpath d='M8 15V10a7 7 0 0 1 14 0v5' fill='none' stroke='%23d8d2f0' stroke-width='3.4' stroke-linecap='round'/%3E%3Crect x='3' y='14' width='24' height='18' rx='4' fill='%23d8d2f0' stroke='%231c1530' stroke-width='3'/%3E%3Ccircle cx='15' cy='22' r='2.6' fill='%231c1530'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.card--tile.is-locked .card-level {
  background: rgba(18, 14, 34, 0.9);
  color: #c9bfe6;
}

/* Painel do nível no detalhe da carta: o nível, os fragmentos, a barra e o Subir de nível. */
.detail-progress {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 2px solid var(--outline);
  border-radius: 12px;
  background: rgba(15, 12, 31, 0.7);
}

.detail-progress[hidden] {
  display: none;
}

.detail-progress-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.detail-progress-line b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
}

.detail-progress-bar {
  display: block;
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: #1a1530;
}

.detail-progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(#b48cff, #7c4ce0);
  transition: width 300ms ease-out;
}

.detail-progress.is-ready .detail-progress-bar i {
  background: linear-gradient(#7ef0a2, #2fb866);
}

.sheet-upgrade {
  min-height: 46px;
  font-size: 18px;
}

.sheet-upgrade[hidden] {
  display: none;
}

@keyframes level-glow {
  50% { box-shadow: 0 0 10px rgba(94, 226, 138, 0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .card--tile.can-upgrade .card-level {
    animation: none;
  }
}
