/* ============================================================
   WARDEC — Deck Composition Analyzer styles
   Builds on warcal.css base (console, paper, table, spark).
   ============================================================ */



body.page-wardec {
  --binder-image: url("../src/empty.png");
  overflow-y: auto;
  overflow-x: auto;
}

/* ── Input row ──────────────────────────────────────────── */

.wardec-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.wardec-deck-input {
  flex: 1 1 400px;
  min-width: 200px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.wardec-error {
  padding: 6px 12px;
  color: #d32f2f;
  font-family: 'VT323', monospace;
  font-size: 16px;
}

/* ── Division header ────────────────────────────────────── */

.wardec-division-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 12px 0 0;
  background: #1a1a1a;
  color: #b6ffb6;
  font-family: 'VT323', monospace;
  font-size: 20px;
  border: 1px solid #333;
  flex-wrap: wrap;
}

.wardec-div-title { flex: 1; min-width: 120px; }
.wardec-div-meta  { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wardec-div-cards { opacity: 0.7; font-size: 16px; }

.wardec-mod-tag {
  display: inline-block;
  background: #d32f2f;
  color: #fff;
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

.wardec-coalition {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 7px;
  border-radius: 2px;
  text-transform: uppercase;
}
.wardec-coalition-nato { background: #1565c0; color: #fff; }
.wardec-coalition-pact { background: #b71c1c; color: #fff; }

.wardec-nation {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  background: #2a2a2a;
  border: 1px solid #555;
  color: #ccc;
  border-radius: 2px;
}

/* ── Summary ────────────────────────────────────────────── */

/* NOTE: old single-deck summary styles removed; replaced by chart below */

/* ── Comparison chart ───────────────────────────────────── */

.wardec-chart-container {
  margin: 12px 0 0;
  background: #f5f3ee;
  border: 1px solid #c5bfa7;
  padding: 12px 12px 8px;
}

.wardec-chart-container svg {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.wardec-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 4px 2px;
  max-width: 760px;
  margin: 0 auto;
}

.wardec-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'VT323', monospace;
  font-size: 15px;
  color: #333;
  white-space: nowrap;
}

.wardec-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 2px;
}

.wardec-legend-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 11px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Deck entry ─────────────────────────────────────────── */

.wardec-entry {
  margin: 12px 0 0;
  border: 1px solid #333;
  border-left: 4px solid var(--deck-color, #4e79a7);
}

.wardec-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #1a1a1a;
  color: #b6ffb6;
  font-family: 'VT323', monospace;
  font-size: 18px;
  flex-wrap: wrap;
}

.wardec-entry-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.wardec-entry-header .wardec-div-title { flex: 1; min-width: 100px; }
.wardec-entry-header .wardec-div-meta  { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.wardec-entry-header .wardec-div-cards { opacity: 0.7; font-size: 14px; margin-left: auto; }
.wardec-div-flag { height: 20px; width: auto; flex-shrink: 0; image-rendering: auto; border: 1px solid rgba(255,255,255,0.15); }
.wardec-div-sigil { height: 32px; width: auto; flex-shrink: 0; image-rendering: auto; }
.wardec-legend-sigil { height: 22px; width: auto; flex-shrink: 0; image-rendering: auto; }

.wardec-remove-btn {
  margin-left: 8px;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid #555;
  color: #e15759;
  font-family: 'VT323', monospace;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.1s, border-color 0.1s;
  flex-shrink: 0;
}
.wardec-remove-btn:hover {
  background: rgba(225, 87, 89, 0.15);
  border-color: #e15759;
}

.wardec-entry-warn {
  padding: 4px 10px;
  background: #1a1a1a;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: #e65100;
  border-top: 1px solid #2a2a2a;
}

.wardec-stats-row {
  margin-top: 10px;
  display: flex;
  gap: 24px;
  font-family: 'VT323', monospace;
  font-size: 15px;
  color: #444;
  flex-wrap: wrap;
}

.wardec-warn {
  color: #e65100;
}

/* ══════════════════════════════════════════════════════════
   DECK CARD LAYOUT
   ══════════════════════════════════════════════════════════ */

/* ── Outer wrapper ──────────────────────────────────────── */
.dc-board-wrap {
  margin: 8px 0 16px;
}

/* ── Board: column of rows ──────────────────────────────── */
.dc-board {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Single tab row ─────────────────────────────────────── */
.dc-row {
  display: flex;
  align-items: stretch;
}

.dc-row-label {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #b6ffb6;
  background: #111;
  border: 1px solid #333;
  border-right: 2px solid #3a3a3a;
  letter-spacing: 1px;
  user-select: none;
}
.dc-row-label-unk { color: #666; }

/* ── Cards area ─────────────────────────────────────────── */
.dc-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  background: #161616;
  border: 1px solid #333;
  border-left: none;
  flex: 1;
  align-content: flex-start;
}

/* ── Individual card ────────────────────────────────────── */
.dc-card {
  width: 94px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1c1c1c;
  border: 1px solid #3a3a3a;
  cursor: default;
  transition: border-color 0.1s;
}
.dc-card:hover {
  border-color: #5af;
  z-index: 1;
}

/* ── Image area ─────────────────────────────────────────── */
.dc-img-wrap {
  position: relative;
  width: 94px;
  height: 62px;
  flex-shrink: 0;
  background: #2a2a2a;
  overflow: hidden;
}
.dc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Placeholder pattern when no image loads */
.dc-img-wrap.dc-no-img {
  background: repeating-linear-gradient(
    45deg,
    #222 0px, #222 4px,
    #2a2a2a 4px, #2a2a2a 8px
  );
}

/* Cost badge — top right */
.dc-cost {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.75);
  color: #ffe566;
  font-family: 'VT323', monospace;
  font-size: 14px;
  line-height: 1;
  padding: 1px 4px;
  border: 1px solid rgba(255,229,102,0.35);
}

/* Quantity badge — bottom left */
.dc-qty {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-family: 'VT323', monospace;
  font-size: 14px;
  line-height: 1;
  padding: 1px 4px;
}

/* Veterancy chevrons — right side, stacked below cost */
.dc-chevrons {
  position: absolute;
  right: 3px;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.dc-chev {
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #ffe566;
}
.dc-chev-elite {
  border-bottom-color: #ff9800;
}

/* ── Names strip ────────────────────────────────────────── */
.dc-names {
  padding: 3px 4px 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  background: #111;
  min-height: 34px;
}
.dc-transport {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #8bdf8b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dc-unit-name {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 13px;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.dc-country {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: #777;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Main layout ────────────────────────────────────────── */

.wardec-main {
  padding-top: 56px;
  padding-bottom: 40px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 680px) {
  .dc-row-label { width: 36px; font-size: 16px; }
  .dc-card { width: 80px; }
  .dc-img-wrap { width: 80px; height: 52px; }
  .dc-unit-name { font-size: 11px; }
  .wardec-entry-header { font-size: 15px; gap: 6px; }
}
