/* card.css — the battlecard itself.
   Everything here is sized in fixed pixels against a 1354x752 canvas so that
   html2canvas can rasterise it at any scale factor and get an identical result.
   Do not introduce CSS that html2canvas cannot rasterise (filter, backdrop-filter,
   clip-path, mask); stick to backgrounds, borders, gradients and text. */

.bc-card {
  --gold: #c8912e;
  --gold-bright: #e0a838;
  --ink: #0c0c0d;
  --panel: #161719;
  --panel-2: #1c1d20;
  --line: #2c2d31;
  --text: #ece9e4;
  --muted: #8d8b87;

  position: relative;
  box-sizing: border-box;
  width: 1354px;
  height: 752px;
  padding: 10px;
  background: #0a0a0b;
  color: var(--text);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- header */

.bc-header {
  position: relative;
  height: 158px;
  flex: 0 0 158px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 26px 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(115deg, #17181b 0%, #101113 45%, #17181b 100%);
  overflow: hidden;
}

.bc-logo {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #101113;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bc-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Fallback when no logo has been uploaded: faction initials in gold. */
.bc-logo-initials {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--gold);
  letter-spacing: 1px;
}

.bc-identity { flex: 1 1 auto; min-width: 0; }

.bc-kicker {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.bc-nameline { display: flex; align-items: baseline; gap: 16px; }

.bc-name {
  margin: 0;                    /* the browser's default h1 margin would push the
                                   faction line out of the fixed-height header */
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 62px;
  line-height: 0.95;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 560px;
}
/* Long names are stepped down by JS via these modifier classes. */
.bc-name.is-long { font-size: 50px; }
.bc-name.is-verylong { font-size: 40px; }

.bc-rankhash {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: var(--gold);
  white-space: nowrap;
}

.bc-faction {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 21px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 6px;
}

.bc-meta {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px 40px;
  padding-left: 34px;
  border-left: 1px solid var(--line);
}
.bc-meta-label {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.bc-meta-value {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 23px;
  color: var(--gold);
  white-space: nowrap;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-meta-value.is-plain { color: var(--text); }

/* Oversized rank numeral in the top-right corner. */
.bc-bigrank {
  flex: 0 0 auto;
  width: 96px;
  text-align: right;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 96px;
  line-height: 1;
  color: var(--gold);
}

/* ------------------------------------------------------------------ body */

.bc-body { flex: 1 1 auto; display: flex; gap: 12px; min-height: 0; }

.bc-panel {
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bc-panel-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bc-panel-title img { width: 20px; height: 20px; display: block; }

/* ---- column 1: war summary ---- */

.bc-col-summary { flex: 0 0 400px; }

.bc-summary-rows { flex: 1 1 auto; display: flex; flex-direction: column; }

.bc-summary-row {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-top: 1px solid #232427;
}
.bc-summary-row .bc-icon { flex: 0 0 34px; width: 34px; height: 34px; display: block; }
.bc-summary-main { flex: 1 1 auto; min-width: 0; }
.bc-summary-label {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}
.bc-summary-value {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.05;
}
.bc-summary-rank { flex: 0 0 auto; text-align: left; width: 78px; }
.bc-summary-rank .bc-summary-label { font-size: 13px; }
.bc-summary-rank .bc-rankval {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 21px;
  color: var(--gold);
}

.bc-impact {
  flex: 0 0 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--gold);
  color: #14100a;
}
.bc-impact-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.05;
}
.bc-impact-sub {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.75;
}
.bc-impact-grade {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 40px;
  padding-left: 20px;
  border-left: 2px solid rgba(20, 16, 10, 0.35);
  line-height: 1;
}

/* ---- column 2: detailed stats ---- */

.bc-col-detail { flex: 0 0 415px; }

.bc-detail-rows { flex: 1 1 auto; display: flex; flex-direction: column; padding: 0 6px; }

.bc-detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 12px 4px;
}
.bc-detail-head span {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  width: 74px;
  text-align: center;
}

.bc-detail-row {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-top: 1px solid #232427;
}
.bc-detail-row:nth-child(odd) { background: #1a1b1e; }
.bc-detail-name {
  flex: 1 1 auto;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.bc-detail-value {
  flex: 0 0 96px;
  text-align: right;
  padding-right: 14px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 22px;
}
.bc-detail-rank {
  flex: 0 0 74px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--gold);
  border-left: 1px solid #232427;
}
.bc-detail-rank.is-na { color: var(--muted); }

.bc-legend {
  flex: 0 0 auto;
  padding: 10px 16px 12px;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 1.4px;
  color: #6a6864;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ---- column 3: radar + notes ---- */

.bc-col-right { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.bc-panel-radar { flex: 1 1 auto; min-height: 0; }
.bc-radar-wrap { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.bc-radar-wrap canvas { display: block; }

.bc-panel-notes { flex: 0 0 152px; }
.bc-notes-text {
  padding: 0 18px 14px;
  font-size: 20px;
  line-height: 1.35;
  color: #cfccc6;
  overflow: hidden;
}
.bc-notes-text.is-dense { font-size: 17px; line-height: 1.3; }
