/* css/opponent.css — opponent paste modal + matchup viewer styles. */

/* ── Paste modal ───────────────────────────────────────────────── */

.yaab-opp-modal {
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
}

.yaab-opp-body {
  padding: 14px 18px 8px;
  overflow-y: auto;
  flex: 1;
}

.yaab-opp-muted {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.yaab-opp-textarea {
  width: 100%;
  resize: vertical;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.45;
  min-height: 180px;
}

.yaab-opp-preview {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  max-height: 260px;
  overflow-y: auto;
}

.yaab-opp-prev-head {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.yaab-opp-prev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.yaab-opp-prev-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  padding: 2px 0;
}

.yaab-opp-prev-row.yaab-opp-unknown {
  color: var(--text-muted);
}

.yaab-opp-prev-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.yaab-opp-prev-pts   { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.yaab-opp-error {
  color: #e67a7a;
  font-size: 12px;
  padding: 6px 0;
}

.yaab-opp-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 14px;
}

.yaab-opp-spacer { flex: 1; }

/* ── Matchup modal ─────────────────────────────────────────────── */

.yaab-mu-modal {
  max-width: 1000px;
  width: 100%;
  max-height: 92vh;
}

.yaab-mu-body {
  padding: 14px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

.yaab-mu-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
}

.yaab-mu-muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* Header row */
.yaab-mu-header {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.yaab-mu-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yaab-mu-them {
  text-align: right;
  align-items: flex-end;
}

.yaab-mu-side-title {
  font-size: 15px;
  font-weight: 600;
}

.yaab-mu-side-sub {
  color: var(--text-muted);
  font-size: 12px;
}

.yaab-mu-vs {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Totals row */
.yaab-mu-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.yaab-mu-totals-cell:last-child { text-align: right; }

/* Section wrapper */
.yaab-mu-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.yaab-mu-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  cursor: default;
}

details.yaab-mu-roster-section > summary.yaab-mu-section-title {
  cursor: pointer;
  list-style: revert;
}

/* Composition bars */
.yaab-mu-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.yaab-mu-compare-cell { min-width: 0; }

.yaab-mu-role-bar {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
}

.yaab-mu-role-seg { height: 100%; }

.yaab-mu-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text);
}

.yaab-mu-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.yaab-mu-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.yaab-mu-legend-pct {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Attack grid */
.yaab-mu-atk-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yaab-mu-atk-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  align-items: center;
}

.yaab-mu-atk-label {
  font-size: 12px;
  color: var(--text);
}

.yaab-mu-atk-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.yaab-mu-atk-side {
  position: relative;
  height: 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.yaab-mu-atk-bar {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  transition: width 0.15s ease;
}

.yaab-mu-atk-you  { background: rgba(var(--accent-rgb, 120 160 220), 0.75); }
.yaab-mu-atk-them { background: rgba(230, 122, 122, 0.65); }

.yaab-mu-atk-val {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.yaab-mu-lead-you .yaab-mu-atk-label::before  { content: '▸ '; color: rgb(var(--accent-rgb, 120 160 220)); }
.yaab-mu-lead-them .yaab-mu-atk-label::after  { content: ' ◂'; color: #e67a7a; float: right; }

/* Roster */
.yaab-mu-roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yaab-mu-roster-row { padding: 0; }

.yaab-mu-roster-btn {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}

.yaab-mu-roster-btn:hover {
  background: rgba(var(--accent-rgb, 120 160 220), 0.08);
}

.yaab-mu-roster-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.yaab-mu-roster-pts   { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.yaab-mu-unknown .yaab-mu-roster-btn { color: var(--text-muted); }

.yaab-mu-roster-detail {
  padding: 8px 10px 10px;
  border-left: 2px solid rgba(var(--accent-rgb, 120 160 220), 0.4);
  margin: 4px 0 4px 14px;
  font-size: 12px;
}

.yaab-mu-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Stat strip */
.yaab-mu-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yaab-mu-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
}

.yaab-mu-stat-k {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.yaab-mu-stat-v {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.yaab-mu-detail-kws {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.yaab-mu-kw {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb, 120 160 220), 0.12);
  color: var(--text);
}

/* Disabled toolbar state (matchup button before opponent exists) */
#yaab-btn-matchup[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Narrow viewports */
@media (max-width: 720px) {
  .yaab-mu-atk-row {
    grid-template-columns: 1fr;
  }
  .yaab-mu-compare {
    grid-template-columns: 1fr;
  }
  .yaab-mu-header {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .yaab-mu-them { text-align: left; align-items: flex-start; }
  .yaab-mu-vs { text-align: left; }
}
