/* =========================================================================
   BaseTrace assets — the Clash of Clans icon layer (round A4)

   A separate stylesheet on purpose: the CSS round (U3) owns basetrace.css and
   the static class names in the pages, so this file only adds bt-asset-* and
   bt-pip* and never redefines anything that already exists there.

   Every colour below is a token from basetrace.css :root. Nothing is invented,
   there is no green, and nothing animates.
   ========================================================================= */

.bt-asset {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  height: auto;
  /* The intrinsic size stays in the attributes; the box below decides the
     on-screen size, so a failed load keeps its space instead of collapsing. */
  object-fit: contain;
}

/* A decorative star is the same file as a filled one, dimmed with outline look. */
.bt-asset--dim {
  opacity: 0.35;
  filter: grayscale(100%) brightness(0.7);
}

/* Attacker Town Hall icon: 28px box in defense ledger. */
.defense-th-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
}

/* Town Hall tab icon: 24px box. */
.bt-asset--tab {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

/* Layout type chip icon: 18px box. */
.bt-asset--chip {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

/* Empty-state art: centred above the headline, never larger than 96px. */
.bt-asset--empty {
  display: block;
  width: auto;
  max-width: 96px;
  max-height: 96px;
  margin: 0 auto var(--bt-space-12);
  opacity: 0.9;
}

/* Setup checklist step icon: 32px box. */
.bt-asset--step {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

/* A star inside a row of three: visible star box with scale to crop empty asset padding */
.bt-asset--star {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  transform: scale(7.2);
  transform-origin: center center;
}

/* Success moment: shown once, above the next step. */
.bt-asset--success {
  display: block;
  width: auto;
  max-width: 96px;
  max-height: 96px;
  margin: 0 auto var(--bt-space-8);
}

/* The text fallback every icon carries. Hidden until its image fails. */
.bt-asset-fallback {
  display: none;
}

.bt-asset-failed .bt-asset-fallback {
  display: inline;
  font-size: 14px;
  line-height: 1;
  color: var(--bt-color-star, #F1A533);
}

/* An icon inside a chip or a tab sits before its label with a 4px gap. The
   chip keeps its own display/height: this is spacing only, so the 44px tap
   target and the chip padding stay whatever basetrace.css already set. */
.bt-chip > .bt-asset,
.bt-tab > .bt-asset {
  margin-right: 4px;
}

/* The proof stats grid is `repeat(2, 1fr)`, and a 1fr track floors at its
   content: at 320px the second card of the gallery detail pushed 2px past the
   viewport. Min-width 0 lets both tracks share the width. basetrace.css is not
   this round's file, so the fix lives here (found by the A4 asset smoke). */
.bt-stats-grid > .bt-stat-metric {
  min-width: 0;
}

/* A checklist step title with its icon, so the icon is a sibling of the title
   rather than a bullet inside its text. */
.bt-checklist-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bt-checklist-step-head .bt-asset {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

/* The success moment after an account is added. No animation: it is one static
   image until the next render replaces the block with nothing. */
.bt-success {
  display: block;
  margin: var(--bt-space-12) 0;
  text-align: center;
}

/* Three stars as a unit, so the fallback sits where the icons were. */
.bt-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  overflow: hidden;
}

/* ---- outcome pips -------------------------------------------------------
   One pip per attack: gold outline + centre dot when it held, red outline +
   cross when it was 3-starred. The shape carries the meaning, not the colour,
   and the container's aria-label says it in words.
   ------------------------------------------------------------------------ */

.bt-pips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: var(--bt-space-8);
}

.bt-pip {
  position: relative;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 4px;
  border: 2px solid var(--bt-color-muted);
  background: transparent;
}

/* Held: steel blue outline, filled centre dot. */
.bt-pip--held {
  border-color: var(--bt-color-held, #3E7BC4);
}

.bt-pip--held::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--bt-color-held, #3E7BC4);
}

/* Lost: red outline, cross drawn with two bars. */
.bt-pip--lost {
  border-color: var(--bt-color-danger, #D4443A);
}

.bt-pip--lost::before,
.bt-pip--lost::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 2px;
  margin: -1px 0 0 -4px;
  background: var(--bt-color-danger, #D4443A);
}

.bt-pip--lost::before {
  transform: rotate(45deg);
}

.bt-pip--lost::after {
  transform: rotate(-45deg);
}

/* "and 3 more" after the tenth pip. */
.bt-pips-extra {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  color: var(--bt-color-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: var(--bt-radius-chip);
  background: transparent;
  border: 1px solid var(--bt-card-border);
  margin-left: 2px;
  flex: 0 0 auto;
}

/* On a chip row the pips have no top margin to add. */
.bt-chip-row .bt-pips,
.bt-proof-early .bt-pips {
  margin-top: 0;
}

@media (max-width: 360px) {
  .bt-pips {
    gap: 4px;
  }
}
