/* Deck strip + fixed-deck shop on the /cards/0 page, plus lock badges for
   purchased fixed decks in the deck builder and player profile.
   Palette follows the existing cards/deck UI: gold accent #c8960c,
   var(--surface-border), translucent panels. Each chip/card can set a
   --deck-accent CSS var (the deck's theme color) used for its thumbnail. */

.deck-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0 18px;
}

.deck-strip-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deck-strip-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 6px;
}

.deck-strip-label i {
  color: #c8960c;
}

.deck-strip-label-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.deck-strip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Owned deck chips ─────────────────────────────────────────────────────── */
.deck-chip {
  --deck-accent: #8a8f98;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  max-width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  background: var(--surface-subtle);
  /* Explicit theme color — the picker is reused in contexts (e.g. the pregame
     screen) that don't set a themed text color, where `inherit` fell back to
     default black and made chips unreadable on the dark variant. */
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.deck-chip:hover:not(:disabled) {
  border-color: #c8960c;
  background: rgba(200, 150, 12, 0.12);
}

.deck-chip:active:not(:disabled) {
  transform: translateY(1px);
}

.deck-chip-active {
  border-color: #c8960c;
  background: rgba(200, 150, 12, 0.18);
  cursor: default;
}

.deck-chip-invalid {
  opacity: 0.55;
  cursor: not-allowed;
}

.deck-chip-thumb {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  background: var(--deck-accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

/* Deck artwork fills the (square) chip thumbnail frame, cropped to cover. */
.deck-chip-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* In the details modal the artwork is shown at its natural aspect ratio
   (portrait card), so the frame is sized by the image instead of cropping. */
.deck-shop-modal-thumb-img {
  height: 100%;
  width: auto;
  border-radius: inherit;
  display: block;
}

.deck-chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deck-chip-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

.deck-chip-lock {
  font-size: 0.7rem;
  color: #c8960c;
}

.deck-chip-meta {
  font-size: 0.72rem;
  opacity: 0.7;
}

.deck-chip-check {
  margin-left: auto;
  color: #c8960c;
  display: none;
}

.deck-chip-active .deck-chip-check {
  display: inline-flex;
}

/* ── Reusable DeckPicker (cards page, pregame, tournament, world map) ─────── */
.deck-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-picker-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deck-picker {
  color: var(--text);
}

.deck-picker-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.deck-picker-title i {
  color: #c8960c;
}

.deck-picker-subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
  color: var(--text);
}

.deck-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Compact variant: chips flex to fill rows (used in tighter modals/forms). */
.deck-picker-compact .deck-chip {
  flex: 1 1 150px;
  min-width: 140px;
  max-width: none;
}

/* ── Purchasable fixed-deck chips (compact, open a details modal) ─────────── */
.deck-chip-shop {
  --deck-accent: #c8960c;
}

.deck-chip-shop-tag {
  margin-left: auto;
  opacity: 0.7;
  font-size: 0.8rem;
}

.deck-chip-shop-locked {
  opacity: 0.78;
}

.deck-chip-shop .deck-chip-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.deck-chip-shop .deck-chip-meta i {
  color: #c8960c;
}

/* ── Fixed-deck details modal ─────────────────────────────────────────────── */
.deck-shop-modal {
  --deck-accent: #c8960c;
  position: relative;
  border-top: 3px solid var(--deck-accent);
  max-width: 460px;
  /* The modal is appended to <body> (outside the themed cards panel), so opt
     into the theme palette explicitly like the other modals do. */
  color: var(--text);
}

.deck-shop-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 0.6;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.deck-shop-modal-close:hover {
  opacity: 1;
}

.deck-shop-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.deck-shop-modal-thumb {
  flex-shrink: 0;
  width: auto;
  min-width: 48px;
  height: 96px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  background: var(--deck-accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.deck-shop-modal-name {
  margin: 0;
  font-size: 1.25rem;
}

.deck-shop-modal-theme {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.deck-shop-modal-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.9;
}

.deck-shop-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.78rem;
  opacity: 0.8;
  margin-bottom: 14px;
}

.deck-shop-modal-meta i {
  color: #c8960c;
  margin-right: 4px;
}

.deck-shop-modal-comp-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 8px;
}

.deck-shop-modal-comp {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding-right: 4px;
}

.deck-shop-comp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  background: var(--surface-subtle);
  font-size: 0.78rem;
}

.deck-shop-comp-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.deck-shop-comp-name {
  white-space: nowrap;
}

.deck-shop-comp-count {
  font-weight: 700;
  color: #c8960c;
}

.deck-shop-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.deck-shop-modal-buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Lock badges in the deck builder / profile deck lists ─────────────────── */
.deck-list-lock,
.profile-deck-item-locked .profile-deck-icon i {
  color: #c8960c;
}

.deck-list-item-locked {
  border-left: 2px solid #c8960c;
}

@media (max-width: 560px) {
  .deck-chip {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
    max-width: none;
  }

  .deck-shop-card {
    width: 100%;
    flex: 1 1 100%;
  }
}
